Damage to self... - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: General Help (/Forum-General-Help) +--- Thread: Damage to self... (/Thread-Damage-to-self) |
Damage to self... - RanXerox - 11-01-2012 08:02 AM I am having difficulty working this out: When a player or npc steps into a fire (for example, an item of type=t_fire), the "source" of the damage in the @GetHit trigger is themselves... Similarly, when a fire elemental drops a fire on the ground and then walks into it, the "source" of the damage is themselves... Does anyone have suggestions on how to prevent a fire elemental from taking damage when they walk into their own droppings, but still allow players or npc's to take fire damage when they step on something dangerous? RE: Damage to self... - Shaklaban - 11-01-2012 09:27 AM linking fire field to fire elemental do the trick for that situation. RE: Damage to self... - RanXerox - 11-01-2012 10:22 AM I presume you do this in @NPCSpecialAction... but how do you reference the item in that trigger? ... on second thought, this trigger occurs before the fire is dropped. What trigger fires AFTER (that has a reference to the fire object)? RE: Damage to self... - Barnabus - 11-01-2012 10:05 PM Hi RanXerox I was wondering what you did here.... I was thinking something like On the ITEMDEFS for FireFields ON=@Step IF <SRC.ISPLAYER> SRC.TAG.StoodOnUIDSFireField=<LINK.UID> ENDIF RETURN 0 Then in PLAYERS GETHIT Doing something like.. ON=@GetHit IF <REF2.TAG.StoodOnUIDSFireField> REF2.TAG.StoodOnUIDSFireField= ARGN2=dam_fire ELSE ARGN2=dam_god ENDIF And in the NPCS get hit IF <REF2.TAG.StoodOnUIDSFireField> && <REF2.BASEID>==c_fire_elemental REF2.TAG.StoodOnUIDSFireField= RETURN 1 ELSE ARGN2=dam_fire ENDIF What did you end up doing ? RE: Damage to self... - Shaklaban - 11-01-2012 11:20 PM (11-01-2012 10:22 AM)RanXerox Wrote: I presume you do this in @NPCSpecialAction... but how do you reference the item in that trigger? mayve @step works since elemental drop the fire field @step must fire for it for first time. or if NPCSpecialAction fires for dropping fire field, maybe you can try act or foritems. RE: Damage to self... - RanXerox - 11-02-2012 01:04 AM The thing is, I don't want to stop all monsters from taking damage by stepping on things... players cast wall of fire, players can lay traps, monsters can fight each other when provoked or after being tamed, etc. I just want certain cases fixed. I like the idea of linking an item to its owner and detecting that to avoid the damage. The case of the fire field is just one example. RE: Damage to self... - Barnabus - 11-02-2012 01:41 AM Ive Decided on something similiar just reading your post and Ive just did something basic, I like skulls idea about defining the NPCSpecial Triggers etc.. I did on the ITEMDEF for the field PHP Code: ON=@Step and then in GETHIT I just did this.... PHP Code: IF <REF2.TAG.StoodOnUIDSFireField> == <REF2.UID> i havnt set no damage or effect yet but at least I know who did it and who got it now @NPCFireField Would rock Ive had difficuty with the dragon breath too.. Just to add another but similiar annoyance. PHP Code: ON=@NPCSpecialAction RE: Damage to self... - Barnabus - 11-04-2012 03:11 AM Sorry I got that Wrong. Ill Repost that @Step and @GetHIt Bit again for the benefit of noobs who may be reading this post. PHP Code: ON=@Step The GETHIT trigger and just to note who is who in my GETHIT trigger. Code: ON=@GetHit ANd Below is the code that was added to my get hit trigger. PHP Code: IF <REF2.TAG0.StoodOnUIDSFireField> == <REF2.UID> RE: Damage to self... - Skul - 11-14-2012 02:51 AM Barnabus, use @spelleffect and @gethit, here's an example: Code: on=@spelleffect RE: Damage to self... - RanXerox - 11-14-2012 04:27 AM This technique will work for "instant" spells... but it won't work for things like firefield etc. So be careful hehe. |