//<------------------------------------------------------------------------------------->
//<-------------------------------------- Arena #1 ------------------------------------->
//<------------------------------------------------------------------------------------->
[ITEMDEF i_dueling_arena_1]
DEFNAME=i_dueling_arena_1
NAME=Arena #1 (Old Style)
ID=0ed4
TYPE=t_normal
On=@Create
COLOR=0876
ATTR=attr_move_never|attr_static|attr_newbie
On=@Click
MESSAGE @38 <NAME>
RETURN 1
On=@DClick
IF (<DISTANCE>>3)||(!<CanSeeLos>)
SRC.SYSMESSAGE You can't reach that
ELIF (!<SRC.FINDLAYER.13>)
SRC.SYSMESSAGE @55 Get your equipment first!
ELIF (<SRC.FINDLAYER.25.UID>)
SRC.SYSMESSAGE @55 You are mounted and may not go to duel!
ELIF (<TAG0.busy>)
SRC.SYSMESSAGE @55 Dueling Pit is busy at this moment..
ELSE
SERV.NEWITEM=i_duel_memory
NEW.EQUIP <SRC>
NEW.TIMER 5
VAR.arena0=<UID>
ENDIF
RETURN 1
//<------------------------------------------------------------------------------------->
//<------------------------------------- Winner Pad ------------------------------------>
//<------------------------------------------------------------------------------------->
[ITEMDEF i_go_winner_pad]
DEFNAME=i_go_winner_pad
NAME=For Winner
ID=i_rune_alchem_6
On=@Create
COLOR=0423
On=@Click
MESSAGE @0ADE <NAME>
RETURN 1
On=@Step
IF !<SRC.IsPlayer>
RETURN 1
ENDIF
TRY UID.<VAR.arena0>.TAG.busy
TRY UID.<VAR.arena0>.COLOR=0876
VAR.first0
VAR.second0
VAR.arena0
SRC.GO 3756,1294
SRC.EVENTS -e_duel_arena_1
REMOVE
//<------------------------------------------------------------------------------------->
//<--------------------------------------- Events -------------------------------------->
//<------------------------------------------------------------------------------------->
[EVENTS e_duel_arena_1]
On=@Death
SRC.GO 4471,1165,20
SRC.SYSMESSAGE You are Looser!
SRC.ACT.SYSMESSAGE You are Winer!
SRC.EVENTS -e_duel_arena_1
SRC.NEWITEM=i_go_winner_pad
SRC.ACT.P=730,1104,20
On=@SpellEffect
IF ((<ARGN> == 24)||(<ARGN> == 32)||(<ARGN> == 45)||(<ARGN> == 52))
SRC.SYSMESSAGE @55 This spell is forbidden here!
RETURN 1
ENDIF
On=@LogOut
SERV.NEWITEM=i_duel_leaving
NEW.EQUIP <SRC>
On=@Login
TRY SRC.FINDID.i_duel_leaving.REMOVE
[ITEMDEF i_duel_leaving]
NAME=Duel Leaving
ID=i_memory
TYPE=t_eq_script
On=@Equip
TIMER=15
On=@Timer
TRY UID.<VAR.second0>.HITS=0
TRY UID.<VAR.second0>.EVENTS -e_duel_arena_1
TRY UID.<VAR.first0>.GO 3756,1294
TRY UID.<VAR.first0>.EVENTS -e_duel_arena_1
TRY UID.<VAR.arena0>.TAG.busy
TRY UID.<VAR.arena0>.COLOR=0876
VAR.first0
VAR.second0
VAR.arena0
REMOVE
RETURN 1
[DIALOG d_duel_arena_1]
200,200
GUMPPIC 0 0 2500
DTEXT 45 30 55 Do you accept duel
DTEXT 45 50 55 with <SRC.TARG.NAME>?
DTEXT 70 75 55 Yes
DTEXT 150 75 55 No
BUTTON 50 80 2224 2224 1 0 1
BUTTON 130 80 2224 2224 1 0 2
[DIALOG d_duel_arena_1 BUTTON]
On=0
TRY UID.<VAR.second0>.TAG.duel_wait
TRY UID.<VAR.first0>.SYSMESSAGE <SRC.NAME> didn't respond to challenge.
TRY UID.<VAR.arena0>.TAG.busy
TRY UID.<VAR.arena0>.COLOR=0876
TRY UID.<VAR.second0>.FINDID.i_duel_welcome.REMOVE
TRY UID.<VAR.first0>.FINDID.i_duel_welcome.REMOVE
VAR.first0
VAR.second0
VAR.arena0
On=1
TRY UID.<VAR.arena0>.COLOR=0486
TRY UID.<VAR.first0>.EVENTS +e_duel_arena_1
TRY UID.<VAR.first0>.GO 734,1106,20
TRY UID.<VAR.first0>.TAG.duel_wait
TRY UID.<VAR.first0>.FINDLAYER.25.REMOVE
TRY UID.<VAR.second0>.FINDLAYER.25.REMOVE
TRY UID.<VAR.second0>.GO 730,1106,20
TRY UID.<VAR.second0>.TAG.duel_wait
TRY UID.<VAR.second0>.EVENTS +e_duel_arena_1
TRY UID.<VAR.second0>.FINDID.i_duel_welcome.REMOVE
TRY UID.<VAR.first0>.FINDID.i_duel_welcome.REMOVE
On=2
TRY UID.<var.second0>.TAG.duel_wait
TRY UID.<var.first0>.SYSMESSAGE <SRC.NAME> has declined the challenge
TRY UID.<var.arena0>.TAG.busy
TRY UID.<var.arena0>.COLOR=0876
TRY UID.<var.second0>.FINDID.i_duel_welcome.REMOVE
TRY UID.<var.first0>.FINDID.i_duel_welcome.REMOVE
VAR.FIRST0
VAR.SECOND0
VAR.ARENA0
[ITEMDEF i_duel_welcome]
NAME=Duel Memory Welcome
ID=i_memory
TYPE=t_eq_script
On=@Create
ATTR=attr_newbie|attr_decay
On=@Equip
SDIALOG d_duel_arena_1
RETURN 1
On=@Timer
CONT.SYSMESSAGE Your enemy is not accepted the duel
TRY UID.<VAR.second0>.TAG.duel_wait
TRY UID.<VAR.arena0>.TAG.busy
TRY UID.<VAR.arena0>.COLOR=0876
REMOVE
RETURN 1
[ITEMDEF i_duel_memory]
NAME=Duel Memory
ID=i_memory
TYPE=t_eq_script
On=@Equip
TARGET
SRC.SYSMESSAGE @38 Choose your opponent!
RETURN 1
On=@TargOn_Char
IF (<ARGO.DISTANCE> > 3)
SRC.SYSMESSAGE You can't reach that
ELIF (<ARGO.TAG0.duel_wait>==1)
SRC.SYSMESSAGE Please wait...
ELIF (<ARGO.UID>==<SRC.UID>)
SRC.SYSMESSAGE @55 You can choose yourself!
ELIF (<ARGO.FLAGS> & statf_dead)
SRC.SYSMESSAGE You can't reach that
ELSE
VAR.first0=<SRC.UID>
ARGO.TAG.duel_wait=1
SRC.NEWITEM=i_duel_welcome
NEW.EQUIP <SRC.ACT.UID>
NEW.TIMER 15
VAR.second0=<SRC.TARG.UID>
TRY UID.<VAR.arena0>.TAG.busy=1
TRY UID.<VAR.arena0>.COLOR=0A39
REMOVE
ENDIF
RETURN 1
On=@TargOn_Ground
SRC.SYSMESSAGE You can't reach that
RETURN 1
On=@TargOn_Item
SRC.SYSMESSAGE You can't reach that
RETURN 1
On=@Timer
REMOVE
RETURN 1