About Flags

smoochy boys on tour

GmTidus

Dedicated Member
Dedicated Member
Oct 14, 2008
54
0
32
I want that the npc check if you have killed a mob and you won a prize for kill it

i put in mapquest.txt

Code:
E002  [999] 1 [MonDie] ScareCrow * [MapQuest_Def\Killer] [@scare]

in mapquest_def\killer.txt

Code:
[@scare]
#IF
CHECK [999] 0
#ACT
SET [999] 1
break

and then in npc i put


[@main]
#IF
CHECK [999] 1
#SAY
You have earned a reward\
<Thanks/@Exit>\\
#ACT
GIVE GOLD 1000000
SET [999] 0
#ELSESAY
You have not earned a reward\
<EXIT/@EXIT>\\


but dont work :(
can anyone say me why?
 

Geordiehc

Mad Dog Geo
VIP
Jul 4, 2007
2,827
49
195
Redditch, UK
Only thing i can think of is the flag in the monai line might mean the flag will have to be open to activate that line. Try adding a say script when u kill the mob just to make sure if it doesnt do the say then u know its not setting the flag
 
Upvote 0

GmTidus

Dedicated Member
Dedicated Member
Oct 14, 2008
54
0
32
Only thing i can think of is the flag in the monai line might mean the flag will have to be open to activate that line. Try adding a say script when u kill the mob just to make sure if it doesnt do the say then u know its not setting the flag


i try this but don't work can anyone have another solution?
 
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
E002 [999] 1 [MonDie] ScareCrow * [MapQuest_Def\Killer] [@scare]

This is looking for the Flag [999] to be a "1", but then in the @scare bit, you do a check to see if [999] is a "0", you can't have both.

Do what Geordie suggests.. put it as a [0].. BUT, you probably haven't changed the "1" after it to a "0".. so do as below..

Code:
E002  [0] 0 [MonDie] ScareCrow * [MapQuest_Def\Killer] [@scare]

Also, I thought the Flags only worked up until around [600] try it like below with a [599]

Try this.. as you don't care if [599] is a Zero or not.. if they have already done it before or not, then the result will be the same .. i.e. [599] will now be a "1"

Code:
[@scare]
#ACT
SET [599] 1
break

And then finally, your NPC would be..
Code:
[@main]
#IF
Check [599] 1
#SAY
You have earned a reward\
<Thanks/@Exit>\\
#ACT
Give Gold 1000000
SET [599] 0
#ELSESAY
You have not earned a reward\
<EXIT/@EXIT>\\


If you want to make it into a once only quest, you need to set a Check Flag to say this quest has been completed.. i.e. Don't change [599] back to 0 and then use the following MapQuest..

Code:
E002  [599] 0 [MonDie] ScareCrow * [MapQuest_Def\Killer] [@scare]

This is now checking that [599] is a "0" so if you have completed the quest, it won't run again.

/Mick
 
Upvote 0

GmTidus

Dedicated Member
Dedicated Member
Oct 14, 2008
54
0
32
working 100% :D

i have 1 question more,

what i need put in npc for check if you kill 10 mobs and not only 1?
 
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
I think this is covered by a thread somewhere..

You need to set a temporary variable if its a quick one (i.e. Setting S1 to 0 then 1 then 2 etc as you kill them).. and if its a lot, use SQL or a text file to increment the amount of kills you have done.
 
Upvote 0

GmTidus

Dedicated Member
Dedicated Member
Oct 14, 2008
54
0
32
In mapquest.txt i put

Code:
E002  [599] 0 [MonDie] ScareCrow * [MapQuest_Def\Killer] [@scare]

in mapquest_Def\killer.txt i put

Code:
[@scare]
#ACT
SET [599] 1
break

in npc i put

[@main]
#IF
checklevel 11
#SAY
You are high lvl to do this quest\

#ELSESAY
kill 1 ScareCrow and come here\
You need to be lower than lvl 11\
to do this quest\
<Quest/@kuest>\


[@kuest]
#IF
Check [599] 1
#SAY
here is your reward\
<thx/@Exit>\\
#ACT
GIVE GOLD 1000000
SET [599] 0
#ELSESAY
you don't completed the quest\



but my npc don't check if you already done the quest

i can do the quest all times i want
 
Last edited:
Upvote 0

Geordiehc

Mad Dog Geo
VIP
Jul 4, 2007
2,827
49
195
Redditch, UK
thats because you set the flag back to 0, your script is made to be a repeatable quest,

[@kuest]
#IF
Check [599] 1
CHECK [598] 0
#SAY
here is your reward\
<thx/@Exit>\\
#ACT
GIVE GOLD 1000000
SET [598] 1
#ELSESAY
You have already completed the quest once or have not yet killed a scarecrow\

Out of easiness i edited the old script to give you the idea
 
Upvote 0