The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
duel pit fails
Author Message
daedelus
Journeyman
*

Posts: 69
Likes Given: 0
Likes Received: 2 in 1 posts
Joined: Aug 2012
Reputation: 0



Post: #1
duel pit fails
Spanish:

Intente crear un sistema automático poniendo simplemente .duelpit y que cree en cada una de las coordenadas una piedra para ingresar al duelpit. Después de 10 minutos se debería borrar. Pero no esta funcionando, porque a los 10 minutos no se borra y no crea todas las piedras que yo especifique.

English:

I Try to creating an automated system by simply putting. Duelpit and believes in each of the coordinates to enter a stone of duelpit. After 10 minutes the stone should be deleted. But not working, because after 10 minutes the stone don't delete.

The another problem is that, the stones don't be create completly, after ten minutes, the announcement again without put .duelpit.

Code:
[ITEMDEF I_GRAVEDUEL]
ID=I_GRAVE_STONE
NAME=Entrada DUEL PIT
CATEGORY=Mayo
SUBSECTION=Duel
DESCRIPTION=Piedra del Duel

on=@create
ATTR=ATTR_MOVE_NEVER
COLOR=0480

ON=@Dclick
SRC.GO 6074,449,-22
SRC.EVENTS +E_DUEL

[EVENTS E_DUEL]
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]

ON=@DEATH
SRC.GO 6091,442,-22
SRC.HITS=<SRC.STR>
RETURN 1

[ITEMDEF I_GRAVEDUEL2]
ID=I_GRAVE_STONE
NAME=Salida DUEL PIT
CATEGORY=Mayo
SUBSECTION=Duel
DESCRIPTION=Piedra del Duel 2

ON=@Dclick
SRC.GO 1336,1997,5,0
SRC.EVENTS -E_DUEL
SRC.EVENTS +E_DUEL2

[EVENTS E_DUEL2]
SRC.NAME=<SRC.TAG.OLDNAME>
SRC.COLOR=<SRC.TAG.OLDCOLOR>
SRC.KARMA=<SRC.TAG.OLDKARMA>
SRC.FAME=<SRC.TAG.OLDFAME>
SRC.KILLS=<SRC.TAG.OLDKILLS>
SRC.EVENTS -E_DUEL2

[ITEMDEF I_RESU]
ID=04
NAME=Ankh

ON=@CREATE
COLOR=COLOR_ICE

ON=@Dclick
SRC.RESURRECT

[ITEMDEF I_RESU2]
ID=05
NAME=Ankh

ON=@CREATE
COLOR=COLOR_ICE

ON=@Dclick
SRC.RESURRECT

[PLEVEL 4]
DUELPIT

[FUNCTION DUELPIT]  //The first stone (brit) only can announce the event.
SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 1431,1695,0,0 //BRIT
NEW.TIMER=1
NEW.MORE=10
SERV.B @0466 Se han creado las piedras para el Duel Pit!

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   SERV.B @0466 Se han creado las piedras para el Duel Pit!
   TAG0.UID_ENTRADA=
return 1
ELSE
   SERV.B @0466 Quedan <MORE> minutos para que comience el Duel Pit.
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
SERV.B @0466 Se cerro el acceso al duel pit.
REMOVE
ENDIF

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 2504,562,0,0  //MINOC
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 577,2131,0,0  //SKARA BRAE
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 4472,1178,0,0 //MOONGLOW
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 2234,1198,0,0 //COVE
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 5674,3142,12,0 //PAPUA
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 2893,3475,15,0 //SERPENT'S HOLD
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF


SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 2723,2188,0,0 //BUCCANNER'S DEN
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF


SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 5222,185,5,0  //WIND
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF


SERV.NEWITEM= I_GRAVEDUEL
NEW.P= J1324,3780,0,0 //JHELOM
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF


//SERV.NEWITEM= I_GRAVEDUEL
//NEW.P= MAGINCIA ADD LATER
SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 3690,2522,0,0 //OCCLO
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 1822,2825,0,0 //TRINSIC
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 636,859,0,0 //YEW
NEW.TIMER=1
NEW.MORE=10

ON=@TIMER
TIMER=60

IF ( <EVAL <MORE> > == 0 )
   TIMER=-1
   REMOVE <EVAL <TAG0.UID_ENTRADA> >
   TAG0.UID_ENTRADA=
return 1
ELSE
   MORE=<MORE>-1
return 1
IF (<MORE> == 0)
REMOVE
ENDIF

[EoF]

Thanks

p.s.: Sorry for my english.
(This post was last modified: 08-15-2012 12:16 AM by daedelus.)
08-14-2012 11:37 PM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #2
RE: duel pit fails
Here is the main problem:

- A function cannot include triggers (things like ON=@something)
- In your case, the trigger should probably be on the gravestone ITEMDEF
- You can not redefine a trigger multiple times... There can only be one ON=@Trigger

Here is other advice:

- I have my doubts that "> ==" is a viable operator... use ">=" instead
- There is no need to EVAL MORE because MORE is always a number. You only need to EVAL things if they could have a string value. For example, a TAG or VAR could contain a number or a string and may need to be EVAL'd.
- The REMOVE function probably doesn't need to have its argument EVAL'd
(This post was last modified: 08-15-2012 12:20 AM by RanXerox.)
08-15-2012 12:18 AM
Find all posts by this user Like Post Quote this message in a reply
daedelus
Journeyman
*

Posts: 69
Likes Given: 0
Likes Received: 2 in 1 posts
Joined: Aug 2012
Reputation: 0



Post: #3
RE: duel pit fails
(08-15-2012 12:18 AM)RanXerox Wrote:  Here is the main problem:

- A function cannot include triggers (things like ON=@something)
- In your case, the trigger should probably be on the gravestone ITEMDEF
- You can not redefine a trigger multiple times... There can only be one ON=@Trigger

Here is other advice:

- I have my doubts that "> ==" is a viable operator... use ">=" instead
- There is no need to EVAL MORE because MORE is always a number. You only need to EVAL things if they could have a string value. For example, a TAG or VAR could contain a number or a string and may need to be EVAL'd.
- The REMOVE function probably doesn't need to have its argument EVAL'd

I looked back to the code and try to apply your answer, now put it in a part <link.more> == <more> and use it in a [function] that is valid?.

thanks

p.s: Sorry for my english

Code:
[ITEMDEF I_GRAVEDUEL]
ID=I_GRAVE_STONE
NAME=Entrada DUEL PIT
CATEGORY=Mayo
SUBSECTION=Duel
DESCRIPTION=Piedra del Duel

on=@create
attr=attr_move_never
color=0480
timer=1
MORE=10
LINK.MORE=<MORE> //I use this link.more for the function

ON=@Timer
Timer=60

IF ( <more> >= 0 )
   timer=-1
   remove <eval <tag0.uid_entrada> >
      tag0.uid_entrada=
return 1
ELSE
   MORE=<MORE>-1
   return 1
ENDIF

ON=@Dclick
SRC.GO 6074,449,-22
SRC.EVENTS +E_DUEL

[EVENTS E_DUEL]
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]

ON=@DEATH
SRC.GO 6091,442,-22
SRC.HITS=<SRC.STR>
RETURN 1

[ITEMDEF I_GRAVEDUEL2]
ID=I_GRAVE_STONE
NAME=Salida DUEL PIT
CATEGORY=Mayo
SUBSECTION=Duel
DESCRIPTION=Piedra del Duel 2

ON=@Dclick
SRC.GO 1336,1997,5,0
SRC.EVENTS -E_DUEL
SRC.EVENTS +E_DUEL2

[EVENTS E_DUEL2]
SRC.NAME=<SRC.TAG.OLDNAME>
SRC.COLOR=<SRC.TAG.OLDCOLOR>
SRC.KARMA=<SRC.TAG.OLDKARMA>
SRC.FAME=<SRC.TAG.OLDFAME>
SRC.KILLS=<SRC.TAG.OLDKILLS>
SRC.EVENTS -E_DUEL2

