Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region WrathoftheEmperor
- case 12570:
- {
- if (CanUseSpell(spell, attacker.Owner))
- {
- PrepareSpell(spell, attacker.Owner);
- SpellUse suse = new SpellUse(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = SpellID;
- suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
- suse.X = X;
- suse.Y = Y;
- suse.SpellEffect = 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) <= 2)
- {
- if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- {
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
- suse.Effect1 = attack.Effect1;
- attack.Effect1 = Attack.AttackEffects1.None;
- ReceiveAttack(attacker, attacked, attack, ref damage, spell);
- suse.AddTarget(attacked, damage, attack);
- }
- }
- }
- else if (_obj.MapObjType == MapObjectType.SobNpc)
- {
- attackedsob = _obj as SobNpcSpawn;
- if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= 2)
- {
- if (CanAttack(attacker, attackedsob, spell))
- {
- uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
- suse.Effect1 = attack.Effect1;
- attack.Effect1 = Attack.AttackEffects1.None;
- ReceiveAttack(attacker, attackedsob, attack, damage, spell);
- suse.AddTarget(attackedsob, damage, attack);
- }
- }
- }
- }
- attacker.Owner.SendScreen(suse, true);
- }
- break;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement