Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.39 KB | None | 0 0
  1. function script is_party_leader {
  2. if ( !getcharid(1) )
  3. return False;
  4. if ( getcharid(0) == getpartyleader(getcharid(1),2) )
  5. return True;
  6. else
  7. return False;
  8. }
  9.  
  10. function script F_instanceinfo {
  11. disable_items;
  12. .@cooldown = getd("cooldown"+getarg(8))-gettimetick(2)+getarg(7);
  13. .@Hertired = (.@cooldown/3600)%60;
  14. .@Mintired = (.@cooldown/60)%60;
  15. .@Sectired = .@cooldown%60;
  16. if ( !getcharid(1) ){
  17. mes "["+getarg(0)+"]";
  18. mes "需要組隊才能與我對話。";
  19. end;
  20. }
  21. mes "["+getarg(0)+"]";
  22. mes "- 副本名稱 : "+getarg(1)+"";
  23. if ( getarg(3) != 185 ) mes "- 等級限制 : "+getarg(2)+" ~ "+getarg(3)+" 等間可進入.";
  24. if ( getarg(3) == 185 ) mes "- 等級限制 : "+getarg(2)+" 等以上可進入.";
  25. if ( getarg(4)+getarg(5) > 2 ) mes "- 組隊人數 : "+getarg(4)+" ~ "+getarg(5)+" 人間可申請.";
  26. if ( getarg(4)+getarg(5) <= 2 ) mes "- 組隊人數 : 僅 "+getarg(4)+" 人可申請.";
  27. if ( ( getarg(6) % 60 ) == 0 ) mes "- 挑戰時間 : "+((getarg(6)/60)/60)+" 小時";
  28. if ( ( getarg(6) % 60 ) != 0 ) mes "- 挑戰時間 : "+((getarg(6)/60)/60)+" 小時 "+(getarg(6)%60)+" 分";
  29. if ( ( getarg(7) % 60 ) == 0 ) mes "- 冷卻時間 : "+((getarg(7)/60)/60)+" 小時";
  30. if ( ( getarg(7) % 60 ) != 0 ) mes "- 冷卻時間 : "+((getarg(7)/60)/60)+" 小時 "+(getarg(7)%60)+" 分";
  31. if ( .@cooldown > 0 ) mes "- 剩餘冷卻時間 : "+.@Hertired+"時"+.@Mintired+"分"+.@Sectired+"秒";
  32. return;
  33. }
  34.  
  35. function script F_instancemenu {
  36. disable_items;
  37. .@inst_id = instance_id(1);
  38. if ( is_party_leader(getcharid(1)) ){
  39. switch(select((.@inst_id?"":"> 創建"+getarg(1)+"副本"),(!.@inst_id?"":"> 進入"+getarg(1)+"副本"),(!.@inst_id?"":"> 銷毀副本"),"> 取消對話")){
  40. case 1:
  41. return 1;
  42. case 2:
  43. return 2;
  44. case 3:
  45. return 3;
  46. case 4:
  47. end;
  48. }
  49. return 0;
  50. } else {
  51. switch(select((!.@inst_id?"":"> 進入"+getarg(1)+"副本"),"> 取消對話")){
  52. case 1:
  53. return 2;
  54. case 2:
  55. end;
  56. }
  57. }
  58. return 0;
  59. }
  60.  
  61. function script F_instancecreat {
  62. disable_items;
  63. if(instance_create(getarg(1)) < 0) {
  64. message strcharinfo(0),""+getarg(1)+"副本創建失敗!";
  65. end;
  66. }
  67. 'ins_name$ = getarg(1);
  68. 'party_id = getcharid(1);
  69. deletearray 'Ip_Reward$;
  70. deletearray 'Ip_Reward2$;
  71. end;
  72. }
  73.  
  74. function script F_instancequest {
  75. disable_items;
  76. if ( getarg(0) == "吉芬魔法大賽" ){
  77. for(set .@i,9284; .@i <= 9307; set .@i,.@i+1)
  78. if(checkquest(.@i) > -1) erasequest .@i;
  79. }
  80. if ( getarg(0) == "古代的克雷斯特漢姆古城" || getarg(0) == "古代的克雷斯特漢姆(困難)" ){
  81. if (checkquest(12318) > -1) erasequest 12318;
  82. if (checkquest(12319) > -1) erasequest 12319;
  83. if (checkquest(12318) == -1) setquest 12318;
  84. if (checkquest(12319) == -1) setquest 12319;
  85. }
  86. return;
  87. }
  88.  
  89. function script F_instancenter {
  90. disable_items;
  91. // 冷卻計算
  92. .@cooldown = getd("cooldown"+getarg(4))-gettimetick(2)+getarg(5);
  93. .@Hertired = (.@cooldown/3600)%60;
  94. .@Mintired = (.@cooldown/60)%60;
  95. .@Sectired = .@cooldown%60;
  96. if ( 'ClearInatance ){
  97. mes "["+getarg(0)+"]";
  98. mes "副本已經完成, 不可以在進入。";
  99. end;
  100. }
  101. if( gettimetick(2) - getd("cooldown"+getarg(4)) < .@cooldown || .@cooldown > 0 ){;
  102. mes "["+getarg(0)+"]";
  103. mes "‧ 剩餘冷卻時間 : "+.@Hertired+"時"+.@Mintired+"分"+.@Sectired+"秒";
  104. end;
  105. }
  106. // 副本進入
  107. switch(instance_enter(getarg(1))) {
  108. case 2: message strcharinfo(0),""+getarg(1)+"副本數據不存在!"; break;
  109. case 1: message strcharinfo(0),"請先申請副本!"; break;
  110. case 3: message strcharinfo(0),"副本場地已滿或副本數據不存在!"; break;
  111. default:
  112. // 冷卻設置
  113. setd("cooldown"+getarg(4)),gettimetick(2);
  114. // 賦予任務
  115. F_instancequest(getarg(1));
  116. break;
  117. }
  118. end;
  119. }
  120.  
  121. function script F_instancedestroy {
  122. disable_items;
  123. if ( instance_id() ) instance_destroy;
  124. return;
  125. }
  126.  
  127. function script F_GetInstancePrize {
  128. disable_items;
  129.  
  130. if( !instance_id() )
  131. end;
  132.  
  133. if( getarg(1) != getcharid(1) )
  134. return;
  135.  
  136. setarray .@in$,"魔物終結塔","封印的神殿","獸人的記憶","尼德霍格的巢穴","排水溝(簡單)","排水溝(困難)","章魚洞穴","噩夢死神","寶箱巨鱷","食月暴龍湖","古代的克雷斯特漢姆古城","驚駭森靈巢穴","中央實驗室","劍士之途";
  137. setarray .@item_id,501,501;
  138. setarray .@item_cnt,1,2;
  139.  
  140. query_sql("SELECT `last_ip` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'",.@Last_ip$);
  141.  
  142. for ( .@i = 0; .@i < getarraysize('Ip_Reward$); .@i++ )
  143. if ( 'Ip_Reward$[.@i] == .@Last_ip$ )
  144. .@index = 1;
  145.  
  146. for ( .@i = 0; .@i < getarraysize('Ip_Reward2$); .@i++ )
  147. if ( 'Ip_Reward2$[.@i] == .@Last_ip$ )
  148. .@index2 = 1;
  149.  
  150. if ( !.@index || !.@index2 ){
  151. 'Reward$[getarraysize('Reward$)] = strcharinfo(0);
  152. if ( !.@index )
  153. 'Ip_Reward$[getarraysize('Ip_Reward$)] = .@Last_ip$;
  154. else
  155. 'Ip_Reward2$[getarraysize('Ip_Reward2$)] = .@Last_ip$;
  156. for ( .@i = 0; .@i < getarraysize(.@in$); .@i++ )
  157. if ( .@in$[.@i] == 'ins_name$ )
  158. .@idx = .@i;
  159. if ( .@item_id[.@idx] && .@item_cnt[.@idx] ){
  160. getitem .@item_id[.@idx],.@item_cnt[.@idx];
  161. dispbottom "[ 副本公告 ] 恭喜你通過了 "+.@in$[.@idx]+"副本, 獲得了 "+getitemname(.@item_id[.@idx])+"。",0xFFFAFA;
  162. }
  163. return;
  164. } else
  165. dispbottom "[ 副本公告 ] 檢測到 "+.@Last_ip$+" 與隊伍內有位成員一致, 故將您傳出副本。",0xFFFAFA;
  166. return;
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement