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
Author Message
Accept
Apprentice
*

Posts: 3
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Nov 2015
Reputation: 0



Post: #1
Smile Duel Pit
Hi guys Bye
I wanna make some duel system ... But have some problem, can you help me ... I need update this script with your help Smile
Maybe some change, i need your advice Veryhappy

PHP Code:
//<------------------------------------------------------------------------------------->
//<-------------------------------------- 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.NAMEhas 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 
11-19-2015 08:44 PM
Find all posts by this user Like Post Quote this message in a reply
azmanomer
Journeyman
*

Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1



Post: #2
RE: Duel Pit
what kind of updates? Do you get any errors? At least say your wishes Smile
11-19-2015 09:05 PM
Find all posts by this user Like Post Quote this message in a reply
an0n!m0use
Journeyman
*

Posts: 56
Likes Given: 16
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #3
Big Grin RE: Duel Pit
(11-19-2015 09:05 PM)azmanomer Wrote:  Do you get any errors?
This script very interesly working ... Dont ask enemy about accept the duel ...)
When you choose the enemy this script ask you fight or not Big Grin
About update: Meybe change VAR.first0 & VAR.second0 to REF1 and REF2 ?
11-20-2015 02:21 AM
Find all posts by this user Like Post Quote this message in a reply
azmanomer
Journeyman
*

Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1



Post: #4
RE: Duel Pit
SRC.NEWITEM=i_duel_welcome
NEW.EQUIP <SRC.ACT.UID> ----> change this one to NEW.EQUIP <argo>

then it will ask to your target there are lots of nonsense things but i think you can figure them out Smile check this page it will help you a lot http://wiki.sphere.torfo.org/index.php/C...y:Triggers
11-20-2015 04:23 AM
Find all posts by this user Like Post Quote this message in a reply
Accept
Apprentice
*

Posts: 3
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Nov 2015
Reputation: 0



Post: #5
RE: Duel Pit
(11-20-2015 04:23 AM)azmanomer Wrote:  SRC.NEWITEM=i_duel_welcome
NEW.EQUIP <SRC.ACT.UID> ----> change this one to NEW.EQUIP <argo
Thx! Little upgrade i have Big Grin
(11-20-2015 02:21 AM)an0n!m0use Wrote:  Dont ask enemy about accept the duel ...) When you choose the enemy this script ask you fight or not Big Grin
How to fix that ? Confused
Quote:About update: Meybe change VAR.first0 & VAR.second0 to REF1 and REF2 ?
I have tried, did not work Cry
11-24-2015 05:23 PM
Find all posts by this user Like Post Quote this message in a reply
Accept
Apprentice
*

Posts: 3
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Nov 2015
Reputation: 0



Post: #6
RE: Duel Pit
Guys ? Cry
11-26-2015 05:11 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #7
RE: Duel Pit
You should look at your vars, vars are global for the server so if you set var.first0 and then another guy set it too, both will have the same value. Change them to tags so they are stored on that memory, or in the player, or where you might like more.
11-26-2015 05:48 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
Post Reply 


Forum Jump:


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