Advertisement
Sarada-L2

Mob Agression Nome Red C5

Jan 15th, 2024
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.30 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2J_Server
  3. diff --git java/config/options.properties
  4. index aaf0e66..eeb8480 100644
  5. --- java/config/options.properties
  6. +++ java/config/options.properties
  7. @@ -111,40 +111,44 @@
  8. # Note: This can increase network traffic
  9. ForceInventoryUpdate = False
  10.  
  11. # Set the html cache's lazy loading True or False
  12. # (Load html's into cache only on first time requested)
  13. LazyCache = True
  14.  
  15. # Maximum range mobs can randomly go from spawn point
  16. MaxDriftRange = 200
  17.  
  18. # Minimum and maximum variable in seconds for npc animation delay.
  19. # You must keep MinNPCAnimation <= MaxNPCAnimation.
  20. # "0" is default value.
  21. MinNPCAnimation = 0
  22. MaxNPCAnimation = 0
  23.  
  24.  
  25. # Show L2Monster level and aggro
  26. ShowNpcLevel = False
  27.  
  28. +# Show Red name of NPC / Monster if is agrro
  29. +# Default: False
  30. +ShowRedName = True
  31.  
  32. # Activate the position recorder
  33. # valid 3D points will be recorded and written to data/universe.txt on shutdown
  34. ActivatePositionRecorder = False
  35.  
  36.  
  37. # =================================================================
  38. # Additionnal features than can be enabled or disabled
  39. # =================================================================
  40. # If you are experiencing problems with Warehouse or Freight transactions,
  41. # feel free to disable them here. (They are both enabled by default).
  42. AllowWarehouse = True
  43. # Enable Warehouse Cache - if WH is not used will server clear memory used by this WH
  44. WarehouseCache = False
  45. # How long Warehouse should be store in Memory
  46. WarehouseCacheTime = 15
  47. AllowFreight = True
  48. # If True player can try on weapon and armor in shop
  49. # Each Item tried cost WearPrice adena
  50. AllowWear = True
  51. WearDelay = 10
  52. diff --git java/net/sf/l2j/Config.java
  53. index 246815b..9303709 100644
  54. --- java/net/sf/l2j/Config.java
  55. +++ java/net/sf/l2j/Config.java
  56. @@ -849,40 +849,41 @@
  57. public static String GAME_SERVER_LOGIN_HOST;
  58.  
  59. /** Internal Hostname */
  60. public static String INTERNAL_HOSTNAME;
  61.  
  62. /** External Hostname */
  63. public static String EXTERNAL_HOSTNAME;
  64.  
  65. public static int PATH_NODE_RADIUS;
  66.  
  67. public static int NEW_NODE_ID;
  68.  
  69. public static int SELECTED_NODE_ID;
  70.  
  71. public static int LINKED_NODE_ID;
  72.  
  73. public static String NEW_NODE_TYPE;
  74.  
  75. /** Show L2Monster level and aggro ? */
  76. public static boolean SHOW_NPC_LVL;
  77. + public static boolean SHOW_RED_NAME_IF_AGGRO;
  78.  
  79. /**
  80. * Force full item inventory packet to be sent for any item change ?<br>
  81. * <u><i>Note:</i></u> This can increase network traffic
  82. */
  83. public static boolean FORCE_INVENTORY_UPDATE;
  84.  
  85. /** Disable the use of guards against agressive monsters ? */
  86. public static boolean ALLOW_GUARDS;
  87.  
  88. /** Allow use Event Managers for change occupation ? */
  89. public static boolean ALLOW_CLASS_MASTERS;
  90.  
  91. /** Time between 2 updates of IP */
  92. public static int IP_UPDATE_TIME;
  93.  
  94. /** Zone Setting */
  95. public static int ZONE_TOWN;
  96.  
  97. /** Crafting Enabled? */
  98. @@ -1569,41 +1570,41 @@
  99. SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(optionsSettings
  100. .getProperty("ShowStatusOnCommunityBoard", "True"));
  101. NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(optionsSettings
  102. .getProperty("NamePageSizeOnCommunityBoard", "50"));
  103. NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(optionsSettings
  104. .getProperty("NamePerRowOnCommunityBoard", "5"));
  105.  
  106. ZONE_TOWN = Integer
  107. .parseInt(optionsSettings.getProperty("ZoneTown", "0"));
  108.  
  109. MAX_DRIFT_RANGE = Integer.parseInt(
  110. optionsSettings.getProperty("MaxDriftRange", "300"));
  111.  
  112. MIN_NPC_ANIMATION = Integer.parseInt(
  113. optionsSettings.getProperty("MinNPCAnimation", "0"));
  114. MAX_NPC_ANIMATION = Integer.parseInt(
  115. optionsSettings.getProperty("MaxNPCAnimation", "0"));
  116.  
  117. SHOW_NPC_LVL = Boolean.valueOf(
  118. optionsSettings.getProperty("ShowNpcLevel", "False"));
  119.  
  120. + SHOW_RED_NAME_IF_AGGRO = Boolean.valueOf(optionsSettings.getProperty("ShowRedName", "false"));
  121. FORCE_INVENTORY_UPDATE = Boolean.valueOf(optionsSettings
  122. .getProperty("ForceInventoryUpdate", "False"));
  123.  
  124. AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(optionsSettings
  125. .getProperty("AutoDeleteInvalidQuestData", "False"));
  126.  
  127. THREAD_P_EFFECTS = Integer.parseInt(optionsSettings
  128. .getProperty("ThreadPoolSizeEffects", "6"));
  129. THREAD_P_GENERAL = Integer.parseInt(optionsSettings
  130. .getProperty("ThreadPoolSizeGeneral", "15"));
  131. GENERAL_PACKET_THREAD_CORE_SIZE = Integer
  132. .parseInt(optionsSettings.getProperty(
  133. "GeneralPacketThreadCoreSize", "4"));
  134. URGENT_PACKET_THREAD_CORE_SIZE = Integer
  135. .parseInt(optionsSettings.getProperty(
  136. "UrgentPacketThreadCoreSize", "2"));
  137. AI_MAX_THREAD = Integer.parseInt(
  138. optionsSettings.getProperty("AiMaxThread", "10"));
  139. GENERAL_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings
  140. .getProperty("GeneralThreadCoreSize", "4"));
  141. diff --git java/net/sf/l2j/gameserver/model/L2Character.java
  142. index 5c466c7..4d0249d 100644
  143. --- java/net/sf/l2j/gameserver/model/L2Character.java
  144. +++ java/net/sf/l2j/gameserver/model/L2Character.java
  145. @@ -263,41 +263,44 @@
  146. // necessary to make a copy
  147. // to avoid that a spell affecting a L2NPCInstance, affects others
  148. // L2NPCInstance of the same type too.
  149. _Skills = ((L2NpcTemplate) template).getSkills();
  150. if (_Skills != null)
  151. {
  152. for (Map.Entry<Integer, L2Skill> skill : _Skills.entrySet())
  153. addStatFuncs(skill.getValue().getStatFuncs(null, this));
  154. }
  155. } else
  156. {
  157. // Initialize the FastMap _skills to null
  158. _Skills = new FastMap<>();
  159.  
  160. // If L2Character is a L2PcInstance or a L2Summon, create the basic
  161. // calculator set
  162. _Calculators = new Calculator[Stats.NUM_STATS];
  163. Formulas.getInstance().addFuncsToNewCharacter(this);
  164. }
  165. }
  166. + public boolean isAggressive()
  167. + {
  168. + return false;
  169. + }
  170. protected void initCharStatusUpdateValues()
  171. {
  172. _hpUpdateInterval = getMaxHp() / 352.0; // MAX_HP div MAX_HP_BAR_PX
  173. _hpUpdateIncCheck = getMaxHp();
  174. _hpUpdateDecCheck = getMaxHp() - _hpUpdateInterval;
  175. }
  176.  
  177. // =========================================================
  178. // Event - Public
  179. /**
  180. * Remove the L2Character from the world when the decay task is
  181. * launched.<BR>
  182. * <BR>
  183. *
  184. * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the
  185. * object from _allObjects of L2World </B></FONT><BR>
  186. * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND
  187. * Server->Client packets to players</B></FONT><BR>
  188. * <BR>
  189. *
  190. diff --git java/net/sf/l2j/gameserver/serverpackets/NpcInfo.java
  191. index b29ab6a..46c05d5 100644
  192. --- java/net/sf/l2j/gameserver/serverpackets/NpcInfo.java
  193. +++ java/net/sf/l2j/gameserver/serverpackets/NpcInfo.java
  194. @@ -148,43 +148,52 @@
  195. writeD(_flWalkSpd);
  196. writeD(_flyRunSpd);
  197. writeD(_flyWalkSpd);
  198. writeF(1.1/* _cha.getProperMultiplier() */);
  199. // writeF(1/*_cha.getAttackSpeedMultiplier()*/);
  200. writeF(_pAtkSpd / 277.478340719);
  201. writeF(collisionRadius);
  202. writeF(collisionHeight);
  203. writeD(_rhand); // right hand weapon
  204. writeD(0);
  205. writeD(_lhand); // left hand weapon
  206. writeC(1); // name above char 1=true ... ??
  207. writeC(_cha.isRunning() ? 1 : 0);
  208. writeC(_cha.isInCombat() ? 1 : 0);
  209. writeC(_cha.isAlikeDead() ? 1 : 0);
  210. writeC(_isSummoned ? 2 : 0); // invisible ?? 0=false 1=true 2=summoned
  211. // (only works if model has a summon
  212. // animation)
  213. writeS(_name);
  214. writeS(_title);
  215. - writeD(0);
  216. - writeD(0);
  217. - writeD(0000); // hmm karma ??
  218. + if (Config.SHOW_RED_NAME_IF_AGGRO && _cha instanceof L2MonsterInstance)
  219. + {
  220. + writeD(0);
  221. + writeD(0);
  222. + writeD(_cha.isAggressive() ? 0x9999 : 0x00);
  223. + }
  224. + else
  225. + {
  226. + writeD(0);
  227. + writeD(0);
  228. + writeD(0000); // hmm karma ??
  229. + }
  230.  
  231. writeD(_cha.getAbnormalEffect()); // C2
  232. writeD(0000); // C2
  233. writeD(0000); // C2
  234. writeD(0000); // C2
  235. writeD(0000); // C2
  236. writeC(0000); // C2
  237.  
  238. writeC(0x00); // C3 team circle 1-blue, 2-red
  239. writeF(0x00); // C4 i think it is collisionRadius a second time
  240. writeF(0x00); // C4 " collisionHeight "
  241. writeD(0x00); // C4
  242. }
  243.  
  244. /*
  245. * (non-Javadoc)
  246. *
  247. * @see net.sf.l2j.gameserver.serverpackets.ServerBasePacket#getType()
  248. */
  249. @Override
  250.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement