Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

An Introduction about KalOnline Quest system

Status
Not open for further replies.
make Love, not War!
Joined
Feb 2, 2008
Messages
511
Reaction score
407
Updated 05.03.2013 - FAQ_How to show a quest in Quest log 'Q'


Whats a quest?

A quest is a simple "if-then" test.
I will use the correct syntax in Code fields only. I ll try to explain HOW the quest system of KalOnline is working. To explain this more easy, i will try to use a mix between normal english words and kalonline syntax.

Step 1: get an overview

Example:
Code:
//easy overview structure:
(case[INDENT](if[/INDENT]
[INDENT=2](item (120 2)[/INDENT]
[INDENT])[/INDENT]
[INDENT](then [/INDENT]
[INDENT=2](item (out 120 2)(in 121 0 1))[/INDENT]
[INDENT])[/INDENT]
)

//common structure:
(case (if (item (120 2))(then (item (out 120 2)(in 121 0 1))))
These 2 cases do exactly the same.
In words:
We open a case (case) -> if the user has the item 120 2 times or more in his inventory, then put item out of inventory 120 2 times and put into inventory item 121 1 time.
Shorter:
If player has item 120 at least 2 times
then item out 120 2 times and item in 121 1 time

Next question is: which options do we have???
There are 2 kinds of options:


  • If's
  • Then's

General meaning of if and then:
Syntax: (if (test) expression)
If the (test) returns TRUE value, the expression (then) will be executed.
If the (test) returns FALSE value, the expression (then) will NOT be executed.

If ONE case returns the value TRUE the other tests will NOT be executed.

Example:
Code:
(quest (index 500 1)
	(case (if ([COLOR=#006400]class 0[/COLOR]))(then (item (in 485 0 1)))) <--first line => test = true => stop!!
	(case (if ([COLOR=#006400]class 0[/COLOR]))(then (item (in 485 0 1)))) <--not executed because first test = true 
)
If a knight executes this quest he will get item 485. BUT only 1 time, because the first test results TRUE => (class 0 = knight = true).
If you want to teleport on different levels in different areas with 1 quest only, build it up like this:
Code:
(quest (index 500 2)	(case (if ([COLOR=#006400]level 100[/COLOR]))(then (item (in 485 0 1)))) 
	(case (if ([COLOR=#006400]level 80[/COLOR]))(then (item (in 485 0 1))))
	(case (if ([COLOR=#006400]level 70[/COLOR]))(then (item (in 485 0 1))))
)
If the Player is level 80=> perfect.
Wrong way:
Code:
(quest (index 500 2)
​	(case (if ([COLOR=#006400]level 70[/COLOR]))(then (item (in 485 0 1))))
	(case (if ([COLOR=#006400]level 80[/COLOR]))(then (item (in 485 0 1)))) 
	(case (if ([COLOR=#006400]level 90[/COLOR]))(then (item (in 485 0 1))))


)
If the Player is level 80 => first test (if (level 70)) => true => execute expression => STOP!


So what tests do we have?

Summary of commands/functions/syntax:

If's:


  • (class x)
-> Checking players class - x= 0 1 2: 0= Knight, 1= Mage, 2= Archer

  • (specialty x y)
-> Checking players specialty - x = class, y = specialty
x-Values: 0 1 2: 0= Knight, 1= Mage, 2= Archer
y-Values: 0 1 2 3 4 5: 0= wondering, 1= apprentice (lv. 30), 2= hermit/vaga/ea, 3=cjb/commander/ic, 4= 3rd job , 5= 3rd job

  • (level x)
-> If the player is at least level x (example: (if (level 100)) - Playerlevel 83 => return value FALSE... - Playerlevel 110 => return value: TRUE

  • (gstate x y)
-> Checking the player state (gstate 104 1) => assassin mode // (gstate 104 0) NO assassin mode
Other known guild states? - guild?

  • (item (x y))
-> Checking if the player has item index x and amount y in inventory

  • (quest x y)
-> Checking if the player saved the quest index x and flag y into database (then (save x y))

  • (clear x)
-> Checking if the quest index x is cleared (Flag is not playing a role here)

  • (notclear x)
-> Checking if the quest index x is NOT cleared (Flag is not playing a role here)

Then's:


  • updated soon


FAQ:



Quest Log - ingame "Q": "How can I show the Quest information on Q ingame?"

How does the task-e.dat in config.pk work?

If the quest is saved in the database => show quest
If the quest is cleared in the database => do not show the quest anymore


  • => (then (save 500 1))
Show Quest 500 flag 1 in task-e.dat

  • => (then (clear 500))
Do not show Quest 500 flag x anymore

task-e.dat:
Code:
( task     ( key 500)
    ( name "Banshee Souls[ToP F1]")
    ( desc "Reward: Geons, Exp, 5 Contribution points, random special item, G70 weapon[normal]")
    ( flag 
        ( key 1)
        ( desc "Collect [15] Skeleton Bone and [15] Banshee Soul and bring them to me.")
        ( param 235968 279757 )
    )
)
If the Quest 500 is saved with flag 1 => show in Q
If the Quest 500 is cleared => delete from Q

task-e.dat can get more flag keys for longer quests:
Code:
( task     ( key 500)
    ( name "Banshee Souls[ToP F1]")
    ( desc "Reward: Geons, Exp, 5 Contribution points, random special item, G70 weapon[normal]")
    ( flag 
        ( key 1)
        ( desc "Collect [15] Skeleton Bone and [15] Banshee Soul and bring them to me.")
        ( param 235968 279757 )
    )
    ( flag 
        ( key 2)
        ( desc "Now bring this letter to blablapipapo!")
        ( param 235968 279757 )
    )

)
(then (save 500 1)) -> after the quest is done => (then (save 500 2))
=>will show "Now bring this letter to blablapipapo!" on the detailed quest description.


I will edit this post when i got more time :) just introduction so far
 
Last edited:
Newbie Spellweaver
Joined
Feb 23, 2009
Messages
62
Reaction score
6
This guide is just epic.

Kind regards,
XiaOnline
 
make Love, not War!
Joined
Feb 2, 2008
Messages
511
Reaction score
407
Isn't this your second or third quest tutorial xD?
Anyways good one :p

Kind regards,
strik3r xD
xD i think yep... im still getting asked same questions over and over...
There was a quest tutorial released on magias realm which taught me everything about quests i think.... but magias realm forum is offline, so i try to copy this guide :)

Kind Regards,

Uppa
 
Helper for everyone
[VIP] Member
Joined
Oct 30, 2010
Messages
1,181
Reaction score
228
xD i think yep... im still getting asked same questions over and over...
There was a quest tutorial released on magias realm which taught me everything about quests i think.... but magias realm forum is offline, so i try to copy this guide :)

Kind Regards,

Uppa


yeah there was full quest tutorials but links dead,anyone still got it?
 
Elite Diviner
Joined
Jan 15, 2011
Messages
486
Reaction score
234
I don't know if this is usefull but I had this ond link from Arturasul's webserver where you can see all the serverside/clientside game config files with all there existing features
 
Banned
Banned
Joined
Jul 8, 2007
Messages
1,628
Reaction score
1,619
even "I" understood it.. good name! *claps hands for applause* good man... if I dnt understand it ..no beesh will...lol
 
Newbie Spellweaver
Joined
Feb 23, 2009
Messages
62
Reaction score
6
The Param @ task-e.dat is the XY Coordinates from your NPC.
 
Status
Not open for further replies.
Back
Top