Advertisement
Sarada-L2

Teleport Free+Html No Price C4 Yo:Sarada

May 1st, 2021
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.81 KB | None | 0 0
  1. diff --git a/config/CustomMods/SpecialMods.ini b/config/CustomMods/SpecialMods.ini
  2. new file mode 100644
  3. index 0000000..bcd1b62
  4. --- /dev/null
  5. +++ b/config/CustomMods/SpecialMods.ini
  6. @@ -0,0 +1,7 @@
  7. +
  8. +#======================================================
  9. +# Teleporte Free For Player Level
  10. +#======================================================
  11. +#Retail Lv 40
  12. +FreeTeleportUntil = 40
  13. +
  14. diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
  15. index 5baf858..783c70c 100644
  16. --- a/java/net/sf/l2j/Config.java
  17. +++ b/java/net/sf/l2j/Config.java
  18. @@ -758,6 +758,7 @@
  19. public static float BUFFER_BASE_MP_MAX;
  20. /** Enable modifying skill duration */
  21. public static boolean ENABLE_MODIFY_SKILL_DURATION;
  22. + public static int FREE_TELEPORT_UNTIL;
  23. /** Skill duration list */
  24. public static Map<Integer, Integer> SKILL_DURATION_LIST;
  25.  
  26. @@ -2212,6 +2213,7 @@
  27. ANNOUNCE_GRANDBOS_KILL = Boolean.parseBoolean(Special.getProperty("AnnounceGranBossKill", "false"));
  28. ANNOUNCE_BOSS_ALIVE = Boolean.parseBoolean(Special.getProperty("AnnounceSpawnAllBoss", "false"));
  29. ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(Special.getProperty("EnableModifySkillDuration", "False"));
  30. + FREE_TELEPORT_UNTIL = Integer.parseInt(Special.getProperty("FreeTeleportUntil", "1"));
  31. // Create Map only if enabled
  32. if (ENABLE_MODIFY_SKILL_DURATION)
  33. {
  34. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2AdventurerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2AdventurerInstance.java
  35. index a597f1b..236ba81 100644
  36. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2AdventurerInstance.java
  37. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2AdventurerInstance.java
  38. @@ -77,7 +77,7 @@
  39. }
  40.  
  41. @Override
  42. - public String getHtmlPath(int npcId, int val)
  43. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  44. {
  45. String pom = "";
  46.  
  47. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2BlacksmithInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2BlacksmithInstance.java
  48. index 7210e80..4adaf4d 100644
  49. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2BlacksmithInstance.java
  50. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2BlacksmithInstance.java
  51. @@ -40,7 +40,7 @@
  52. }
  53.  
  54. @Override
  55. - public String getHtmlPath(int npcId, int val)
  56. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  57. {
  58. String pom = "";
  59. if (val == 0)
  60. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
  61. index 6c93c78..55d7862 100644
  62. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
  63. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
  64. @@ -44,7 +44,7 @@
  65. }
  66.  
  67. @Override
  68. - public String getHtmlPath(int npcId, int val)
  69. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  70. {
  71. String pom = "";
  72.  
  73. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2FishermanInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2FishermanInstance.java
  74. index 0edf1a1..c0a478f 100644
  75. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2FishermanInstance.java
  76. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2FishermanInstance.java
  77. @@ -36,7 +36,7 @@
  78. }
  79.  
  80. @Override
  81. - public String getHtmlPath(int npcId, int val)
  82. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  83. {
  84. String pom = "";
  85.  
  86. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java
  87. index 882bd50..40efd8f 100644
  88. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java
  89. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java
  90. @@ -120,7 +120,7 @@
  91. *
  92. */
  93. @Override
  94. - public String getHtmlPath(int npcId, int val)
  95. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  96. {
  97. String pom = "";
  98. if (val == 0)
  99. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2ManorManagerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2ManorManagerInstance.java
  100. index 55aad2e..25d05dc 100644
  101. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2ManorManagerInstance.java
  102. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2ManorManagerInstance.java
  103. @@ -180,7 +180,7 @@
  104. }
  105.  
  106. @Override
  107. - public String getHtmlPath(int npcId, int val)
  108. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  109. {
  110. return "data/html/manormanager/manager.htm"; // Used only in parent method to return from "Territory status" to initial screen.
  111. }
  112. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2MerchantInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2MerchantInstance.java
  113. index 5d55e59..04c7282 100644
  114. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2MerchantInstance.java
  115. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2MerchantInstance.java
  116. @@ -47,7 +47,7 @@
  117. }
  118.  
  119. @Override
  120. - public String getHtmlPath(int npcId, int val)
  121. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  122. {
  123. String pom = "";
  124.  
  125. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
  126. index 0b059c1..bbe736c 100644
  127. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
  128. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
  129. @@ -1262,11 +1262,12 @@
  130. * <BR>
  131. * <li>L2GuardInstance : Set the pathfile to data/html/guard/12006-1.htm (npcId-page number)</li><BR>
  132. * <BR>
  133. + * @param player
  134. * @param npcId The Identifier of the L2NpcInstance whose text must be display
  135. * @param val The number of the page to display
  136. * @return
  137. */
  138. - public String getHtmlPath(int npcId, int val)
  139. + public String getHtmlPath(L2PcInstance player, int npcId, int val)
  140. {
  141. String pom = "";
  142. if (val == 0)
  143. @@ -1537,7 +1538,7 @@
  144.  
  145. if (val == 0) // 0 - first buy lottery ticket window
  146. {
  147. - filename = (getHtmlPath(npcId, 1));
  148. + filename = (getHtmlPath(player, npcId, 1));
  149. html.setFile(filename);
  150. }
  151. else if ((val >= 1) && (val <= 21)) // 1-20 - buttons, 21 - second buy lottery ticket window
  152. @@ -1555,7 +1556,7 @@
  153. return;
  154. }
  155.  
  156. - filename = (getHtmlPath(npcId, 5));
  157. + filename = (getHtmlPath(player, npcId, 5));
  158. html.setFile(filename);
  159.  
  160. int count = 0;
  161. @@ -1679,17 +1680,17 @@
  162. iu.addModifiedItem(adenaupdate);
  163. player.sendPacket(iu);
  164.  
  165. - filename = (getHtmlPath(npcId, 3));
  166. + filename = (getHtmlPath(player, npcId, 3));
  167. html.setFile(filename);
  168. }
  169. else if (val == 23) // 23 - current lottery jackpot
  170. {
  171. - filename = (getHtmlPath(npcId, 3));
  172. + filename = (getHtmlPath(player, npcId, 3));
  173. html.setFile(filename);
  174. }
  175. else if (val == 24) // 24 - Previous winning numbers/Prize claim
  176. {
  177. - filename = (getHtmlPath(npcId, 4));
  178. + filename = (getHtmlPath(player, npcId, 4));
  179. html.setFile(filename);
  180.  
  181. int lotonumber = Lottery.getInstance().getId();
  182. @@ -2151,7 +2152,7 @@
  183. return;
  184. }
  185. // Get the text of the selected HTML file in function of the npcId and of the page number
  186. - filename = (getHtmlPath(npcId, val));
  187. + filename = (getHtmlPath(player, npcId, val));
  188. break;
  189. }
  190.  
  191. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2ObservationInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2ObservationInstance.java
  192. index 3756c49..7009387 100644
  193. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2ObservationInstance.java
  194. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2ObservationInstance.java
  195. @@ -83,7 +83,7 @@
  196. }
  197.  
  198. @Override
  199. - public String getHtmlPath(int npcId, int val)
  200. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  201. {
  202. String pom = "";
  203. if (val == 0)
  204. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java
  205. index 7c09e4e..95be6b5 100644
  206. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java
  207. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java
  208. @@ -230,7 +230,7 @@
  209. }
  210. else
  211. {
  212. - filename = (getHtmlPath(npcId, val));
  213. + filename = (getHtmlPath(player, npcId, val));
  214. }
  215. break;
  216. case 8690:
  217. @@ -244,7 +244,7 @@
  218. }
  219. else
  220. {
  221. - filename = (getHtmlPath(npcId, val));
  222. + filename = (getHtmlPath(player, npcId, val));
  223. }
  224. break;
  225. }
  226. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java
  227. index 3b304af..d11f5c0 100644
  228. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java
  229. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java
  230. @@ -287,7 +287,7 @@
  231. int npcId = getTemplate().npcId;
  232. String filename, search;
  233. NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
  234. - filename = getHtmlPath(npcId, 5);
  235. + filename = getHtmlPath(player, npcId, 5);
  236. html.setFile(filename);
  237. for (int i = 0; i < 8; i++)
  238. {
  239. @@ -306,7 +306,7 @@
  240. int npcId = getTemplate().npcId;
  241. String filename, search;
  242. NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
  243. - filename = getHtmlPath(npcId, 6);
  244. + filename = getHtmlPath(player, npcId, 6);
  245. html.setFile(filename);
  246. for (int i = 0; i < 8; i++)
  247. {
  248. @@ -328,7 +328,7 @@
  249. NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
  250. if (val < 10)
  251. {
  252. - filename = getHtmlPath(npcId, 2);
  253. + filename = getHtmlPath(player, npcId, 2);
  254. html.setFile(filename);
  255. for (int i = 0; i < 8; i++)
  256. {
  257. @@ -347,7 +347,7 @@
  258. else if (val < 20)
  259. {
  260. if (player.getRace(0) == 0) return;
  261. - filename = getHtmlPath(npcId, 3);
  262. + filename = getHtmlPath(player, npcId, 3);
  263. html.setFile(filename);
  264. html.replace("0place", "" + player.getRace(0));
  265. search = "Mob1";
  266. @@ -364,7 +364,7 @@
  267. else if (val == 20)
  268. {
  269. if (player.getRace(0) == 0 || player.getRace(1) == 0) return;
  270. - filename = getHtmlPath(npcId, 4);
  271. + filename = getHtmlPath(player, npcId, 4);
  272. html.setFile(filename);
  273. html.replace("0place", "" + player.getRace(0));
  274. search = "Mob1";
  275. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
  276. index be23e00..076a902 100644
  277. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
  278. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
  279. @@ -183,7 +183,7 @@
  280. }
  281.  
  282. @Override
  283. - public String getHtmlPath(int npcId, int val)
  284. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  285. {
  286. String pom = "";
  287. if (val == 0)
  288. @@ -197,7 +197,7 @@
  289. @Override
  290. public void showChatWindow(L2PcInstance player, int val)
  291. {
  292. - String filename = getHtmlPath(getNpcId(), val);
  293. + String filename = getHtmlPath(player, getNpcId(), val);
  294. NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
  295. html.setFile(filename);
  296. html.replace("%objectId%", String.valueOf(getObjectId()));
  297. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2SymbolMakerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2SymbolMakerInstance.java
  298. index 7eaa7e3..a2e7123 100644
  299. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2SymbolMakerInstance.java
  300. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2SymbolMakerInstance.java
  301. @@ -81,7 +81,7 @@
  302. }
  303.  
  304. @Override
  305. - public String getHtmlPath(int npcId, int val)
  306. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  307. {
  308. String pom = "";
  309.  
  310. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java
  311. index 2d4e9d5..381bec0 100644
  312. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java
  313. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java
  314. @@ -89,7 +89,7 @@
  315. }
  316.  
  317. @Override
  318. - public String getHtmlPath(int npcId, int val)
  319. + public String getHtmlPath(L2PcInstance player, int npcId, int val)
  320. {
  321. String pom = "";
  322. if (val == 0)
  323. @@ -100,7 +100,10 @@
  324. {
  325. pom = npcId + "-" + val;
  326. }
  327. -
  328. + if (player.getLevel() <= Config.FREE_TELEPORT_UNTIL)
  329. + {
  330. + return "data/html/teleporter/free/" + pom + ".htm";
  331. + }
  332. return "data/html/teleporter/" + pom + ".htm";
  333. }
  334.  
  335. @@ -123,7 +126,7 @@
  336. }
  337. else if (condition == COND_CASTLE_OWNER) // Clan owns castle
  338. {
  339. - filename = getHtmlPath(getNpcId(), 0); // Owner message window
  340. + filename = getHtmlPath(player, getNpcId(), 0); // Owner message window
  341. }
  342. }
  343. else if (condition == COND_ALL_FALSE)
  344. @@ -169,6 +172,10 @@
  345. player.sendMessage("You cannot use teleporting services while in combat.");
  346. return;
  347. }
  348. + else if(!list.getIsForNoble() && ((Config.ALT_GAME_FREE_TELEPORT || player.getLevel() <= Config.FREE_TELEPORT_UNTIL) || player.reduceAdena("Teleport", list.getPrice(), this, true)))
  349. + {
  350. + player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), true);
  351. + }
  352. else if (list.getIsForNoble() && !player.isNoble())
  353. {
  354. String filename = "data/html/teleporter/nobleteleporter-no.htm";
  355. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2TrainerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2TrainerInstance.java
  356. index e723d36..b51bd28 100644
  357. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2TrainerInstance.java
  358. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2TrainerInstance.java
  359. @@ -33,7 +33,7 @@
  360. }
  361.  
  362. @Override
  363. - public String getHtmlPath(int npcId, int val)
  364. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  365. {
  366. String pom = "";
  367. if (val == 0)
  368. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java
  369. index e18b170..8e9f755 100644
  370. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java
  371. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java
  372. @@ -388,7 +388,7 @@
  373. }
  374.  
  375. @Override
  376. - public String getHtmlPath(int npcId, int val)
  377. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  378. {
  379. String pom = "";
  380.  
  381. diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2WarehouseInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2WarehouseInstance.java
  382. index 5f2e366..1d09985 100644
  383. --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2WarehouseInstance.java
  384. +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2WarehouseInstance.java
  385. @@ -42,7 +42,7 @@
  386. }
  387.  
  388. @Override
  389. - public String getHtmlPath(int npcId, int val)
  390. + public String getHtmlPath(L2PcInstance player,int npcId, int val)
  391. {
  392. String pom = "";
  393. if (val == 0)
  394.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement