L2JMobius
Free Users => Solved/Invalid Bug Reports => Topic started by: caioconc on June 24, 2020, 05:01:07 PM
-
hello,
It turns out that when using the key in the boxes is never given the prize.
Delux key is implemented ? I noticed that in the file (DeluxeKey.java), the verification function of chansse is not called (Chests.java//quests)!
LOGGER.info("Delux key casting succeded.") (ok)
....
-
Hi,
I can confirm that the keys won't ever open a chest, it will just attack the player even if the success rate is 100%. No error or anything.
-
Try this.
Index: dist/game/data/scripts/ai/others/Chests.java
===================================================================
--- dist/game/data/scripts/ai/others/Chests.java (revision 7463)
+++ dist/game/data/scripts/ai/others/Chests.java (working copy)
@@ -64,13 +64,14 @@
// if this has already been interacted, no further ai decisions are needed
// if it's the first interaction, check if this is a box or mimic
final ChestInstance chest = (ChestInstance) npc;
- if (chest.isInteracted())
+ if (!chest.isInteracted())
{
chest.setInteracted();
- if (Rnd.get(100) < IS_BOX)
+ final boolean isDeluxeSkill = skill.getId() == SKILL_DELUXE_KEY;
+ if ((Rnd.get(100) < IS_BOX) || isDeluxeSkill)
{
// if it's a box, either it will be successfully openned by a proper key, or instantly disappear
- if (skill.getId() == SKILL_DELUXE_KEY)
+ if (isDeluxeSkill)
{
// check the chance to open the box
final int keyLevelNeeded = chest.getLevel() / 10;
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/ChestKey.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/ChestKey.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/ChestKey.java (working copy)
@@ -53,7 +53,6 @@
final PlayerInstance player = (PlayerInstance) playable;
final int itemId = item.getItemId();
- final Skill skill = SkillTable.getInstance().getSkill(2229, itemId - 6664); // box key skill
final WorldObject target = player.getTarget();
if (!(target instanceof ChestInstance))
{
@@ -65,11 +64,13 @@
final ChestInstance chest = (ChestInstance) target;
if (chest.isDead() || chest.isInteracted())
{
- player.sendMessage("The chest Is empty.");
+ player.sendMessage("The chest is empty.");
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
+
+ final Skill skill = SkillTable.getInstance().getSkill(2229, itemId - 6664); // box key skill
player.useMagic(skill, false, false);
}
}
Index: java/org/l2jmobius/gameserver/handler/skillhandlers/DeluxeKey.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/skillhandlers/DeluxeKey.java (revision 7541)
+++ java/org/l2jmobius/gameserver/handler/skillhandlers/DeluxeKey.java (working copy)
@@ -51,7 +51,7 @@
return;
}
- LOGGER.info("Delux key casting succeded.");
+ // LOGGER.info("Delux key casting succeded.");
// This is just a dummy skill handler for the golden food and crystal food skills, since the AI responce onSkillUse handles the rest.
}
Not sure about
if ((Rnd.get(100) < IS_BOX) || isDeluxeSkill)
proper method might be
if (Rnd.get(100) < IS_BOX)
-
Any news on this?
-
Sorry for the late response, got home quite late. Yes it works, it opens the chests. What i noticed is that every time a chest is opened successfully and receive the drops, it also says: "That is the incorrect target" in the chat.
*UPDATE*
This is the correct method for this check:
if (Rnd.get(100) < IS_BOX)
-
I only get invalid target when you spam the item and a key is already used.
Fixed with https://bitbucket.org/MobiusDev/l2j_mobius/commits/83e79b6ac0a4034b698ebc96987575efbb2ccb56