Code:
case 6001:
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
MsgMagicEffect suse = new MsgMagicEffect(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
{
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
{
attacked = _obj as Player;
if (attacked.MapObjType == MapObjectType.Monster)
if (attacked.Name == "TeratoDragon")//SnowBanshee
continue;
if (attacked.Name == "SnowBanshee")//SnowBanshee
continue;
if (attacked.Name == "ThrillingSpook")//SnowBanshee
continue;
if (attacked.Name == "SwordMaster")//SnowBanshee
continue;
if (attacked.Name == "LavaBeast")//SnowBanshee
continue;
if (attacked.Name == "Guard1")//SnowBanshee
continue;
if (spell.ID == 6001)
{
MsgMagicCoat.Process(attacker.Owner, attacked, spell.ID);
}
if (Constants.NoVeneno.Contains(attacked.Name))
continue;
if (Kernel.GetDistance(X, Y, attacked.X, attacked.Y) <= spell.Range)
{
if (CanAttack(attacker, attacked, spell, attack.InteractType == MsgInteract.Melee))
{
uint damage = Calculate.Percent(attacked, spell.PowerPercent);
int potDifference = attacker.BattlePower - attacked.BattlePower;
int rate = (int)spell.Percent + potDifference - 20;
if (Kernel.Rate(rate))
{
attacked.Hitpoints -= damage;
attacked.ToxicFogStamp = Time32.Now;
attacked.ToxicFogLeft = 20;
attacked.ToxicFogPercent = spell.PowerPercent;
attacked.AddFlag((ulong)MsgUpdate.Flags.Poisoned, attacked.ToxicFogLeft, true);
suse.AddTarget(attacked.UID, damage, null);
}
else
{
//attacked.Hitpoints -= damage;
suse.AddTarget(attacked.UID, 0, null);
suse.Targets[attacked.UID].Hit = false;
}
}
}
}
}
}
else
{
attacker.AttackPacket = null;
}
attacker.Owner.SendScreen(suse, true);
}
break;
}







