Jump to content
Sign in to follow this  
Rafael

Random quest

Recommended Posts

I need help, i want put 5 items with random quest, click = get 1 random of 5 quest
when you finish the quest go for the other item. 
5 Items = 5 random quest ea, then 5 items = 25 quests, how i can do a "random quest"?

Share this post


Link to post
Share on other sites

@Rafael
Not if this works .. you will have to try, I did while reading your post, anyway .. Try it!:)

 

 

-----in Npcscript0x.lua


function rand_quest()
    Talk( 1, "PKODev: bla bla bla")

     RandQuest = {}
     RandQuest[1] = 0001 - put your quest Id 
     RandQuest[2] = 0002 - put your quest Id
     RandQuest[3] = 0003 - put your quest Id 
     RandQuest[4] = 0004 - put your quest Id  
     RandQuest[5] = 0005 - put your quest Id 
     local i = math.random (1,5)
     AddMission(RandQuest[i]) 

end


---in Missionscript0x.lua

     QuestItem ={}
     QuestItem[1] = #### - put your item Id 
     QuestItem[2] = #### - put your item Id
     QuestItem[3] = #### - put your item Id
     QuestItem[4] = #### - put your item Id
     QuestItem[5] = #### - put your item Id
     local i = math.random(1,5)
 
     DefineMission( 6000, "Mission Test", 6000 )
    MisBeginTalk("<t>Hi! Get Me <r5x> of <b..GetItemName(QuestItem[i])..> and Win <b300M>.")
    MisBeginCondition(NoMission,6000)
    MisBeginAction(AddMission,6000)
    MisBeginAction(AddTrigger, 60001, TE_GETITEM, QuestItem[i] , 5)
    MisCancelAction(ClearMission, 6000)
    MisNeed(MIS_NEED_DESP, "Get x700 <rWood>")
    MisNeed(MIS_NEED_ITEM, QuestItem[i] , 5, 10, 5)
    
    MisPrize(MIS_PRIZE_MONEY, 300000000, 1)
    MisPrizeSelAll()    
    MisHelpTalk("<t>You can get Pine Tree near of Argent")
    MisResultTalk("<t>Obtain <300M>.")

    MisResultCondition(HasItem, QuestItem[i] , 5)
    
    
    MisResultAction(TakeItem, QuestItem[i] , 5 )
    
    
    MisResultAction(ClearMission, 6000)
    MisResultAction(SetRecord, 6000)
    MisResultBagNeed(1)
    

    InitTrigger()
    TriggerCondition( 1, IsItem, QuestItem[i] )    
    TriggerAction( 1, AddNextFlag, 6000, 10, 1 )
    RegCurTrigger( 60001 )

 

Edited by Ximboliex
  • Like 1

xbx3.png

Share this post


Link to post
Share on other sites

@Ximboliex

 


function dd_dd()
    Talk( 1, "dddddddd" )


     AddNpcMission(7783) 

end

 

its work the random, but when i finish the quest still with the same quest, just change with "updateall"
its like this now:

 

 MOB1 ={}
     MOB1[1] = 237 
     MOB1[2] = 298
     MOB1[3] = 225
     MOB1[4] = 252
     MOB1[5] = 93
     local a = math.random(1,5)
  MOB2 ={}
     MOB2[1] = 62 
     MOB2[2] = 100
     MOB2[3] = 101
     MOB2[4] = 203
     MOB2[5] = 45
     local b = math.random(1,5)
  MOB3 ={}
     MOB3[1] = 83 
     MOB3[2] = 266
     MOB3[3] = 46
     MOB3[4] = 130
     MOB3[5] = 281
     local c = math.random(1,5)

    DefineMission( 7783, "Travel of Gold", 6089 )

    MisBeginTalk( "Kill all this mobs and i go give you my Necklace" )
    

    MisBeginAction(AddMission, 6089)
    MisBeginAction(AddTrigger, 60891, TE_KILL, MOB1[a] , 10 )
    MisBeginAction(AddTrigger, 60892, TE_KILL, MOB2 , 10 )
    MisBeginAction(AddTrigger, 60893, TE_KILL, MOB3[c] , 10 )

    MisCancelAction( ClearMission, 6089)

    MisNeed(MIS_NEED_DESP, "<Good Luck!> ")
    MisNeed(MIS_NEED_KILL,MOB1[a] , 10, 10, 10 )
    MisNeed(MIS_NEED_KILL,MOB2 , 10, 20, 10 )
    MisNeed(MIS_NEED_KILL,MOB3[c] , 10, 30, 10 )

    MisPrize(MIS_PRIZE_MONEY, 500000, 1)
    MisPrizeSelAll()

    MisResultTalk("Nice, you follow my words! Here is the Necklace.")
    MisHelpTalk("In Forgotten Island you can find this mobs.")
    MisResultCondition(HasMission, 6089)
    MisResultCondition(HasFlag, 6089, 19 )
    MisResultCondition(HasFlag, 6089, 29 )
    MisResultCondition(HasFlag, 6089, 39 )
    MisResultAction(ClearMission, 6089 )
    MisResultBagNeed(1)

    InitTrigger()
    TriggerCondition( 1, IsMonster,MOB1[a] )
    TriggerAction( 1, AddNextFlag, 6089, 10, 10 )
    RegCurTrigger( 60891 )

    InitTrigger()
    TriggerCondition( 1, IsMonster,MOB2 )
    TriggerAction( 1, AddNextFlag, 6089, 20, 10 )
    RegCurTrigger( 60892 )


    InitTrigger()
    TriggerCondition( 1, IsMonster,MOB3[c] )
    TriggerAction( 1, AddNextFlag, 6089, 30, 10 )
    RegCurTrigger( 60893 ) 
    

Edited by Rafael

Share this post


Link to post
Share on other sites

  MisNeed(MIS_NEED_KILL,MOB2 , 10, 20, 10)  have MOB2 [     b    ] 
no work put together in this forum lol

 

Edited by Rafael

Share this post


Link to post
Share on other sites

I would suggest looking at "A [Class]'s Life" quests. (A Swordsman'sLiife from Peter , A Herbalist's Life from Gannon , and so on. Every class-quest bearing NPC has it)

Instead of making 5 different quests and setting them to come up randomly , just make one quest with randomized goals.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...