Hi, I'm new to modding DoD, but I was just wondering... is there a code available to make it where a spell has a chance of activating, when the player is attacked? If so, what is it? What I want to do is make a buff that you can activate. While that buff is active, each time you are hit there is a chance that a spell will be cast on you. Is this possible? Thanks!
It's certainly possible! I don't know how to because I'm all kinds of useless when it comes to mods but Essence's Poisoneer mod uses this in its last spell.
Daynab, I believe that triggers from the skill itself, rather than a buff. Then that goes into the skillDB instead of the spellDB. What you want is a playerhiteffectbuff trigger put into a buff. Here's a simple example from the base game: Code: <spell name="Radiant Aura" type="self" icon="skills/spells/radiant_aura32.png" wand="0"> <requirements mp="10" savvyBonus="0.25" mincost="4" /> <anim sprite="sprites/sfx/summonA/summonA" frames="10" sfx="radiant" framerate="60" centerEffect="1"/> <buff useTimer="0" brittle="5" removable="1" allowstacking="0" icon="skills/spells/radiant_aura64.png" smallicon="skills/spells/radiant_aura32.png"> <halo name="sprites/sfx/radiance_loop/radiance_loop" first="0" num="4" frameRate="100" /> <primarybuff id="1" amount="1"/> <!-- Sagacity --> <secondarybuff id="9" amount="5"/> <!-- EDR --> <secondarybuff id="11" amount="5"/> <!-- resist --> <resistbuff necromantic="1"/> <sightbuff amount="2"/> <damagebuff righteous="1"/> <playerHitEffectBuff percentage="35" name="Blinding Flash" /> </buff> <description text="Surrounds you with a halo of light which illuminates the darkness (and your inner strength). Those who dare attack you are occasionally met with a blinding flash which stuns. The aura can only absorb a few hits before it is dissipated."/> <ai hint="ally" /> </spell> So 35% of the time you are hit with this buff on, the spell blnding flash will be cast. Now what you want to do is to set up the spell that it casts to target yourself - using the "self" type in your triggered spell would be the easiest way to do that.
Iccorp has just presented a perfect example of how new modders should experiment with the game files to get things working the way that they want.