me again ... NPC flags this time :oP

Aspious

Dedicated Member
Dedicated Member
Nov 27, 2003
21
0
47
Yes, before you say i did search and it came up with a load of crap. There was a few examples but no tutorial on flags i could find. Anyway i had a look in server files and built this script, my m2server wont load so i cant make my own server to test it on. SO have a look at this and tell me if it is coded right.

NOTE: i am posting a general lay-out to this quest, obviously it'll be better than collecting 1 meat :P (Yes, i know i missed out the /'s on the end of everything)

[@main]
#IF
check [501] 1
#ACT
break
#SAY
You have done what i asked

<Yes i have/@exit>

#IF
check [500] 0
#ACT
goto @main-1

#IF
check [500] 1
#ACT
goto @main-2

[@main-1]
Start Quest?

<Yes/@start>
<No/@exit>

[@start]
#IF
checklevel 1
#SAY
Collect these items for me and bring them to me

1 Meat

<Sure thing/@ok>
<No i won't/@exit>

[@ok]
#IF
check [500] 0
#ACT
set [500] 1
#SAY
ThankYou

<Exit/@exit>

[@main-2]
#IF
checkitem meat 1
check [501] 0 (<< dont think i need that bit)
#ACT
take meat 1
givegold 100
set [501] 1
#SAY
Thankyou for doing quest

<No problem/@exit>
#ELSESAY
You dont have what i asked for

<sorry/@exit>


Someone should do a proper tutorial on flags not some half assed look at someone elses Quest and server files. If that above is right though, i can say it aint that hard... we'll have to see, need a pro NPC scripter :P
 
Last edited:

Schimmy

Dedicated Member
Dedicated Member
[@main]
#IF
check [501] 0
#ACT
goto @quest
#ELSEACT
goto @noquest

[@quest]
#IF
check [500] 0
#SAY
Please can you bring me:\\\
1 Meat\\
<ok\@doquest>\
<Na\@exit>
#ELSEACT
goto @quest2

[@doquest]
#ACT
set [500] 1
goto @exit

[@quest2]
#IF
checkitem meat 1
#ACT
take meat 1
give gold 100
#SAY
Thank You for doing my quest
#ELSESAY
You did not bring me the meat

[@noquest]
#SAY
You have done the Quest Before\
Now Be Gone!


Dont over Complicate Things
 
Last edited:

Aspious

Dedicated Member
Dedicated Member
Nov 27, 2003
21
0
47
Viola A.I. said:
There have been a few full threads that discussed flags.

Example

Yeh thats the one i was talking about, no tutorial there, just an example and you are expected to know everything :(

Any had a work out what Schimmy put, that looks like that'll do i think, now gotta work it bigger so it works for lvl 1, 11, 18, 20 and 22 >_< with flags for all and same NPC

m00
 
Last edited:

Aspious

Dedicated Member
Dedicated Member
Nov 27, 2003
21
0
47
[@main]
#IF
check [502] 1
#ACT
goto Q-18
break

#IF
check [501] 1
#ACT
goto @Q2-11
break

#IF
check [500] 1
#ACT
goto @main-2
#ELSEACT
goto @main-1

[@main-1]
You are new to the world of Judgement i see, would you like/
a helping hand to start you off?//
<Yes, please/@Q-1>/
<No, thanks/@nohelp>/

[@Q-1]
#IF
check [500] 0
#ACT
set [500] 1
givegold 10000
#SAY
Here is some gold to help you on your way//
<Thanks/@exit>/

[@main-2]
I see that 10,000 gold helped you, would you do a favour for me/
i will reward you well.//
All you have to do is bring me 5 meat, 5 chicken and 3 CannibalLeaf/
as well as being level 11.//
<Yeh sure thing/@Q-11>
<No, go get them yourself/@exit>

[@nohelp]
Fair enough, come to me when your lvl 11 with 5 Meat, 5 Chicken/
and 3 CannibalLeaf and i will reward you.//
<Yes, i will do that/@Q-11>
<No, get them yourself/@exit>

[@Q-11]
#IF
check [501] 0
#ACT
set [501] 1
#SAY
ThankYou Very much//
<No problem/@exit>/

[@Q2-11]
#IF
checklevel 11
checkitem Meat 5
checkitem Chicken 5
checkitem CannibalLeaf 3
#ACT
set [502] 1
take Meat 5
take Chicken 5
take CannibalLeaf 3
#SAY
Here is a test for you, finish it and you will get your reward!/
If you don't do this test you will miss the rewards and wont be/
able to try it again, you must then do a different type of task/
for me//

<What is this test?/@Q3-11>
<No way, i aint playing your game, you used me!/@exit>


Would this work?

It generally works as you go to him at lvl 1 then you can either get 10k of him or not, but you can still do the lvl 11 quest later if you do that for him, then do the test or not, you have to move onto level 18 quest. Thats how it should work.
 
Last edited:

Viola A.I.

Golden Oldie
Golden Oldie
Aug 14, 2003
692
0
173
Newcastle - UK
Code:
[@main]
#IF
check [502] 1
#ACT
goto Q-18
break

What you basically have to do is talk yourself through it.
Here we have: IF the user has 502 ON, then skip to script area Q-18, which in this script is non exsistant.

Code:
[@main-1]
You are new to the world of Judgement i see, would you like/
a helping hand to start you off?//
<Yes, please/@Q-1>/
<No, thanks/@nohelp>/

Next, you have all your line breaks the wrong way; use \ to move text onto the next line, not / (which is only used inside the <LINK> tags).

Code:
[@Q-11]
#IF
check [501] 0
#ACT
set [501] 1
#SAY
ThankYou Very much//
<No problem/@exit>/

In this scripts case you do not need to check to see if flag 501 is OFF. In a script where you would need to you'd need an ELSE statement or another #IF statement (like you have done at the start) otherwise your script wouldn't function fully.

Code:
[@Q2-11]
#IF
checklevel 11
checkitem Meat 5
checkitem Chicken 5
checkitem CannibalLeaf 3
#ACT
set [502] 1
take Meat 5
take Chicken 5
take CannibalLeaf 3
#SAY
Here is a test for you, finish it and you will get your reward!/
If you don't do this test you will miss the rewards and wont be/
able to try it again, you must then do a different type of task/
for me//

<What is this test?/@Q3-11>
<No way, i aint playing your game, you used me!/@exit>

Here you need to add an ELSE statement and add the line breaks at the end of your LINK's.
 

Aspious

Dedicated Member
Dedicated Member
Nov 27, 2003
21
0
47
Thanks Viola, you've been a big help :)

Oh the @Q-18 was the second part of the quest, i didn't put that in to reduce the size you'd have to read.