[ITEMDEF I_RESU]
ID=04
NAME=Ankh

ON=@CREATE
COLOR=COLOR_ICE

ON=@Dclick
SRC.RESURRECT

[ITEMDEF I_RESU2]
ID=05
NAME=Ankh

ON=@CREATE
COLOR=COLOR_ICE

ON=@Dclick
SRC.RESURRECT

[PLEVEL 4]
DUELPIT

[FUNCTION DUELPIT]
SERV.B @0466 Se han creado las piedras para el Duel Pit!
IF (<LINK.MORE> == 10)
SERV.B @0466 Quedan <LINK.MORE> minutos para que comience el Duel Pit.
ELIF (<LINK.MORE> == 9)
SERV.B @0466 Quedan <LINK.MORE> minutos para que comience el Duel Pit.
ELIF (<LINK.MORE> == 8)
SERV.B @0466 Quedan <LINK.MORE> minutos para que comience el Duel Pit.
ELIF (<LINK.MORE> == 7)
SERV.B @0466 Quedan <LINK.MORE> minutos para que comience el Duel Pit.
ELIF (<LINK.MORE> == 6)
SERV.B @0466 Quedan <LINK.MORE> minutos para que comience el Duel Pit.
ELIF (<LINK.MORE> == 5)
SERV.B @0466 Quedan <LINK.MORE> minutos para que comience el Duel Pit.
ELIF (<LINK.MORE> == 4)
SERV.B @0466 Quedan <LINK.MORE> minutos para que comience el Duel Pit.
ELIF (<LINK.MORE> == 3)
SERV.B @0466 Quedan <LINK.MORE> minutos para que comience el Duel Pit.
ELIF (<LINK.MORE> == 2)
SERV.B @0466 Quedan <LINK.MORE> minutos para que comience el Duel Pit.
ELIF (<LINK.MORE> == 1)
SERV.B @0466 Quedan <LINK.MORE> minutos para que comience el Duel Pit.
ELIF (<LINK.MORE> == 0)
SERV.B @0466 Duel Pit cerrado!.
ENDIF

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 1431,1695,0,0 //BRIT

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 2504,562,0,0  //MINOC

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 4472,1178,0,0 //MOONGLOW

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 2234,1198,0,0 //COVE

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 5674,3142,12,0 //PAPUA

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 2893,3475,15,0 //SERPENT'S HOLD

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 2723,2188,0,0 //BUCCANNER'S DEN

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 5222,185,5,0  //WIND

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 1324,3780,0,0 //JHELOM

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 3690,2522,0,0 //OCCLO

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 1822,2825,0,0 //TRINSIC

SERV.NEWITEM= I_GRAVEDUEL
NEW.P= 636,859,0,0 //YEW

[EoF]
(This post was last modified: 08-15-2012 01:03 AM by daedelus.)
08-15-2012 12:46 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #4
RE: duel pit fails
Try this:

PHP Code:
[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.@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.P1431,1695,0,//BRIT
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P2504,562,0,0  //MINOC
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P4472,1178,0,//MOONGLOW
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P2234,1198,0,//COVE
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P5674,3142,12,//PAPUA
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P2893,3475,15,//SERPENT'S HOLD
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P2723,2188,0,//BUCCANNER'S DEN
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P5222,185,5,0  //WIND
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P1324,3780,0,//JHELOM
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P3690,2522,0,//OCCLO
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P1822,2825,0,//TRINSIC
NEW.LINK=<VAR.DuelPitRunning>
SERV.NEWITEM=i_duel_entrance
NEW.P636,859,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.@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.@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
.@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 
(This post was last modified: 08-15-2012 06:38 AM by RanXerox.)
08-15-2012 06:32 AM
Find all posts by this user Like Post Quote this message in a reply
daedelus
Journeyman
*

Posts: 69
Likes Given: 0
Likes Received: 2 in 1 posts
Joined: Aug 2012
Reputation: 0



Post: #5
RE: duel pit fails
Oh thanks y see this script and i learn!!.

Thanks man!.
08-15-2012 08:24 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)