[PLEVEL 4]
DUELPIT
[FUNCTION DUELPIT]
IF (<VAR.DuelPitRunning>)
   SRC.SYSMESSAGE You cannot start a new duel event till the previous one is finished
   RETURN 1
ENDIF
SERV.B @0466 Se han creado las piedras para el Duel Pit!
SERV.NEWITEM=i_duel_control
VAR.DuelPitRunning=<NEW>  // Set a global variable with the control stone's UID
NEW.P=<SRC.P>    // Put the control stone at the GM's feet
NEW.LINK=<SRC>  // Link the control stone to the GM
NEW.MORE=10       // This is the number of minutes for the countdown
NEW.TIMER=1        // Start the countdown timer
//Create all the entrance stones at each bank (link them to the control stone)...
SERV.NEWITEM=i_duel_entrance
NEW.P= 1431,1695,0,0 //BRIT
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 2504,562,0,0  //MINOC
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 4472,1178,0,0 //MOONGLOW
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 2234,1198,0,0 //COVE
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 5674,3142,12,0 //PAPUA
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 2893,3475,15,0 //SERPENT'S HOLD
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 2723,2188,0,0 //BUCCANNER'S DEN
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 5222,185,5,0  //WIND
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 1324,3780,0,0 //JHELOM
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 3690,2522,0,0 //OCCLO
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 1822,2825,0,0 //TRINSIC
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P= 636,859,0,0 //YEW
NEW.LINK=<VAR.DuelPitRunning>
[ITEMDEF i_duel_control]
ID=I_GRAVE_STONE
NAME=DUEL PIT CONTROL
TYPE=t_normal
CATEGORY=Mayo
SUBSECTION=Duel
DESCRIPTION=Duel Pit Controller
ON=@Create
   ATTR=attr_move_never
   COLOR=0480
ON=@Timer
   IF (<MORE>)
      SERV.B @0466 Quedan <EVAL <MORE>> minutos para que comience el Duel Pit.
      MORE --             // subtract 1 from MORE
      TIMER=60          // set the TIMER for 60 more seconds
   ELSE
      SERV.B @0466 Duel Pit cerrado!.
      //The timer is finished so find and remove all the duel event entrances:
      FORINSTANCES i_duel_entrance
         REMOVE
      ENDFOR
   ENDIF
   RETURN 1
ON=@Dclick
   IF (<SRC.ISGM>)
      // Code to cancel the duel event:
      VAR.DuelPitRunning=
   ENDIF
   REMOVE
[ITEMDEF i_duel_entrance]
ID=I_GRAVE_STONE
NAME=Entrada DUEL PIT
TYPE=t_normal
CATEGORY=Mayo
SUBSECTION=Duel
DESCRIPTION=Piedra del Duel
ON=@Create
   ATTR=attr_move_never
   COLOR=0480
ON=@DClick
   SERV.B @0466 <SRC.NAME>entered the Duel Pit!
   TAG.PlayerUID=<SRC>   // Store the Player's UID in a tag
   SRC.GO 6074,449,-22     // Send the player to the Duel Area Start
   SRC.EVENTS +E_DUEL    // Give the Player a duel event
   // Save the player's vital statistics:
   SRC.TAG.OLDNAME=<SRC.NAME>
   SRC.TAG.OLDCOLOR=<SRC.COLOR>
   SRC.TAG.OLDKARMA=<SRC.KARMA>
   SRC.TAG.OLDFAME=<SRC.FAME>
   SRC.TAG.OLDKILLS=<SRC.KILLS>
   SRC.NAME=<SRC.NAME>[DUEL PIT]
[EVENTS E_DUEL]
ON=@Death
   SRC.GO 6091,442,-22   //Send the player back to the duel start
   SRC.HITS=<SRC.STR>
   RETURN 1  //Prevent the player from actually dying