spell damage
Moderator: POL Developer
spell damage
Whewre do i find spell damage, i looked at the (spell).src files, but i found nothing
-
- Distro Developer
- Posts: 2825
- Joined: Thu Feb 02, 2006 1:41 pm
- Location: San Antonio, Texas
- Contact:
Since this is the "General Help (095) forum I'll assume you're using 095 Distro.
Here are a few examples taken directly from the spell scripts showing the "Apply Damage" lines:
From clumsy.src starting at line 28:
From curse.src starting at line 20:
From fireball.src starting at line 19:
From lighting.src starting at line 17:
And finally from fstrike.src starting at line 17:
Just posting a few examples to show you the different ways damage can be applied. Some are using temporary mods for "damaging" vitals like mana or stamina and some use the ApplyDamage function to do HP damage.
Here are a few examples taken directly from the spell scripts showing the "Apply Damage" lines:
From clumsy.src starting at line 28:
Code: Select all
var magery := GetEffectiveSkill(caster, SKILLID_MAGERY);
var mod_amount := Resisted(circle,caster,cast_on,(GetModAmount( magery )));
var duration := GetModDuration( magery );
DoTempMod(cast_on, "dex", 0 - mod_amount, duration); // Damage dealt here
From curse.src starting at line 20:
Code: Select all
var magery := GetEffectiveSkill(caster, SKILLID_MAGERY);
var mod_amount := Resisted(circle,caster,cast_on,GetModAmount( magery ));
var duration := GetModDuration( magery );
SetObjProperty(cast_on, "LastHit", {caster.name,caster.serial, "curse" });
if(Reflected(cast_on))
cast_on := caster;
endif
if (CanMod(cast_on, "str"))
DoTempMod(cast_on, "str", 0- mod_amount, duration); // Damage dealt here
endif
if (CanMod(cast_on, "dex"))
DoTempMod(cast_on, "dex", 0- mod_amount, duration); // Damage dealt here
endif
if (CanMod(cast_on, "int"))
DoTempMod(cast_on, "int", 0- mod_amount, duration); // Damage dealt here
endif
From fireball.src starting at line 19:
Code: Select all
var dmg := RandomDiceRoll("3d6");
SetObjProperty(cast_on, "LastHit", {caster.name, caster.serial, "fireball"});
if(Reflected(cast_on))
PlayMovingEffect(cast_on, caster, FX_FIREBALL, 5, 1);
PlaySoundEffect(cast_on, 0x15f);
cast_on := caster;
endif
if(GetHp(cast_on) > 1)
if(cast_on.npctemplate)
dmg := dmg * 2;
endif
ApplyRawDamage(cast_on, Resisted(circle,caster,cast_on, dmg)); // Damage dealt here
endif
From lighting.src starting at line 17:
Code: Select all
var dmg := RandomDiceRoll("3d7");
if (dmg < 1)
dmg := 1;
endif
PlaySoundEffect(cast_on, SFX_SPELL_LIGHTNING);
PlayLightningBoltEffect( cast_on);
SetObjProperty(cast_on, "LastHit", {caster.name,caster.serial, "lightning bolt"});
if(Reflected(cast_on))
cast_on := caster;
PlaySoundEffect(cast_on, SFX_SPELL_LIGHTNING);
PlayLightningBoltEffect( cast_on);
endif
if(cast_on.isA(POLCLASS_NPC))
dmg := dmg * 2;
endif
ApplyRawDamage(cast_on, Resisted(circle,caster,cast_on,dmg)); //damage dealt here
And finally from fstrike.src starting at line 17:
Code: Select all
var dmg := RandomDiceRoll("6d8");
SetObjProperty(cast_on, "LastHit", {caster.name,caster.serial, "flame strike" });
if (Reflected(cast_on))
cast_on := caster;
endif
PlayObjectCenteredEffect(cast_on, 0x3709, 0x0a, 0x1e );
PlaySoundEffect( caster, SFX_SPELL_FLAME_STRIKE );
if(GetHp(cast_on) >= 1)
if(cast_on.npctemplate)
dmg := dmg * 2;
endif
ApplyRawDamage(cast_on, Resisted(circle,caster,cast_on,dmg)); //Damage dealt here
endif