Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.08 KB | None | 0 0
  1. using Phoenix.HabboHotel.GameClients;
  2. using Phoenix.HabboHotel.Items;
  3. using Phoenix.HabboHotel.Rooms;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8.  
  9. namespace Phoenix.HabboHotel.Misc.Commands.Combat
  10. {
  11. /// <summary>
  12. /// Class HitCmd implements IChatCommand.
  13. /// </summary>
  14. class HitCmd : IChatCommand
  15. {
  16. public int RequiredRank
  17. {
  18. get { return -1; }
  19. }
  20.  
  21. public string PermissionRequired
  22. {
  23. get { return ""; }
  24. }
  25.  
  26. public bool IsAsynchronous
  27. {
  28. get { return false; }
  29. }
  30.  
  31. public void Parse(GameClient Session, string Message)
  32. {
  33. string[] s = Message.Split(' ');
  34.  
  35. if (s.Length == 1 || s.Length == 0)
  36. {
  37. return;
  38. }
  39.  
  40. string msg = CommandManager.MergeParams(s, 1);
  41.  
  42. var grabTarget = Phoenix.GetGame().GetClientManager().GetClientByHabbo(msg);
  43.  
  44. var grabRoom = Phoenix.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
  45.  
  46. if (grabTarget != null)
  47. {
  48. RoomUser theAttacker = grabRoom.method_53(Session.GetHabbo().Id);
  49. RoomUser theTarget = grabRoom.method_53(grabTarget.GetHabbo().Id);
  50.  
  51. int _damage = Phoenix.GetRandomNumber(1, 10);
  52.  
  53. if (Session.GetRoleplay().Strength > 5)
  54. _damage = Phoenix.GetRandomNumber(2, 15);
  55.  
  56. if (Session.GetRoleplay().Strength > 10)
  57. _damage = Phoenix.GetRandomNumber(6, 25);
  58.  
  59. if (Math.Abs(theAttacker.int_3 - theTarget.int_3) < 2 && Math.Abs(theAttacker.int_4 - theTarget.int_4) < 2)
  60. {
  61. switch (Phoenix.GetRandomNumber(1, 4))
  62. {
  63.  
  64. case 1:
  65. {
  66. if (grabTarget.GetRoleplay().Health <= 0)
  67. {
  68.  
  69. theAttacker.method_1(Session, "*Swings my fist into " + msg + "'s face causing " + _damage + " damage and killing them! [-2E, +35XP]*", true);
  70. grabTarget.GetRoleplay().Health -= _damage;
  71.  
  72. return;
  73. }
  74.  
  75. theAttacker.method_1(Session, "*Swings my fist into " + msg + "'s face causing " + _damage + " damage [-2E, +20XP]*", true);
  76. grabTarget.GetRoleplay().Health -= _damage;
  77. Session.GetRoleplay().Energy -= 2;
  78. theTarget.method_1(grabTarget, "[" + grabTarget.GetRoleplay().Health + "/100]", true);
  79. }
  80. return;
  81.  
  82. case 2:
  83. {
  84. if (grabTarget.GetRoleplay().Health <= 0)
  85. {
  86.  
  87. theAttacker.method_1(Session, "*Ducks and right-hooks " + msg + " into their jaw causing " + _damage + " damage and killing them! [-2E, +35XP]*", true);
  88. grabTarget.GetRoleplay().Health -= _damage;
  89.  
  90. return;
  91. }
  92.  
  93. theAttacker.method_1(Session, "*Ducks and right-hooks " + msg + " into their jaw causing " + _damage + " damage [-2E, +20XP]*", true);
  94. grabTarget.GetRoleplay().Health -= _damage;
  95. Session.GetRoleplay().Energy -= 2;
  96.  
  97. theTarget.method_1(grabTarget, "[" + grabTarget.GetRoleplay().Health + "/100]", true);
  98. }
  99. return;
  100.  
  101. case 3:
  102. {
  103. if (grabTarget.GetRoleplay().Health <= 1)
  104. {
  105.  
  106. theAttacker.method_1(Session, "Sideswipes " + msg + " straight into their privates causing " + _damage + " damage and killing them! [-2E, +35XP]*", true);
  107. grabTarget.GetRoleplay().Health -= _damage;
  108.  
  109. return;
  110. }
  111.  
  112. theAttacker.method_1(Session, "*Sideswipes " + msg + " straight into their privates causing " + _damage + " damage [-2E, +20XP]*", true);
  113. grabTarget.GetRoleplay().Health -= _damage;
  114. Session.GetRoleplay().Energy -= 2;
  115.  
  116. theTarget.method_1(grabTarget, "[" + grabTarget.GetRoleplay().Health + "/100]", true);
  117. }
  118. return;
  119.  
  120. case 4:
  121. {
  122.  
  123. theAttacker.method_1(Session, "*Dropkicks " + msg + " straight into their nose causing " + _damage + " damage [-2E, +20XP]*", true);
  124. grabTarget.GetRoleplay().Health -= _damage;
  125. Session.GetRoleplay().Energy -= 2;
  126.  
  127. theTarget.method_1(grabTarget, "[" + grabTarget.GetRoleplay().Health + "/100]", true);
  128. }
  129. return;
  130. }
  131. }
  132. else
  133. {
  134. theAttacker.method_1(Session, "*Swings at " + msg + "'s face but fails to hit them*", true);
  135. Session.GetHabbo().method_28("This user '" + msg + "' is too far away, try gettig closer!");
  136. return;
  137. }
  138. }
  139. else
  140. {
  141. Session.GetHabbo().method_28("This user '" + msg + "' does not exists!");
  142. return;
  143. }
  144. }
  145. }
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement