 |
 |
 |
 |
|
 |
 |
|
 |
 |
| Author |
Message |
Yukiko
Joined: 02 Feb 2006 Posts: 1094 Location: Southern Central USA
|
Posted: Sun Sep 03, 2006 4:46 pm Post subject: |
|
|
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:
| Code: |
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: |
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: |
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: |
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: |
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
|
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. |
|
 |
|
|
 |
 |
|