Advertisement
DevWilliams

Merchant Say 2

Apr 23rd, 2021
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.17 KB | None | 0 0
  1. diff --git a/aCis/data/xml/merchantSays.xml b/aCis/data/xml/merchantSays.xml
  2. index 144a7f5..3bc5c8a 100644
  3. --- a/aCis/data/xml/merchantSays.xml
  4. +++ b/aCis/data/xml/merchantSays.xml
  5. @@ -1,26 +1,4 @@
  6. <?xml version="1.0" encoding="UTF-8"?>
  7. <list>
  8. -<!-- SayType
  9. -
  10. - ALL,
  11. - SHOUT, // !
  12. - TELL, // "
  13. - PARTY, // #
  14. - CLAN, // @
  15. - GM,
  16. - PETITION_PLAYER,
  17. - PETITION_GM,
  18. - TRADE, // +
  19. - ALLIANCE, // $
  20. - ANNOUNCEMENT,
  21. - BOAT,
  22. - L2FRIEND,
  23. - MSNCHAT,
  24. - PARTYMATCH_ROOM,
  25. - PARTYROOM_COMMANDER, // (Yellow)
  26. - PARTYROOM_ALL, // (Red)
  27. - HERO_VOICE,
  28. - CRITICAL_ANNOUNCE;
  29. - -->
  30. - <settings npcId="30001" text="Hello what do you want ?" sayType="SHOUT" effect="true" />
  31. + <settings npcId="30001" text="Hello what do you want ?" effect="true" />
  32. </list>
  33. \ No newline at end of file
  34. diff --git a/aCis/java/net/sf/l2j/gameserver/data/xml/MerchantSayData.java b/aCis/java/net/sf/l2j/gameserver/data/xml/MerchantSayData.java
  35. index 8d089c8..b8c41b0 100644
  36. --- a/aCis/java/net/sf/l2j/gameserver/data/xml/MerchantSayData.java
  37. +++ b/aCis/java/net/sf/l2j/gameserver/data/xml/MerchantSayData.java
  38. @@ -6,7 +6,6 @@
  39.  
  40. import net.sf.l2j.commons.data.xml.IXmlReader;
  41.  
  42. -import net.sf.l2j.gameserver.enums.SayType;
  43. import net.sf.l2j.gameserver.model.MerchantSay;
  44. import org.w3c.dom.Document;
  45. import org.w3c.dom.NamedNodeMap;
  46. @@ -46,10 +45,9 @@
  47.  
  48. final int npcId = Integer.valueOf(attrs.getNamedItem("npcId").getNodeValue());
  49. final String text = attrs.getNamedItem("text").getNodeValue();
  50. - final SayType say = Enum.valueOf(SayType.class, attrs.getNamedItem("sayType").getNodeValue());
  51. final boolean effect = Boolean.valueOf(attrs.getNamedItem("effect").getNodeValue());
  52.  
  53. - _says.put(npcId, new MerchantSay(npcId, text, say, effect));
  54. + _says.put(npcId, new MerchantSay(text, effect));
  55. }));
  56. }
  57.  
  58. diff --git a/aCis/java/net/sf/l2j/gameserver/model/MerchantSay.java b/aCis/java/net/sf/l2j/gameserver/model/MerchantSay.java
  59. index 256d7af..18d027d 100644
  60. --- a/aCis/java/net/sf/l2j/gameserver/model/MerchantSay.java
  61. +++ b/aCis/java/net/sf/l2j/gameserver/model/MerchantSay.java
  62. @@ -1,41 +1,25 @@
  63. package net.sf.l2j.gameserver.model;
  64.  
  65. -import net.sf.l2j.gameserver.enums.SayType;
  66. -
  67. /**
  68. * @author willi
  69. *
  70. */
  71. public class MerchantSay
  72. {
  73. - private final int _npcId;
  74. private final String _text;
  75. - private final SayType _type;
  76. private final boolean _effect;
  77.  
  78. - public MerchantSay(int npcId, String text, SayType type, boolean effect)
  79. + public MerchantSay(String text, boolean effect)
  80. {
  81. - _npcId = npcId;
  82. _text = text;
  83. - _type = type;
  84. _effect = effect;
  85. }
  86.  
  87. - public int getNpcId()
  88. - {
  89. - return _npcId;
  90. - }
  91. -
  92. public String getText()
  93. {
  94. return _text;
  95. }
  96.  
  97. - public SayType getType()
  98. - {
  99. - return _type;
  100. - }
  101. -
  102. public boolean isEffects()
  103. {
  104. return _effect;
  105. diff --git a/aCis/java/net/sf/l2j/gameserver/model/actor/instance/Merchant.java b/aCis/java/net/sf/l2j/gameserver/model/actor/instance/Merchant.java
  106. index 070ef2e..d8f1b28 100644
  107. --- a/aCis/java/net/sf/l2j/gameserver/model/actor/instance/Merchant.java
  108. +++ b/aCis/java/net/sf/l2j/gameserver/model/actor/instance/Merchant.java
  109. @@ -9,6 +9,7 @@
  110. import net.sf.l2j.gameserver.data.xml.MerchantSayData;
  111. import net.sf.l2j.gameserver.data.xml.MultisellData;
  112. import net.sf.l2j.gameserver.enums.FloodProtector;
  113. +import net.sf.l2j.gameserver.enums.SayType;
  114. import net.sf.l2j.gameserver.model.MerchantSay;
  115. import net.sf.l2j.gameserver.model.actor.Player;
  116. import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  117. @@ -38,13 +39,13 @@
  118. public String getHtmlPath(int npcId, int val)
  119. {
  120. final MerchantSay says = MerchantSayData.getInstance().getNpc(getNpcId());
  121. - if (says == null)
  122. - return "";
  123. -
  124. - broadcastPacket(new CreatureSay(getObjectId(), says.getType(), getName(), says.getText()));
  125. -
  126. - if (says.isEffects())
  127. - broadcastPacket(new MagicSkillUse(this, this, 2024, 1, 5, 0));
  128. + if (says != null)
  129. + {
  130. + broadcastPacket(new CreatureSay(getObjectId(), SayType.TELL, getName(), says.getText()));
  131. +
  132. + if (says.isEffects())
  133. + broadcastPacket(new MagicSkillUse(this, this, 2024, 1, 5, 0));
  134. + }
  135.  
  136. String filename = "";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement