Sarada-L2

Sell Items for 0 Adena aCis

Jul 30th, 2023
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.73 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P aCis_gameserver
  3. diff --git config/npcs.properties
  4. index c5a3339..3f300ce 100644
  5. --- config/npcs.properties
  6. +++ config/npcs.properties
  7. @@ -23,40 +23,45 @@
  8.  
  9. # Enable Red Name Champion color?
  10. EnableRedNameChampion = True
  11.  
  12. # Atk bonus for champion (changes apply on patk & matk)
  13. ChampionAtk = 1.
  14.  
  15. # Spd Atk bonus for champion (changes apply on patkspd & matkspd)
  16. ChampionSpdAtk = 1.
  17.  
  18. # Chance to obtain a specified reward item from a higher lvl champion (in percents) default is off using glittering medal as reward
  19. ChampionRewardItem = 0
  20.  
  21. # Specified reward item ID
  22. ChampionRewardItemID = 6393
  23.  
  24. # Specified reward item rnd qty
  25. ChampionRewardItemQty = 1
  26.  
  27. +#=============================================================
  28. +# Vender todos items por 0 Adena no NPCS
  29. +#=============================================================
  30. +DisablePriceAdenaItems = True
  31.  
  32. #=============================================================
  33. # Desabilitar ataque aos Npcs na cidade
  34. #=============================================================
  35. # Retail False
  36. DisableAttackToNpcs = true
  37.  
  38. #=============================================================
  39. # Buffer
  40. #=============================================================
  41.  
  42. # Maximum number of available schemes per player.
  43. BufferMaxSchemesPerChar = 4
  44.  
  45. # Static cost of buffs ; override skills price if different of -1.
  46. BufferStaticCostPerBuff = -1
  47.  
  48. #=============================================================
  49. # Misc
  50. #=============================================================
  51.  
  52. # Allow the use of class Managers to change occupation
  53. diff --git java/net/sf/l2j/Config.java
  54. index cff5321..58fdcc4 100644
  55. --- java/net/sf/l2j/Config.java
  56. +++ java/net/sf/l2j/Config.java
  57. @@ -516,40 +516,41 @@
  58. // NPCs / Monsters
  59. // --------------------------------------------------
  60.  
  61. /** Champion Mod */
  62. public static int CHAMPION_FREQUENCY;
  63. public static int CHAMP_MIN_LVL;
  64. public static int CHAMP_MAX_LVL;
  65. public static int CHAMPION_HP;
  66. public static int CHAMPION_REWARDS;
  67. public static int CHAMPION_ADENAS_REWARDS;
  68. public static double CHAMPION_HP_REGEN;
  69. public static double CHAMPION_ATK;
  70. public static double CHAMPION_SPD_ATK;
  71. public static int CHAMPION_REWARD;
  72. public static int CHAMPION_REWARD_ID;
  73. public static int CHAMPION_REWARD_QTY;
  74. public static int L2JMOD_CHAMPION_ENABLE_AURA;
  75. public static boolean AGGRESSION_CHAMPION;
  76. public static boolean SHOW_RED_NAME_CHAMPION;
  77. public static boolean DISABLE_ATTACK_NPC_TYPE;
  78. + public static boolean BLOCK_SELL_ITEMS_ADENA;
  79.  
  80. /** Crazy Rates Event */
  81. public static int EVENT_CRAZY_DROP_TIME;
  82. public static String[] EVENT_CRAZY_FARM_INTERVAL_BY_TIME_OF_DAY;
  83. public static float RateMultipler;
  84. public static boolean ENABLE_EVENT_CRAZY_RATES;
  85. public static String CRAZY_RATES_MESSAGE_TEXT;
  86.  
  87. /** Chat trade global. */
  88. public static String DEFAULT_GLOBAL_CHAT;
  89. public static boolean ENABLE_BLOCK_SUPPORTZONE;
  90. public static String DEFAULT_TRADE_CHAT;
  91. public static boolean DISABLE_CAPSLOCK;
  92. public static int CUSTOM_GLOBAL_CHAT_TIME;
  93. public static boolean GLOBAL_CHAT_WITH_PVP;
  94. public static int GLOBAL_PVP_AMOUNT;
  95. public static boolean TRADE_CHAT_WITH_PVP;
  96. public static int TRADE_PVP_AMOUNT;
  97. public static int CUSTOM_HERO_CHAT_TIME;
  98.  
  99. @@ -1752,40 +1753,41 @@
  100. hexSetting.setProperty("HexID", hexId);
  101.  
  102. try (OutputStream out = new FileOutputStream(file))
  103. {
  104. hexSetting.store(out, "the hexID to auth into login");
  105. }
  106. }
  107. catch (Exception e)
  108. {
  109. LOGGER.error("Failed to save hex ID to '{}' file.", e, filename);
  110. }
  111. }
  112.  
  113. /**
  114. * Loads NPC settings.<br>
  115. * Such as champion monsters, NPC buffer, class master, wyvern, raid bosses and grand bosses, AI.
  116. */
  117. private static final void loadNpcs()
  118. {
  119. final ExProperties npcs = initProperties(NPCS_FILE);
  120. + BLOCK_SELL_ITEMS_ADENA = Boolean.parseBoolean(npcs.getProperty("DisablePriceAdenaItems", "False"));
  121. DISABLE_ATTACK_NPC_TYPE = Boolean.parseBoolean(npcs.getProperty("DisableAttackToNpcs", "False"));
  122. CHAMPION_FREQUENCY = npcs.getProperty("ChampionFrequency", 0);
  123. CHAMP_MIN_LVL = npcs.getProperty("ChampionMinLevel", 20);
  124. CHAMP_MAX_LVL = npcs.getProperty("ChampionMaxLevel", 70);
  125. CHAMPION_HP = npcs.getProperty("ChampionHp", 8);
  126. CHAMPION_HP_REGEN = npcs.getProperty("ChampionHpRegen", 1.);
  127. CHAMPION_REWARDS = npcs.getProperty("ChampionRewards", 8);
  128. CHAMPION_ADENAS_REWARDS = npcs.getProperty("ChampionAdenasRewards", 1);
  129. CHAMPION_ATK = npcs.getProperty("ChampionAtk", 1.);
  130. CHAMPION_SPD_ATK = npcs.getProperty("ChampionSpdAtk", 1.);
  131. CHAMPION_REWARD = npcs.getProperty("ChampionRewardItem", 0);
  132. CHAMPION_REWARD_ID = npcs.getProperty("ChampionRewardItemID", 6393);
  133. CHAMPION_REWARD_QTY = npcs.getProperty("ChampionRewardItemQty", 1);
  134. L2JMOD_CHAMPION_ENABLE_AURA = Integer.parseInt(npcs.getProperty("ChampionEnableAura", "0"));
  135. AGGRESSION_CHAMPION = Boolean.parseBoolean(npcs.getProperty("DisableAgressionChampion", "False"));
  136. SHOW_RED_NAME_CHAMPION = Boolean.parseBoolean(npcs.getProperty("EnableRedNameChampion", "False"));
  137.  
  138. BUFFER_MAX_SCHEMES = npcs.getProperty("BufferMaxSchemesPerChar", 4);
  139. BUFFER_STATIC_BUFF_COST = npcs.getProperty("BufferStaticCostPerBuff", -1);
  140. //COIN_ITEMID = Integer.parseInt(npcs.getProperty("CoinIdPriceBuff", "-1"));
  141. diff --git java/net/sf/l2j/gameserver/model/item/kind/Item.java
  142. index d3d3545..780f237 100644
  143. --- java/net/sf/l2j/gameserver/model/item/kind/Item.java
  144. +++ java/net/sf/l2j/gameserver/model/item/kind/Item.java
  145. @@ -1,29 +1,31 @@
  146. package net.sf.l2j.gameserver.model.item.kind;
  147.  
  148. import java.util.ArrayList;
  149. import java.util.Collections;
  150. import java.util.HashMap;
  151. import java.util.List;
  152. import java.util.Map;
  153.  
  154. import net.sf.l2j.commons.util.StatsSet;
  155. +
  156. +import net.sf.l2j.Config;
  157. import net.sf.l2j.gameserver.data.xml.IconTable;
  158. import net.sf.l2j.gameserver.enums.items.ActionType;
  159. import net.sf.l2j.gameserver.enums.items.ArmorType;
  160. import net.sf.l2j.gameserver.enums.items.CrystalType;
  161. import net.sf.l2j.gameserver.enums.items.EtcItemType;
  162. import net.sf.l2j.gameserver.enums.items.ItemType;
  163. import net.sf.l2j.gameserver.enums.items.MaterialType;
  164. import net.sf.l2j.gameserver.enums.items.WeaponType;
  165. import net.sf.l2j.gameserver.model.WorldObject;
  166. import net.sf.l2j.gameserver.model.actor.Creature;
  167. import net.sf.l2j.gameserver.model.actor.Player;
  168. import net.sf.l2j.gameserver.model.actor.Summon;
  169. import net.sf.l2j.gameserver.model.holder.IntIntHolder;
  170. import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  171. import net.sf.l2j.gameserver.network.SystemMessageId;
  172. import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  173. import net.sf.l2j.gameserver.scripting.Quest;
  174. import net.sf.l2j.gameserver.skills.Env;
  175. import net.sf.l2j.gameserver.skills.basefuncs.Func;
  176. import net.sf.l2j.gameserver.skills.basefuncs.FuncTemplate;
  177. @@ -126,41 +128,48 @@
  178. private final boolean _heroItem;
  179. private final boolean _isOlyRestricted;
  180.  
  181. private final ActionType _defaultAction;
  182.  
  183. protected List<FuncTemplate> _funcTemplates;
  184.  
  185. protected List<Condition> _preConditions;
  186. private IntIntHolder[] _skillHolder;
  187.  
  188. private List<Quest> _questEvents = Collections.emptyList();
  189.  
  190. protected Item(StatsSet set)
  191. {
  192. _itemId = set.getInteger("item_id");
  193. _name = set.getString("name");
  194. _weight = set.getInteger("weight", 0);
  195. _materialType = set.getEnum("material", MaterialType.class, MaterialType.STEEL);
  196. _duration = set.getInteger("duration", -1);
  197. _bodyPart = SLOTS.get(set.getString("bodypart", "none"));
  198. - _referencePrice = set.getInteger("price", 0);
  199. + if(Config.BLOCK_SELL_ITEMS_ADENA)
  200. + {
  201. + _referencePrice = 0;
  202. + }
  203. + else
  204. + {
  205. + _referencePrice = set.getInteger("price", 0);
  206. + }
  207. _crystalType = set.getEnum("crystal_type", CrystalType.class, CrystalType.NONE);
  208. _crystalCount = set.getInteger("crystal_count", 0);
  209.  
  210. _stackable = set.getBool("is_stackable", false);
  211. _sellable = set.getBool("is_sellable", true);
  212. _dropable = set.getBool("is_dropable", true);
  213. _destroyable = set.getBool("is_destroyable", true);
  214. _tradable = set.getBool("is_tradable", true);
  215. _depositable = set.getBool("is_depositable", true);
  216.  
  217. _heroItem = (_itemId >= 6611 && _itemId <= 6621) || _itemId == 6842;
  218. _isOlyRestricted = set.getBool("is_oly_restricted", false);
  219.  
  220. _defaultAction = set.getEnum("default_action", ActionType.class, ActionType.none);
  221.  
  222. if (set.containsKey("item_skill"))
  223. _skillHolder = set.getIntIntHolderArray("item_skill");
  224. }
  225.  
  226. /**
  227.  
Add Comment
Please, Sign In to add comment