|
case 10381:
{
if (CanUseSpell(spell, attacker.Owner) && Time32.Now > attacker.SpellStamp.AddMilliseconds(500))
{
attacker.SpellStamp = Time32.Now;
ushort Xx, Yx;
if (attacked != null)
{
Xx = attacked.X;
Yx = attacked.Y;
}
else
{
Xx = attackedsob.X;
Yx = attackedsob.Y;
}
if (Kernel.GetDistance(attacker.X, attacker.Y, Xx, Yx) <= spell.Range)
{
if (attackedsob == null)
if (attacked.ContainsFlag(Update.Flags.Fly))
return;
if (attacker.ContainsFlag(Update.Flags.Fly))
return;
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
bool send = false;
if (attackedsob == null)
{
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, client_Spell.LevelHu2);
suse.Effect1 = attack.Effect1;
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
send = true;
}
}
else
{
if (CanAttack(attacker, attackedsob, spell))
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.Effect1 = attack.Effect1;
suse.AddTarget(attackedsob, damage, attack);
send = true;
}
}
if (send)
attacker.Owner.SendScreen(suse, true);
}
else
{
attacker.AttackPacket = null;
}
}
break;
}
#region Melee
#region Melee
else if (attack.AttackType == Attack.Melee)
{
if (attacker.Assassin() || attacker.IsBowEquipped || attacker.IsChaser1())
{
attack.AttackType = Attack.Ranged;
new Game.Attacking.Handle(attack, attacker, attacked);
return;
}
if (attacker.Owner.Screen.TryGetValue(attack.Attacked, out attacked))
{
if (attacker.LeeLong())
{
attacker.Owner.IncreaseProficiencyExperience(10, 617);
}
//#region EarthSweep
//if (attack.SpellID == 12220 || attack.SpellID == 12210)
//{
// SpellUse suse = new SpellUse(true);
// suse.Attacker = attacker.UID;
// suse.SpellID = attack.SpellID;
// suse.SpellLevel = 0;
// suse.X = attacker.X;
// suse.Y = attacker.Y;
// Fan fan = new Fan(attacker.X, attacker.Y, attacked.X, attacked.Y, 7, 180);
// foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
// {
// if (_obj == null)
// continue;
// if (_obj.MapObjType == MapObjectType.Monster ||
// _obj.MapObjType == MapObjectType.Entity)
// {
// attacked = _obj as Entity;
// if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 7)
// {
// if (CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee))
// {
// attack.Effect1 = Attack.AttackEffects1.None;
// uint damage = Game.Attacking.Calculate.Melee(attacker,
// attacked, ref attack);
// attack.Attacked = 0;
// attack.Damage = damage;
// suse.Effect1 = attack.Effect1;
// ReceiveAttack(attacker, attacked, attack, ref damage, null);
// suse.AddTarget(attacked, damage, attack);
// }
// }
// }
// }
// attacker.Owner.SendScreen(suse, true);
// attacker.AttackPacket = null;
// attack = null;
// return;
//}
//#endregion
//#region EpicMonk
//if (attack.SpellID == 12580 || attack.SpellID == 12590 || attack.SpellID == 12600)
//{
// Fan fan = new Fan(attacker.X, attacker.Y, attacked.X, attacked.Y, 7, 240);
// foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
// {
// if (_obj == null) continue;
// if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
// {
// attacked = _obj as Entity;
// if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 5)
// {
// if (CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee))
// {
// attack.Effect1 = Attack.AttackEffects1.None;
// uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
// damage = (damage * 35) / 100;
// attack.Attacked = attacker.UID;
// attack.Attacked = attacked.UID;
// attack.Damage = damage;
// ReceiveAttack(attacker, attacked, attack, ref damage, null);
// }
// }
// }
// }
// attacker.AttackPacket = null;
// attack = null;
// return;
//}
//#endregion
#region EpicMonk
if (attack.SpellID == 12580 || attack.SpellID == 12590 || attack.SpellID == 12600)
{
Fan fan = new Fan(attacker.X, attacker.Y, attacked.X, attacked.Y, 7, 240);
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null) continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
{
attacked = _obj as Entity;
if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 5)
{
if (CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee))
{
attack.Effect1 = Attack.AttackEffects1.None;
var damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
damage = (uint)(damage * 0.2);
attack.Attacked = attacker.UID;
attack.Attacked = attacked.UID;
attack.Damage = damage;
ReceiveAttack(attacker, attacked, attack, ref damage, null);
}
}
}
}
attacker.AttackPacket = null;
attack = null;
return;
}
#endregion
#region Stomper(Melee)
#region Anger-Horror-Peace~of~Stomper(Windwalker-Stomper-Passive)
var lastattacked = attacked;
var spell5 = Database.SpellTable.GetSpell(12980, attacker.Owner);
if (Kernel.Rate(spell5.Percent) && attacker.Owner.Spells.ContainsKey(12980) && attacker.IsStomper2())
{
#region AngerofStomper
{
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell5.ID;
suse.SpellLevel = spell5.Level;
suse.X = lastattacked.X;
suse.Y = lastattacked.Y;
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null)
continue;
attacked = _obj as Entity;
if (attacked == null) continue;
if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) <= spell5.Range)
{
if (_obj.MapObjType == MapObjectType.Entity)
{
if (!CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee)) continue;
attack.Effect1 = Attack.AttackEffects1.None;
var damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
damage = (uint)(damage * 0.750);
suse.Effect1 = attack.Effect1;
attack.Damage = 0;
ReceiveAttack(attacker, attacked, attack, ref damage, spell5);
suse.AddTarget(attacked, damage, attack);
}
else if (_obj.MapObjType == MapObjectType.Monster)
{
if (!CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee)) continue;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
damage = (uint)(damage * 0.780);
attack.Damage = 0;
ReceiveAttack(attacker, attacked, attack, ref damage, spell5);
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) <= spell5.Range)
{
if (CanAttack(attacker, attackedsob, spell5))
{
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
damage = (damage * 22) / 100;
attack.Damage = 0;
ReceiveAttack(attacker, attackedsob, attack, damage, spell5);
suse.AddTarget(attackedsob, damage, attack);
}
}
}
}
}
attacker.AttackPacket = null;
attacker.Owner.SendScreen(suse, true);
}
#endregion
#region HorrorofStomper
{
var spell2 = Database.SpellTable.GetSpell(12990, attacker.Owner);
if (!attacker.Owner.Spells.ContainsKey(12990)) return;
attack.Damage = 0;
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell2.ID;
suse.SpellLevel = spell2.Level;
suse.X = lastattacked.X;
suse.Y = lastattacked.Y;
attacker.AttackPacket = null;
attacker.Owner.SendScreen(suse, true);
#region Flooritem
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 = 1530;
flooritem.X = lastattacked.X;
flooritem.Y = lastattacked.Y;
flooritem.Type = FloorItem.Effect;
flooritem.mColor = 14;
flooritem.OwnerUID = attacker.UID;
flooritem.OwnerGuildUID = attacker.GuildID;
flooritem.FlowerType = 3;
flooritem.Unknown37 = 1;
flooritem.X2 = attacker.X;
flooritem.MapObjType = MapObjectType.FloorSpell;
flooritem.Y2 = attacker.Y;
flooritem.Angle = attacker.Facing;
flooritem.MapID = map.ID;
flooritem.Attack = attack;
flooritem.OnFloor = Time32.Now;
flooritem.Owner = attacker.Owner;
map.AddFloorItem(flooritem);
attacker.Owner.SendScreenSpawn(flooritem, true);
#endregion
}
#endregion
#region PeaceofStomper
{
var spell3 = Database.SpellTable.GetSpell(13000, attacker.Owner);
if (!attacker.Owner.Spells.ContainsKey(13000)) return;
attack.Damage = 0;
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellLevel = spell3.Level;
suse.SpellID = spell3.ID;
suse.X = lastattacked.X;
suse.Y = lastattacked.Y;
attacker.AttackPacket = null;
attacker.Owner.SendScreen(suse, true);
#region Flooritem
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 = 1540;
flooritem.X = lastattacked.X;
flooritem.Y = lastattacked.Y;
flooritem.X2 = attacker.X;
flooritem.Y2 = attacker.Y;
flooritem.Type = FloorItem.Effect;
flooritem.mColor = 14;
flooritem.OwnerUID = attacker.UID;
flooritem.OwnerGuildUID = attacker.GuildID;
flooritem.FlowerType = 3;
flooritem.Unknown37 = 1;
flooritem.MapID = map.ID;
flooritem.MapObjType = MapObjectType.FloorSpell;
flooritem.Attack = attack;
flooritem.OnFloor = Time32.Now;
flooritem.Owner = attacker.Owner;
map.AddFloorItem(flooritem);
attacker.Owner.SendScreenSpawn(flooritem, true);
#endregion
}
#endregion
return;
}
#endregion
else if (attacker.IsStomper1())
{
#region Sector-Circle-Rectangle(Windwalker-Stomper-Melee)
if (attack.SpellID == 13040 || attack.SpellID == 13050)
{
#region Sector
if (attack.SpellID == 13040)
{
var spell = Database.SpellTable.GetSpell(13040, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = attack.SpellID;
suse.X = attacker.X;
suse.Y = attacker.Y;
var angle = Kernel.GetAngle(attacker.X, attacker.Y, attacked.X, attacked.Y);
Map.UpdateCoordonatesForAngle(ref X, ref Y, angle);
Fan sector = new Fan(attacker.X, attacker.Y, X, Y, spell.Range, spell.Sector);
if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 7)
{
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj.MapObjType == MapObjectType.Entity || _obj.MapObjType == MapObjectType.Monster)
{
if (_obj == null)
continue;
attacked = _obj as Entity;
if (attacked == null) continue;
if (!CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee)) continue;
if (sector.IsInFan(attacked.X, attacked.Y))
{
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
attack.Damage = 0;
suse.Effect1 = attack.Effect1;
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
}
}
}
}
}
}
#endregion
#region Circle
if (attack.SpellID == 13050)
{
var spell = Database.SpellTable.GetSpell(13050, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = attack.SpellID;
suse.X = attacker.X;
suse.Y = attacker.Y;
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj.MapObjType == MapObjectType.Entity || _obj.MapObjType == MapObjectType.Monster)
{
if (_obj == null)
continue;
attacked = _obj as Entity;
if (attacked == null) continue;
if (!CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee)) continue;
if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 5) continue;
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
attack.Damage = 0;
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
}
}
attacker.Owner.SendScreen(suse, true);
return;
}
#endregion
}
#endregion
}
#endregion
CheckForExtraWeaponPowers(attacker.Owner, attacked);
if (!CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee)) return;
pass = false;
if (attacker.OnFatalStrike())
{
if (attacked.EntityFlag == EntityFlag.Monster)
{
pass = true;
}
}
ushort range = attacker.AttackRange;
if (attacker.Transformed)
range = (ushort)attacker.TransformationAttackRange;
if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= range || pass)
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
damage = (uint)(damage * 0.450);
attack.Damage = damage;
if (attacker.OnFatalStrike())
{
if (attacked.EntityFlag == EntityFlag.Monster)
{
var weaps = attacker.Owner.Weapons;
bool can = false;
if (weaps.Item1 != null)
if (weaps.Item1 != null) if (weaps.Item1.ID / 1000 == 601 || weaps.Item1.ID / 1000 == 616) can = true; if (weaps.Item2 != null) if (weaps.Item2.ID / 1000 == 601 || weaps.Item2.ID / 1000 == 616) can = true;
can = true;
if (weaps.Item2 != null)
if (weaps.Item1 != null) if (weaps.Item1.ID / 1000 == 601 || weaps.Item1.ID / 1000 == 616) can = true; if (weaps.Item2 != null) if (weaps.Item2.ID / 1000 == 601 || weaps.Item2.ID / 1000 == 616) can = true;
can = true;
if (!can)
return;
ushort x = attacked.X;
ushort y = attacked.Y;
Map.UpdateCoordonatesForAngle(ref x, ref y, Kernel.GetAngle(attacked.X, attacked.Y, attacker.X, attacker.Y));
attacker.Shift(x, y);
attack.X = x;
attack.Y = y;
attack.Damage = damage;
attack.AttackType = Attack.FatalStrike;
}
}
var weapons = attacker.Owner.Weapons;
if (weapons.Item1 != null)
{
ConquerItem rightweapon = weapons.Item1;
ushort wep1subyte = (ushort)(rightweapon.ID / 500), wep2subyte = 0;
bool wep1bs = false, wep2bs = false;
if (wep1subyte == 421 || wep1subyte == 620)
{
wep1bs = true;
wep1subyte = 420;
}
ushort wep1spellid = 0, wep2spellid = 0;
Database.SpellInformation wep1spell = null, wep2spell = null;
if (wep1subyte == 622)
{
if (attacker.WrathoftheEmperor == true)
{
if (attacker.WrathoftheEmperorStamp <= DateTime.Now.AddMilliseconds(1500))
{
//wep1spellid = 12570;
wep1spellid = 10490;
}
attacker.WrathoftheEmperor = false;
}
}
if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
{
var weaponskill = Database.SpellTable.WeaponSpells[wep1subyte];
for (int i = 0; i < weaponskill.Count; i++)
{
if (!doWep1Spell)
{
wep1spellid = weaponskill[i];
if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
{
wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
doWep1Spell = Kernel.Rate(wep1spell.Percent);
if (attacked.EntityFlag == EntityFlag.Entity && wep1spellid == 10490)
doWep1Spell = Kernel.Rate(5);
}
}
}
}
if (!doWep1Spell)
{
if (weapons.Item2 != null)
{
ConquerItem leftweapon = weapons.Item2;
wep2subyte = (ushort)(leftweapon.ID / 1000);
if (wep2subyte == 421 || wep2subyte == 620)
{
wep2bs = true;
wep2subyte = 420;
}
if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
{
var weaponskill2 = Database.SpellTable.WeaponSpells[wep2subyte];
for (int i = 0; i < weaponskill2.Count; i++)
{
if (!doWep2Spell)
{
wep2spellid = weaponskill2[i];
if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
{
wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
doWep2Spell = Kernel.Rate(wep2spell.Percent);
if (attacked.EntityFlag == EntityFlag.Entity && wep2spellid == 10490)
doWep2Spell = Kernel.Rate(5);
}
}
}
}
}
}
if (!attacker.Transformed)
{
if (doWep1Spell)
{
attack.AttackType = Attack.Magic;
attack.Decoded = true;
attack.weaponspell = true;
attack.X = attacked.X;
attack.Y = attacked.Y;
attack.Attacked = attacked.UID;
attack.Damage = wep1spell.ID;
goto restart;
}
if (doWep2Spell)
{
attack.AttackType = Attack.Magic;
attack.Decoded = true;
attack.weaponspell = true;
attack.X = attacked.X;
attack.Y = attacked.Y;
attack.Attacked = attacked.UID;
attack.Damage = wep2spell.ID;
goto restart;
}
if (wep1bs)
wep1subyte++;
if (attacker.EntityFlag == EntityFlag.Entity && attacked.EntityFlag != EntityFlag.Entity)
if (damage > attacked.Hitpoints)
{
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep1subyte);
if (wep2subyte != 0)
{
if (wep2bs)
wep2subyte++;
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep2subyte);
}
}
else
{
attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
if (wep2subyte != 0)
{
if (wep2bs)
wep2subyte++;
attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
}
}
}
}
else
{
if (!attacker.Transformed)
{
if (attacker.EntityFlag == EntityFlag.Entity && attacked.EntityFlag != EntityFlag.Entity)
if (damage > attacked.Hitpoints)
{
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), 0);
}
else
{
attacker.Owner.IncreaseProficiencyExperience(damage, 0);
}
}
}
ReceiveAttack(attacker, attacked, attack, ref damage, null);
attack.AttackType = Attack.Melee;
}
else
{
attacker.AttackPacket = null;
}
}
else if (attacker.Owner.Screen.TryGetSob(attack.Attacked, out attackedsob))
{
CheckForExtraWeaponPowers(attacker.Owner, null);
if (CanAttack(attacker, attackedsob, null))
{
ushort range = attacker.AttackRange;
if (attacker.Transformed)
range = (ushort)attacker.TransformationAttackRange;
if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= range)
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
var weapons = attacker.Owner.Weapons;
if (weapons.Item1 != null)
{
ConquerItem rightweapon = weapons.Item1;
ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
bool wep1bs = false, wep2bs = false;
if (wep1subyte == 421 || wep1subyte == 620)
{
wep1bs = true;
wep1subyte = 420;
}
ushort wep1spellid = 0, wep2spellid = 0;
Database.SpellInformation wep1spell = null, wep2spell = null;
if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
{
var wep1 = Database.SpellTable.WeaponSpells[wep1subyte];
for (int i = 0; i < wep1.Count; i++)
{
if (!doWep1Spell)
{
wep1spellid = wep1[i];
if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
{
wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
doWep1Spell = Kernel.Rate(wep1spell.Percent);
}
}
}
}
if (!doWep1Spell)
{
if (weapons.Item2 != null)
{
ConquerItem leftweapon = weapons.Item2;
wep2subyte = (ushort)(leftweapon.ID / 1000);
if (wep2subyte == 421 || wep2subyte == 620)
{
wep2bs = true;
wep2subyte = 420;
}
if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
{
var wep2 = Database.SpellTable.WeaponSpells[wep2subyte];
for (int i = 0; i < wep2.Count; i++)
{
wep2spellid = wep2[i];
if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
{
wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
doWep2Spell = Kernel.Rate(wep2spell.Percent);
}
}
}
}
}
if (!attacker.Transformed)
{
if (doWep1Spell)
{
attack.AttackType = Attack.Magic;
attack.Decoded = true;
attack.weaponspell = true;
attack.X = attackedsob.X;
attack.Y = attackedsob.Y;
attack.Attacked = attackedsob.UID;
attack.Damage = wep1spell.ID;
goto restart;
}
if (doWep2Spell)
{
attack.AttackType = Attack.Magic;
attack.Decoded = true;
attack.weaponspell = true;
attack.X = attackedsob.X;
attack.Y = attackedsob.Y;
attack.Attacked = attackedsob.UID;
attack.Damage = wep2spell.ID;
goto restart;
}
if (attacker.MapID == 1039)
{
if (wep1bs)
wep1subyte++;
if (attacker.EntityFlag == EntityFlag.Entity)
if (damage > attackedsob.Hitpoints)
{
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep1subyte);
if (wep2subyte != 0)
{
if (wep2bs)
wep2subyte++;
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep2subyte);
}
}
else
{
attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
if (wep2subyte != 0)
{
if (wep2bs)
wep2subyte++;
attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
}
}
}
}
}
attack.Damage = damage;
ReceiveAttack(attacker, attackedsob, attack, damage, null);
}
else
{
attacker.AttackPacket = null;
}
}
}
else
{
attacker.AttackPacket = null;
}
}
#endregion
#region Ranged
#region Ranged
else if (attack.AttackType == Attack.Ranged)
{
if (attacker.Owner.Screen.TryGetValue(attack.Attacked, out attacked))
{
CheckForExtraWeaponPowers(attacker.Owner, attacked);
if (!CanAttack(attacker, attacked, null, false))
return;
var weapons = attacker.Owner.Weapons;
if (weapons.Item1 == null) return;
if ((weapons.Item1.ID / 1000 != 500 && weapons.Item1.ID / 1000 != 613) && !attacker.IsChaser1())
return;
if (weapons.Item1.ID / 1000 == 500)
if (weapons.Item2 != null && !attacker.IsChaser1())
if (!PacketHandler.IsArrow(weapons.Item2.ID))
return;
#region Kinetic Spark
if (attacker.ContainsFlag3((ulong)Update.Flags3.KineticSpark))
{
var spell = Database.SpellTable.GetSpell(11590, attacker.Owner);
if (spell != null)
{
spell.CanKill = true;
if (Kernel.Rate(spell.Percent))
{
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = attacker.X;
suse.Y = attacker.Y;
IMapObject lastAttacked = attacker;
uint p = 0;
if (Handle.CanAttack(attacker, attacked, spell, false))
{
lastAttacked = attacked;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
damage = (uint)((damage) / 1.50);
suse.Effect1 = attack.Effect1;
if (attacker.SpiritFocus)
{
damage = (uint)(damage * attacker.SpiritFocusPercent);
attacker.SpiritFocus = false;
}
damage = damage - damage * (p += 20) / 100;
Handle.ReceiveAttack(attacker, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
}
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null) continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
{
if (_obj.UID == attacked.UID) continue;
var attacked1 = _obj as Entity;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
{
if (Handle.CanAttack(attacker, attacked1, spell, false))
{
lastAttacked = attacked1;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked1, spell, ref attack);
suse.Effect1 = attack.Effect1;
if (attacker.SpiritFocus)
{
damage = (uint)(damage * attacker.SpiritFocusPercent);
attacker.SpiritFocus = false;
}
damage = damage - damage * (p += 20) / 100;
if (damage == 0) break;
ReceiveAttack(attacker, attacked1, attack, ref damage, spell);
suse.AddTarget(attacked1, damage, attack);
}
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
{
if (Handle.CanAttack(attacker, attackedsob, spell))
{
lastAttacked = attackedsob;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
suse.Effect1 = attack.Effect1;
if (attacker.SpiritFocus)
{
damage = (uint)(damage * attacker.SpiritFocusPercent);
attacker.SpiritFocus = false;
}
damage = damage - damage * (p += 20) / 100;
if (damage == 0) break;
Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.AddTarget(attackedsob, damage, attack);
}
}
}
}
attacker.Owner.SendScreen(suse, true);
return;
}
}
}
#endregion
#region ShadowofChaser
if (attacker.ContainsFlag4(Update.Flags4.ShadowofChaser) && attacker.IsChaser2())
{
var spell = Database.SpellTable.GetSpell(13090, attacker.Owner);
if (spell != null)
{
spell.CanKill = true;
if (Kernel.Rate(spell.Percent))
{
ShadowofChaser(attacker, attacked, attack, 1);
return;
}
}
}
#endregion
if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= Constants.pScreenDistance)
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = 0;
if (!attacker.Assassin() && !attacker.IsChaser1())
damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack) * 300;
else
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
damage = damage - (uint)(damage * .50);
damage = damage * 7 / 100;
attack.Damage = damage;
if (attacker.EntityFlag == EntityFlag.Entity && attacked.EntityFlag != EntityFlag.Entity)
if (damage > attacked.Hitpoints)
{
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), (ushort)(weapons.Item1.ID / 1000));
}
else
{
attacker.Owner.IncreaseProficiencyExperience(damage, (ushort)(weapons.Item1.ID / 1000));
}
ReceiveAttack(attacker, attacked, attack, ref damage, null);
}
}
else if (attacker.Owner.Screen.TryGetSob(attack.Attacked, out attackedsob))
{
if (CanAttack(attacker, attackedsob, null))
{
var weapons = attacker.Owner.Weapons;
if (weapons.Item1 == null) return;
if (weapons.Item1.ID / 1000 != 500 && weapons.Item1.ID / 1000 != 613) return;
if (attacker.MapID != 1039)
{
if (weapons.Item1.ID / 1000 == 500)
{
if (weapons.Item2 == null)
{
attacker.SendSysMesage("please make sure you equipment an arrow");
return;
}
else
{
if (!PacketHandler.IsArrow(weapons.Item2.ID))
{
attacker.SendSysMesage("please make sure you equipment an arrow");
return;
}
}
}
}
#region Kinetic Spark
if (attacker.ContainsFlag3((ulong)Update.Flags3.KineticSpark))
{
var spell = Database.SpellTable.GetSpell(11590, attacker.Owner);
if (spell != null)
{
spell.CanKill = true;
if (Kernel.Rate(spell.Percent))
{
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = attacker.X;
suse.Y = attacker.Y;
IMapObject lastAttacked = attacker;
uint p = 0;
if (Handle.CanAttack(attacker, attackedsob, spell))
{
lastAttacked = attackedsob;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
damage = (uint)((damage) / 1);
suse.Effect1 = attack.Effect1;
if (attacker.SpiritFocus)
{
damage = (uint)(damage * attacker.SpiritFocusPercent);
attacker.SpiritFocus = false;
}
damage = damage - damage * (p += 20) / 100;
Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.AddTarget(attackedsob, damage, attack);
}
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null) continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
{
var attacked1 = _obj as Entity;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
{
if (Handle.CanAttack(attacker, attacked1, spell, false))
{
lastAttacked = attacked1;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked1, spell, ref attack);
suse.Effect1 = attack.Effect1;
if (attacker.SpiritFocus)
{
damage = (uint)(damage * attacker.SpiritFocusPercent);
attacker.SpiritFocus = false;
}
damage = damage - damage * (p += 20) / 100;
if (damage == 0) break;
ReceiveAttack(attacker, attacked1, attack, ref damage, spell);
suse.AddTarget(attacked1, damage, attack);
}
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
if (_obj.UID == Target) continue;
var attackedsob1 = _obj as SobNpcSpawn;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob1.X, attackedsob1.Y) <= 5)
{
if (Handle.CanAttack(attacker, attackedsob1, spell))
{
lastAttacked = attackedsob1;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob1, ref attack);
suse.Effect1 = attack.Effect1;
if (attacker.SpiritFocus)
{
damage = (uint)(damage * attacker.SpiritFocusPercent);
attacker.SpiritFocus = false;
}
damage = damage - damage * (p += 20) / 100;
if (damage == 0) break;
Handle.ReceiveAttack(attacker, attackedsob1, attack, damage, spell);
suse.AddTarget(attackedsob1, damage, attack);
}
}
}
}
attacker.Owner.SendScreen(suse, true);
return;
}
}
}
#endregion
if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= Constants.pScreenDistance)
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = 0;
if (!attacker.Assassin() && !attacker.IsChaser1())
damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack) / 2;
else
damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack) / 2;
attack.Damage = damage;
ReceiveAttack(attacker, attackedsob, attack, damage, null);
if (damage > attackedsob.Hitpoints)
{
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), (ushort)(weapons.Item1.ID / 1000));
}
else
{
attacker.Owner.IncreaseProficiencyExperience(damage, (ushort)(weapons.Item1.ID / 1000));
}
}
}
}
else
{
attacker.AttackPacket = null;
}
}
#endregion
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
أدوات الموضوع | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
بخصوص اتشكات الحماية | Mostafa Shalby | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2020-05-11 10:28 PM |
الحماية من هكر كونكر | body2020 | مشكلات السيرفيرات كونكر الشخصيه | 7 | 2020-05-03 12:51 AM |
الحماية من السبييد | Mostafa Shalby | مشكلات السيرفيرات كونكر الشخصيه | 4 | 2020-01-26 02:45 AM |
خلي الجماية التورتس شغالة زي Conquer Online | Mero | تطوير سيرفرات كونكر | 3 | 2019-10-23 01:01 PM |