Advertisement
Guest User

Untitled

a guest
Jan 24th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.52 KB | None | 0 0
  1. /*==========================================================================
  2. - 腳本名稱: 尋寶活動- Ver 0.4
  3. - 腳本作者: 貓薄荷
  4. - 測試環境:RAthenaCN
  5. - 更新內容:
  6. - Ver 0.1 2018-11-03 -初步完成
  7. - Ver 0.2 2018-11-03 -改用事件語法開關地圖pvp,並增加事件再次執行時移除上一輪事件中遺留的npc
  8. - Ver 0.3 2018-11-03 -增設多項獎勵設置,開關與否,隨機領取幾次物品
  9. - Ver 0.4 2018-11-05 -增加end結尾,每次執行'$@prt_map$'地圖調適問題已解決
  10.  
  11. - 注意事項: 腳本僅供,程式語言研究,學術研究用途
  12. ============================================================================
  13. ============================================================================*/
  14.  
  15. - script auto_ptr -1,{
  16. end;
  17.  
  18. /* 這裡增設時間 */
  19. OnClock9000:
  20. OnClock1500:
  21. OnClock2100:
  22. hideonnpc "寶藏#"+$@prt_map$[$maprand]+"";
  23. if($openpvp) pvpoff ""+$@prt_map$[$maprand]+"";
  24. donpcevent "Explorer"+"::OnStart";
  25. end;
  26.  
  27. Oninit:
  28. /* 如果有新增寶藏地點請在這裡增設地圖名稱 */
  29. setarray $@prt_map$[1],"prontera","morocc","geffen","payon","auda_city1";
  30. setarray $Chin_ap$[1],"普隆德拉","夢羅克","吉芬","斐陽","彩虹之都";
  31. set $mpaquantity,5; //地圖數量
  32.  
  33. /* 這裡設定相關獎勵&次數 */
  34. set $all,5; //最多連續幾次尋寶事件
  35. set $item,38043; //獎品ID
  36. set $count,1; //獲得數量
  37. set $Tzeny,1; //是否可以領取Zeny
  38. set $gzeny,1500000; //可以領取多少Zeny
  39. set $opensecond,10; //開啟寶箱所需要的秒數
  40. set $openpvp,1; //開啟寶箱時是否開啟PK模式
  41. set $Buyintelligence,3000000; //購買情報所需要的zeny
  42.  
  43. /* [多獎勵設置]多項獎勵的公告預設為當前寶藏地圖公告避免洗頻 */
  44. set $Mass,1; //是否開啟多獎品
  45. set $gifitem,3; //可以隨機領取幾次獎品
  46. /* 設置獎品 */
  47. setarray $@ReCardA[1],12817,12246,12264,12263,61008,61009,61010,12412,7650,38007,38008,38009,30060,61005,61006,38013,38014,38015,38016,38018,38019,984,985,6223,6224,38004,16263,16262,6228,6232,22687,22702,22703,22704,22705,22706,22707,7621,6438,6439,7776;
  48. set $Massreward,41; //多項獎勵的數量
  49. /* */
  50. end;
  51. }
  52.  
  53. /* 如果你要增/減 寶藏地點請在這裡修改 新增完NPC請務必在這裡補上NPCID */
  54. prontera,0,0,4 script 寶藏#prontera 10005,{ callfunc "Treasure_Open"; end; Oninit: hideonnpc "寶藏#prontera"; end; }
  55. morocc,0,0,4 script 寶藏#morocc 10005,{ callfunc "Treasure_Open"; end; Oninit: hideonnpc "寶藏#morocc"; end; }
  56. geffen,0,0,4 script 寶藏#geffen 10005,{ callfunc "Treasure_Open"; end; Oninit: hideonnpc "寶藏#geffen"; end; }
  57. payon,0,0,4 script 寶藏#payon 10005,{ callfunc "Treasure_Open"; end; Oninit: hideonnpc "寶藏#payon"; end; }
  58. auda_city1,0,0,4 script 寶藏#auda_city1 10005,{ callfunc "Treasure_Open"; end; Oninit: hideonnpc "寶藏#auda_city1"; end; }
  59.  
  60. /* 分 隔 線 */
  61.  
  62. auda_city1,97,103,4 script 探險者協會 641,{
  63.  
  64. set .@open,select(getgmlevel()>=90?" ^7700BB- GM - 開啟尋寶系統^000000 ":""
  65. ,$Start!=$all?" ^7700BB- GM - 直接到寶藏地點^000000 ":""
  66. ,$Start!=$all?" - 我要準確的'座標'!! ^7700BB["+$Buyintelligence+" Zeny]^000000 ":""
  67. ," - 請問探險者協會是幹甚麼的?");
  68.  
  69. if(.@open==1){
  70. dispbottom "[ 書記官 ]: 收到!! 尋寶系統將在7秒後執行。";
  71. hideonnpc "寶藏#"+$@prt_map$[$maprand]+"";
  72. if($openpvp) pvpoff ""+$@prt_map$[$maprand]+"";
  73. donpcevent "Explorer"+"::OnStart";
  74. end;
  75. }
  76. else
  77.  
  78. if(.@open==2){
  79. warp ""+$@prt_map$[$maprand]+"",$Treasure_x,$Treasure_y;
  80. end;
  81. }
  82. else
  83.  
  84. if(.@open==3){
  85. if(zeny<=$Buyintelligence){ showscript " - Zeny 不足 !!"; end; }
  86. set zeny,zeny-$Buyintelligence;
  87. dispbottom "[ 書記官 ]: 地點在 "+$Chin_ap$[$maprand]+" , "+$Treasure_x+" , "+$Treasure_y+"";
  88. end;
  89. }
  90. else
  91.  
  92. if(.@open==4){
  93. mes "^0088FF[ "+strnpcinfo(0)+" ]^000000";
  94. mes " ";
  95. mes "/*在此寫上自己的說明*/";
  96. end;
  97. }
  98. end;
  99. OnInit:
  100. waitingroom " 探險者協會",0;
  101. end;
  102. }
  103.  
  104. function script Treasure_Open {
  105.  
  106. if($openpvp) pvpon ""+$@prt_map$[$maprand]+"";
  107. if($openpvp) mapannounce ""+$@prt_map$[$maprand]+"","[ 探險者協會 公告 ]: 好像有人正在開啟寶箱,這個人"+$opensecond+"秒內肯定無法移動快去把他找出來!! -開啟PVP公告- [寶箱開啟前PK領域不會消失]",bc_map,"0xFFFF00";
  108. if(!$openpvp) mapannounce ""+$@prt_map$[$maprand]+"","[ 探險者協會 公告 ]: 有人正在觸碰寶箱 !! 形勢變的緊張起來了..",bc_map,"0xffff00";
  109. message strcharinfo(0),"開鎖中.."+$opensecond+"秒內請勿移動..";
  110. progressbar "ffff00",$opensecond;
  111. set $Start,$Start+1;
  112. if($Mass)
  113. {
  114. set .@Re,$gifitem;
  115. for(.@i=0; .@i<.@Re; .@i++){
  116. set .@RegA,rand(1,$Massreward);
  117. getitem $@ReCardA[.@RegA],1; mapannounce ""+$@prt_map$[$maprand]+"","[ 探險者協會 公告 ]: 恭喜玩家 [ "+strcharinfo(0)+" ] 找到了這次的寶藏,取得 "+getitemname($@ReCardA[.@RegA])+" x 1",bc_map,"0xFFFF00"; //if(.@RegA <= $Massreward){}
  118. }//for
  119. }
  120. getitem $item,$count;
  121. announce "[ 探險者協會 公告 ]: 恭喜玩家 [ "+strcharinfo(0)+" ] 找到了這次的寶藏,取得 "+getitemname($item)+" x "+$count+"",15;
  122. if($Tzeny) set Zeny,zeny+$gzeny; dispbottom "[ 寶藏 ]: 獲得了 "+$gzeny+" Zeny.";
  123. if($openpvp) pvpoff ""+$@prt_map$[$maprand]+"";
  124. hideonnpc "寶藏#"+$@prt_map$[$maprand]+"";
  125. if($Start>=$all) callsub OnOFF;
  126. else donpcevent "Explorer"+"::OnStart";
  127. end;
  128.  
  129. OnOFF:
  130. announce "[ 探險者協會 公告 ]: 這次的尋寶結束了 感謝各位的參與。",15;
  131. end;
  132. }
  133.  
  134. - script Explorer -1,{
  135.  
  136. OnStart:
  137.  
  138. if($Start==$all){ set $Start,rand(0,($all-1)); }
  139. $maprand=rand(1,$mpaquantity);
  140. do {
  141. set .@p,.@p+1;
  142. set .@g1,bg_monster (0,$@prt_map$[$maprand],0,0,"隨機座標",2328);
  143. sleep 7000;
  144. if(.@g1>0){
  145. getunitdata .@g1,.@array;
  146. MobRemove .@g1;
  147. }
  148. if(.@p>30) { announce "設置有誤 請通知GM",15; end; }
  149. } while (.@array[6]==0 && .@array[7]==0);
  150. $Treasure_x=.@array[6];
  151. $Treasure_y=.@array[7];
  152. hideoffnpc "寶藏#"+$@prt_map$[$maprand]+"";
  153. movenpc "寶藏#"+$@prt_map$[$maprand]+"",.@array[6],.@array[7];
  154. announce "[ 探險者協會 公告 ]: 在 "+$Chin_ap$[$maprand]+" 出現了寶藏的氣息,想尋寶的人請盡快前往 !!",15;
  155.  
  156. /*啟用時砍這行*/
  157. //announce " [ Test公告 ] 地點: "+$@prt_map$[$maprand]+","+.@array[6]+","+.@array[7]+"",15;
  158.  
  159. end;
  160.  
  161. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement