FORUM ARCHIVED

Why does this spell backfire on the caster?

Discussion in 'Modding' started by Bohandas, Sep 27, 2013.

  1. Bohandas

    Bohandas Member

    I have a custom spell used as a criticalbuff proc in my bard mod, but instead of targeting the target it seems to target the caster, despite not being either a "self" spell nor a missile.
    Code:
    <spell name="Saturday Night Fever" type="target">
    	<buff useTimer="1" time="40" allowstacking="0" icon="skills/spells/diggle_flu64.png" smallicon="skills/spells/diggle_flu32.png" bad="1" > <!-- Needs Art -->
          <primarybuff id="0" amount="-1"/> <!-- Burliness -->
          <primarybuff id="1" amount="-1"/> <!-- Sagacity -->
          <primarybuff id="4" amount="-1"/> <!-- Stubbornness -->
          <secondarybuff id="0" amount="-2"/> <!-- hp -->
       </buff>
      
    	<anim sprite="sprites/sfx/corpse_hit_mini/corpse_hit_mini" frames="4" framerate="100" sfx="impact" centerEffect="0"/>
       <description text="You've caught an embarrassing and debilitating disease." monsterText="PLACEHOLDER"/> <!-- Needs better and more Original description -->
       </spell>
    
     
  2. lccorp2

    lccorp2 Member

    Put self="0" in the buff definitions.
     
  3. Bohandas

    Bohandas Member

    OK. Will do.

    Couple of questions though:

    -Is "criticalbuff" and/or "target" supposed to target the player? or is this just a workaround?

    -Would changing type to "targetmonster" also work? What about triggering it with an effect with "affectscaster" set to 0?

    -What would I do to make a non-custom buff spell not autotarget the player? I have a different spell which is supposed to cause Food Poisoning (a spell from expansion 3) in the target but which causes it on the caster instead (presumably because it also doesn't have self="0")
     
    Last edited: Sep 27, 2013
  4. bluehinter

    bluehinter Member

    In the off chance this is a monster spell, you might also try adding <ai hint="target"/> if self="0" doesn't work.

    I've had plenty of problems with spells backfiring on me and ignoring affectscaster="0", but mainly as a result of spell mines and spells that are triggered as a result of other spells.