FORUM ARCHIVED

Why doesn't this monster's onhit spell work?

Discussion in 'Modding' started by Bohandas, Jul 28, 2013.

  1. Bohandas

    Bohandas Member

    Ok, so I've got this custom monster, the "Diggle Vampire Spawn" which is supposed to cast a spell when it attacks that heals the monster. For some reason though, it doesn't ever seem to cast the spell when it hits, even when I increased the casting chance to onechancein="1"

    Since I can't figure out what's going wrong with this, maybe someone here can. Here are the stats for the monster and the relevant spells:

    <monster name="Diggle Vampire Spawn" level="1" taxa="Undead" tiny="1" diggleHell="1">

    <idleSprite left="sprites/monster/vladiggle/vladiggle_run_l.xml" right="sprites/monster/vladiggle/vladiggle_run_r.xml" up="sprites/monster/vladiggle/vladiggle_run_u.xml" down="sprites/monster/vladiggle/vladiggle_run_d.xml"/>
    <attackSprite left="sprites/monster/vladiggle/vladiggle_atk_l.xml" right="sprites/monster/vladiggle/vladiggle_atk_r.xml" up="sprites/monster/vladiggle/vladiggle_atk_u.xml" down="sprites/monster/vladiggle/vladiggle_atk_d.xml"/>
    <hitSprite left="sprites/monster/vladiggle/vladiggle_hit_l.xml" right="sprites/monster/vladiggle/vladiggle_hit_r.xml" up="sprites/monster/vladiggle/vladiggle_hit_u.xml" down="sprites/monster/vladiggle/vladiggle_hit_d.xml"/>
    <dieSprite name="sprites/monster/vladiggle/vladiggle_die_r.xml"/>
    <castSpellSprite name="sprites/monster/vladiggle/vladiggle_wand_r.xml" />
    <sfx attack="diggle_attack" hit="diggle_damage" die="diggle_die" spell="diggle_cast"/>

    <digSprites downSprite = "sprites/monster/digula_digging/digula_dig.xml" upSprite = "sprites/monster/digula_digging/digula_pop.xml" /> <!-- These are custom sprites cobbled together from the core digging and digula sprites -->


    <info latin="(Poingus Poingus)" text="A strange little bird-thing that tunnels through walls and feeds on the blood of the living."/>


    <dig mindistance="3" percent="15" ambushpercent="15" blockedpercent="100" minturns="3" maxTurns="6" />

    <stats numFig="2" numRog="1" numWiz="2" xpValue="20" />
    <secondarybuff id="4" amount="-3"/> <!-- crit -->
    <secondarybuff id="6" amount="4"/> <!-- dodge -->

    <palette tint="140"/>

    <resistances necromantic="2" toxic="1" asphyxiative="1" righteous="-1" />
    <damage slashing="1" piercing="2" necromantic="1" />
    <onhit spell="Weaker Vampiritic Attack" onechancein="1"/>

    <ai aggressiveness="4" span="10" spellPercentage="5" />
    <sight cone="90" modifier="1.10" />
    <spell name="Lingering Weakness Missile"/>
    <spell name="Lingering Dullness Missile"/>
    <spell name="Weak Existential Despair Missile"/>


    </monster>



    <spell name="Vampiritic Healing Effect" type="self" >
    <effect type="heal" amount="2" amountF="0.05" />
    </spell>

    <spell name="Weaker Vampiritic Attack" type="target" >
    <effect type="damage" necromantic="1" necromanticF="0.06" primaryScale="3"/> <!-- Scales to caddishness -->
    <anim sprite="sprites/sfx/bloodmagic/bloodmagic" frames="7" framerate="60" centerEffect="0" sfx="fleshbore" />
    <effect type="trigger" spell="Vampiritic Healing Effect"/>
    </spell>