Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- En Handler.cs void ReceiveAttack agregan :
- #region Perfection Attacks
- if (attacked.PlayerFlag == PlayerFlag.Player)
- {
- #region Perfection StrikeLock TESTEAR
- Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.StrikeLock;
- byte chance = 10;
- new MsgRefineEffect().HandleStrikeLock(attacked, ref chance);
- if (Kernel.Rate(chance))
- {
- new MsgRefineEffect().SendEffect(attacked, attacker, effect);
- damage = damage / 2;
- }
- #endregion
- }
- if (attacked.PlayerFlag == PlayerFlag.Player)
- {
- #region FreeSoul [Remover SoulShakle]
- if (attacked.ContainsFlag2((ulong)MsgUpdate.Flags2.SoulShackle))
- {
- Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.FreeSoul;
- byte chance = 4;
- new MsgRefineEffect().HandleFreeSoul(attacked, ref chance);
- if (Kernel.Rate(chance))
- {
- new MsgRefineEffect().SendEffect(attacked, attacker, effect);
- }
- }
- #endregion
- }
- if (attacked.PlayerFlag == PlayerFlag.Player)
- {
- #region Perfection DivineGuard
- Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.DivineGuard;
- byte chance = 10;
- new MsgRefineEffect().HandleDivineGuard(attacked, ref chance);
- if (Kernel.Rate(chance))
- {
- new MsgRefineEffect().SendEffect(attacked, attacker, effect);
- }
- #endregion
- }
- if (attacked.PlayerFlag == PlayerFlag.Player)
- {
- #region Perfection ShieldBreak
- Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.ShieldBreak;
- byte chance = 10;
- new MsgRefineEffect().ShieldBreak(attacked, ref chance);
- if (Kernel.Rate(chance))
- {
- new MsgRefineEffect().SendEffect(attacked, attacker, effect);
- }
- #endregion
- }
- if (attacked.PlayerFlag == PlayerFlag.Player)
- {
- #region Perfection BloodSpawn
- Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.BloodSpawn;
- byte chance = 10;
- new MsgRefineEffect().HandleBloodSpawn(attacked, ref chance);
- if (Kernel.Rate(chance))
- {
- new MsgRefineEffect().SendEffect(attacked, attacker, effect);
- attacked.Hitpoints = attacked.MaxHitpoints;
- attacked.Mana = attacked.MaxMana;
- }
- #endregion
- }
- #region Perfection CalmWind
- if (attacker.PlayerFlag == PlayerFlag.Player)
- {
- uint rand = (uint)COServer.Kernel.Random.Next(0, 1);
- switch (rand)
- {
- case 0:
- {
- break;
- }
- case 1:
- {
- if (attacked.PlayerFlag == PlayerFlag.Player)
- {
- #region Perfection
- Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.CalmWind;
- byte chance = 10;
- new MsgRefineEffect().GenerateEffectandChance(attacker.Owner, ref effect, ref chance);
- if (Kernel.Rate(chance))
- {
- new MsgRefineEffect().SendEffect(attacker, attacked, effect);
- }
- #endregion
- }
- break;
- }
- }
- }
- #endregion
- #region Perfection MirrorOfSin
- if (attacked.PlayerFlag == PlayerFlag.Player)
- {
- uint rand = (uint)COServer.Kernel.Random.Next(0, 1);
- switch (rand)
- {
- case 0:
- {
- break;
- }
- case 1:
- {
- if (attacked.PlayerFlag == PlayerFlag.Player)
- {
- #region Perfection
- Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.MirrorofSin;
- byte chance = 10;
- new MsgRefineEffect().HandleMirror(attacked, ref chance);
- if (Kernel.Rate(chance))
- {
- new MsgRefineEffect().SendEffect(attacked, attacker, effect);
- attacked.AddFlag((ulong)Network.GamePackets.MsgUpdate.Flags.XPList);
- }
- #endregion
- }
- break;
- }
- }
- }
- #endregion
- #endregion
- ===========================================================================
- En MsgRefineEffect Agregan :
- public void HandleDivineGuard(Game.Player client, ref byte chance)
- {
- chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.DivineGuard);
- }
- public void HandleStrikeLock(Game.Player client, ref byte chance)
- {
- chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.StrikeLock);
- }
- public void ShieldBreak(Game.Player client, ref byte chance)
- {
- chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.ShieldBreak);
- }
- public void HandleFreeSoul(Game.Player client, ref byte chance)
- {
- chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.FreeSoul);
- }
- public void HandleStraightLife(Game.Player client, ref byte chance)
- {
- chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.StraightLife);
- }
- public void HandleBloodSpawn(Game.Player client, ref byte chance)
- {
- chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.BloodSpawn);
- }
- public void HandleMirror(Game.Player client, ref byte chance)
- {
- chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.MirrorofSin);
- }
- =============================================================================0
- en MsgRefine Effect Reemplazan o Agregan :
- public byte GetChance(Client.GameState client, Game.Enums.PerfectionEffect effect)
- {
- if (client.Equipment.TotalPerfectionLevel == 0) return 0;
- byte Chance = 10;
- if (effect == Game.Enums.PerfectionEffect.CalmWind)
- {
- if (client.Equipment.TotalPerfectionLevel == 3) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 90) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 170) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 250) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 285) Chance += 1;
- }
- if (effect == Game.Enums.PerfectionEffect.BloodSpawn)
- {
- if (client.Equipment.TotalPerfectionLevel >= 40) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 240) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 288) Chance += 1;
- }
- if (effect == Game.Enums.PerfectionEffect.DivineGuard)
- {
- if (client.Equipment.TotalPerfectionLevel <= 40) Chance += 5;
- }
- if (effect == Game.Enums.PerfectionEffect.DrainingTouch)
- {
- if (client.Equipment.TotalPerfectionLevel >= 35) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 220) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 276) Chance += 1;
- }
- if (effect == Game.Enums.PerfectionEffect.FreeSoul)
- {
- if (client.Equipment.TotalPerfectionLevel >= 25) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 95) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 130) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 195) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 279) Chance += 1;
- }
- if (effect == Game.Enums.PerfectionEffect.KillingFlash)
- {
- if (client.Equipment.TotalPerfectionLevel >= 55) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 165) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 294) Chance += 1;
- }
- if (effect == Game.Enums.PerfectionEffect.LightofStamina)
- {
- if (client.Equipment.TotalPerfectionLevel >= 1) Chance += 5;
- }
- if (effect == Game.Enums.PerfectionEffect.MirrorofSin)
- {
- if (client.Equipment.TotalPerfectionLevel >= 60) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 190) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 291) Chance += 1;
- }
- if (effect == Game.Enums.PerfectionEffect.ShieldBreak)
- {
- if (client.Equipment.TotalPerfectionLevel == 155 && client.Equipment.TotalPerfectionLevel <= 254) Chance += 50 / 100;
- if (client.Equipment.TotalPerfectionLevel == 255 && client.Equipment.TotalPerfectionLevel <= 296) Chance += 70 / 100;
- if (client.Equipment.TotalPerfectionLevel == 297 && client.Equipment.TotalPerfectionLevel <= 311) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel == 312 && client.Equipment.TotalPerfectionLevel <= 321) Chance += 150 / 100;
- if (client.Equipment.TotalPerfectionLevel == 322 && client.Equipment.TotalPerfectionLevel >= 322) Chance += 2;
- }
- if (effect == Game.Enums.PerfectionEffect.StraightLife)
- {
- if (client.Equipment.TotalPerfectionLevel >= 30) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 125) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 210) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 265) Chance += 1;
- if (client.Equipment.TotalPerfectionLevel >= 303) Chance += 1;
- }
- if (effect == Game.Enums.PerfectionEffect.StrikeLock)
- {
- if (client.Equipment.TotalPerfectionLevel >= 308) Chance += 1;
- }
- return Chance;
- }
- public void SendEffect(Game.Player attacker, Game.Player attacked, Game.Enums.PerfectionEffect effect)
- {
- if (attacker == null || attacked == null) return;
- var proto = new MsgRefineEffectProto();
- proto.AttackerUID = attacker.UID;
- if (attacked.PlayerFlag == Game.PlayerFlag.Player)
- proto.AttackedUID = attacked.UID;
- else if (attacked.PlayerFlag == Game.PlayerFlag.Monster && attacked != null && attacked.UID != 0)
- {
- proto.AttackedUID = attacked.UID;
- }
- proto.Effect = (uint)effect;
- var proto2 = Kernel.FinalizeProtoBuf(proto, 3254);
- attacker.Owner.SendScreen(proto2, true);
- if (effect == Game.Enums.PerfectionEffect.DrainingTouch)
- {
- attacker.Hitpoints = attacker.MaxHitpoints;
- }
- if (effect == Game.Enums.PerfectionEffect.KillingFlash)
- {
- attacker.AddFlag((ulong)Network.GamePackets.MsgUpdate.Flags.XPList);
- }
- if (effect == Game.Enums.PerfectionEffect.DivineGuard)
- {
- attacker.AddFlag3((ulong)Network.GamePackets.MsgUpdate.Flags3.DivineGuard);
- attacker.DivineGuardStamp = Time32.Now;
- attacker.Defence = (ushort)(((attacker.Defence) * 50) / 100);
- }
- if (effect == Game.Enums.PerfectionEffect.ShieldBreak)
- {
- attacker.AddFlag3((ulong)Network.GamePackets.MsgUpdate.Flags3.ShieldBreak);
- attacker.ShieldBreakStamp = Time32.Now;
- attacker.Block += (ushort)(((attacker.Block) * 20) / 10);
- }
- if (effect == Game.Enums.PerfectionEffect.FreeSoul)
- {
- attacked.SoulShackleRemover();
- }
- if (effect == Game.Enums.PerfectionEffect.StraightLife)
- {
- attacker.BringToLife();
- }
- if (effect == Game.Enums.PerfectionEffect.LightofStamina && attacked.PlayerFlag == Game.PlayerFlag.Player && attacker.Owner.Equipment.TotalPerfectionLevel > attacked.Owner.Equipment.TotalPerfectionLevel || effect == Game.Enums.PerfectionEffect.LightofStamina && attacked.PlayerFlag == Game.PlayerFlag.Monster) attacker.Stamina = 100;
- }
- =========================================================
- Hasta Ahi :D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement