View Revision: EO Quest System
Introduction
Quests are important to keep your clients amused. They are easy to write and use the original Endless Online quest format. The quest system can be added yourself or you can download a compiled version that has it already included.
The quest header
Main { questname "My first quest" version 1.0 }
All quests should start of with this header. The quest name is the name displayed in the Quest Progress and History dialog in-game.
The version is a double. The first digit is the Major version and the second is the Minor version.
'''IMPORTANT: You must open and close the brackets in all States (Talked about next) and the Main routine.'''
States
All states must be unique and contain no spaces in the name.
'''Example of a GOOD state'''
State FirstStateName { }
'''Example of a BAD state'''
State First State Name { }
You can have as many or as little states as you require.
Setting the Description
First of all, You do not need to add this to every step. It's simply used to display the description of the task in hand. Example: If the character has to Kill 10 Sheep, the description could be "Go kill 10 Sheep".To set the Description we use the command '''desc'''.
'''Example:'''
State Begin { desc "Talk to Ayla" }
This would show "Talk to Ayla" in the description area located in the Quest Progress dialog.
Actions
Well we need actions for our quests to have any functionality. There are currently a total of actions. All actions should end with an ";" so bare that in mind if you run into any bugs whilst running the quest then check for this kind of error.
- AddNpcChat(NpcQuestID, Message)
- AddNpcInput(NpcQuestID, InputID, Message)
- AddNpcText(NpcQuestID, Message)
- End()
- GiveExp(Amount)
- GiveItem(ItemID, Amount)
- GiveKarma(Amount)
- PlaySound(SoundID)
- Quake(Size, MapID)
- RemoveItem(ItemID, Amount)
- RemoveKarma(Amount)
- Reset()
- SetClass(ClassID)
- SetCoord(MapID, PosX, PosY)
- SetRace(RaceID)
- SetState(StateName)
- ShowHint(Message)
'''An example state using actions'''
state Begin { desc "Talk to Jessica" action AddNpcText( 1 , "Hello, I am Jessica" ); action AddNpcText( 1 , "I am really scared of those sheep..."); action AddNpcChat( 1 , "Can you please help me by killing 10 Sheep?"); action AddNpcInput( 1 , 1 , "No, Do it yourself"); action AddNpcInput( 1 , 2 , "Sure, I will help you"); }
Rules
Rules are when a requirement has been met. This is where we move onto the next part of the quest and switch state.There are a total of 10 rules.
- EnterCoord(MapID, PosX, PosY)
- EnterMap(MapID)
- GotItems(ItemID, Amount)
- InputNpc(InputID)
- KilledNpcs(NpcID, Amount)
- KilledPlayers(Amount)
- LeaveCoord(MapID, PosX, PosY)
- LeaveMap(MapID)
- LostItems(ItemID, Amount)
- TalkedToNpc(NpcQuestID)
'''An example using rules'''
state Begin { desc "Talk to Jessica" action AddNpcText( 1 , "Hello, I am Jessica" ); action AddNpcText( 1 , "I am really scared of those sheep..."); action AddNpcChat( 1 , "Can you please help me by killing 10 Sheep?"); action AddNpcInput( 1 , 1 , "No, Do it yourself"); action AddNpcInput( 1 , 2 , "Sure, I will help you"); rule InputNpc( 1 ) goto Coward; rule InputNpc( 2 ) goto KillSheep; } State KillSheep { } State Coward { }
A complete working example
This example quest is started by clicking on '''Jessica'''
Main { questname "Problem with Sheep" version 1.0 } State Begin { desc "Talk to Jessica" action AddNpcText(13, "Hello, I am Jessica"); action AddNpcText(13, "I am really scared of those sheep..."); action AddNpcText(13, "Could you please help me by killing 10 Sheep?"); action AddNpcInput(13, 1, "No, Do it yourself"); action AddNpcInput(13, 2, "Sure, I will help you"); rule InputNpc(1) goto Coward rule InputNpc(2) goto KillSheep } State KillSheep { desc "Kill 10 Sheep" rule KilledNpcs(170, 10) goto TalkToJessica } State TalkToJessica { desc "Talk to Jessica" action AddNpcText(13, "Thankyou so much."); action AddNpcText(13, "Here is a reward for your effort."); rule TalkedToNpc(13) goto Reward } State Reward { action GiveExp(500); action Reset(); } State Coward { action AddNpcText(13, "Okay then, I'm sure someone else will help me."); action Reset(); }