Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.34 KB | None | 0 0
  1. /*
  2.  
  3. add to item_db2.sql
  4.  
  5. // Mining Pickaxe
  6. INSERT INTO `item_db2` VALUES (3500, 'Pickaxe_', 'Pickaxe', 4, 30000, NULL, 100, NULL, 0, NULL, 0, 4294967295, 7, 2, 128, NULL, 0, 0, 0, NULL, NULL, NULL),
  7. INSERT INTO `item_db2` VALUES (3501, 'Super_Pickaxe_', 'Super Pickaxe', 4, 30000, NULL, 100, NULL, 0, NULL, 0, 4294967295, 7, 2, 128, NULL, 0, 0, 0, NULL, NULL, NULL);
  8.  
  9. // Energy Potion
  10. // Description : Restores Energy by 5
  11. INSERT INTO `item_db2` VALUES (3503,'S_Energy_Potion','Small Energy Potion',0,50,NULL,70,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'set #ENERGY, #ENERGY+5; if ( #ENERGY > #MAX_ENERGY ) set #ENERGY, #MAX_ENERGY; callfunc "energy_check"; specialeffect2 EF_HEAL;',NULL,NULL);
  12.  
  13. // Description : Restores Energy by 10
  14. INSERT INTO `item_db2` VALUES (3504,'M_Energy_Potion','Medium Energy Potion',0,50,NULL,70,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'set #ENERGY, #ENERGY+10; if ( #ENERGY > #MAX_ENERGY ) set #ENERGY, #MAX_ENERGY; callfunc "energy_check"; specialeffect2 EF_HEAL;',NULL,NULL);
  15.  
  16. // Description : Restores Energy by 15
  17. INSERT INTO `item_db2` VALUES (3505,'L_Energy_Potion','Large Energy Potion',0,50,NULL,70,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'set #ENERGY, #ENERGY+15; if ( #ENERGY > #MAX_ENERGY ) set #ENERGY, #MAX_ENERGY; callfunc "energy_check"; specialeffect2 EF_HEAL;',NULL,NULL);
  18.  
  19. // Description : Restores Energy to full
  20. INSERT INTO `item_db2` VALUES (3506,'F_Energy_Potion','Full Energy Potion',0,50,NULL,70,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'set #ENERGY, #MAX_ENERGY; callfunc "energy_check"; specialeffect2 EF_HEAL;',NULL,NULL);
  21.  
  22.  
  23. === Normal Pickaxe Drop rates
  24. Oridecon 70%
  25. Elunium 70%
  26. Bradium 50%
  27. Carnium 50%
  28. HD Carnium 20%
  29. HD Bradium 20%
  30. HD Oridecon 20%
  31. HD Elunium 20%
  32. Enriched Oridecon 10%
  33. Enriched Elunium 10%
  34. Charcoal - Replace to Black Magic Stone 10%
  35. Cursed Magical Stone 10%
  36. ** 5 Seconds mining time
  37. ** 20% chance no energy consume
  38.  
  39. == Donate Pickaxe Drop rates (+10%)
  40. Oridecon 80%
  41. Elunium 80%
  42. Bradium 60%
  43. Carnium 60%
  44. HD Carnium 30%
  45. HD Bradium 30%
  46. HD Oridecon 30%
  47. HD Elunium 30%
  48. Enriched Oridecon 20%
  49. Enriched Elunium 20%
  50. Charcoal - Replace to Black Magic Stone 20%
  51. Cursed Magical Stone 20%
  52. ** 2 Seconds mining time
  53. ** 50% chance no energy consume
  54.  
  55. */
  56.  
  57. function script energy_check {
  58. dispbottom "Current Energy : [ "+#ENERGY+" / "+#MAX_ENERGY+" ]", 0x06e5ff;
  59. return;
  60. }
  61.  
  62. - script Energy_System -1,{
  63. OnInit:
  64. // How much energy will player gain?
  65. .gain_energy = 1;
  66.  
  67. // @energy to check your current energy..
  68. bindatcmd "energy", strnpcinfo(0)+"::OnCheckEnergy";
  69.  
  70. // Initial energy.
  71. .energy = 50;
  72.  
  73. initnpctimer;
  74. end;
  75.  
  76. OnPCLogoutEvent:
  77. #LOGOUT_ENERGY = gettimetick(2);
  78. end;
  79.  
  80. OnPCLoginEvent:
  81. if ( #MAX_ENERGY != .energy ) #MAX_ENERGY = .energy;
  82. if ( #LOGOUT_ENERGY ) {
  83. .@time = gettimetick(2) - #LOGOUT_ENERGY;
  84. if ( .@time > 3600 * 2 ) {
  85. .@gain = .@time / 3600 * 2;
  86. #ENERGY += .@gain;
  87. if ( #ENERGY >= #MAX_ENERGY ) #ENERGY = #MAX_ENERGY;
  88. }
  89. }
  90. OnCheckEnergy:
  91. energy_check;
  92. end;
  93.  
  94. OnTimer120000:
  95. foreachinserver strnpcinfo(0)+"::OnSGainCheck";
  96. setnpctimer 0;
  97. end;
  98.  
  99. OnSGainCheck:
  100. .@gain = .gain_energy;
  101. if ( !checkvending() ) {
  102. #ENERGY += .@gain;
  103. if ( #ENERGY >= #MAX_ENERGY ) #ENERGY = #MAX_ENERGY;
  104. }
  105. end;
  106. }
  107.  
  108. - script mine_spot -1,{
  109. .@equipid = getequipid(EQI_ACC_L);
  110. if ( .@equipid < .pickaxe[0] || .@equipid > .pickaxe[1] ) {
  111. message strcharinfo(0),"I must equip a pickaxe to mine here!";
  112. end;
  113. }
  114. if ( .@equipid == .pickaxe[0] ) {
  115. .@time = 5; // 5 sec casting
  116. .@consume = 20; // 20% no consume
  117. .@amount = 2; // 2 drops
  118. } else if ( .@equipid == .pickaxe[1] ) {
  119. .@bonus = 1000; // +10% drop rate if super pickaxe
  120. .@time = 2; // 3 sec casting
  121. .@consume = 50; // 50% no consume
  122. .@amount = 4; // 4 drops
  123. }
  124. explode(.@T$,.dropData$,",");
  125. do{
  126. if ( #ENERGY < 1 ) {
  127. showscript "Insufficient energy.", getcharid(3);
  128. dispbottom "I need more energy to mine.", 0xff0000;
  129. end;
  130. }
  131. progressbar "", .@time;
  132. explode(.@TT$,.@T$[rand(getarraysize(.@T$))],":");
  133. .@itemid = atoi(.@TT$[0]);
  134. .@rate = atoi(.@TT$[1]) + .@bonus;
  135. if ( .@consume <= rand(100) ) --#ENERGY;
  136. energy_check;
  137. if( .@rate >= rand(0,10000) ) {
  138. specialeffect 51;
  139. specialeffect2 610;
  140. showscript getitemname(.@itemid)+" found!",getcharid(3);
  141. getitem .@itemid, .@amount;
  142. end;
  143. }
  144. specialeffect2 611;
  145. showscript rand(2) ? "Nothing found..." : "Try again...",getcharid(3);
  146. } while(1);
  147. end;
  148.  
  149. OnInit:
  150. .pickaxe[0] = 3500; // normal pickaxe id
  151. .pickaxe[1] = 3501; // super pickaxe id
  152. .dropData$ = "984:7000,985:7000,6223:5000,6224:5000,6225:2000,6226:2000,6240:2000,6241:2000,7619:1000,7620:1000,7892:500,6307:500,6307:300";
  153. }
  154.  
  155. // Add more duplicates
  156. anthell01,47,254,1 duplicate(mine_spot) Mining Spot#001 1907
  157. anthell01,43,241,1 duplicate(mine_spot) Mining Spot#002 1908
  158. anthell01,53,235,1 duplicate(mine_spot) Mining Spot#003 1907
  159. anthell01,60,236,1 duplicate(mine_spot) Mining Spot#004 1908
  160. anthell01,66,229,1 duplicate(mine_spot) Mining Spot#005 1907
  161. anthell01,65,222,1 duplicate(mine_spot) Mining Spot#006 1908
  162. anthell01,81,209,1 duplicate(mine_spot) Mining Spot#007 1907
  163. anthell01,99,230,1 duplicate(mine_spot) Mining Spot#008 1908
  164. anthell01,97,242,1 duplicate(mine_spot) Mining Spot#009 1907
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement