case 10490:
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
//suse.SpellLevelHu = attacker.Owner.Spells[spell.ID].LevelHu;
if (suse.SpellID != 10415)
{
suse.X = X;
suse.Y = Y;
}
else
{
suse.X = 6;
}
if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
{
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null)
continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
{
attacked = _obj as Entity;
if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
{
if (attacked.ContainsFlag(Update.Flags.Fly))
return;
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
PrepareSpell(spell, attacker.Owner);
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
suse.Effect1 = attack.Effect1;
ReceiveAttack(attacker, attacked, attack, damage, spell);
suse.AddTarget(attacked.UID, damage, attack);
}
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
{
if (CanAttack(attacker, attackedsob, spell))
{
PrepareSpell(spell, attacker.Owner);
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
damage = (uint)(damage * spell.PowerPercent);
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.AddTarget(attackedsob.UID, damage, attack);
}
}
}
}
}
else
{
attacker.AttackPacket = null;
}
attacker.Owner.SendScreen(suse, true);
}
break;
}
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
//suse.SpellLevelHu = attacker.Owner.Spells[spell.ID].LevelHu;
if (suse.SpellID != 10415)
{
suse.X = X;
suse.Y = Y;
}
else
{
suse.X = 6;
}
if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
{
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null)
continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
{
attacked = _obj as Entity;
if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
{
if (attacked.ContainsFlag(Update.Flags.Fly))
return;
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
PrepareSpell(spell, attacker.Owner);
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
suse.Effect1 = attack.Effect1;
ReceiveAttack(attacker, attacked, attack, damage, spell);
suse.AddTarget(attacked.UID, damage, attack);
}
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
{
if (CanAttack(attacker, attackedsob, spell))
{
PrepareSpell(spell, attacker.Owner);
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
damage = (uint)(damage * spell.PowerPercent);
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.AddTarget(attackedsob.UID, damage, attack);
}
}
}
}
}
else
{
attacker.AttackPacket = null;
}
attacker.Owner.SendScreen(suse, true);
}
break;
}
hELP






