Spells on @gethit - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Spells on @gethit (/Thread-Spells-on-gethit) Pages: 1 2 |
Spells on @gethit - Lano - 10-16-2012 06:41 AM I there, i need a little help with this: ON=@GETHIT IF (this is a fire spell, lets say s_explosion) local.magicfire = <muldiv <argn1>,100,100> local.magicfire -= <muldiv <resfire>,100,100> src.say Fire dmg argn1 = <eval <local.magicfire> + <local.magiccold> + <local.magicpoison> + <local.magicenergy>> endif I just cant seem to get the dmg output of the spell argn1.. I know that under @spelleffect argn1 is the spell type and argn2 the effect, but i am interestet in the dmg output, so my custom resistance system can work against the spell dmg output. I just cant seem to check for the spell, nor find the dmg output. Hope you understand it, its quite confusing to explain RE: Spells on @gethit - Barnabus - 10-16-2012 07:08 AM Combat can be tricky. GETHIT happens when the player actually gets hit with a damage. It is not the trigger used to calculate the damage... MAGE DAMAGE - do all your calculations inside the SpellEffect Trigger. PHP Code: ON=@SpellEffect PHP Code: ON=@HIT Then now you have the damage tagged to the person whom is getting Hit !! PHP Code: ON=@GETHIT Ok so briefly now : 1. Do all your damage calculations in HIT and SPELLEFECT 2. Transfer these damages one way or another to the GETHIT Trigger 3. In the GETHIT Trigger set ARGN1 asthe damage 4. ARGN2 as the damage type 5. Set ARGN3 as 0 (I dont remeber why i did this but i have a feeling it was parry or resist) 6. NOTE:dam_fire, or dam_cold, will get resisted by resfire rescold etc but dam_god wont get resisted. Ooops I forgot to say and its important... Remeber to remove the tags after you pass the damage !! PHP Code: ARGN1=<EVAL <REF1.CTAG.A_Mage_Damaged_Me_For>> RE: Spells on @gethit - Lano - 10-16-2012 05:29 PM Okay, i had a long bumby ride ahead of me before i had figured that one out myself so thanks so much RE: Spells on @gethit - Barnabus - 10-17-2012 12:13 AM The sphere community pack has an exellent example of this.. http://code.google.com/p/sphere-community-pack/source/browse/trunk/scripts/add-on/combat/sphere_combat_events.scp RE: Spells on @gethit - Lano - 10-17-2012 03:40 AM Okay call me stupid, but i still dont get it, you say: ON=@SpellEffect REF1=<SERV.UID.<SRC.UID>> // Caster REF2=<SERV.UID.<UID>> // Target // also here in this trigger <ARGN1> is the spell no. // Here we know the caster the target and the spellno // do your calculations here get a total, local.DamageTotal // then carry the damage value across to the GetHit Trigger, for example as a CTAG REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.damageTotal>> Okay, but: ""// do your calculations here get a total, local.DamageTotal"" that still gives me the same problem, where is the dmg from the spell stored? ARGN1 is the spell number, ARGN2 is the spelltype/effect where is the damage stored? how do i calculate that? i have no trouble appliying the dmg to my resist system and making it..well resist it, but i have trouble locating where the dmg a spell gives is stored.... I mean... ON=@SpellEffect REF1=<SERV.UID.<SRC.UID>> // Caster REF2=<SERV.UID.<UID>> // Target IF (<argn1> == some stupid spell number i wish to add % to resist) local.damagetotal = <eval <what? not argn1 or argn2? so what?> + <whatever i would like to add or take from that number> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.damageTotal>> RE: Spells on @gethit - Barnabus - 10-17-2012 05:57 AM If we just look at a Spell for example spell number 51 shown below PHP Code: [Spell 51] We can see this spell has the flag SPELLFLAG_HARM This means it will do damage. The Damage on the spell is the EFFECT. How do we access this damage from code ? <SERV.SPELL.51.EFFECT> PHP Code: ON=@SpellEffect Hopefully that should make sense now, if your still confused let me know RE: Spells on @gethit - Lano - 10-17-2012 05:11 PM <SERV.SPELL.<ARGN1>.EFFECT>> <----That was my mystery component. Thanks for your patience, now i will be able to get it done. Thanks again, always nice to have the forums to fall back to when you cant find the answer on sphere wiki RE: Spells on @gethit - Lano - 10-18-2012 03:09 AM But! Will this not only take the excact value from the EFFECT= line? i mean wont it always use EFFECT=59 the effect may be 59, but a low lvl mage would do less dmg with that spell, and a über monster with 300.0+ magery would do way more dmg, but we would always only be getting 59 as the output value/dmg? or am i wrong? RE: Spells on @gethit - Barnabus - 10-18-2012 05:56 AM Yes but thats were you put your calulations in It starts as 59, then after you calculate EvalInt Magery Int and - Resist Depending on your calculations it will not be 59 If you just do @GETHIT ARGN1=59 ARGN2=Dam_God ARGN3=0 It will just be 59.... RE: Spells on @gethit - Skul - 10-18-2012 07:03 AM You'll need to set a tag in @spelleffect and read it through @gethit, that's the only way to really store what 'spell' was sent through, here's a quick example: Code: on=@spelleffect |