|
أفضل جواب - كتبه Hassan Emprator |
يغلق لعدم المتابعه من صاحب الموضوع |
#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 == TOFAN.Game.ConquerStructures.NobilityRank.King)
{
damage = (uint)(damage * 0.738);
}
if (attacker.NobilityRank == TOFAN.Game.ConquerStructures.NobilityRank.Prince)
{
damage = (uint)(damage * 0.838);
}
if (attacker.NobilityRank == TOFAN.Game.ConquerStructures.NobilityRank.Duke)
{
damage = (uint)(damage * 0.900);
}
if (attacker.NobilityRank == TOFAN.Game.ConquerStructures.NobilityRank.Earl)
{
damage = (uint)(damage * 1.000);
}
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 = (uint)(Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack) * (spell.Power - 30000) / 450);
attack.Damage = damage;
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.AddTarget(attackedsob, damage, attack);
}
}
}
attacker.Owner.SendScreen(suse, true);
attacker.AttackPacket = null;
}
break;
}
#endregion
#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
#region RageOfWar[Stomper]
case 12930:
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
InLineAlgorithm ila = new 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;
attacker.Stamina -= spell.UseStamina;
attacker.Stamina -= 15;
suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
suse.X = X;
suse.Y = Y;
ushort Xo1 = 0, Yo1 = 0;
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;
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
if (attacker.NobilityRank == ElSaher.Game.ConquerStructures.NobilityRank.King)
{
damage = (uint)(damage * 0.826);
}
if (attacker.NobilityRank == ElSaher.Game.ConquerStructures.NobilityRank.Prince)
{
damage = (uint)(damage * 0.971);
}
if (attacker.NobilityRank == ElSaher.Game.ConquerStructures.NobilityRank.Duke)
{
damage = (uint)(damage * 1.30);
}
if (attacker.NobilityRank == ElSaher.Game.ConquerStructures.NobilityRank.Earl)
{
damage = (uint)(damage * 1.020);
}
// damage = (uint)MathHelper.AdjustDataEx((int)damage, (int)spell.Power);
suse.Effect1 = attack.Effect1;
attack.Damage = damage;
Xo1 = attacked.X;
Yo1 = attacked.Y;
suse.AddTarget(attacked.UID, damage, attack);
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
}
}
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;
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, client_Spell.LevelHu2);
damage = (uint)(damage * SkillsAttack.RageofWarMonsters);
suse.Effect1 = attack.Effect1;
attack.Damage = damage;
Xo1 = attacked.X;
Yo1 = attacked.Y;
suse.AddTarget(attacked.UID, damage, attack);
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (ila.InLine(attackedsob.X, attackedsob.Y))
{
if (!CanAttack(attacker, attackedsob, spell)) continue;
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
damage = (uint)(damage * 3.4);
suse.AddTarget(attackedsob.UID, damage, attack);
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
}
}
}
if (Xo1 != 0 && Yo1 != 0)
{
FloorItem item = new FloorItem(true);
item.Owner = attacker.Owner;
item.UID = FloorItem.FloorUID.Next;
// item.MapObjType = MapObjectType.Item;
item.ItemID = 1500;
item.X = (ushort)(Xo1);
item.Y = (ushort)(Yo1);
item.Type = 10;
item.mColor = 14;
item.OwnerUID = attacker.UID;
item.FlowerType = 1;
item.Name = "RageofWarTrap";
attacker.SendScreen(item);
var map = Kernel.Maps[attacker.MapID];
while (map.Npcs.ContainsKey(item.UID))
item.UID = Network.GamePackets.FloorItem.FloorUID.Next;
map.AddFloorItem(item);
}
attacker.Owner.SendScreen(suse, true);
}
break;
}
#endregion
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
حل مشكله شخصيه بيضرب فيه اول ضربه يختفي | Tefa | تطوير سيرفرات كونكر | 15 | 2023-12-07 01:29 AM |
تعديل وقت | Bayoumi | مشكلات السيرفيرات كونكر الشخصيه | 4 | 2020-04-12 02:23 PM |
طلب تعديل التوبات | ElSaher | مشكلات السيرفيرات كونكر الشخصيه | 8 | 2020-02-05 07:36 PM |
مشكله تعديل ضربه اسكله FatalVortex يارجاله | ahmedshetos888 | مشكلات السيرفيرات كونكر الشخصيه | 6 | 2020-01-23 02:44 AM |
عندي مشكلة ف اسكلة RageofWar | Omar Mohamed100 | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2019-11-05 08:31 AM |