escribano
Journeyman
Posts: 170
Likes Given: 16
Likes Received: 32 in 23 posts
Joined: Nov 2012
Reputation: 2
Dragon Shard
|
Help with Explosion Potion
Hello guys,
I'm having a problem on my explosion potions
Code:
[ITEMDEF i_potion_ExplosionLess]
NAME=Lesser Explosion
ID=i_bottle
TYPE=T_POTION
WEIGHT=7
TDATA1=0
RESOURCES=i_reag_sulfur_ash 3, i_bottle_EMPTY
SKILLMAKE=ALCHEMY 29.0
ON=@DCLICK
if ! (<src.targ.cont>==<src.findlayer(21).UID>)
Src.sysmessage Only on backpack.
return 1
endif
IF (<eval <SRC.REGION.FLAGS>>&04000)
SRC.SYSMESSAGE You cant use <SRC.TARG.NAME> on pretection.
RETURN 1
ELSE
if (<src.flags> & statf_dead) || (<src.flags> & statf_freeze) || (<src.flags> & statf_stone)
src.sysmessage @07a1 You cant use this potion now
return 1
endif
If (<src.restest i_delay_explosion>)
Src.message [<eval <src.findid.(i_delay_explosion).timer>> Segs]
return 1
endif
IF
src.consume 1 i_potion_ExplosionLess
Src.newitem i_delay_explosion
Src.act.equip
ENDIF
ON=@Create
COLOR=07b2
MORE1=s_explosion
MORE2=0.1
[ITEMDEF i_delay_explosion]
NAME=Delay Explosion
ID=i_handr_1
TYPE=T_EQ_SCRIPT
WEIGHT=0
LAYER=0
ON=@Equip
TIMER=3
ON=@TIMER
REMOVE
RETURN 1
Ok, this is my Explosion Potion script, and it works... but i have this error:
When a player use explosion potion, the potion will explode in 3 seconds... but if on this 3 seconds, the player cast a spell, and the potion explodes, the player still casting (the player has not been hit by the explosion).
Another example:
If a player cast a spell on you, and you use a explosion potion to cancel the player spell, it works... but if u are casting a spell, your spell isn't canceled and the spell of the other player is cancelled.
I need help to fix this problem.
Thanks!
UltimaPHP - OpenSource Ultima Online Server v0.1-pre-alpha under development, we need help!
|
|
01-28-2013 03:19 PM |
|
|
RanXerox
Master
Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19
|
RE: Help with Explosion Potion
Try this version instead:
Code:
[ITEMDEF i_potion_explosionless]
ID=i_bottle_purple
NAME=exploding potion
TYPE=t_thrown_explosive
VALUE=25
WEIGHT=1.0
RESOURCES=i_reag_sulfur_ash 3,1 i_bottle_empty
SKILLMAKE=Alchemy 30.1
CATEGORY=Magic
SUBSECTION=Potions
DESCRIPTION=Explosion (lesser)
ON=@Create
COLOR=012
TAG.Damage=6,15
TAG.Range=1
It uses a special type:
Code:
[TYPEDEF t_thrown_explosive]
ON=@DClick
IF (<SRC.RESTEST i_throw_delay>)
SRC.SYSMESSAGE @color_text,,1 You must wait a moment to throw this potion.
ELSE
SERV.NEWITEM i_throw_delay,1,<SRC>
NEW.TIMER=1
LINK=<SRC>
TARGETG @color_text,,2 1113280//"Which target do you wish to throw this at?"
ENDIF
RETURN 1
ON=@Targon_Ground
IF (<SRC.CANSEELOSFLAG 0 <SRC.TARGP>>==0)
SRC.SYSMESSAGELOC color_text,500237//"Target cannot be seen!"
ELSEIF (<SRC.DISTANCE <SRC.TARGP>> < 3)
SRC.SYSMESSAGELOC color_text,1063303//"Your target is too close!"
ELSEIF (<SRC.DISTANCE <SRC.TARGP>> > 10)
SRC.SYSMESSAGELOC color_text,1063304//"Your target is too far!"
ELSE
SRC.SPELLEFFECT s_reveal,100.0,<SRC>
SRC.ANIM 11
P=<SRC.TARGP>
MORE2=4
TIMER=1
EFFECT 0,0f0d,8,16
ENDIF
RETURN 1
ON=@Targon_Char
IF !(<SRC.TARG.CANSEELOS>)
SRC.SYSMESSAGELOC color_text,500237//"Target cannot be seen!"
ELSEIF (<SRC.TARG>==<SRC>)
SRC.SYSMESSAGELOC color_text,1005576//"You can't throw this at yourself."
ELSEIF (<SRC.CHECKDIST> < 2)
SRC.SYSMESSAGE color_text,1063303//"Your target is too close!"
ELSEIF (<SRC.CHECKDIST> > 10)
SRC.SYSMESSAGELOC color_text,1063304//"Your target is too far!"
ELSE
SRC.SPELLEFFECT s_reveal,100.0
SRC.ANIM 11
P=<SRC.TARGP>
MORE2=4
TIMER=1
EFFECT 0,0f0d,8,16
ENDIF
RETURN 1
ON=@Targon_Item
SRC.SYSMESSAGE @color_text,,1 You can not target that!
RETURN 1
ON=@Timer
MORE2 --
IF (<MORE2>)
SAY <dMORE2>
TIMER=1
ELSE
REMOVE
LINK.SFX 519
SERV.NEWITEM=i_fx_explode
NEW.TYPE=t_explosion
NEW.ATTR=attr_move_never|attr_can_decay
NEW.LINK=<LINK> //this should link the explosion to thrower - possibly making them a criminal
NEW.MOREX=<R<STRARG <TAG0.Damage>>,<STREAT <TAG0.Damage>>>
NEW.MOREY=dam_fire|dam_general
NEW.MOREZ=<TAG0.Range>
NEW.P=<P>
NEW.TIMERD=1
ENDIF
RETURN 1
Which requires a "delay" item:
Code:
[ITEMDEF i_throw_delay]
ID=i_handr_1
NAME=throwing delay
TYPE=t_eq_script
WEIGHT=0
LAYER=layer_special
ON=@Create
ATTR=attr_invis|attr_decay
MORE1=4
ON=@Equip
TIMER=1
ON=@Timer
IF (<CONT>)
IF (<MORE1>)
MORE1 --
TIMER=1
RETURN 1
ENDIF
ENDIF
REMOVE
RETURN 1
|
|
01-28-2013 03:55 PM |
|
|
escribano
Journeyman
Posts: 170
Likes Given: 16
Likes Received: 32 in 23 posts
Joined: Nov 2012
Reputation: 2
Dragon Shard
|
|
01-29-2013 05:04 AM |
|
|