Advertisement
Reanimation06

L2jMobius C6 Interlude Simple Buffer Basic

Jan 23rd, 2024 (edited)
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 10.87 KB | Gaming | 0 0
  1. diff --git a/L2J_Mobius_C6_Interlude/.gitignore b/L2J_Mobius_C6_Interlude/.gitignore
  2. new file mode 100644
  3. index 0000000..ae3c172
  4. --- /dev/null
  5. +++ b/L2J_Mobius_C6_Interlude/.gitignore
  6. @@ -0,0 +1 @@
  7. +/bin/
  8. diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/html/mods/Buffer/50009.htm b/L2J_Mobius_C6_Interlude/dist/game/data/html/mods/Buffer/50009.htm
  9. new file mode 100644
  10. index 0000000..64cf0a0
  11. --- /dev/null
  12. +++ b/L2J_Mobius_C6_Interlude/dist/game/data/html/mods/Buffer/50009.htm
  13. @@ -0,0 +1,270 @@
  14. +<html>
  15. +<body>
  16. +<table width="300">
  17. +       <tr>
  18. +           <td align="center">
  19. +               <font color="FF9900">
  20. +                   Simple Buffer Basic
  21. +               </font>
  22. +               <img src="L2UI.SquareWhite" width="300" height="1">
  23. +           </td>
  24. +       </tr>
  25. +       <tr>
  26. +           <td align="center">
  27. +               <table width="300">
  28. +                   <tr>
  29. +                       <td>
  30. +                           <font color="FF9900">
  31. +                               Buffs
  32. +                           </font>
  33. +                       </td>
  34. +                   </tr>
  35. +                   <tr>
  36. +                       <td>
  37. +                           <a action="bypass -h npc_%objectId%_getbuff 1204 1">
  38. +                               Wind Walk
  39. +                           </a>
  40. +                       </td>
  41. +                       <td>
  42. +                           <a action="bypass -h npc_%objectId%_getbuff 1040 1">
  43. +                               Shield
  44. +                           </a>
  45. +                       </td>
  46. +                   </tr>
  47. +                   <tr>
  48. +                       <td>
  49. +                           <a action="bypass -h npc_%objectId%_getbuff 1068 1">
  50. +                               Might
  51. +                           </a>
  52. +                       </td>
  53. +                       <td>
  54. +                           <a action="bypass -h npc_%objectId%_getbuff 1036 1">
  55. +                               Magic Barrier
  56. +                           </a>
  57. +                       </td>
  58. +                   </tr>
  59. +                   <tr>
  60. +                       <td>
  61. +                           <a action="bypass -h npc_%objectId%_getbuff 1035 1">
  62. +                               Mental Shield
  63. +                           </a>
  64. +                       </td>
  65. +                       <td>
  66. +                           <a action="bypass -h npc_%objectId%_getbuff 1045 1">
  67. +                               Bless the Body
  68. +                           </a>
  69. +                       </td>
  70. +                   </tr>
  71. +                   <tr>
  72. +                       <td>
  73. +                           <a action="bypass -h npc_%objectId%_getbuff 1048 1">
  74. +                               Bless the Soul
  75. +                           </a>
  76. +                       </td>
  77. +                       <td>
  78. +                           <a action="bypass -h npc_%objectId%_getbuff 1062 1">
  79. +                               Berserker Spirit
  80. +                           </a>
  81. +                       </td>
  82. +                   </tr>
  83. +                   <tr>
  84. +                       <td>
  85. +                           <a action="bypass -h npc_%objectId%_getbuff 1086 1">
  86. +                               Haste
  87. +                           </a>
  88. +                       </td>
  89. +                       <td>
  90. +                           <a action="bypass -h npc_%objectId%_getbuff 1240 1">
  91. +                               Guidance
  92. +                           </a>
  93. +                       </td>
  94. +                   </tr>
  95. +                   <tr>
  96. +                       <td>
  97. +                           <a action="bypass -h npc_%objectId%_getbuff 1242 1">
  98. +                               Death Whisper
  99. +                           </a>
  100. +                       </td>
  101. +                       <td>
  102. +                           <a action="bypass -h npc_%objectId%_getbuff 1077 1">
  103. +                               Focus
  104. +                           </a>
  105. +                       </td>
  106. +                   </tr>
  107. +                   <tr>
  108. +                       <td>
  109. +                           <a action="bypass -h npc_%objectId%_getbuff 1268 1">
  110. +                               Vampiric Rage
  111. +                           </a>
  112. +                       </td>
  113. +                       <td>
  114. +                           <a action="bypass -h npc_%objectId%_getbuff 1087 1">
  115. +                               Agility
  116. +                           </a>
  117. +                       </td>
  118. +                   </tr>
  119. +                   <tr>
  120. +                       <td>
  121. +                           <a action="bypass -h npc_%objectId%_getbuff 1085 1">
  122. +                               Acumen
  123. +                           </a>
  124. +                       </td>
  125. +                       <td>
  126. +                           <a action="bypass -h npc_%objectId%_getbuff 1059 1">
  127. +                               Empower
  128. +                           </a>
  129. +                       </td>
  130. +                   </tr>
  131. +                   <tr>
  132. +                       <td>
  133. +                           <a action="bypass -h npc_%objectId%_getbuff 1303 1">
  134. +                               Wild Magic
  135. +                           </a>
  136. +                       </td>
  137. +                       <td>
  138. +                           <a action="bypass -h npc_%objectId%_getbuff 1078 1">
  139. +                               Concentration
  140. +                           </a>
  141. +                       </td>
  142. +                   </tr>
  143. +                   <tr>
  144. +                       <td>
  145. +                           <a action="bypass -h npc_%objectId%_getbuff 1243 1">
  146. +                               Bless Shield
  147. +                           </a>
  148. +                       </td>
  149. +                       <td>
  150. +                           <a action="bypass -h npc_%objectId%_getbuff 1259 1">
  151. +                               Resist Shock
  152. +                           </a>
  153. +                       </td>
  154. +                   </tr>
  155. +                   <tr>
  156. +                       <td>
  157. +                           <a action="bypass -h npc_%objectId%_getbuff 1304 1">
  158. +                               Advanced Block
  159. +                           </a>
  160. +                       </td>
  161. +                       <td>
  162. +                           <a action="bypass -h npc_%objectId%_restore">
  163. +                               Heal
  164. +                           </a>
  165. +                       </td>
  166. +                       <td>
  167. +                           <a action="bypass -h npc_%objectId%_cancel">
  168. +                               Cancel
  169. +                           </a>
  170. +                       </td>
  171. +                   </tr>
  172. +                   <tr>
  173. +                       <td>
  174. +                           <font color="FF9900">
  175. +                           Dances
  176. +                           </font>
  177. +                       </td>
  178. +                   </tr>
  179. +                   <tr>
  180. +                       <td>
  181. +                           <a action="bypass -h npc_%objectId%_getbuff 271 1">
  182. +                               Warrior
  183. +                           </a>
  184. +                       </td>
  185. +                       <td>
  186. +                           <a action="bypass -h npc_%objectId%_getbuff 274 1">
  187. +                               Fire
  188. +                           </a>
  189. +                       </td>
  190. +                       <td>
  191. +                           <a action="bypass -h npc_%objectId%_getbuff 275 1">
  192. +                               Fury
  193. +                           </a>
  194. +                       </td>
  195. +                   </tr>
  196. +                   <tr>
  197. +                       <td>
  198. +                           <a action="bypass -h npc_%objectId%_getbuff 272 1">
  199. +                               Inspiration
  200. +                           </a>
  201. +                       </td>
  202. +                       <td>
  203. +                           <a action="bypass -h npc_%objectId%_getbuff 310 1">
  204. +                               Vampire
  205. +                           </a>
  206. +                       </td>
  207. +                       <td>
  208. +                           <a action="bypass -h npc_%objectId%_getbuff 273 1">
  209. +                               Mystic
  210. +                           </a>
  211. +                       </td>
  212. +                   </tr>
  213. +                   <tr>
  214. +                       <td>
  215. +                           <a action="bypass -h npc_%objectId%_getbuff 276 1">
  216. +                               Concentration
  217. +                           </a>
  218. +                       </td>
  219. +                       <td>
  220. +                           <a action="bypass -h npc_%objectId%_getbuff 277 1">
  221. +                               Light
  222. +                           </a>
  223. +                       </td>
  224. +                   </tr>
  225. +                   <tr>
  226. +                       <td>
  227. +                           <font color="FF9900">
  228. +                           Songs
  229. +                           </font>
  230. +                       </td>
  231. +                   </tr>
  232. +                   <tr>
  233. +                       <td>
  234. +                           <a action="bypass -h npc_%objectId%_getbuff 264 1">
  235. +                               Earth
  236. +                           </a>
  237. +                       </td>
  238. +                       <td>
  239. +                           <a action="bypass -h npc_%objectId%_getbuff 304 1">
  240. +                               Vitality
  241. +                           </a>
  242. +                       </td>
  243. +                       <td>
  244. +                           <a action="bypass -h npc_%objectId%_getbuff 268 1">
  245. +                               Wind
  246. +                           </a>
  247. +                       </td>
  248. +                   </tr>
  249. +                   <tr>
  250. +                       <td>
  251. +                           <a action="bypass -h npc_%objectId%_getbuff 267 1">
  252. +                               Warding
  253. +                           </a>
  254. +                       </td>
  255. +                       <td>
  256. +                           <a action="bypass -h npc_%objectId%_getbuff 266 1">
  257. +                               Water
  258. +                           </a>
  259. +                       </td>
  260. +                       <td>
  261. +                           <a action="bypass -h npc_%objectId%_getbuff 269 1">
  262. +                               Hunter
  263. +                           </a>
  264. +                       </td>
  265. +                   </tr>
  266. +                   <tr>
  267. +                       <td>
  268. +                           <a action="bypass -h npc_%objectId%_getbuff 265 1">
  269. +                               Life
  270. +                           </a>
  271. +                       </td>
  272. +                       <td>
  273. +                           <a action="bypass -h npc_%objectId%_getbuff 270 1">
  274. +                           Invocation
  275. +                           </a>
  276. +                       </td>
  277. +                   </tr>
  278. +               </table>
  279. +           </td>
  280. +       </tr>
  281. +   </table>
  282. +</body>
  283. +</html>
  284. \ No newline at end of file
  285. diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/Buffer.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/Buffer.java
  286. new file mode 100644
  287. index 0000000..2c6b1bf
  288. --- /dev/null
  289. +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/Buffer.java
  290. @@ -0,0 +1,103 @@
  291. +/*
  292. + * This file is part of the L2J Mobius project.
  293. + *
  294. + * This program is free software: you can redistribute it and/or modify
  295. + * it under the terms of the GNU General Public License as published by
  296. + * the Free Software Foundation, either version 3 of the License, or
  297. + * (at your option) any later version.
  298. + *
  299. + * This program is distributed in the hope that it will be useful,
  300. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  301. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  302. + * General Public License for more details.
  303. + *
  304. + * You should have received a copy of the GNU General Public License
  305. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  306. + */
  307. +package org.l2jmobius.gameserver.model.actor.instance;
  308. +
  309. +import java.util.StringTokenizer;
  310. +
  311. +import org.l2jmobius.gameserver.data.SkillTable;
  312. +import org.l2jmobius.gameserver.model.actor.Player;
  313. +import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
  314. +import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
  315. +import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
  316. +
  317. +/**
  318. + * @author Trance, Bluur
  319. + * @adapted for L2jmobius Reanimation
  320. + */
  321. +public final class Buffer extends Folk
  322. +{
  323. +   public Buffer(int objectId, NpcTemplate template)
  324. +   {
  325. +       super(objectId, template);
  326. +   }
  327. +  
  328. +   @Override
  329. +   public void onBypassFeedback(Player player, String command)
  330. +   {
  331. +       StringTokenizer st = new StringTokenizer(command, " ");
  332. +       String actualCommand = st.nextToken();
  333. +      
  334. +       int buffid = 0, bufflevel = 1;
  335. +       if (st.countTokens() == 2)
  336. +       {
  337. +           buffid = Integer.valueOf(st.nextToken());
  338. +           bufflevel = Integer.valueOf(st.nextToken());
  339. +       }
  340. +       else if (st.countTokens() == 1)
  341. +       {
  342. +           buffid = Integer.valueOf(st.nextToken());
  343. +       }
  344. +      
  345. +       if (actualCommand.equalsIgnoreCase("getbuff"))
  346. +       {
  347. +           SkillTable.getInstance().getSkill(buffid, bufflevel).applyEffects(this, player);
  348. +           broadcastPacket(new MagicSkillUse(this, player, buffid, bufflevel, 500, 0));
  349. +           final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
  350. +           html.setFile(getHtmlPath(getNpcId(), 0));
  351. +           html.replace("%objectId%", getObjectId());
  352. +           player.sendPacket(html);
  353. +       }
  354. +       else if (actualCommand.equalsIgnoreCase("restore"))
  355. +       {
  356. +           player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
  357. +           player.setCurrentCp(player.getMaxCp());
  358. +          
  359. +           broadcastPacket(new MagicSkillUse(this, player, 1258, 4, 500, 0));
  360. +           final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
  361. +           html.setFile(getHtmlPath(getNpcId(), 0));
  362. +           html.replace("%objectId%", getObjectId());
  363. +           player.sendPacket(html);
  364. +       }
  365. +       else if (actualCommand.equalsIgnoreCase("cancel"))
  366. +       {
  367. +           player.stopAllEffects();
  368. +           broadcastPacket(new MagicSkillUse(this, player, 1056, 12, 500, 0));
  369. +           final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
  370. +           html.setFile(getHtmlPath(getNpcId(), 0));
  371. +           html.replace("%objectId%", getObjectId());
  372. +           player.sendPacket(html);
  373. +       }
  374. +       else
  375. +       {
  376. +           super.onBypassFeedback(player, command);
  377. +       }
  378. +   }
  379. +  
  380. +   @Override
  381. +   public String getHtmlPath(int npcId, int value)
  382. +   {
  383. +       String filename = "";
  384. +       if (value == 0)
  385. +       {
  386. +           filename = Integer.toString(npcId);
  387. +       }
  388. +       else
  389. +       {
  390. +           filename = npcId + "-" + value;
  391. +       }
  392. +       return "data/html/mods/Buffer/" + filename + ".htm";
  393. +   }
  394. +}
  395. \ No newline at end of file
  396.  
  397.  
  398.  
  399.  
  400. =================================================
  401. SQL
  402. =================================================
  403.  
  404. INSERT INTO `custom_npc` (`id`, `displayId`, `name`, `serverSideName`, `title`, `serverSideTitle`, `class`, `collision_radius`, `collision_height`, `level`, `sex`, `type`, `attackrange`, `hp`, `mp`, `hpreg`, `mpreg`, `str`, `con`, `dex`, `int`, `wit`, `men`, `exp`, `sp`, `patk`, `pdef`, `matk`, `mdef`, `atkspd`, `aggro`, `matkspd`, `rhand`, `lhand`, `armor`, `walkspd`, `runspd`, `faction_id`, `faction_range`, `isUndead`, `absorb_level`, `absorb_type`) VALUES ('50009', '31228', 'The Cat', '1', 'Buffer', '1', 'Monster.cat_the_cat', '9', '16', '70', 'male', 'Buffer', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', '', '0', '0', '0', 'LAST_HIT')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement