Advertisement
plugandplaydev

PvP Points v1.8

May 19th, 2015
661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. - script mypvppoints -1,{
  2. OnInit:
  3. bindatcmd "pvppoints",strnpcinfo(3)+"::OnAtcommand";
  4. end;
  5. OnAtcommand:
  6. dispbottom "[ PvP Points ] : Your PvP Points: "+PvPPoints;
  7. end;
  8.  
  9. }
  10.  
  11. - script check player -1,{
  12. OnPCLoginEvent:
  13. if(!PvPPoints) { PvPPoints = 0; PvPWarning = 0; }
  14. end;
  15. }
  16.  
  17. - script PvPPointTimer -1,{
  18. OnTimerStart:
  19. sleep2 90000;
  20. PvPFlag = 0;
  21. end;
  22. }
  23.  
  24. - script PvP Points -1,{
  25. OnPCKillEvent:
  26. for (set @i,0; @i < getarraysize(.Open_Maps$); set @i,@i+1)
  27. if( strcharinfo(3) == .Open_Maps$[@i] ) {
  28. if(PvPFlag && (killedrid == PrevKilled)) {
  29. PvPWarning += 1;
  30. if(PvPWarning >= .cons_kill_count) {
  31. PvPPoints -= .deducted_points;
  32. callsub L_PointCheck,PvPPoints;
  33. dispbottom "You've lost "+.deducted_points+" PvP Points.";
  34. dispbottom "You now have "+PvPPoints+" Points.";
  35. PvPWarning = 0;
  36. callsub Timer;
  37. }
  38. PvPPoints += .added_points;
  39. dispbottom "You've been awarded "+.added_points+" PvP Point.";
  40. dispbottom "You now have "+PvPPoints+" Points.";
  41. Timer:
  42. awake "PvPPointTimer";
  43. PvPFlag = 1;
  44. doevent "PvPPointTimer::OnTimerStart";
  45. end;
  46. }
  47. if ( killedrid == getcharid(3) ) {
  48. PvPPoints -= .deducted_points;
  49. callsub L_PointCheck,PvPPoints;
  50. dispbottom "You've lost "+.deducted_points+" PvP Point.";
  51. dispbottom "You now have "+PvPPoints+" Points.";
  52. end;
  53. }
  54.  
  55. callsub AddPoint;
  56. attachrid(killedrid);
  57. PvPPoints -= .deducted_points;
  58. callsub L_PointCheck,PvPPoints;
  59. dispbottom "You've lost "+.deducted_points+" PvP Point.";
  60. dispbottom "You now have "+PvPPoints+" Points.";
  61. detachrid;
  62. AddPoint:
  63. PvPPoints += .added_points;
  64. dispbottom "You've been awarded "+.added_points+" PvP Point.";
  65. dispbottom "You now have "+PvPPoints+" Points.";
  66. PrevKilled = killedrid;
  67. PvPFlag = 1;
  68. doevent "PvPPointTimer::OnTimerStart";
  69. end;
  70.  
  71. L_PointCheck:
  72. if(getarg(0) < 0) PvPPoints = 0;
  73. return;
  74. end;
  75. }
  76.  
  77. OnInit:
  78. // Put the map you want to enable the PvP Points ( only for Option 1 )
  79. setarray .Open_Maps$[0],"izlude","geffen","morocc","prontera";
  80. set .cons_kill_count,5; // count consecutive kill in the same player ( Default 5 )
  81. set .deducted_points,30; // deducted points in killing the same player ( Default 5 )
  82. set .added_points,3; // Added Points when killing ( Default 3 )
  83. end;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement