Advertisement
XConquer

WrathOfEmperor

Mar 30th, 2019
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 21.26 KB | None | 0 0
  1. Handler.cs
  2.  
  3. #region WrathoftheEmperor
  4.                                 case 12570:
  5.                                     {
  6.                                         if (CanUseSpell(spell, attacker.Owner))
  7.                                         {
  8.                                             PrepareSpell(spell, attacker.Owner);
  9.                                             SpellUse suse = new SpellUse(true);
  10.                                             suse.Attacker = attacker.UID;
  11.                                             suse.SpellID = SpellID;
  12.                                             suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
  13.                                             suse.X = X;
  14.                                             suse.Y = Y;
  15.                                             suse.SpellEffect = 1;
  16.                                             foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  17.                                             {
  18.                                                 if (_obj == null) continue;
  19.                                                 if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  20.                                                 {
  21.                                                     attacked = _obj as Entity;
  22.                                                     if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 2)
  23.                                                     {
  24.                                                         if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  25.                                                         {
  26.  
  27.                                                             attack.Effect = Attack.AttackEffects.None;
  28.                                                             uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
  29.                                                             damage = (uint)(damage * 1.2);
  30.                                                             //     damage = (uint)MathHelper.AdjustDataEx((int)damage / 3, (int)spell.Power / 100);
  31.                                                             attack.Damage = damage;
  32.  
  33.                                                             attacker.WrathoftheEmperor = true;
  34.                                                             attacker.WrathoftheEmperorStamp = DateTime.Now;
  35.                                                             suse.Effect = attack.Effect;
  36.                                                             ReceiveAttack(attacker, attacked, attack, ref damage, spell);
  37.                                                             suse.AddTarget(attacked.UID, damage, attack);
  38.                                                         }
  39.                                                     }
  40.                                                 }
  41.                                                 else if (_obj.MapObjType == MapObjectType.SobNpc)
  42.                                                 {
  43.                                                     attackedsob = _obj as SobNpcSpawn;
  44.                                                     if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= 2)
  45.                                                     {
  46.                                                         if (CanAttack(attacker, attackedsob, spell))
  47.                                                         {
  48.  
  49.                                                             attack.Effect = Attack.AttackEffects.None;
  50.                                                             uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  51.                                                             suse.Effect = attack.Effect;
  52.                                                             ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  53.                                                             suse.AddTarget(attackedsob.UID, damage, attack);
  54.                                                         }
  55.                                                     }
  56.                                                 }
  57.                                             }
  58.                                             attacker.Owner.SendScreen(suse, true);
  59.                                         }
  60.                                         break;
  61.                                     }
  62.                                 #endregion
  63. #region Single target
  64.                                 case 11140://WindStorm
  65.                                 case 10490://TripleAtaque Monje
  66.                                     {
  67.                                         if (CanUseSpell(spell, attacker.Owner))
  68.                                         {
  69.                                             PrepareSpell(spell, attacker.Owner);
  70.  
  71.                                             TryTrip suse = new TryTrip(true);
  72.                                             suse.Attacker = attacker.UID;
  73.                                             suse.SpellID = spell.ID;
  74.                                             suse.SpellLevel = spell.Level;
  75.  
  76.                                             if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
  77.                                             {
  78.                                                 if (attackedsob != null)
  79.                                                 {
  80.                                                     if (CanAttack(attacker, attackedsob, spell))
  81.                                                     {
  82.                                                         suse.Attacked = attackedsob.UID;
  83.                                                         PrepareSpell(spell, attacker.Owner);
  84.                                                         attack.Effect = Attack.AttackEffects.None;
  85.                                                         uint AllDamage = 0;
  86.                                                         uint damage1 = 0;
  87.                                                         uint damage2 = 0;
  88.                                                         uint damage = 0;
  89.                                                         Network.GamePackets.Attack.AttackEffects Eff1 = 0;
  90.                                                         Network.GamePackets.Attack.AttackEffects Eff2 = 0;
  91.                                                         Network.GamePackets.Attack.AttackEffects Eff3 = 0;
  92.                                                         damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  93.                                                      
  94.                                                         AllDamage += damage;
  95.                                                         Eff1 = attack.Effect;
  96.                                                         attack.Effect = Attack.AttackEffects.None;
  97.                                                         if (attackedsob.Hitpoints <= AllDamage)
  98.                                                         {
  99.                                                             suse.Eff1 = Eff1;
  100.                                                             suse.Damage += damage;
  101.                                                             suse.Count = 1;
  102.                                                         }
  103.                                                         else
  104.                                                         {
  105.                                                             damage1 = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  106.                                                             Eff2 = attack.Effect;
  107.                                                             attack.Effect = Attack.AttackEffects.None;
  108.                                                             AllDamage += damage1;
  109.                                                             if (attackedsob.Hitpoints <= AllDamage)
  110.                                                             {
  111.                                                                 suse.Eff1 = Eff1;
  112.                                                                 suse.Eff2 = Eff2;
  113.                                                                 suse.Damage += damage;
  114.                                                                 suse.Damage1 += damage1;
  115.                                                                 suse.Count = 2;
  116.                                                             }
  117.                                                             else
  118.                                                             {
  119.                                                                 damage2 = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  120.                                                              
  121.                                                                 Eff3 = attack.Effect;
  122.                                                                 attack.Effect = Attack.AttackEffects.None;
  123.                                                                 AllDamage += damage2;
  124.                                                                 suse.Eff1 = Eff1;
  125.                                                                 suse.Eff2 = Eff2;
  126.                                                                 suse.Eff3 = Eff3;
  127.                                                                 suse.Damage = damage;
  128.                                                                 suse.Damage1 = damage1;
  129.                                                                 suse.Damage2 = damage2;
  130.                                                                 suse.Count = 3;
  131.  
  132.                                                             }
  133.                                                         }
  134.                                                         if (spellID == 10490)
  135.                                                         {
  136.                                                             if (attacker.EpicMonk())
  137.                                                             {
  138.                                                                 if (attacker.Owner.Spells.ContainsKey(12570))
  139.                                                                 {
  140.                                                                     attacker.WrathoftheEmperor = true;
  141.                                                                     attacker.WrathoftheEmperorStamp = DateTime.Now;
  142.                                                                 }
  143.                                                             }
  144.                                                         }
  145.                                                         ReceiveAttack(attacker, attackedsob, attack, AllDamage, spell);
  146.  
  147.                                                     }
  148.                                                 }
  149.                                                 else
  150.                                                 {
  151.                                                     if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  152.                                                     {
  153.                                                         suse.Attacked = attacked.UID;
  154.                                                         PrepareSpell(spell, attacker.Owner);
  155.                                                         attack.Effect = Attack.AttackEffects.None;
  156.                                                         uint AllDamage = 0;
  157.                                                         uint damage1 = 0;
  158.                                                         uint damage2 = 0;
  159.                                                         uint damage = 0;
  160.                                                         Network.GamePackets.Attack.AttackEffects Eff1 = 0;
  161.                                                         Network.GamePackets.Attack.AttackEffects Eff2 = 0;
  162.                                                         Network.GamePackets.Attack.AttackEffects Eff3 = 0;
  163.                                                         damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  164.                                                         damage = (uint)(damage / 2);
  165.                                                         Eff1 = attack.Effect;
  166.                                                         attack.Effect = Attack.AttackEffects.None;
  167.                                                         if (attacked.MaxHitpoints <= AllDamage)
  168.                                                         {
  169.                                                             suse.Eff1 = Eff1;
  170.                                                             suse.Damage += damage;
  171.                                                             suse.Count = 1;
  172.                                                         }
  173.                                                         else
  174.                                                         {
  175.                                                             damage1 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  176.                                                             damage1 = (uint)(damage1 / 2);
  177.                                                             Eff2 = attack.Effect;
  178.                                                             attack.Effect = Attack.AttackEffects.None;
  179.                                                             AllDamage += damage1;
  180.                                                             attack.Damage = AllDamage;
  181.                                                             if (attacked.MaxHitpoints <= AllDamage)
  182.                                                             {
  183.                                                                 suse.Eff1 = Eff1;
  184.                                                                 suse.Eff2 = Eff2;
  185.                                                                 suse.Damage += damage;
  186.                                                                 suse.Damage1 += damage1;
  187.                                                                 suse.Count = 2;
  188.                                                             }
  189.                                                             else
  190.                                                             {
  191.                                                                 damage2 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  192.                                                                 damage2 = (uint)(damage2 / 2);
  193.                                                                 Eff3 = attack.Effect;
  194.                                                                 attack.Effect = Attack.AttackEffects.None;
  195.                                                                 AllDamage += damage2;
  196.                                                                 suse.Eff1 = Eff1;
  197.                                                                 suse.Eff2 = Eff2;
  198.                                                                 suse.Eff3 = Eff3;
  199.                                                                 suse.Damage = damage;
  200.                                                                 suse.Damage1 = damage1;
  201.                                                                 suse.Damage2 = damage2;
  202.                                                                 suse.Count = 3;
  203.  
  204.                                                             }
  205.                                                         }
  206.                                                         if (spellID == 10490)
  207.                                                         {
  208.                                                             if (attacker.EpicMonk())
  209.                                                             {
  210.                                                                 if (attacker.Owner.Spells.ContainsKey(12570))
  211.                                                                 {
  212.                                                                     attacker.WrathoftheEmperor = true;
  213.                                                                     attacker.WrathoftheEmperorStamp = DateTime.Now;
  214.                                                                 }
  215.                                                             }
  216.                                                         }
  217.  
  218.                                                         ReceiveAttack(attacker, attacked, attack, ref AllDamage, spell);
  219.                                                     }
  220.                                                 }
  221.  
  222.                                                 attacker.AttackPacket = null;
  223.                                             }
  224.                                             else
  225.                                             {
  226.                                                 attacker.AttackPacket = null;
  227.                                             }
  228.  
  229.                                             attacker.Owner.SendScreen(suse, true);
  230.                                         }
  231.                                         attacker.AttackPacket = null;
  232.                                         break;
  233.                                     }
  234.                                 case 1290:
  235.                                 case 5030:
  236.                                 case 5040:
  237.                                 case 7000:
  238.                                 case 7010:
  239.                                 case 7030:
  240.                                 case 7040:
  241.                                     {
  242.                                         if (CanUseSpell(spell, attacker.Owner))
  243.                                         {
  244.                                             PrepareSpell(spell, attacker.Owner);
  245.  
  246.                                             SpellUse suse = new SpellUse(true);
  247.                                             suse.Attacker = attacker.UID;
  248.                                             suse.SpellID = spell.ID;
  249.                                             suse.SpellLevel = spell.Level;
  250.                                             suse.X = X;
  251.                                             suse.Y = Y;
  252.                                             //suse.SoulLevel = client_Spell.SoulLevel;
  253.                                             if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
  254.                                             {
  255.                                                 if (attackedsob != null)
  256.                                                 {
  257.                                                     if (CanAttack(attacker, attackedsob, spell))
  258.                                                     {
  259.                                                         PrepareSpell(spell, attacker.Owner);
  260.                                                         attack.Effect = Attack.AttackEffects.None;
  261.                                                         uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  262.                                                         ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  263.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  264.                                                     }
  265.                                                 }
  266.                                                 else
  267.                                                 {
  268.                                                     if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  269.                                                     {
  270.                                                         PrepareSpell(spell, attacker.Owner);
  271.                                                         attack.Effect = Attack.AttackEffects.None;
  272.                                                         uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  273.                                                         suse.Effect = attack.Effect;
  274.                                                         ReceiveAttack(attacker, attacked, attack, ref damage, spell);
  275.                                                         suse.AddTarget(attacked.UID, damage, attack);
  276.                                                     }
  277.                                                 }
  278.  
  279.                                             }
  280.                                             else
  281.                                             {
  282.                                                 attacker.AttackPacket = null;
  283.                                             }
  284.                                             attacker.Owner.SendScreen(suse, true);
  285.                                         }
  286.  
  287.                                         break;
  288.                                     }
  289.  
  290.                                 #endregion
  291.  
  292. en Region Melee busca algo asi
  293. if (attacked.EntityFlag == EntityFlag.Player && wep1spellid == 10490)
  294.  
  295. y fijate donde dice el Rate le mandas 35
  296. =============================
  297.  
  298. SpellTable.cs al Final del todo agregas el case 12570
  299.  
  300. en la parte de switch (information.ID)
  301.                 {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement