Simple Varabile script please

~HeavenSent~

Golden Oldie
Golden Oldie
Nov 9, 2005
2,157
17
180
Chorley
Been looking for some help with this for a long time its one of the biggest reasons i Carnot get ma server up for testing the Quest system is a big part of ma server & having these problems with Variable's is holding me up big time!

My Old Post
http://www.lomcn.co.uk/forum/showthread.php?t=64103

As you can see from that i havent got it working im only reposteing to try & get it working!


All i want to do is get a simple one done then i can get in to it without haveing these prob's.

e.g

(QUEST NPC)
Kill 5 Deer.

(CHAR)
Kill's 5 Deer

(MSG Appears)
Well done come & see me for your Gift.


DONE How is this not so easy

ME ---> :crying:




 

boothy

LOMCN Veteran
Veteran
Mar 23, 2007
458
12
45
Oh sorry I didn't look at the link you posted lol, it should work i've tested it before and it worked fine =/

Edit: Are you killing the deers in bichon? That's where they need to be killed if you've copied preachers npc. Apart from that I'm not sure never been any good with variables =/
 
Last edited:
Upvote 0

~HeavenSent~

Golden Oldie
Golden Oldie
Nov 9, 2005
2,157
17
180
Chorley
Oh sorry I didn't look at the link you posted lol, it should work i've tested it before and it worked fine =/

Edit: Are you killing the deers in bichon? That's where they need to be killed if you've copied preachers npc. Apart from that I'm not sure never been any good with variables =/


Yes my test NPC is in BWSZ i kill the Deer & get the TextBox WELLDONE go see the npc for your prize, I go to the npc & its just got my count there

"You have Killeed 5/5 Deer please come back when you have killed them all"

allso if i log out & in the NPC TextBox just say's "??"
 
Upvote 0

Gezza

Golden Oldie
Golden Oldie
Sep 23, 2008
2,202
65
135
uk
Code:
[@main]
#IF
checknamelist Quests/CompleteomaQuest.txt
#SAY
You have already completed this quest
#ELSEACT
goto @main3
[@main3]
#IF
checknamelist Quests/omaquest.txt
#ACT
goto @quest1
#ELSESAY
Hello <$USERNAME> welcome to the beginners quest. \
To complete this quest you need to kill 20 Omas. \\
<Attempt the [EMAIL="quest/@attempt"]quest/@attempt[/EMAIL]> \
<Not now [EMAIL="thanks/@exit"]thanks/@exit[/EMAIL]>
[@attempt]
#IF
#ACT
addnamelist Quests/omaquest.txt
SET [303] 1
Var Integer Human omaKilled
#SAY
Good luck, come back to me to check \
how many Oma you have killed. \\
<[EMAIL="Exit/@exit"]Exit/@exit[/EMAIL]>
[@quest1]
#IF
CheckVar Human omaKilled > 19
#ACT
addnamelist Quests/CompleteomaQuest.txt
#SAY
Well done, you have killed enough Oma! \
Take this reward. \\
\
<[EMAIL="Here/@male"]Here/@male[/EMAIL]>
\
<[EMAIL="Exit/@exit"]Exit/@exit[/EMAIL]> \
#ELSESAY
Number of Omas killed : <$HUMAN(omaKilled)> \\
<[EMAIL="Exit/@exit"]Exit/@exit[/EMAIL]>
[@male]
#if
GENDER MAN
#act
Give LightArmour(M) 1
RESET [303] 1
#elseact
Give LightArmour(F) 1
RESET [303] 1

qmanage
Code:
#IF
#ACT
Var Integer Human omaKilled
LoadVar Human omaKilled ..\QuestDiary\Variables\Integral.txt
break

q funtion
Code:
[@onkillmob(Oma)]
#IF
CHECK [303] 1
#ACT
CalcVar Human omaKilled + 1
SaveVar Human omaKilled ..\QuestDiary\Variables\Integral.txt
goto @oma1

[@oma1]
#IF
CheckVar Human omaKilled > 19
#ACT
sendmsg 6 "Well done you have killed all 20 Oma come back for your reward!!!"

In QuestDiary have Variables folder with Integral.txt inside and in npc_def add a folder called Quests, you can also add the CompleteomaQuest.txt, omaquest.txt inside the Quests folder.
 
Last edited:
Upvote 0

Gezza

Golden Oldie
Golden Oldie
Sep 23, 2008
2,202
65
135
uk
no in the folder i said to make in the NPC_DEF called Quests. i just do it like this to keep it tidy. you can take the Quests bit out of the checknamelist lines if you rather not use it. and the namelists would make them selfs anyways after a few errors on the m2.
 
Last edited:
Upvote 0

~HeavenSent~

Golden Oldie
Golden Oldie
Nov 9, 2005
2,157
17
180
Chorley
Ok i got that working ty very much your a big help just 2 things...


1st

Is there a way of geting it to shou up with a Txt box or in the chat window that when the player has killed 20 oms's it tell's them?

2nd

Can this script be used to kill mob's on other maps? So if i changed Oma's to Wooma's ?
 
Upvote 0

Gezza

Golden Oldie
Golden Oldie
Sep 23, 2008
2,202
65
135
uk
yes to both, i'll edit this post in bit after hot choc. u can kill the oma in any map.

make the q funtion like this

[@onkillmob(Oma)]
#IF
CHECK [303] 1
#ACT
CalcVar Human omaKilled + 1
SaveVar Human omaKilled ..\QuestDiary\Variables\Integral.txt
goto @oma1

[@oma1]
#IF
CheckVar Human omaKilled > 19
#ACT
sendmsg 6 Well done you have killed all 20 Oma come back for your reward!!!
 
Last edited:
Upvote 0

Gezza

Golden Oldie
Golden Oldie
Sep 23, 2008
2,202
65
135
uk
heres a simple boss count also so each player can check how many boss's they killed i just done one you can copy it and edit it to add more..

npc

Code:
[@main]
Here you can check your local boss killcount. <Exit/@exit>\
=====================================================\
Number of WoomaTaurus	killed : <$HUMAN(wtKilled)> \

qfuntion
Code:
[@onkillmob(WoomaTaurus)]
#IF
#ACT
CalcVar Human wtKilled + 1
SaveVar Human wtKilled ..\QuestDiary\Variables\Integral.txt
break

qmanage
Code:
#IF
#ACT
Var Integer Human wtKilled
LoadVar Human wtKilled ..\QuestDiary\Variables\Integral.txt
break
 
Last edited:
Upvote 0

~HeavenSent~

Golden Oldie
Golden Oldie
Nov 9, 2005
2,157
17
180
Chorley
I only have One prob left :P

Just been testing script ingame i killed 10 Oma's & the npc told me i had killed 10, I loged out & back in & the NPC's TextBox juts Says "??" i killed 20 more oma's but i get nothing dose loging out break it ??

In the Quest Foulder it say's i have only killed 9


[Test]
omaKilled=9


M2Server Say's


[21/10/2009 23:47:52] [Npc Condition Error] Cmd:CHECKVAR NPC:QFunction Map:0 (0:0) Param1:Human Param2:eek:maKilled Param3:> Param4:19 Param5:
[21/10/2009 23:47:55] [QuestAction] ±äÁ¿omaKilled²»´æÔÚ£¬±äÁ¿ÀàÐÍ:Human Command:CALCVAR NPC:QFunction Map:0(0:0) Param1:Human Param2:eek:maKilled Param3:+ Param4:1 Param5: Param6:
[21/10/2009 23:47:55] [QuestAction] ±äÁ¿omaKilled²»´æÔÚ£¬±äÁ¿ÀàÐÍ:Human Command:SAVEVAR NPC:QFunction Map:0(0:0) Param1:Human Param2:eek:maKilled Param3:..\QuestDiary\Variables\Integral.txt Param4: Param5: Param6:



ScreenShot you carnt really see but it says ??

 
Last edited:
Upvote 0

Gezza

Golden Oldie
Golden Oldie
Sep 23, 2008
2,202
65
135
uk
is your qmanage like this...

[@login]
#IF
#ACT
Var Integer Human omaKilled
LoadVar Human omaKilled ..\QuestDiary\Variables\Integral.txt
break
 
Upvote 0

~HeavenSent~

Golden Oldie
Golden Oldie
Nov 9, 2005
2,157
17
180
Chorley
:wink: ty lol & ty for the Scripts ill be haveing a crack @ them 2morrow,


:thumbup2::thumbup2::thumbup2:


P.s i had to change this...


sendmsg 6 Well_done_you_have_killed_all_20_Oma_come_back_for_your_reward!!!

It was only comein up with "Well"
 
Last edited:
Upvote 0

~HeavenSent~

Golden Oldie
Golden Oldie
Nov 9, 2005
2,157
17
180
Chorley
sendmsg 6 "put ur text in here"

u dont need _ stuff.. just " "


Ty Bon.

Is there a way to change the sendmsg 6 colour so different quests can have different colour's?

E.g When you have done a quest for a item it show's like this...

{ITEM}
Well done you have finished the DarkStone Quest.


Or a EXP Quest will show like this...

{EXP}
Well done you have finished the 2x EXP Quest.
 
Last edited:
Upvote 0