Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Para reparar ese fallo se Dirigen a su Handler.cs y buscan la #region Melee y la reemplazan por la mia :
- #region Melee
- else if (attack.InteractType == MsgInteract.Melee)
- {
- if (attacker.Owner.Screen.TryGetValue(attack.Attacked, out attacked))
- {
- #region EarthSweep
- if (attack.SpellID == 12220 || attack.SpellID == 12210)
- {
- MsgMagicEffect suse = new MsgMagicEffect(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.Player)
- {
- attacked = _obj as Player;
- if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 7)
- {
- if (CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee))
- {
- attack.Effect = MsgInteract.InteractEffects.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
- attack.Attacked = 0;
- attack.Damage = damage / 2;
- suse.Effect = attack.Effect;
- ReceiveAttack(attacker, attacked, attack, ref damage, null);
- suse.AddTarget(attacked.UID, damage, attack);
- }
- }
- }
- }
- attacker.Owner.SendScreen(suse, true);
- 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
- {
- MsgMagicEffect suse = new MsgMagicEffect(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 Player;
- if (attacked == null) continue;
- if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) <= spell5.Range)
- {
- if (_obj.MapObjType == MapObjectType.Player)
- {
- if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
- attack.Effect = MsgInteract.InteractEffects.None;
- uint damage5 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 2;
- damage5 = (uint)(damage5 * .5);
- suse.Effect = attack.Effect;
- attack.Damage = damage5 / 2;
- ReceiveAttack(attacker, attacked, attack,ref damage5, spell5);
- suse.AddTarget(attacked.UID, damage5, attack);
- }
- else if (_obj.MapObjType == MapObjectType.Monster)
- {
- if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
- uint damage5 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 2;
- attack.Damage = damage5 / 2;
- ReceiveAttack(attacker, attacked, attack,ref damage5, spell5);
- suse.AddTarget(attacked.UID, damage5, 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 = 1;
- MsgMagicEffect suse = new MsgMagicEffect(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 MsgMapItem
- var map = Kernel.Maps[attacker.MapID];
- MsgMapItem MsgMapItem = new MsgMapItem(true);
- MsgMapItem.UID = MsgMapItem.FloorUID.Next;
- while (map.Npcs.ContainsKey(MsgMapItem.UID))
- MsgMapItem.UID = MsgMapItem.FloorUID.Next;
- MsgMapItem.ItemID = MsgMapItem.HorrorofStomper;
- MsgMapItem.X = lastattacked.X;
- MsgMapItem.Y = lastattacked.Y;
- MsgMapItem.Type = MsgMapItem.Effect;
- MsgMapItem.mColor = 14;
- MsgMapItem.OwnerUID = attacker.UID;
- MsgMapItem.OwnerGuildUID = attacker.GuildID;
- MsgMapItem.FlowerType = 3;
- MsgMapItem.Unknown37 = 1;
- MsgMapItem.X2 = attacker.X;
- MsgMapItem.Y2 = attacker.Y;
- MsgMapItem.Angle = attacker.Facing;
- MsgMapItem.MapID = map.ID;
- MsgMapItem.Attack = attack;
- MsgMapItem.OnFloor = Time32.Now;
- MsgMapItem.Owner = attacker.Owner;
- map.AddFloorItem(MsgMapItem);
- attacker.Owner.SendScreenSpawn(MsgMapItem, true);
- #endregion
- }
- #endregion
- #region PeaceofStomper
- {
- var spell3 = Database.SpellTable.GetSpell(13000, attacker.Owner);
- if (!attacker.Owner.Spells.ContainsKey(13000)) return;
- attack.Damage = 1;
- MsgMagicEffect suse = new MsgMagicEffect(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 MsgMapItem
- var map = Kernel.Maps[attacker.MapID];
- MsgMapItem MsgMapItem = new MsgMapItem(true);
- MsgMapItem.UID = MsgMapItem.FloorUID.Next;
- while (map.Npcs.ContainsKey(MsgMapItem.UID))
- MsgMapItem.UID = MsgMapItem.FloorUID.Next;
- MsgMapItem.ItemID = MsgMapItem.PeaceofStomper;
- MsgMapItem.X = lastattacked.X;
- MsgMapItem.Y = lastattacked.Y;
- MsgMapItem.X2 = attacker.X;
- MsgMapItem.Y2 = attacker.Y;
- MsgMapItem.Type = MsgMapItem.Effect;
- MsgMapItem.mColor = 14;
- MsgMapItem.OwnerUID = attacker.UID;
- MsgMapItem.OwnerGuildUID = attacker.GuildID;
- MsgMapItem.FlowerType = 3;
- MsgMapItem.Unknown37 = 1;
- MsgMapItem.MapID = map.ID;
- MsgMapItem.Attack = attack;
- MsgMapItem.OnFloor = Time32.Now;
- MsgMapItem.Owner = attacker.Owner;
- map.AddFloorItem(MsgMapItem);
- attacker.Owner.SendScreenSpawn(MsgMapItem, true);
- #endregion
- }
- #endregion
- return;
- }
- #endregion
- else if (attacker.IsStomper1())
- {
- #region Sector-Circle-Rectangle(Windwalker-Stomper-Melee)
- if (attack.SpellID == 13040 || attack.SpellID == 13050 || attack.SpellID == 13060)
- {
- #region Sector
- if (attack.SpellID == 13040)
- {
- var spell = Database.SpellTable.GetSpell(13040, attacker.Owner);
- MsgMagicEffect suse = new MsgMagicEffect(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.Player || _obj.MapObjType == MapObjectType.Monster)
- {
- if (_obj == null) continue;
- attacked = _obj as Player;
- if (attacked == null) continue;
- if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
- if (sector.IsInFan(attacked.X, attacked.Y))
- {
- if (CanAttack(attacker, attacked, spell, attack.InteractType == MsgInteract.Melee))
- {
- attack.Effect = MsgInteract.InteractEffects.None;
- uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 4;
- damages = (uint)(damages * .5);
- attack.Damage = damages / 2;
- suse.Effect = attack.Effect;
- ReceiveAttack(attacker, attacked, attack,ref damages, spell);
- suse.AddTarget(attacked.UID, damages, attack);
- }
- }
- }
- }
- }
- }
- #endregion
- #region Circle
- if (attack.SpellID == 13050)
- {
- var spell = Database.SpellTable.GetSpell(13050, attacker.Owner);
- MsgMagicEffect suse = new MsgMagicEffect(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.Player || _obj.MapObjType == MapObjectType.Monster)
- {
- if (_obj == null)
- continue;
- attacked = _obj as Player;
- if (attacked == null) continue;
- if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
- if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 5) continue;
- attack.Effect = MsgInteract.InteractEffects.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 4;
- damage = (uint)(damage * .5);
- attack.Damage = damage / 2;
- ReceiveAttack(attacker, attacked, attack,ref damage, spell);
- suse.AddTarget(attacked.UID, damage, attack);
- }
- }
- attacker.Owner.SendScreen(suse, true);
- return;
- }
- #endregion
- #region Rectangle
- if (attack.SpellID == 13060)
- {
- var spell = Database.SpellTable.GetSpell(13060, attacker.Owner);
- MsgMagicEffect suse = new MsgMagicEffect(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);
- uint damage2 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
- attack.Damage = damage2 / 2;
- ReceiveAttack(attacker, attacked, attack,ref damage2, spell);
- suse.AddTarget(attacked.UID, damage2, attack);
- foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
- {
- if (_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
- {
- if (_obj == null) continue;
- attacked = _obj as Player;
- if (attacked == null) continue;
- if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
- if (sector.IsInFan(attacked.X, attacked.Y))
- {
- if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 7) continue;
- attack.Effect = MsgInteract.InteractEffects.None;
- uint damage43 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 4;
- damage43 = (uint)(damage43 * .5);
- attack.Damage = damage43 / 2;
- ReceiveAttack(attacker, attacked, attack, ref damage43, spell);
- suse.AddTarget(attacked.UID, damage43, attack);
- }
- }
- }
- attacker.Owner.SendScreen(suse, true);
- return;
- }
- #endregion
- }
- #endregion
- }
- #endregion
- #region DragonPunch
- if (attacker.HaveOneLeeLong())
- {
- if (attacker.Owner.Spells.ContainsKey(12240))
- {
- var spell = Database.SpellTable.GetSpell(12240, attacker.Owner);
- if (spell != null)
- {
- spell.CanKill = true;
- if (Kernel.Rate(spell.Percent))
- {
- MsgMagicEffect suse = new MsgMagicEffect(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = spell.ID;
- suse.SpellLevel = spell.Level;
- suse.X = attacker.X;
- suse.Y = attacker.Y;
- IMapObject lastAttacked = attacker;
- foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
- {
- if (_obj == null) continue;
- if (_obj.MapObjType == MapObjectType.Monster)
- {
- if (_obj.UID == attacked.UID) continue;
- var attacked1 = _obj as Player;
- if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
- {
- if (Handle.CanAttack(attacker, attacked1, spell, false))
- {
- if (!CanAttack(attacker, attacked, spell, attack.InteractType == MsgInteract.Melee))
- continue;
- attack.Effect = MsgInteract.InteractEffects.None;
- uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
- suse.Effect = attack.Effect;
- attack.Damage = damages / 2;
- ReceiveAttack(attacker, attacked, attack,ref damages, spell);
- suse.AddTarget(attacked.UID, damages, attack);
- }
- }
- }
- else if (_obj.MapObjType == MapObjectType.Player)
- {
- if (_obj.UID == attacked.UID) continue;
- var attacked1 = _obj as Player;
- if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
- {
- if (Handle.CanAttack(attacker, attacked1, spell, false))
- {
- lastAttacked = attacked1;
- uint damages = Game.Attacking.Calculate.Melee(attacker, attacked1, ref attack, spell);
- attack.Damage = damages / 2;
- suse.Effect = attack.Effect;
- if (damages == 0) break;
- Handle.ReceiveAttack(attacker, attacked1, attack,ref damages, spell);
- suse.AddTarget(attacked1.UID, damages, attack);
- }
- }
- }
- else if (_obj.MapObjType == MapObjectType.SobNpc)
- {
- attackedsob = _obj as MsgNpcInfoEX;
- if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
- {
- if (Handle.CanAttack(attacker, attackedsob, spell))
- {
- lastAttacked = attackedsob;
- uint damages = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
- suse.Effect = attack.Effect;
- if (damages == 0) break;
- attack.Damage = damages / 2;
- Handle.ReceiveAttack(attacker, attackedsob, attack, damages, spell);
- suse.AddTarget(attackedsob.UID, damages, attack);
- }
- }
- }
- }
- attacker.Owner.SendScreen(suse, true);
- return;
- }
- }
- }
- }
- #endregion
- CheckForExtraWeaponPowers(attacker.Owner, attacked);
- if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) return;
- pass = false;
- if (attacker.OnFatalStrike())
- {
- if (attacked.PlayerFlag == PlayerFlag.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)
- {
- #region SyxRay
- if (attacker.EpicTrojan())
- {
- if (attacker.Owner.Spells.ContainsKey(11990))
- {
- var spell = Database.SpellTable.GetSpell(11990, attacker.Owner);
- if (spell != null)
- {
- spell.CanKill = true;
- if (Kernel.Rate(spell.Percent))
- {
- MsgMagicEffect suse = new MsgMagicEffect(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = spell.ID;
- suse.SpellLevel = spell.Level;
- suse.X = attacker.X;
- suse.Y = attacker.Y;
- IMapObject lastAttacked = attacker;
- if (Handle.CanAttack(attacker, attacked, spell, false))
- {
- lastAttacked = attacked;
- uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
- damages = damages * (uint)(damages * 0.45);
- attack.Damage = damages / 2;
- suse.Effect = attack.Effect;
- Handle.ReceiveAttack(attacker, attacked, attack, ref damages, spell);
- suse.AddTarget(attacked.UID, damages, attack);
- }
- foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
- {
- if (_obj == null) continue;
- if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
- {
- if (_obj.UID == attacked.UID) continue;
- var attacked1 = _obj as Player;
- if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
- {
- if (Handle.CanAttack(attacker, attacked1, spell, false))
- {
- lastAttacked = attacked1;
- uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
- suse.Effect = attack.Effect;
- if (damages == 0) break;
- Handle.ReceiveAttack(attacker, attacked1, attack,ref damages, spell);
- suse.AddTarget(attacked1.UID, damages, attack);
- }
- }
- }
- else if (_obj.MapObjType == MapObjectType.SobNpc)
- {
- attackedsob = _obj as MsgNpcInfoEX;
- if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
- {
- if (Handle.CanAttack(attacker, attackedsob, spell))
- {
- lastAttacked = attackedsob;
- uint damages = Game.Attacking.Calculate.Melee(attacker,
- attackedsob, ref attack);
- suse.Effect = attack.Effect;
- if (damages == 0) break;
- Handle.ReceiveAttack(attacker, attackedsob, attack, damages, spell);
- suse.AddTarget(attackedsob.UID, damages, attack);
- }
- }
- }
- }
- attacker.Owner.SendScreen(suse, true);
- return;
- }
- }
- }
- }
- #endregion
- attack.Effect = MsgInteract.InteractEffects.None;
- ushort spellidd = attack.SpellID;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack); // FISICOS GENERALES SIN IMPORTAR CLASE!
- attack.Damage = damage;
- if (attacker.OnFatalStrike())
- {
- if (attacked.PlayerFlag == PlayerFlag.Monster)
- {
- var weaps = attacker.Owner.Weapons;
- bool can = false;
- 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;
- 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;
- // damage = damage / 2;
- attack.Damage = damage / 3;
- attack.InteractType = MsgInteract.FatalStrike;
- }
- }
- var weapons = attacker.Owner.Weapons;
- if (weapons.Item1 != null)
- {
- MsgItemInfo rightweapon = weapons.Item1;
- ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
- bool wep1bs = false, wep2bs = false;
- if (wep1subyte == 421)
- {
- wep1bs = true;
- wep1subyte--;
- }
- ushort wep1spellid = 0, wep2spellid = 0;
- if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
- {
- Database.SpellTable.WeaponSpells[wep1subyte].Shuffle();
- wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte].FirstOrDefault();
- }
- if (wep1spellid == 12570 && attacker.WrathoftheEmperor == false)
- {
- wep1spellid = 10490;
- }
- if (attacker.WrathoftheEmperor == true)
- {
- if (wep1subyte == 622)
- {
- if (attacker.WrathoftheEmperorStamp <= DateTime.Now.AddMilliseconds(5000))
- {
- wep1spellid = 12570;
- }
- attacker.WrathoftheEmperor = false;
- }
- }
- Database.SpellInformation wep1spell = null, wep2spell = null;
- 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.PlayerFlag == PlayerFlag.Player && wep1spellid == 10490)
- doWep1Spell = Kernel.Rate(5);
- }
- if (!doWep1Spell)
- {
- if (weapons.Item2 != null)
- {
- MsgItemInfo leftweapon = weapons.Item2;
- wep2subyte = (ushort)(leftweapon.ID / 1000);
- if (wep2subyte == 421)
- {
- wep2bs = true;
- wep2subyte--;
- }
- if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
- {
- Database.SpellTable.WeaponSpells[wep1subyte].Shuffle();
- wep1spellid = Database.SpellTable.WeaponSpells[wep2subyte].FirstOrDefault();
- }
- if (wep2spellid == 12570 && attacker.WrathoftheEmperor == false)
- {
- wep2spellid = 10490;
- }
- if (attacker.WrathoftheEmperor == true)
- {
- if (wep2subyte == 622)
- {
- if (attacker.WrathoftheEmperorStamp <= DateTime.Now.AddMilliseconds(5000))
- {
- wep2spellid = 12570;
- }
- attacker.WrathoftheEmperor = false;
- }
- }
- 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.PlayerFlag == PlayerFlag.Player && wep2spellid == 10490)
- doWep2Spell = Kernel.Rate(5);
- }
- }
- }
- if (!attacker.Transformed)
- {
- if (doWep1Spell)
- {
- attacker.AttackPacket = attack;
- attack.InteractType = MsgInteract.Magic;
- attack.Decoded = true;
- attack.CheckWeponSpell = true;
- attack.X = attacked.X;
- attack.Y = attacked.Y;
- attack.Attacked = attacked.UID;
- attack.Damage = wep1spell.ID;
- goto restart;
- }
- if (doWep2Spell)
- {
- attacker.AttackPacket = attack;
- attack.InteractType = MsgInteract.Magic;
- attack.Decoded = true;
- attack.CheckWeponSpell = true;
- attack.X = attacked.X;
- attack.Y = attacked.Y;
- attack.Attacked = attacked.UID;
- attack.Damage = wep2spell.ID;
- goto restart;
- }
- if (wep1bs)
- wep1subyte++;
- if (attacker.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag != PlayerFlag.Player)
- 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.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag != PlayerFlag.Player)
- 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.InteractType = MsgInteract.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.Effect = MsgInteract.InteractEffects.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
- attack.Damage = damage / 2;
- var weapons = attacker.Owner.Weapons;
- if (weapons.Item1 != null)
- {
- MsgItemInfo rightweapon = weapons.Item1;
- ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
- bool wep1bs = false, wep2bs = false;
- if (wep1subyte == 421)
- {
- wep1bs = true;
- wep1subyte--;
- }
- ushort wep1spellid = 0, wep2spellid = 0;
- if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
- {
- Database.SpellTable.WeaponSpells[wep1subyte].Shuffle();
- wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte].FirstOrDefault();
- }
- if (wep1spellid == 12570 && attacker.WrathoftheEmperor == false)
- {
- wep1spellid = 10490;
- }
- if (attacker.WrathoftheEmperor == true)
- {
- if (wep1subyte == 622)
- {
- if (attacker.WrathoftheEmperorStamp <= DateTime.Now.AddMilliseconds(5000))
- {
- wep1spellid = 12570;
- }
- attacker.WrathoftheEmperor = false;
- }
- }
- Database.SpellInformation wep1spell = null, wep2spell = null;
- 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)
- {
- MsgItemInfo leftweapon = weapons.Item2;
- wep2subyte = (ushort)(leftweapon.ID / 1000);
- if (wep2subyte == 421)
- {
- wep2bs = true;
- wep2subyte--;
- }
- if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
- {
- Database.SpellTable.WeaponSpells[wep2subyte].Shuffle();
- wep2spellid = Database.SpellTable.WeaponSpells[wep2subyte].FirstOrDefault();
- }
- if (wep2spellid == 12570 && attacker.WrathoftheEmperor == false)
- {
- wep2spellid = 10490;
- }
- if (attacker.WrathoftheEmperor == true)
- {
- if (wep2subyte == 622)
- {
- if (attacker.WrathoftheEmperorStamp <= DateTime.Now.AddMilliseconds(5000))
- {
- wep1spellid = 12570;
- }
- attacker.WrathoftheEmperor = false;
- }
- }
- 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.InteractType = MsgInteract.Magic;
- attack.Decoded = true;
- attack.CheckWeponSpell = true;
- attack.X = attackedsob.X;
- attack.Y = attackedsob.Y;
- attack.Attacked = attackedsob.UID;
- attack.Damage = wep1spell.ID;
- goto restart;
- }
- if (doWep2Spell)
- {
- attack.InteractType = MsgInteract.Magic;
- attack.Decoded = true;
- attack.CheckWeponSpell = 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.PlayerFlag == PlayerFlag.Player)
- 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
- ============================================================================================================
- Despues Buscan Attack.cs o MsgInteract.cs y lo deben tener asi
- public MsgInteract(bool Create)
- {
- if (Create)
- {
- Packet = new byte[45 + 16];// 45 + 8
- fixed (byte* Pack = Packet)
- {
- *(ushort*)(Pack + (Packet.Length - 8)) = 0;
- *((ushort*)(Pack + 2)) = (ushort)MsgTypes.MsgInteract;
- *((uint*)(Pack + 4)) = (uint)Time32.timeGetTime().GetHashCode();
- }
- }
- }
- lo mismo con el public Attack. lo que pasa es que yo lo tengo de Emulator pero ya se daran cuenta a que me refiero
- despues mas abajo si usan MsgInteract en el codigo de void Process agregaran :
- case Magic:
- {
- attack.InteractType = Magic;
- client.Player.AttackMagicStamp = Time32.Now//Pueden Modificar y hacer que ataque cada 1 Sec
- break;
- }
- case Melee:
- {
- attack.InteractType = Melee;
- client.Player.AttackMeleeStamp = Time32.Now
- break;
- }
- case Ranged:
- {
- client.Player.AttackRangedStamp = Time32.Now
- attack.InteractType = Ranged;
- break;
- }
- Si Usan Attack.cs busquen en PacketHandler y los agregan tambien.
- ======================================================================================0
- En Player.cs agregan:
- public Time32 AttackRangedStamp, AttackMeleeStamp, AttackMagicStamp;
- ========================================================================================
- Creditos Reservados del Fix : Pezzi Tomas! EL MEJOR!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement