Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
57 stars 45 forks source link

@Step and newnpc or newitem make spell change target #621

Closed alexdan2 closed 3 years ago

alexdan2 commented 3 years ago

Hello have found a issue whit trigger @Step and Casting.

When i cast a spell and keep target open and step a item whit @step and NEWITEM or NEWNPC.. When i target whit spell char mobile, target is forced to NEW object created by @step.

I make a test whit invisibility spell.

How Reproduce:

Spell Code:

[SPELL 44]
DEFNAME=s_invisibility
NAME=Invisibility
SOUND=snd_spell_invisibility
RUNES=.An Lor Xen
CAST_TIME=3.0
RESOURCES=i_reag_blood_moss,i_reag_nightshade
RUNE_ITEM=i_rune_invisibility
SCROLL_ITEM=i_scroll_invisibility
FLAGS=spellflag_dir_anim|spellflag_targ_char|spellflag_good|spellflag_playeronly
EFFECT_ID=0
EFFECT=0
LAYER=layer_spell_invis
DURATION=2*60.0,5*60.0
MANAUSE=30  //25
SKILLREQ=MAGERY 60.0
INTERRUPT=100.0,100.0

Item whit step code:

[ITEMDEF i_test22]      
DEFNAME=i_test22
ID=i_bandage
TYPE=t_normal

ON=@Step
    IF (<SRC.ISPLAYER>)
        SRC.NEWNPC c_cat
        NEW.P=<SRC.P>
    ENDIF
drk84 commented 3 years ago

you have to use serv.newnpc, if you use src.newnpc you will change the act value of the character.