spell damage

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.

Moderator: POL Developer

Post Reply
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

spell damage

Post by Poi »

Whewre do i find spell damage, i looked at the (spell).src files, but i found nothing
User avatar
CWO
POL Expert
Posts: 1159
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Post by CWO »

depends on your scriptbase. Most of the time that is where the damage part is though, right in the spell scripts themselves.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Post by Yukiko »

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: 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
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.
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

Ok, thanks for your help, and i realize you did answerr my question, so let me restate it, where do i find the poison damage?(Spell/weapon(skill))

thanks though
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Post by Yukiko »

Are you asking about poison damage done by the poison spell or poison damage done by a poisoned weapon? The poison damage script is located in \pkg\spells. The info is passed to that script from the calling script in an array.
Post Reply