SphereCommunity
Spellflag_Targ_XYZ and Spellflag_Area - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Spellflag_Targ_XYZ and Spellflag_Area (/Thread-Spellflag-Targ-XYZ-and-Spellflag-Area)



Spellflag_Targ_XYZ and Spellflag_Area - Gil Amarth - 03-29-2013 08:27 PM

I´m trying to replicate some default spells, but scripting myself to have a better control about his functions.

In my new teleport spell:

Code:
[Spell 1120]
DEFNAME = s_teleportation
NAME = Teleportation
SOUND = snd_SPELL_TELEPORT
RUNES = UJ
CAST_TIME = 3.0
RESOURCES = 2 i_blood_moss
RUNE_ITEM =
SCROLL_ITEM = i_scroll_teleportation
FLAGS = SPELLFLAG_TARG_XYZ | SPELLFLAG_AREA
EFFECT_ID =
EFFECT = 0,0
DURATION = 0,0
MANAUSE = 28
SKILLREQ = MAGERY 95.0
INTERRUPT = 0.0,0.0
GROUP = 4

ON=@SUCCESS
    IF (<SRC.DISTANCE <TARGP>> <= 8)
        SRC.P = <TARGP>
        SRC.UPDATE
    ELSE
        SRC.SYSMESSAGE The target is too far away
        RETURN 1
    ENDIF

The strange thing is when i put only in FLAGS= SPELLFLAG_TARG_XYZ, the spell works correctly, but at the end, returns me a failed spell cast. ¿?

When I put in FLAGS = SPELLFLAG_TARG_XYZ | SPELLFLAG_AREA, then there is no fail at the end. ¿?

This only happens to me with SPELLFLAG_TARG_XYZ.
SPELLFLAG_TARG_CHAR or SPELLFLAG_TARG_ITEM works fine without anything more.

Anyone experienced this? Seems a bug, and I have to put always this two spellflags together.


RE: Spellflag_Targ_XYZ and Spellflag_Area - darksun84 - 03-29-2013 08:51 PM

SPELLFLAG_AREA is for area effect spells like meteor swarm, earthquake and so on.

I think you have to add SPELLFLAG_SCRIPTED


RE: Spellflag_Targ_XYZ and Spellflag_Area - Gil Amarth - 03-29-2013 09:11 PM

Yep, you are right.

The strange thing is with _TARG_CHAR and _TARG_ITEM I didn´t need to add _SCRIPTED. But if it works, perfect.

Thank you! Smile