OP
RedBeard

RedBeard

Member
ServUO Version
Publish 57
Ultima Expansion
Endless Journey
Looking for the correct method. When player casts a specific spell it has an affect on basecreature.

public override void OnDamagedBySpell(Mobile caster)
{
base.OnDamagedBySpell(caster);

//==Lightning Absorption==
if (caster (typeof (LightningSpell)));
{
FixedParticles(0, 10, 0, 0x2522, EffectLayer.Waist);
this.Hits += 1000; //1000 health replenished
caster.SendMessage("The creature absorbs the energy replenishing its health.");

}
}
 
I got it. This works. Enjoy

//==Lightning Absorption==
if (caster.Spell is LightningSpell)
{
FixedParticles(0, 10, 0, 0x2522, EffectLayer.Waist);
this.Hits += 1000; //1000 health replenished
caster.SendMessage("The creature absorbs the energy replenishing its health.");

}
 
working on similar except when when damaged on cast by castor int another creature..
public override void OnDamagedBySpell(Mobile caster)
{
if (caster == this)
return;

BlackSheep(caster);
}
public void BlackSheep(Mobile target)
{
Map map = target.Map;

if (map == null)
return;

int lambs = 0;

foreach (Mobile m in this.GetMobilesInRange(2))
{
if (m is BlackSheep)
++lambs;
}

if (lambs < 1)
{
BaseCreature sheep = new BlackSheep();

lambs.Team = this.Team;

Point3D loc = target.Location;
bool validLocation = false;

for (int j = 0; !validLocation && j < 1; ++j)
{
int x = target.X + Utility.Random(3) - 1;
int y = target.Y + Utility.Random(3) - 1;
int z = map.GetAverageZ(x, y);

if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
loc = new Point3D(x, y, Z);
else if (validLocation = map.CanFit(x, y, z, 16, false, false))
loc = new Point3D(x, y, z);
}

lambs.MoveToWorld(loc, map);

lambs.Combatant = target;
}
}

how do i add script to this quote?
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back