Advertisement
warc222

autoreward by daGGER

Sep 19th, 2022
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.56 KB | None | 0 0
  1. PASTEBIN
  2. API
  3. TOOLS
  4. FAQ
  5. paste
  6. LOGIN SIGN UP
  7. Advertisement
  8. Ad
  9. SHARE
  10. TWEET
  11. warc222
  12. Reward System For L2Jfrozen Last Rev By Dagger
  13. WARC222
  14. OCT 10TH, 2015
  15. 137
  16. 0
  17. NEVER
  18. ADD COMMENT
  19. Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  20. 4.04 KB | None |
  21.  
  22.  
  23. ===================================================================
  24. com/l2jfrozen/Config.java
  25. ===================================================================
  26. + public static boolean ALLOW_AUTO_REWARDER;
  27. + public static int AUTO_REWARD_DELAY;
  28. + public static int AUTO_REWARD_ID;
  29. + public static int AUTO_REWARD_COUNT;
  30. + public static String NAME_ITEM_REWARD;
  31. +
  32. public static String ALLOWED_SKILLS;
  33. ;
  34.  
  35. + /** Automatic Restart **/
  36. + ALLOW_AUTO_REWARDER = Boolean.parseBoolean(L2JSanneSettings.getProperty("AllowAutoRewarder", "True"));
  37. + AUTO_REWARD_DELAY = Integer.parseInt(L2JSanneSettings.getProperty("AutoRewardDelay", "1200"));
  38. + AUTO_REWARD_ID = Integer.parseInt(L2JSanneSettings.getProperty("AutoRewardID", "57"));
  39. + AUTO_REWARD_COUNT = Integer.parseInt(L2JSanneSettings.getProperty("AutoRewardCount", "1000"));
  40. + NAME_ITEM_REWARD = L2JSanneSettings.getProperty("RewardItemName", "Event medal");
  41. +
  42. /** Server Name **/
  43.  
  44. gameserver/model/entity/AutoRewarder.java
  45. ===================================================================
  46. gameserver/model/entity/AutoRewarder.java (revision 0)
  47. gameserver/model/entity/AutoRewarder.java (working copy)
  48. /*
  49. * This program is free software: you can redistribute it and/or modify it under
  50. * the terms of the GNU General Public License as published by the Free Software
  51. * Foundation, either version 3 of the License, or (at your option) any later
  52. * version.
  53. *
  54. * This program is distributed in the hope that it will be useful, but WITHOUT
  55. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  56. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  57. * details.
  58. *
  59. * You should have received a copy of the GNU General Public License along with
  60. * this program. If not, see .
  61. */
  62. package com.l2jfrozen.gameserver.model.entity;
  63.  
  64. import java.util.Collection;
  65.  
  66. import com.l2jfrozen.Config;
  67. import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  68. import com.l2jfrozen.gameserver.model.L2World;
  69. import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  70.  
  71. /**
  72. * @author Dagger
  73. *
  74. */
  75. public class AutoRewarder
  76. {
  77. public static void getInstance()
  78. {
  79. ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
  80. {
  81. @Override
  82. public void run()
  83. {
  84. AutoReward();
  85. }
  86.  
  87. }, 0,Config.AUTO_REWARD_DELAY * 1000);
  88. }
  89. public static void AutoReward()
  90. {
  91. Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers();
  92. for (L2PcInstance p : pls)
  93. {
  94. p.sendMessage("AutoReward: Usted ha recibido " + Config.AUTO_REWARD_COUNT +" "+ Config.NAME_ITEM_REWARD + " Por Estar online 1 Hora");
  95. p.getInventory().addItem("", Config.AUTO_REWARD_ID, Config.AUTO_REWARD_COUNT, p, null);
  96. }
  97. }
  98. }
  99. \ No newline at end of file
  100. ===================================================================
  101. gameserver/GameServer.java
  102. ===================================================================
  103.  
  104. import com.l2jfrozen.gameserver.model.entity.Announcements;
  105. +import com.l2jfrozen.gameserver.model.entity.AutoRewarder;
  106. import com.l2jfrozen.gameserver.model.entity.Hero;
  107.  
  108. Util.printSection("Custom Mods");
  109.  
  110. - if (Config.L2JMOD_ALLOW_WEDDING || Config.ALLOW_AWAY_STATUS || Config.PCB_ENABLE || Config.POWERPAK_ENABLED)
  111. + if (Config.L2JMOD_ALLOW_WEDDING || Config.ALLOW_AWAY_STATUS || Config.PCB_ENABLE || Config.POWERPAK_ENABLED || Config.ALLOW_AUTO_REWARDER)
  112. {
  113. if (Config.L2JMOD_ALLOW_WEDDING)
  114. CoupleManager.getInstance();
  115.  
  116. if (Config.POWERPAK_ENABLED)
  117. PowerPak.getInstance();
  118. +
  119. + if (Config.ALLOW_AUTO_REWARDER)
  120. + AutoRewarder.getInstance();
  121. }
  122. else
  123. LOGGER.info("All custom mods are Disabled.");
  124.  
  125. config/functions/L2Jfrozen.properties
  126. ===================================================================
  127. +# Auto rewarder.
  128. +AllowAutoRewarder = True
  129. +# Delay for reward. (in seconds)
  130. +AutoRewardDelay = 1200
  131. +# ID of item reward.
  132. +AutoRewardID = 6392
  133. +# Count of item reward.
  134. +AutoRewardCount = 1000
  135. +# Item Name SendMensagem the payer will win ex Medal Event.
  136. +RewardItemNameItemName = Event Medal
  137. \ No newline at end of file
  138. Advertisement
  139. Ad
  140. RAW Paste Data
  141. ===================================================================
  142. com/l2jfrozen/Config.java
  143. ===================================================================
  144. + public static boolean ALLOW_AUTO_REWARDER;
  145. + public static int AUTO_REWARD_DELAY;
  146. + public static int AUTO_REWARD_ID;
  147. + public static int AUTO_REWARD_COUNT;
  148. + public static String NAME_ITEM_REWARD;
  149. +
  150. public static String ALLOWED_SKILLS;
  151. ;
  152.  
  153. + /** Automatic Restart **/
  154. + ALLOW_AUTO_REWARDER = Boolean.parseBoolean(L2JSanneSettings.getProperty("AllowAutoRewarder", "True"));
  155. + AUTO_REWARD_DELAY = Integer.parseInt(L2JSanneSettings.getProperty("AutoRewardDelay", "1200"));
  156. + AUTO_REWARD_ID = Integer.parseInt(L2JSanneSettings.getProperty("AutoRewardID", "57"));
  157. + AUTO_REWARD_COUNT = Integer.parseInt(L2JSanneSettings.getProperty("AutoRewardCount", "1000"));
  158. + NAME_ITEM_REWARD = L2JSanneSettings.getProperty("RewardItemName", "Event medal");
  159. +
  160. /** Server Name **/
  161.  
  162. gameserver/model/entity/AutoRewarder.java
  163. ===================================================================
  164. gameserver/model/entity/AutoRewarder.java (revision 0)
  165. gameserver/model/entity/AutoRewarder.java (working copy)
  166. /*
  167. * This program is free software: you can redistribute it and/or modify it under
  168. * the terms of the GNU General Public License as published by the Free Software
  169. * Foundation, either version 3 of the License, or (at your option) any later
  170. * version.
  171. *
  172. * This program is distributed in the hope that it will be useful, but WITHOUT
  173. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  174. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  175. * details.
  176. *
  177. * You should have received a copy of the GNU General Public License along with
  178. * this program. If not, see .
  179. */
  180. package com.l2jfrozen.gameserver.model.entity;
  181.  
  182. import java.util.Collection;
  183.  
  184. import com.l2jfrozen.Config;
  185. import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  186. import com.l2jfrozen.gameserver.model.L2World;
  187. import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  188.  
  189. /**
  190. * @author Dagger
  191. *
  192. */
  193. public class AutoRewarder
  194. {
  195. public static void getInstance()
  196. {
  197. ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
  198. {
  199. @Override
  200. public void run()
  201. {
  202. AutoReward();
  203. }
  204.  
  205. }, 0,Config.AUTO_REWARD_DELAY * 1000);
  206. }
  207. public static void AutoReward()
  208. {
  209. Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers();
  210. for (L2PcInstance p : pls)
  211. {
  212. p.sendMessage("AutoReward: Usted ha recibido " + Config.AUTO_REWARD_COUNT +" "+ Config.NAME_ITEM_REWARD + " Por Estar online 1 Hora");
  213. p.getInventory().addItem("", Config.AUTO_REWARD_ID, Config.AUTO_REWARD_COUNT, p, null);
  214. }
  215. }
  216. }
  217. \ No newline at end of file
  218. ===================================================================
  219. gameserver/GameServer.java
  220. ===================================================================
  221.  
  222. import com.l2jfrozen.gameserver.model.entity.Announcements;
  223. +import com.l2jfrozen.gameserver.model.entity.AutoRewarder;
  224. import com.l2jfrozen.gameserver.model.entity.Hero;
  225.  
  226. Util.printSection("Custom Mods");
  227.  
  228. - if (Config.L2JMOD_ALLOW_WEDDING || Config.ALLOW_AWAY_STATUS || Config.PCB_ENABLE || Config.POWERPAK_ENABLED)
  229. + if (Config.L2JMOD_ALLOW_WEDDING || Config.ALLOW_AWAY_STATUS || Config.PCB_ENABLE || Config.POWERPAK_ENABLED || Config.ALLOW_AUTO_REWARDER)
  230. {
  231. if (Config.L2JMOD_ALLOW_WEDDING)
  232. CoupleManager.getInstance();
  233.  
  234. if (Config.POWERPAK_ENABLED)
  235. PowerPak.getInstance();
  236. +
  237. + if (Config.ALLOW_AUTO_REWARDER)
  238. + AutoRewarder.getInstance();
  239. }
  240. else
  241. LOGGER.info("All custom mods are Disabled.");
  242.  
  243. config/functions/L2Jfrozen.properties
  244. ===================================================================
  245. +# Auto rewarder.
  246. +AllowAutoRewarder = True
  247. +# Delay for reward. (in seconds)
  248. +AutoRewardDelay = 1200
  249. +# ID of item reward.
  250. +AutoRewardID = 6392
  251. +# Count of item reward.
  252. +AutoRewardCount = 1000
  253. +# Item Name SendMensagem the payer will win ex Medal Event.
  254. +RewardItemNameItemName = Event Medal
  255. \ No newline at end of file
  256. Add Comment
  257. Please, Sign In to add comment
  258. Advertisement
  259. Ad
  260. Public Pastes
  261. Spammers and Scammers [9-4/2022]
  262. HTML | 29 sec ago | 85.49 KB
  263. Untitled
  264. Python | 19 min ago | 0.41 KB
  265. Untitled
  266. Perl | 25 min ago | 0.79 KB
  267. s3l1
  268. C# | 1 hour ago | 15.31 KB
  269. Lexicon + Syntax Parser
  270. Java | 1 hour ago | 5.15 KB
  271. Biết Đâu Sau Này Biết Đâu Sau Này - Kym, CUS...
  272. HTML 5 | 1 hour ago | 2.21 KB
  273. Biết Đâu Sau Này (Beat) Biết Đâu Sau Này (Be...
  274. HTML 5 | 1 hour ago | 2.22 KB
  275. Untitled
  276. PHP | 1 hour ago | 1.75 KB
  277. Advertisement
  278. create new paste / syntax languages / archive / faq / tools / night mode / api / scraping api / news / pro
  279. privacy statement / cookies policy / terms of serviceupdated / security disclosure / dmca / report abuse / contact
  280.  
  281. By using Pastebin.com you agree to our cookies policy to enhance your experience.
  282. Site design & logo © 2022 Pastebin
  283. We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
  284. Not a member of Pastebin yet?
  285. Sign Up, it unlocks many cool features!
  286.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement