[NPC] Guild Territory

smoochy boys on tour

Chriz

Captain Lurker
VIP
Mar 24, 2003
1,158
277
335
LOMCN
This works for me anyway =)

you'll have to make this file:
..\QuestDiary\Variables\Integral.txt

This is only an example of how it can be done, my grammer is really bad, so you'll have to rewrite it so it looks pro :P

Code:
; GT

[@main]
#IF 
ISGUILDMASTER
#ACT
goto @GM
#ELSEACT
goto @player

[@player]
#IF
CHECKGUILDLIST GT1.txt
#ACT 
goto @membergt1
#ELSEACT
goto @player-1
[@player-1]
#IF
CHECKGUILDLIST GT2.txt
#ACT 
goto @membergt2
#ELSEACT
goto @player-2
[@player-2]
#IF
CHECKGUILDLIST GT3.txt
#ACT 
goto @membergt3
#ELSEACT
goto @player-3
[@player-3]
#IF
CHECKGUILDLIST GT4.txt
#ACT 
goto @membergt4
#ELSEACT
goto @player-4
[@player-4]
#IF
CHECKGUILDLIST GT5.txt
#ACT 
goto @membergt5
#ELSESAY
Hello there!\

[@membergt1]
#SAY
Would you like to move to the guild territory?\\
<Yes please take me there/@movegt1>\
<no thanks/@exit>\

[@movegt1]
#ACT
mapmove GT001 100 100
break

[@membergt2]
#SAY
Would you like to move to the guild territory?\\
<Yes please take me there/@movegt2>\
<no thanks/@exit>\

[@movegt2]
#ACT
mapmove GT002 100 100
break

[@membergt3]
#SAY
Would you like to move to the guild territory?\\
<Yes please take me there/@movegt3>\
<no thanks/@exit>\

[@movegt3]
#ACT
mapmove GT003 100 100
break

[@membergt4]
#SAY
Would you like to move to the guild territory?\\
<Yes please take me there/@movegt4>\
<no thanks/@exit>\

[@movegt4]
#ACT
mapmove GT004 100 100
break

[@membergt5]
#SAY
Would you like to move to the guild territory?\\
<Yes please take me there/@movegt5>\
<no thanks/@exit>\

[@movegt5]
#ACT
mapmove GT005 100 100
break

[@GM]
#IF
CHECKGUILDLIST GT1.txt
#ACT 
goto @gmgt1
#ELSEACT
goto @gm-1
[@gm-1]
#IF
CHECKGUILDLIST GT2.txt
#ACT 
goto @gmgt2
#ELSEACT
goto @gm-2
[@gm-2]
#IF
CHECKGUILDLIST GT3.txt
#ACT 
goto @gmgt3
#ELSEACT
goto @gm-3
[@gm-3]
#IF
CHECKGUILDLIST GT4.txt
#ACT 
goto @gmgt4
#ELSEACT
goto @gm-4
[@gm-4]
#IF
CHECKGUILDLIST GT5.txt
#ACT 
goto @gmgt5
#ELSEACT
goto @buygt

[@gmgt1]
#SAY
How can i help you?\
<Take me to the Guild territory/@movegt1>\
<i would like to sell my GT/@sellgt>

[@gmgt2]
#SAY
How can i help you?\
<Take me to the Guild territory/@movegt2>\
<i would like to sell my GT/@sellgt>

[@gmgt3]
#SAY
How can i help you?\
<Take me to the Guild territory/@movegt3>\
<i would like to sell my GT/@sellgt>

[@gmgt4]
#SAY
How can i help you?\
<Take me to the Guild territory/@movegt4>\
<i would like to sell my GT/@sellgt>

[@gmgt5]
#SAY
How can i help you?\
<Take me to the Guild territory/@movegt5>\
<i would like to sell my GT/@sellgt>

[@buygt]
#SAY
Hey, i see you are a guild master!\
would you like to purchase a Guild territory for\
your members?\
\
<Yes please/@buygt2>\
<No thanks/@exit>\

[@buygt2]
#IF
checkgold 1
#ACT
Var integer GLOBAL GT1
Var integer GLOBAL GT2
Var integer GLOBAL GT3
Var integer GLOBAL GT4
Var integer GLOBAL GT5
LoadVar GLOBAL GT1 ..\QuestDiary\Variables\Integral.txt
LoadVar GLOBAL GT2 ..\QuestDiary\Variables\Integral.txt
LoadVar GLOBAL GT3 ..\QuestDiary\Variables\Integral.txt
LoadVar GLOBAL GT4 ..\QuestDiary\Variables\Integral.txt
LoadVar GLOBAL GT5 ..\QuestDiary\Variables\Integral.txt
#SAY
It'll cost you 10 million gold, are you sure?\
<Yeah/@buygt3>\
<No thanks /@exit>\
#ELSESAY
you dont have enought money!\
come back when you have 10 million gold!!


[@buygt3]
#IF
CheckVar GLOBAL GT1 = 0
#ACT
goto @buygt1F
#ELSEACT
goto @buygt3-1

[@buygt3-1]
#IF
CheckVar GLOBAL GT2 = 0
#ACT
goto @buygt2F
#ELSEACT
goto @buygt3-2

[@buygt3-2]
#IF
CheckVar GLOBAL GT3 = 0
#ACT
goto @buygt3F
#ELSEACT
goto @buygt3-3

[@buygt3-3]
#IF
CheckVar GLOBAL GT4 = 0
#ACT
goto @buygt4F
#ELSEACT
goto @buygt3-4

[@buygt3-4]
#IF
CheckVar GLOBAL GT5 = 0
#ACT
goto @buygt5F
#ELSESAY
there are to guild territorys for sale atm\

[@buygt1F]
#IF
checkgold 10000000
#ACT
take gold 10000000
ADDGUILDLIST GT1.txt
CalcVar GLOBAL GT1 = 1
SaveVar GLOBAL GT1 ..\QuestDiary\Variables\Integral.txt
#SAY
there you go, you and you members may now enter the guild territory!\
<Send me there!/@movegt>\
#ELSESAY
Where has your gold gone?

[@buygt2F]
#IF
checkgold 10000000
#ACT
take gold 10000000
ADDGUILDLIST GT2.txt
CalcVar GLOBAL GT2 = 1
SaveVar GLOBAL GT2 ..\QuestDiary\Variables\Integral.txt
#SAY
there you go, you and you members may now enter the guild territory!\
<Send me there!/@movegt>\
#ELSESAY
Where has your gold gone?

[@buygt3F]
#IF
checkgold 10000000
#ACT
take gold 10000000
ADDGUILDLIST GT3.txt
CalcVar GLOBAL GT3 = 1
SaveVar GLOBAL GT3 ..\QuestDiary\Variables\Integral.txt
#SAY
there you go, you and you members may now enter the guild territory!\
<Send me there!/@movegt>\
#ELSESAY
Where has your gold gone?

[@buygt4F]
#IF
checkgold 10000000
#ACT
take gold 10000000
ADDGUILDLIST GT4.txt
CalcVar GLOBAL GT4 = 1
SaveVar GLOBAL GT4 ..\QuestDiary\Variables\Integral.txt
#SAY
there you go, you and you members may now enter the guild territory!\
<Send me there!/@movegt>\
#ELSESAY
Where has your gold gone?

[@buygt5F]
#IF
checkgold 10000000
#ACT
take gold 10000000
ADDGUILDLIST GT5.txt
CalcVar GLOBAL GT5 = 1
SaveVar GLOBAL GT5 ..\QuestDiary\Variables\Integral.txt
#SAY
there you go, you and you members may now enter the guild territory!\
<Send me there!/@movegt>\
#ELSESAY
Where has your gold gone?

[@gmgt]
#SAY
How can i help you?\
<Take me to the Guild territory/@mmovegt>\
<i would like to sell my GT/@sellgt>

[@sellgt]
#SAY
Are you sure you want to sell your guild territory?\
i can only offer 5 million gold as a refund!!\
\
<Yeah im sure/@sellgt2-T>\
<No thanks/@exit>\

[@sellgt2-T]
#IF
CHECKGUILDLIST GT1.txt
#ACT
goto @sellgt1
#ELSEACT
goto @sellgt2-1
[@sellgt2-1]
#IF
CHECKGUILDLIST GT2.txt
#ACT
goto @sellgt2
#ELSEACT
goto @sellgt2-2
[@sellgt2-2]
#IF
CHECKGUILDLIST GT3.txt
#ACT
goto @sellgt3
#ELSEACT
goto @sellgt2-3
[@sellgt2-3]
#IF
CHECKGUILDLIST GT4.txt
#ACT
goto @sellgt4
#ELSEACT
goto @sellgt2-4
[@sellgt2-4]
#IF
CHECKGUILDLIST GT5.txt
#ACT
goto @sellgt5

[@sellgt1]
#IF
CHECKGUILDLIST GT1.txt
ISGUILDMASTER
#ACT
DELGUILDLIST GT1.txt
CalcVar GLOBAL GT1 = 0
SaveVar GLOBAL GT1 ..\QuestDiary\Variables\Integral.txt
give gold 5000000
#Say
you and your guild members will not be able to enter the guild\
territory anymore!!\\

[@sellgt2]
#IF
CHECKGUILDLIST GT2.txt
ISGUILDMASTER
#ACT
DELGUILDLIST GT2.txt
give gold 5000000
CalcVar GLOBAL GT2 = 0
SaveVar GLOBAL GT2 ..\QuestDiary\Variables\Integral.txt
#Say
you and your guild members will not be able to enter the guild\
territory anymore!!\\

[@sellgt3]
#IF
CHECKGUILDLIST GT3.txt
ISGUILDMASTER
#ACT
DELGUILDLIST GT3.txt
give gold 5000000
CalcVar GLOBAL GT3 = 0
SaveVar GLOBAL GT3 ..\QuestDiary\Variables\Integral.txt
#Say
you and your guild members will not be able to enter the guild\
territory anymore!!\\

[@sellgt4]
#IF
CHECKGUILDLIST GT4.txt
ISGUILDMASTER
#ACT
DELGUILDLIST GT4.txt
give gold 5000000
CalcVar GLOBAL GT4 = 0
SaveVar GLOBAL GT4 ..\QuestDiary\Variables\Integral.txt
#Say
you and your guild members will not be able to enter the guild\
territory anymore!!\\

[@sellgt5]
#IF
CHECKGUILDLIST GT5.txt
ISGUILDMASTER
#ACT
DELGUILDLIST GT5.txt
give gold 5000000
CalcVar GLOBAL GT5 = 0
SaveVar GLOBAL GT5 ..\QuestDiary\Variables\Integral.txt
#Say
you and your guild members will not be able to enter the guild\
territory anymore!!\\

also if you want a GT tele scroll add this to your Qfunction

; Guild Territory Teleport scroll
[@StdModeFunc20]
#IF
CHECKGUILDLIST GT1.txt
#ACT
mapmove GT001 100 100
#IF
CHECKGUILDLIST GT2.txt
#ACT
mapmove GT002 100 100
#IF
CHECKGUILDLIST GT3.txt
#ACT
mapmove GT003 100 100
#IF
CHECKGUILDLIST GT4.txt
#ACT
mapmove GT004 100 100
#IF
CHECKGUILDLIST GT5.txt
#ACT
mapmove GT005 100 100
#ELSEACT
give GTTeleport 1

and this to you items db:
ID,GTTeleport,31,0,0,20,0,0,274,0,0,0,0,0,0,0,0,0,0,0,0,0,1100,5
 
Last edited: