#region RageofWar(Passive) case 12930: { if (CanUseSpell(spell, attacker.Owner)) { PrepareSpell(spell, attacker.Owner); Game.Attacking.InLineAlgorithm ila = new Game.Attacking.InLineAlgorithm(attacker.X, X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA); 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; attacker.Owner.SendScreen(suse, true); bool first = false; foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects) { if (_obj == null) continue; if (_obj.MapObjType == MapObjectType.Entity) { attacked = _obj as Entity; if (ila.InLine(attacked.X, attacked.Y)) { if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee)) continue; if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 15) continue; if (!first) { var map = Kernel.Maps[attacker.MapID]; Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true); flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next; while (map.Npcs.ContainsKey(flooritem.UID)) flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next; flooritem.ItemID = FloorItem.RageOfWarTrap; flooritem.X = attacked.X; flooritem.MapID = map.ID; flooritem.Y = attacked.Y; flooritem.MapObjType = MapObjectType.FloorSpell; flooritem.Type = FloorItem.Effect; flooritem.mColor = 15; flooritem.OwnerUID = attacker.UID; flooritem.OnFloor = Time32.Now; flooritem.Owner = attacker.Owner; flooritem.Name2 = "RageofWarTrap"; map.AddFloorItem(flooritem); attacker.Owner.SendScreenSpawn(flooritem, true); first = true; } uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack); if (attacker.NobilityRank == AbdoRedaGxV4.Game.ConquerStructures.NobilityRank.King) { damage = (uint)(damage * 0.550); } if (attacker.NobilityRank == AbdoRedaGxV4.Game.ConquerStructures.NobilityRank.Prince) { damage = (uint)(damage * 0.550); } if (attacker.NobilityRank == AbdoRedaGxV4.Game.ConquerStructures.NobilityRank.Duke) { damage = (uint)(damage * 0.550); } if (attacker.NobilityRank == AbdoRedaGxV4.Game.ConquerStructures.NobilityRank.Earl) { damage = (uint)(damage * 0.550); } if (attacker.NobilityRank == AbdoRedaGxV4.Game.ConquerStructures.NobilityRank.Baron) { damage = (uint)(damage * 0.550); } if (attacker.NobilityRank == AbdoRedaGxV4.Game.ConquerStructures.NobilityRank.Knight) { damage = (uint)(damage * 0.550); } if (attacker.NobilityRank == AbdoRedaGxV4.Game.ConquerStructures.NobilityRank.Serf) { damage = (uint)(damage * 0.300); } attack.Damage = damage; ReceiveAttack(attacker, attacked, attack, ref damage, spell); suse.AddTarget(attacked, damage, attack); } } else if (_obj.MapObjType == MapObjectType.Monster) { attacked = _obj as Entity; if (ila.InLine(attacked.X, attacked.Y)) { if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee)) continue; if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 11) continue; if (!first) { var map = Kernel.Maps[attacker.MapID]; Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true); flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next; while (map.Npcs.ContainsKey(flooritem.UID)) flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next; flooritem.ItemID = FloorItem.RageOfWarTrap; flooritem.X = attacked.X; flooritem.MapID = map.ID; flooritem.Y = attacked.Y; flooritem.Type = FloorItem.Effect; flooritem.MapObjType = MapObjectType.FloorSpell; flooritem.mColor = 15; flooritem.OwnerUID = attacker.UID; flooritem.OnFloor = Time32.Now; flooritem.Owner = attacker.Owner; flooritem.Name2 = "RageofWarTrap"; map.AddFloorItem(flooritem); attacker.Owner.SendScreenSpawn(flooritem, true); first = true; } uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack); damage = (uint)(damage * 1.0); attack.Damage = damage; ReceiveAttack(attacker, attacked, attack, ref damage, spell); suse.AddTarget(attacked, damage, attack); } } else if (_obj.MapObjType == MapObjectType.SobNpc) { attackedsob = _obj as SobNpcSpawn; if (attackedsob == null) continue; if (ila.InLine(attackedsob.X, attackedsob.Y)) { if (!CanAttack(attacker, attackedsob, spell)) continue; if (Kernel.GetDistance(attackedsob.X, attackedsob.Y, attacker.X, attacker.Y) > 11) continue; if (!first) { var map = Kernel.Maps[attacker.MapID]; Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true); flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next; while (map.Npcs.ContainsKey(flooritem.UID)) flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next; flooritem.MapObjType = MapObjectType.FloorSpell; flooritem.ItemID = FloorItem.RageOfWarTrap; flooritem.X = attackedsob.X; flooritem.MapID = map.ID; flooritem.Y = attackedsob.Y; flooritem.Type = FloorItem.Effect; flooritem.mColor = 15; flooritem.OwnerUID = attacker.UID; flooritem.OnFloor = Time32.Now; flooritem.Owner = attacker.Owner; flooritem.Name2 = "RageofWarTrap"; map.AddFloorItem(flooritem); attacker.Owner.SendScreenSpawn(flooritem, true); first = true; } uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack); damage = (uint)(damage * 180 / 100); attack.Damage = damage; ReceiveAttack(attacker, attackedsob, attack, damage, spell); suse.AddTarget(attackedsob, damage, attack); } } } attacker.Owner.SendScreen(suse, true); attacker.AttackPacket = null; } break; } #endregion