Jump to content
Angelix

Create a Quest

Recommended Posts

DefineMission( 2020, "Money Mission", 2020)

	MisBeginTalk( "<t>Want to get money for your growth?.<n><t>Then go outside do some monster killing.<n><t>I will give you the money needed.")
	MisBeginCondition(LvCheck, ">", 41 )
	--MisBeginCondition(HasItem, 0844, 1)
	MisBeginCondition(NoMission, 2020)
	MisBeginAction(AddMission, 2020)
	MisBeginAction(AddTrigger, 20201, TE_KILL, 695, 30 )
	MisBeginAction(AddTrigger, 20202, TE_KILL, 697, 30 )
	MisBeginAction(AddTrigger, 20203, TE_KILL, 696, 5 )
	MisCancelAction(ClearMission, 2020)

	--MisNeed(MIS_NEED_DESP, "Kill 30 Swamp Bog")	
	MisNeed(MIS_NEED_KILL, 695, 30, 10, 30)--asal semua 10
	MisNeed(MIS_NEED_KILL, 697, 30, 20, 30)
	MisNeed(MIS_NEED_KILL, 696, 5, 30, 5)
	 
	MisHelpTalk("<t>Go now! For the money!")	
	MisResultTalk("<t>You are quite fast!")
	MisResultCondition(HasMission, 2020)
	MisResultCondition(HasFlag, 2020, 39 )--kt sini
	MisResultCondition(HasFlag, 2020, 49 )
	MisResultCondition(HasFlag, 2020, 34 )
	--MisResultCondition(HasItem,0844,1)
	--MisResultAction(TakeItem, 0844,1)
	MisResultAction(ClearMission,2020)
	MisResultAction(GiveItem, 854, 1, 4)
	MisResultBagNeed(1)
		
	InitTrigger() 
	TriggerCondition( 1, IsMonster, 695 )	
	TriggerAction( 1, AddNextFlag, 2020, 10, 10 )
	RegCurTrigger(20201)
	
	InitTrigger() 
	TriggerCondition( 1, IsMonster, 697 )	
	TriggerAction( 1, AddNextFlag, 2020, 20, 30 )
	RegCurTrigger(20202)
	
	InitTrigger() 
	TriggerCondition( 1, IsMonster, 696 )	
	TriggerAction( 1, AddNextFlag, 2020, 5,  )
	RegCurTrigger(20203)

The Mission Work, since I add some info inside missioninfo.lua

 

AddMisData( 2020	,	"Money Mission",1)

 

I'm not sure if this step necessary but it let my quest appear properly like a new quest. The only issue is that, the quest finish after killing some mobs. not meeting the exact amount I decide in the quest. Do anyone know why?

Share this post


Link to post
Share on other sites
On 12/7/2016 at 4:44 PM, SoundX said:

This is great guide very useful!

 

This maybe helpful, I had asked about random quests in the past I think in serverdv forum and this is how I think it work: (though I didn't finally do it, so some things I still don't know what is)

 

Random mob to kill:


AddRandKillInfo(    level    ,    monsterid,    randvalue,    randscope,    exp    ,    money    )
AddRandKillInfo(    10    ,    206    ,    3    ,    2    ,    4028    ,    4000    )

10 = Char level
206=  id of mob to hunt (mini bee in this one)
3 = minimum number of mobs to hunt
2 = variation: minimun number + 2, quest can ask kill 3, 4, or 5 (3+2) mobs
4028: Quest gives 201g money reward at round 1 (roughly 4028/20) and each round increases by 40 (2 first digits)
4000: Quest give 200exp first round (4000/20) and increase 40 each round

 

Random item to collect:


AddRandGetItem( level, itemid, randvalue, randscope, exp, money )
AddRandGetItem(	10	,	4485	,	3	,	2	,	4028	,	4000	)

Same as above:
10 = Char level
4485=  id of item to collect (Bee Wing)
3 = min number of items
2 = variation
4028 and 4000: money and exp as above

 

Random give item to other NPC:


AddRandSendInfo( level, npcid, exp, money )
AddRandSendInfo(	80	,	41	,	727500	,	86569	)

AddRandSendItem( level, item )
AddRandSendItem(	80	,	1850	)

80 = level
41 = npc ID
727500 and 86569 money and exp

1850 is parcel

 

Price (randomised)


SetRandPrizeItem( level )
SetRandPrizeItem(	10	)

AddRandPrizeItem( level, item1, itemdata1, item2, itemdata2, item3, itemdata3, item4, itemdata4 )				
AddRandPrizeItem(	10	,	290	,	810	)

level 10, item reward 290 (husk armor) and itemdata 810 I am not sure what means

 

Cycling quests (quest complete every 10 rounds)


SetRandPrizeOdds( loopnum, odds, completenum )
SetRandPrizeOdds( 1, 100, 10 )

completenum (10) is the number of quests to complete a cycle. I don't know how the other two are cacluleted

Does this mean that an entry has to be added to each possible character level? Can't a variable be set to get the character's level, then use math.random to pick the mobs to kill instead?

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.


×
×
  • Create New...