L2JMobius

Fafurion talismans disappear

monomo · 5 · 477

Offline monomo

  • Heir
  • **
    • Posts: 10

Hello, I was trying various things about the fafurion, testing quests and so on, I found that the talismans disappear when you equip them and log in again, they are not there, they appear as passive then if you equip them and you take off the bracelet, but they should not disappear the talismans


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16153
Try this.
Code: [Select]
Index: java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java (revision 13444)
+++ java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java (working copy)
@@ -364,6 +364,11 @@
  */
  public int getTalismanSlots()
  {
+ if (!getActiveChar().hasEnteredWorld())
+ {
+ return 6;
+ }
+
  return _talismanSlots.get();
  }
 
No idea if it works on free version.


Offline monomo

  • Heir
  • **
    • Posts: 10
   public int getTalismanSlots()
   {
      return _talismanSlots.get();
   }
   
   public void addTalismanSlots(int count)
   {
      _talismanSlots.addAndGet(count);


this is what appears in the mentioned file


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16153
Apply the patch I posted above.

How to create and apply DIFF patches
https://l2jmobius.org/forum/index.php?topic=896

Alternative patch.
Code: [Select]
Index: java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java (revision 13444)
+++ java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java (working copy)
@@ -364,6 +364,11 @@
  */
  public int getTalismanSlots()
  {
+ if (!getActiveChar().hasEnteredWorld())
+ {
+ return 6;
+ }
+
  return _talismanSlots.get();
  }
 
Index: java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java
===================================================================
--- java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java (revision 13444)
+++ java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java (working copy)
@@ -1616,13 +1616,25 @@
  }
  }
 
- // Notify to scripts
  if (old != null)
  {
  final Creature owner = getOwner();
- if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
+ if ((owner != null) && owner.isPlayer())
  {
- EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
+ // Proper talisman display on login.
+ if ((slot == PAPERDOLL_RBRACELET) && !owner.getActingPlayer().hasEnteredWorld())
+ {
+ for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
+ {
+ owner.getActingPlayer().addSkill(skill.getSkill(), false);
+ }
+ }
+
+ // Notify to scripts.
+ if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
+ {
+ EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
+ }
  }
  }