Guest User

Untitled

a guest
Mar 8th, 2014
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.37 KB | None | 0 0
  1. /**
  2. * Dieing
  3. **/
  4.  
  5. public void applyDead() {
  6. c.respawnTimer = 15;
  7. c.isDead = false;
  8. if(c.duelStatus != 6) {
  9. c.killerId = findKiller();
  10. Client o = (Client) PlayerHandler.players[c.killerId];
  11. if(o != null && (c.killerId != c.playerId)) {
  12. o.specAmount = 10;
  13. o.getItems().addSpecialBar(o.playerEquipment[o.playerWeapon]);
  14. o.sendMessage("Your special attack refills completely!");
  15. o.cStreak += 1;
  16. o.getPA().sendFrame126("@whi@Current Kill Streak: @bla@(@red@" + o.cStreak + "@bla@)", 7334);
  17. if (o.cStreak >= 3) {
  18. for (int j = 0; j < PlayerHandler.players.length; j++) {
  19. if (PlayerHandler.players[j] != null) {
  20. Client c2 = (Client)PlayerHandler.players[j];
  21. c2.sendMessage("@blu@[Killstreak] @red@"+o.playerName+" just killed @blu@"+c.playerName+"@red@ and is on a "+o.cStreak+" killstreak");
  22. }
  23. }
  24. }
  25. if(o.cStreak > o.hStreak) {
  26. o.sendMessage("Congratulations, your Highest kill streak has increased!");
  27. o.hStreak = o.cStreak;
  28. o.getPA().sendFrame126("@whi@Highest Kill Streak: @bla@(@red@" + o.hStreak + "@bla@)", 7333);
  29. }
  30. if(!o.inPits){
  31. if(o.killsThisMinute <= 2){
  32. if(o.cantGetKills == 0){
  33. if(c.playerId != o.playerId){
  34. if(!c.inPits && !c.inFunPk()){
  35. if (c.pkPoints > 10){
  36. //c.getItems().addItem(c.randomStatues(), 1);
  37. c.pkPoints = (c.pkPoints - 1);
  38. c.sendMessage("You now have "+c.pkPoints+" PK Points. @red@(-1)");
  39. }
  40.  
  41. if (c.pkPoints <=10){
  42. c.sendMessage("@red@You lose no points because you only have "+c.pkPoints+" PK Points.");
  43. }
  44. c.DC++;
  45.  
  46. } else if(c.inFunPk()) {
  47. c.sendMessage("You were killed in FunPK so you don't lose any PK Points.");
  48. } else if(c.inPits) {
  49. c.sendMessage("@red@You receive no penalty for dying in Fight Pits.");
  50. }
  51. String a = ""+o.connectedFrom+"";
  52. String b = ""+c.connectedFrom+"";
  53.  
  54. if(o.playerKilled != c.playerId && o.lastKilled != Server.playerHandler.players[c.playerId].connectedFrom){
  55. o.KC++;
  56. //if(o.hasRegistered == 1)
  57. //o.updateStats();
  58. //else if(o.hasRegistered != 1)
  59. //o.sendMessage("@red@Type @blu@::register @red@and compare your k/d with friends in the new highscores!");
  60.  
  61. o.killsThisMinute++;
  62. o.playerKilled = c.playerId;
  63. if (!o.inFunPk()){
  64.  
  65. if(c.playerId == o.myTarget){
  66. if (!a.equals(b)){
  67. o.sendMessage("@blu@You gain 1 target point for killing your target! ");
  68. o.sendMessage("@blu@You gain 5 extra PK Points for killing your target!");
  69. o.pkPoints += 5;
  70. o.targetPoints += 1;
  71. o.totalTargetPoints += 1;
  72. //c.getItems().addItem(c.randomStatues(), 1);
  73.  
  74.  
  75. c.myTarget = -1;
  76. o.myTarget = -1;
  77. c.target = 0;
  78. o.target = 0;
  79. o.getPA().createPlayerHints(10, -1);
  80. c.getPA().createPlayerHints(10, -1);
  81. o.targetName = "None";
  82. c.targetName = "None";
  83. o.findTarget();
  84. c.findTarget();
  85. }
  86. if (a.equals(b)){
  87. o.sendMessage("@blu@You gained nothing from your kill and your target was reset.");
  88. c.myTarget = -1;
  89. o.myTarget = -1;
  90. c.target = 0;
  91. o.target = 0;
  92. o.getPA().createPlayerHints(10, -1);
  93. c.getPA().createPlayerHints(10, -1);
  94. o.targetName = "None";
  95. c.targetName = "None";
  96. o.findTarget();
  97. c.findTarget();
  98. }
  99. }
  100.  
  101. if(o.memberStatus == 2){
  102. if (!a.equals(b)){
  103. o.pkPoints = (o.pkPoints + 6);
  104. o.sendMessage("@red@Super Donator bonus: @blu@(+6 PK points)");
  105. //c.getItems().addItem(c.randomStatues(), 1);
  106. }
  107. if (a.equals(b)){
  108. c.sendMessage("You didn't gain any PKP for that kill.");
  109. }
  110. }
  111. if(o.memberStatus == 1){
  112. if (!a.equals(b)){
  113. o.pkPoints = (o.pkPoints + 5);
  114. o.sendMessage("@red@Super Donator bonus: @blu@(+5 PK points)");
  115. //c.getItems().addItem(c.randomStatues(), 1);
  116. }
  117. if (a.equals(b)){
  118. c.sendMessage("You didn't gain any PKP for that kill.");
  119. }
  120. }
  121. if(o.isTraining){
  122. if (!a.equals(b)){
  123. o.pkPoints = (o.pkPoints + 10);
  124. o.sendMessage("@red@Training account: @blu@(+10 PK points)");
  125. //c.getItems().addItem(c.randomStatues(), 2);
  126. }
  127. if (a.equals(b)){
  128. c.sendMessage("You didn't gain any PKP for that kill.");
  129. }
  130. }
  131. if(o.memberStatus == 3){
  132. if (!a.equals(b)){
  133. o.pkPoints = (o.pkPoints + 7);
  134. o.sendMessage("@red@Donator bonus: @blu@(+7 PK points)");
  135. //c.getItems().addItem(c.randomStatues(), 2);
  136. }
  137. if (a.equals(b)){
  138. c.sendMessage("You didn't gain any PKP for that kill.");
  139. }
  140. }
  141. if(o.memberStatus == 0){
  142. if (!a.equals(b)){
  143. o.pkPoints = (o.pkPoints + 5);
  144. //c.getItems().addItem(c.randomStatues(), 1);
  145. o.sendMessage("@blu@(+5 PK points)");
  146. }
  147. if (a.equals(b)){
  148. c.sendMessage("You didn't gain any PKP for that kill.");
  149. }
  150. }
  151.  
  152.  
  153. if(!o.isInHighRiskPK()){
  154. o.pkPoints = (o.pkPoints + 10);
  155. o.sendMessage("@red@You now have "+o.pkPoints+" PK Points. @blu@(+10 PK points)");
  156. } else {
  157. o.pkPoints = (o.pkPoints + 10);
  158. o.sendMessage("@red@You now have "+o.pkPoints+" PK Points. @blu@(+5 PK points)");
  159. }
  160. }
  161.  
  162. if (o.inFunPk()){
  163. o.pkPoints = (o.pkPoints + 1);
  164. if(o.memberStatus <= 1){
  165. o.sendMessage("@red@You gain 1 PK Point because you were in FunPK!");
  166. o.sendMessage("@red@You now have "+o.pkPoints+" PK Points. @blu@(+1 PK points)");
  167. } else if(o.memberStatus >= 2){
  168. o.pkPoints = (o.pkPoints + 1);
  169. o.sendMessage("@red@You gain 2 PK Points for being a Super Donor in FunPK!");
  170. o.sendMessage("@red@You now have "+o.pkPoints+" PK Points. @blu@(+2 PK points)");
  171. }
  172. }
  173. o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom;
  174.  
  175. } else {
  176. o.sendMessage("@red@You gain no PK points.");
  177. }
  178. }
  179. } else {
  180. o.sendMessage("@red@You have been blocked from recieving PK Points for 1 hour.");
  181. c.playerKilled = c.playerId;
  182. c.DC++;
  183. c.pkPoints = (c.pkPoints - 1);
  184. c.sendMessage("@red@You now have "+c.pkPoints+" PK Points. (-1)");
  185. }
  186. } else {
  187. c.DC++;
  188. c.pkPoints = (c.pkPoints - 1);
  189. c.sendMessage("@red@You now have "+c.pkPoints+" PK Points. (-1)");
  190. o.cantGetKills = 1;
  191. o.cantGetKillsTimer = 3600;
  192. o.sendMessage("@red@You have been blocked from recieving PK Points for 1 hour.");
  193. }
  194. } else {
  195. o.sendMessage("@red@You now have "+o.pkPoints+" PK Points. (+4)");
  196. o.pkPoints = (o.pkPoints + 4);
  197. //o.pitsPoints = (o.pitsPoints + 1);
  198. //o.sendMessage("@red@You now have "+o.pitsPoints+" Pits Points. (+1)");
  199. //o.sendMessage("@red@Fight pits PK point bonus is temporarily disabled!");
  200. }
  201.  
  202. if(o.duelStatus == 5) {
  203. o.duelStatus++;
  204. }
  205. }
  206. }
  207. c.faceUpdate(0);
  208. c.npcIndex = 0;
  209. c.playerIndex = 0;
  210. c.stopMovement();
  211. if(c.duelStatus <= 4) {
  212. if (c.redSkull == true) {
  213. return;
  214. }
  215. c.sendMessage("Oh dear you are dead!");
  216. c.cStreak = 0;
  217. c.getPA().sendFrame126("@whi@Current Kill Streak: @bla@(@red@" + c.cStreak + "@bla@)", 7334);
  218. //MYSQL.updateKD(c.KC, c.DC, c.playerName);
  219. } else if(c.duelStatus != 6) {
  220. c.sendMessage("You have lost the duel!");
  221. }
  222. resetDamageDone();
  223. c.specAmount = 10;
  224. c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]);
  225. c.lastVeng = 0;
  226. c.vengOn = false;
  227. c.doubleHit = false;
  228. c.usingClaws = false;
  229. resetFollowers();
  230. c.attackTimer = 10;
  231. }
  232.  
  233. public void resetDamageDone() {
  234. for (int i = 0; i < PlayerHandler.players.length; i++) {
  235. if (PlayerHandler.players[i] != null) {
  236. PlayerHandler.players[i].damageTaken[c.playerId] = 0;
  237. }
  238. }
  239. }
Advertisement
Add Comment
Please, Sign In to add comment