Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.40 KB | None | 0 0
  1. // Rarity Server Service
  2. // Date 19.06.28
  3. prontera,130,142,4 script 守護女神 10104,{
  4. disable_items;
  5. mes "["+strnpcinfo(1)+"]";
  6. mes "你好, 請問要參加 "+.insname$+" 嗎~";
  7. if ( .CostZeny )
  8. mes "進入需要收 "+F_InsertComma(.CostZeny)+" z 的手續費哦!";
  9. next;
  10. .@party_id = getcharid(1);
  11. .@party_leader = getpartyleader(getcharid(1),2);
  12. .@char_id = getcharid(0);
  13. .@Acoount_id = getcharid(3);
  14. if ( !.@party_id ){
  15. message strcharinfo(0),"需要創建組隊才可以報名守護女神。";
  16. end;
  17. }
  18. .@OptionVar = select((.@char_id == .@party_leader)?"- 報名"+.insname$+"":"",instance_id()?"- 進入"+.insname$+"":"",(.@char_id == .@party_leader)?"- 銷毀"+.insname$+"":"","- 取消對話");
  19. switch(.@OptionVar){
  20. case 1:
  21. if ( .@party_leader != .@char_id ){
  22. message strcharinfo(0),"請隊長來與我對話。";
  23. end;
  24. }
  25. if(instance_create(.insname$) < 0) {
  26. message strcharinfo(0),""+.insname$+"副本創建失敗!";
  27. end;
  28. }
  29. 'ins_name$ = .insname$;
  30. 'party_name$ = getpartyname(getcharid(1));
  31. getpartymember getcharid(1),0;
  32. getpartymember getcharid(1),1;
  33. getpartymember getcharid(1),2;
  34. 'party_id = getcharid(1);
  35. .@partymembercount = $@partymembercount;
  36. copyarray .@partymembername$,$@partymembername$[0],.@partymembercount;
  37. copyarray .@partymembercid,$@partymembercid[0],.@partymembercount;
  38. copyarray .@partymemberaid,$@partymemberaid[0],.@partymembercount;
  39. for ( .@i = 0; .@i < .@partymembercount; .@i++ ){
  40. if ( !isloggedin(.@partymemberaid[.@i],.@partymembercid[.@i]) )
  41. continue;
  42. if ( readparam(Baselevel,.@partymembercid[.@i]) < .LevelMin )
  43. continue;
  44. if ( readparam(Baselevel,.@partymembercid[.@i]) > .LevelMax )
  45. continue;
  46. if ( 'partymembercount >= .SignupCount )
  47. continue;
  48. 'Challengelist$[getarraysize('Challengelist$)] = .@partymembername$[.@i];
  49. 'ChallengeAidlist[getarraysize('ChallengeAidlist)] = .@partymemberaid[.@i];
  50. 'partymembercount++;
  51. }
  52. mes "["+strnpcinfo(1)+"]";
  53. mes "副本初始化已完成。";
  54. end;
  55. case 2:
  56. .@index = inarray('Challengelist$,strcharinfo(0));
  57. if ( .@index == -1 ){
  58. mes "["+strnpcinfo(1)+"]";
  59. mes ""+strcharinfo(0)+"不符合挑戰規定, 禁止進入.";
  60. end;
  61. }
  62. if ( .CostZeny ){
  63. if ( Zeny < .CostZeny ){
  64. mes "["+strnpcinfo(1)+"]";
  65. mes "進入費用不足, 進入需要 "+F_InsertComma(.CostZeny)+"z.";
  66. end;
  67. }
  68. }
  69. if ( .Cooldown ){
  70. .@cooldown = GuardianGoddess-gettimetick(2)+.Cooldown;
  71. .@Hertired = (.@cooldown/3600)%60;
  72. .@Mintired = (.@cooldown/60)%60;
  73. .@Sectired = .@cooldown%60;
  74. if ( gettimetick(2) - GuardianGoddess < .@cooldown || .@cooldown > 0 ){
  75. mes "["+strnpcinfo(1)+"]";
  76. mes "- 剩餘冷卻時間 : "+(.@Hertired?""+.@Hertired+"時":"")+""+(.@Mintired?""+.@Mintired+"分":"")+""+.@Sectired+"秒";
  77. end;
  78. }
  79. }
  80. if ( 'Start ){
  81. mes "["+strnpcinfo(1)+"]";
  82. mes "副本挑戰已開始, 無法再進入.";
  83. end;
  84. }
  85. switch(instance_enter(.insname$)) {
  86. case IE_NOMEMBER: message strcharinfo(0),""+.insname$+"副本數據不存在!"; break;
  87. case IE_NOINSTANCE: message strcharinfo(0),"請先申請副本!"; break;
  88. case IE_OTHER: message strcharinfo(0),"副本場地已滿或副本數據不存在!"; break;
  89. default:
  90. if ( .Cooldown )
  91. GuardianGoddess = gettimetick(2);
  92. if ( .CostZeny )
  93. Zeny = Zeny - .CostZeny;
  94. if ( is_party_leader() == true )
  95. announce "由隊長 "+strcharinfo(0)+" 帶領的隊伍 "+getpartyname(getcharid(1))+" 進入了 "+'ins_name$+" 副本!",bc_all;
  96. break;
  97. }
  98. end;
  99. case 3:
  100. if ( instance_id() )
  101. instance_destroy;
  102. end;
  103. case 4:
  104. end;
  105. }
  106. end;
  107.  
  108. OnTimer1000:
  109. showscript "[ 守護女神 ]";
  110. initnpctimer;
  111. end;
  112. OnInit:
  113. showscript "[ 守護女神 ]";
  114. initnpctimer;
  115. // 副本名稱
  116. .insname$ = "守護女神";
  117. // 最小等級限制
  118. .LevelMin = 120;
  119. // 最大等級限制
  120. .LevelMax = 185;
  121. // 最大報名人數
  122. .SignupCount = 12;
  123. // 進入花費金錢 ( 0 : 關閉 )
  124. .CostZeny = 0;
  125. // 是否開啟冷卻時間 ( 0 : 關閉 | 填入秒數 : 開啟 )
  126. .Cooldown = 0;
  127. end;
  128. }
  129.  
  130. 1@guar,76,63,4 script 守護女神#副本 403,{
  131.  
  132. if( is_party_leader() == false )
  133. end;
  134. mes "[規則說明]";
  135. mes "^0000FF一直保護女神到最大關卡^000000";
  136. mes "^0000FF消滅每關所有出現的怪物^000000";
  137. mes " ";
  138. mes "^FF0000女神死亡的話將挑戰失敗^000000";
  139. if(select("開始挑戰","在等一下")==2) end;
  140. close2;
  141. 'Start++;
  142. set 'pid,getcharid(1);
  143. set 'mpcs,0;
  144. set 'mvpgg,0;
  145. // set 'sysfor,10;
  146. set 'gp_item,0;
  147. set 'my_level,1;
  148. set 'map$,instance_mapname("1@guar");
  149. set 'bg1,bg_monster(1,'map$,76,63,"--ja--",20559,instance_npcname(strnpcinfo(0))+"::OnMvpDead");
  150. setunitdata 'bg1,UMOB_AI,1;
  151. setunitdata 'bg1,UMOB_MASTERAID,getcharid(3);
  152. setarray 'mobid[1],1447,1446,1445,1444,1443,1442,1441,1440,1399,1115;
  153. setarray 'mobAmount[1],1,2,3,4,5,6,7,8,2,2;
  154. mapannounce 'map$,"[規則說明]: 保護女神 至 第 "+getarraysize('mobid)+" 關 全部魔物殺死 ",15,"0x00FF99";
  155. hideonnpc instance_npcname(strnpcinfo(0));
  156. donpcevent instance_npcname("守護女神#副本")+"::OnMobLoop";
  157. end;
  158.  
  159. OnMobLoop:
  160. if(!'mobid['my_level]){
  161. set 'mobid['my_level],1002;
  162. debugmes "[守護女神]: 第 "+'my_level+" 關 怪物為 NULL 系統修正為 波利";
  163. }
  164. set .@answer$,strmobinfo (2,'mobid['my_level]);
  165. mapannounce 'map$,"[守護女神]: 第 "+'my_level+" 關 已放出 "+.@answer$+"",15,"0x77DDFF";
  166. set 'mpcs,'mobAmount['my_level]*4;
  167. .@sysfor = 'mobAmount['my_level];
  168. for( .@i = 1; .@i <= .@sysfor; .@i++){
  169. set 'mob1,bg_monster (2,'map$,58,63,"--ja--",'mobid['my_level],instance_npcname(strnpcinfo(0))+"::OnMobDead");//左
  170. set 'mob2,bg_monster (2,'map$,93,64,"--ja--",'mobid['my_level],instance_npcname(strnpcinfo(0))+"::OnMobDead");//右
  171. set 'mob3,bg_monster (2,'map$,76,81,"--ja--",'mobid['my_level],instance_npcname(strnpcinfo(0))+"::OnMobDead");//上
  172. set 'mob4,bg_monster (2,'map$,76,47,"--ja--",'mobid['my_level],instance_npcname(strnpcinfo(0))+"::OnMobDead");//下
  173. if('mvpgg)
  174. end;
  175. sleep rand(300,600);
  176. if ( 'mob1 )
  177. unitwalk 'mob1,70,63;
  178. if ( 'mob2 )
  179. unitwalk 'mob2,81,64;
  180. if ( 'mob3 )
  181. unitwalk 'mob3,76,68;
  182. if ( 'mob4 )
  183. unitwalk 'mob4,76,60;
  184. }
  185. end;
  186.  
  187. OnMvpDead:
  188. set 'mvpgg,1;
  189. mapannounce 'map$,"[守關女神]: 闖關失敗 3秒後 自動傳送回城",15,"0x00FF99";
  190. killmonster 'map$,instance_npcname(strnpcinfo(0))+"::OnMobDead";
  191. initnpctimer;
  192. end;
  193.  
  194. instance_warpall "prontera",156,77;
  195. end;
  196.  
  197. OnMobDead:
  198. set 'mpcs,'mpcs-1;
  199. if('mpcs)
  200. end;
  201. set 'my_level,'my_level+1;
  202. if( 'my_level < getarraysize('mobid) ){
  203. donpcevent instance_npcname("守護女神#副本")+"::OnMobLoop";
  204. end;
  205. }
  206. getmapxy(.@map$,'x,'y,BL_PC);
  207. donpcevent instance_npcname("守護女神#副本")+"::OnInstgp";
  208. end;
  209.  
  210. Oninstgp:
  211. set 'gp_item,1;
  212. donpcevent instance_npcname("副本寶箱#guar")+"::OnGpitem";
  213. end;
  214. }
  215.  
  216. 1@guar,0,0,0 script 副本寶箱#guar 10005,{
  217.  
  218. if ( is_party_leader() == false ){
  219. showscript "請隊長與我對話。";
  220. end;
  221. }
  222.  
  223. if ( select( "領取獎勵", "取消對話" ) == 2 )
  224. end;
  225.  
  226. for ( .@i = 0; .@i < getarraysize('Reward_Chance); .@i++ )
  227. .@MaxChance += 'Reward_Chance[.@i];
  228.  
  229. for ( .@j = 0; .@j < getarraysize('ChallengeAidlist); .@j++ ){
  230. if ( !isloggedin('ChallengeAidlist[.@j]) )
  231. continue;
  232. .@chance = rand(0,.@MaxChance);
  233. for ( .@e = 0; .@e <= getarraysize('Reward_Chance); .@e++ ){
  234. .@chancev2 += 'Reward_Chance[.@e];
  235. if ( .@chance >= (.@chancev2-'Reward_Chance[.@e]) && .@chance < .@chancev2 ){
  236. getitem 'Reward_Item[.@e],'Reward_Amount[.@e],'ChallengeAidlist[.@j];
  237. break;
  238. }
  239. }
  240. }
  241.  
  242. instance_warpall "prontera",156,77;
  243. end;
  244.  
  245. OnGpitem:
  246. enablenpc instance_npcname(strnpcinfo(0));
  247. movenpc instance_npcname("副本寶箱#guar"),'x,'y;
  248. end;
  249.  
  250. OnInstanceInit:
  251. setarray 'Reward_Item,501,502,503,504,505,506,507,508,509,510;
  252. setarray 'Reward_Amount,1,2,3,4,5,6,7,8,9,10;
  253. setarray 'Reward_Chance,10,10,10,10,10,10,10,10,10,10;
  254. disablenpc instance_npcname(strnpcinfo(0));
  255. end;
  256. }
  257.  
  258. 1@guar mapflag noteleport
  259. 1@guar mapflag nosave SavePoint
  260. 1@guar mapflag nomemo
  261. 1@guar mapflag nobranch
  262. 1@guar mapflag monster_noteleport
  263. 1@guar mapflag nopenalty
  264.  
  265.  
  266. 1@guar mapflag nomvploot
  267. 1@guar mapflag nomobloot
  268. 1@guar mapflag restricted 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement