Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. prontera,158,173,4 script Party Invasion 999,{
  2. function F_PartyCreate;
  3.  
  4. mes .n$;
  5. mes "I am looking for adventures";
  6. mes "that can help me invade the";
  7. mes "monsters spreading in a small town.";
  8. next;
  9. if(select("Join the party:Maybe next time") == 2) {
  10. mes .n$;
  11. mes "Alright, I'll see you then.";
  12. close;
  13. }
  14. if(BaseLevel < .baselvl){
  15. mes .n$;
  16. mes "Your power is not enough to join the party come again when you are strong enough.";
  17. close;
  18. }
  19. if(JobLevel < .joblvl) {
  20. mes .n$;
  21. mes "The skills that you got right now is not enough to help the party.";
  22. close;
  23. }
  24. // Add the players to the list
  25. .party_list_users[getarraysize(.party_list_users)] = getcharid(0);
  26. mes "I can see that you are worthy to join our adveture of invading the monsters.";
  27. close2;
  28. donpcevent strnpcinfo(0) + "::OnCheckMembers";
  29. end;
  30.  
  31. OnCheckMembers:
  32. if(getarraysize(.party_list_users) == .register_num) {
  33. .joinable = false;
  34. for(.@a = 0; .@a < .register_num; ++.@a) {
  35. attachrid(convertpcinfo(.party_list_users[.@a],CPC_ACCOUNT),1);
  36. if(playerattached()) {
  37. .joinable = true;
  38. deletearray .party_list_users[.@a],1;
  39. end;
  40. } else { // If player is offline.
  41. .joinable = true;
  42. deletearray .party_list_users[.@a],1;
  43. end;
  44. }
  45. if(getcharid(1)) { // Attempting to remove player from its party.
  46. party_delmember(.party_list_users[.@a],getcharid(1));
  47. sleep2 50;
  48. }
  49. if(getcharid(1)) { // Cannot remove the player from the party.
  50. .joinable = true;
  51. deletearray .party_list_users[.@a],1;
  52. end;
  53. }
  54. detachrid;
  55. }
  56. // List of all members
  57. copyarray .@party_list_users, .party_list_users, .register_num;
  58. for(.@i = (.register_num)-1; .@i >= 0; --.@i) {
  59. set .@n, getarraysize(.@party_list_users);
  60. set .@temp, .@party_list_users[.@i];
  61. set .@party_list_users[.@i], .@party_list_users[.@n];
  62. set .@party_list_users[.@n], .@temp;
  63. }
  64. deletearray .party_list_users;
  65.  
  66. .@party_create = F_PartyCreate(.@party_list_users[.@i]);
  67. if(!.@party_create) {
  68. .joinable = true;
  69. end;
  70. }
  71. sleep 50;
  72. for(.@a = 1; .@a < .register_num; ++.@a)
  73. party_addmember($@party_create_id,.@party_list_users[.@a]);
  74.  
  75. warpparty .map$,0,0,.@party_list_users[.@a];
  76.  
  77. .active = false;
  78. sleep 2000;
  79. mapannounce .map$,"YOU HUMANS!! Dont learned your lessons!",bc_all,0xFFFF00;
  80. for(.@i = 0; .@i < getarraysize(.mobs); ++.@i) {
  81. monster .map$,0,0,"Monster Guardians!",.mobs[.@i],.mobs[.@i+1], strnpcinfo(0)+"::OnMobKill";
  82. }
  83. @mob_cd = 300;
  84. initnpctimer;
  85. }
  86. end;
  87.  
  88. // Triggers when 1 monster got killed.
  89. OnMobKill:
  90. --@mob_cd;
  91. mapannounce "("+@mob_cd+") Monster Guardian left in the map!",bc_map,0xFFFF00;
  92. if(!mobcount(.map$,strnpcinfo(0)+"::OnKill")) {
  93. goto OnTimer3600000;
  94. }
  95. end;
  96.  
  97. OnTimer30000:
  98. addrid(1,0,.map$);
  99. getitem 32609,10;
  100. mapannounce .map$,"Damn........ YOU HUMANS!",bc_map,0xFFFF00;
  101. stopnpctimer;
  102. .joinable = false;
  103. end;
  104.  
  105. function F_PartyCreate {
  106. detachrid;
  107. attachrid(convertpcinfo(getarg(0),CPC_ACCOUNT),1);
  108. switch(party_create("MonsterInvasion",getarg(0),1)) {
  109. case 0: debugmes "Unknown Error."; break;
  110. case -1: debugmes "Player not found."; break;
  111. case -2: debugmes "Player already has a party."; break;
  112. case -3: debugmes "Party name exists."; break;
  113. default:
  114. sleep 1000;
  115. return $@party_create_id;
  116. }
  117. return 0;
  118. }
  119.  
  120. OnInit:
  121. .n$ = "[Party Invasion]";
  122. .baselvl = 500;
  123. .joblvl = 200;
  124. .register_num = 2;
  125. .map$ = "06guild_01";
  126. setarray .mobs,1002,20,1113,20,1613,20,1031,20,1242,20,1096,1;
  127. end;
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement