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:
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:
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:
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:
If the Player is level 80=> perfect.
Wrong way:
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:
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
Other known guild states? - guild?
Then's:
Quest Log - ingame "Q": "How can I show the Quest information on Q ingame?"
If the quest is saved in the database => show quest
If the quest is cleared in the database => do not show the quest anymore
task-e.dat:
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:
(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
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))))
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 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))))
)
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))))
)
So what tests do we have?
Summary of commands/functions/syntax:
If's:
- (class x)
- (specialty x y)
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)
- (gstate x y)
Other known guild states? - guild?
- (item (x y))
- (quest x y)
- (clear x)
- (notclear x)
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))
- => (then (clear 500))
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 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 )
)
)
=>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: