From d736d00964c20e835d71ed4e7af309f463ab6c84 Mon Sep 17 00:00:00 2001 From: ronancpl Date: Wed, 17 May 2017 19:27:44 -0300 Subject: [PATCH] Fixed Pet Name Tag + quest 3927 Fixed some issues related to Pet Name Tag item and quest 3927. --- README_wzchanges.txt | 5 +- mychanges_ptbr.txt | 9 ++- nbproject/private/private.xml | 47 +++++++------ scripts/event/HenesysPQ.js | 2 +- scripts/npc/world0/2103001.js | 14 ++++ scripts/quest/3927.js | 67 +++++++++++++++++++ src/client/inventory/MaplePet.java | 4 +- .../channel/handlers/QuestActionHandler.java | 2 - .../channel/handlers/UseCashItemHandler.java | 7 +- src/scripting/AbstractPlayerInteraction.java | 10 +++ src/server/quest/MapleQuest.java | 6 +- wz/Quest.wz/Act.img.xml | 2 - wz/Quest.wz/Check.img.xml | 6 +- wz/Quest.wz/Say.img.xml | 17 ----- 14 files changed, 142 insertions(+), 56 deletions(-) create mode 100644 scripts/npc/world0/2103001.js create mode 100644 scripts/quest/3927.js diff --git a/README_wzchanges.txt b/README_wzchanges.txt index 21d1710bb9..3bfc2a84c8 100644 --- a/README_wzchanges.txt +++ b/README_wzchanges.txt @@ -1,5 +1,8 @@ Changes from the original v83 WZs: +Character.wz/*: + Upgraded info of some items. + Map.wz/MapX/*: Fixed entries of portals placed incorrectly. @@ -19,7 +22,7 @@ Ronan Lana's MobBookUpdate facility. P.S.: Yeah, these explanations are pretty simplistic, I know. If one really wants to -compare the two WZ systems, I recommend do the following: +compare the original v83 WZ with the ones I provided, I recommend do the following: - Open HaRepacker and, for each MapleSolaxiaV2's WZ file, extract all the XMLs for "Private Server". - Now, install MapleStory from "ManagerMsv83.exe" on an other folder and do the diff --git a/mychanges_ptbr.txt b/mychanges_ptbr.txt index a25568c5a5..4ea438c08f 100644 --- a/mychanges_ptbr.txt +++ b/mychanges_ptbr.txt @@ -218,4 +218,11 @@ Sistema de Lobbys na BRPQ: aloca lobbys disponiveis para times de acordo com o l Sword Earrings: +30HP -> +1 W.att / Shield Earrings: +1ACC -> +1 M.att 15 Maio 2017, -Implementação da LMPQ. \ No newline at end of file +Implementação da LMPQ. + +16 Maio 2017, +Implementação da HPQ. + +17 Maio 2017, +Correção de bug com o item "Pet Name Tag", que não retirava o item após ser usado. +Correção em bug de uma quest (id 3927) de Ariant que envolve uma "parede". \ No newline at end of file diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 29a476cbad..ce3e6dc565 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -3,27 +3,34 @@ - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/1012113.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/2040047_old.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/9108004.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/9108001.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/MobDamageMobFriendlyHandler.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/9108002.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/KerningPQ.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/1012114.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/9108005.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/9201134.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/LudiPQ.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/2030010.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/HenesysPQ.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/9040005.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/1012112.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/9108000.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/2131000.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/quest/requirements/InfoExRequirement.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/Item.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/map/MapScriptMethods.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/2101000.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/2103001.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/quest/1021.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/Equip.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/UseCashItemHandler.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/quest/3927.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/quest/QuestActionManager.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/quest/QuestScriptManager.java file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleClient.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/9108003.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/ModifyInventory.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/MaplePet.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/2111009.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleShop.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/wz/String.wz/Npc.img.xml + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/quest/20522.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/MapleInventory.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/2101001.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/2094001.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleQuestStatus.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/QuestActionHandler.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/2131002.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/quest/MapleQuest.java diff --git a/scripts/event/HenesysPQ.js b/scripts/event/HenesysPQ.js index b95aed05cd..509d65bb33 100644 --- a/scripts/event/HenesysPQ.js +++ b/scripts/event/HenesysPQ.js @@ -4,7 +4,7 @@ */ var isPq = true; -var minPlayers = 1, maxPlayers = 6; +var minPlayers = 3, maxPlayers = 6; var minLevel = 10, maxLevel = 200; var entryMap = 910010000; var exitMap = 910010300; diff --git a/scripts/npc/world0/2103001.js b/scripts/npc/world0/2103001.js new file mode 100644 index 0000000000..241adeade8 --- /dev/null +++ b/scripts/npc/world0/2103001.js @@ -0,0 +1,14 @@ +var status = -1; + +function start() { + action(1, 0, 0); +} + +function action(mode, type, selection) { + if(cm.isQuestStarted(3927)) { + cm.sendNext("If I had an iron hammer and a dagger, a bow and an arrow..."); + cm.setQuestProgress(3927, 1); + } + + cm.dispose(); +} \ No newline at end of file diff --git a/scripts/quest/3927.js b/scripts/quest/3927.js new file mode 100644 index 0000000000..d3d3fa14a8 --- /dev/null +++ b/scripts/quest/3927.js @@ -0,0 +1,67 @@ +/* + This file is part of the OdinMS Maple Story Server + Copyright (C) 2008 Patrick Huy + Matthias Butz + Jan Christian Meyer + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +/* + Author : Ronan Lana +*/ + +var status = -1; + +function end(mode, type, selection) { + if (mode == -1) { + qm.dispose(); + } else { + if (mode == 0 && status == 0) { + qm.dispose(); + return; + } + + if (mode == 1) + status++; + else + status--; + + + if(qm.getQuestProgress(3927) == 0) { // didn't find the wall yet, eh? + qm.sendOk("Did you find the wall? Look closely, the wall is more near than you think!"); + qm.dispose(); + return; + } + + if (status == 0) { + qm.sendSimple("Did you find the wall?\r\n#L0##b I did, but... I have no idea what it's talking about.#l"); + } else if (status == 1) { + qm.sendSimple("What did it say?\r\n#L0##b 'If I had an iron hammer and a dagger, a bow and an arrow...'#l\r\n#L1# 'Byron S2 Sirin'#l\r\n#L2# 'Ahhh I forgot.'"); + } else if (status == 2) { + if(selection == 0) { + qm.sendOk("If I had an iron hammer and a dagger... a bow and an arrow... what does that mean? Do you want me to tell you? I don't know myself. It's something you should think about. If you need a clue... it would go something like... a weapon is just an item... until someone uses it...?"); + qm.gainExp(1000 * qm.getPlayer().getExpRate()); + qm.forceCompleteQuest(); + } else if(selection == 1) { + qm.sendOk("Man, Jiyur wrote on the wall again! Arrgh!!"); + } else { + qm.sendOk("What? You forgot? Do you remember where it was written?"); + } + + qm.dispose(); + } + } +} \ No newline at end of file diff --git a/src/client/inventory/MaplePet.java b/src/client/inventory/MaplePet.java index faee2f9309..5ccdf531e5 100644 --- a/src/client/inventory/MaplePet.java +++ b/src/client/inventory/MaplePet.java @@ -203,8 +203,8 @@ public class MaplePet extends Item { saveToDb(); Item petz = owner.getInventory(MapleInventoryType.CASH).getItem(getPosition()); - if (petz == null) return; - owner.forceUpdateItem(petz); + if (petz != null) + owner.forceUpdateItem(petz); } public void setLevel(byte level) { diff --git a/src/net/server/channel/handlers/QuestActionHandler.java b/src/net/server/channel/handlers/QuestActionHandler.java index dedb7ec7a8..b231fad416 100644 --- a/src/net/server/channel/handlers/QuestActionHandler.java +++ b/src/net/server/channel/handlers/QuestActionHandler.java @@ -69,8 +69,6 @@ public final class QuestActionHandler extends AbstractMaplePacketHandler { if(quest.canComplete(player, npc)) { QuestScriptManager.getInstance().end(c, questid, npc); - player.getClient().getSession().write(MaplePacketCreator.showSpecialEffect(9)); //show effect when completion - player.getMap().broadcastMessage(player, MaplePacketCreator.showForeignEffect(player.getId(), 9));//show effect around players I guess } } } diff --git a/src/net/server/channel/handlers/UseCashItemHandler.java b/src/net/server/channel/handlers/UseCashItemHandler.java index df285512b0..1ace8c74db 100644 --- a/src/net/server/channel/handlers/UseCashItemHandler.java +++ b/src/net/server/channel/handlers/UseCashItemHandler.java @@ -376,11 +376,14 @@ public final class UseCashItemHandler extends AbstractMaplePacketHandler { c.announce(MaplePacketCreator.enableActions()); return; } - Item item = player.getInventory(MapleInventoryType.CASH).getItem(pet.getPosition()); String newName = slea.readMapleAsciiString(); pet.setName(newName); pet.saveToDb(); - player.forceUpdateItem(item); + + Item item = player.getInventory(MapleInventoryType.CASH).getItem(pet.getPosition()); + if (item != null) + player.forceUpdateItem(item); + player.getMap().broadcastMessage(player, MaplePacketCreator.changePetName(player, newName, 1), true); c.announce(MaplePacketCreator.enableActions()); remove(c, itemId); diff --git a/src/scripting/AbstractPlayerInteraction.java b/src/scripting/AbstractPlayerInteraction.java index d172a5ddca..ef624941ab 100644 --- a/src/scripting/AbstractPlayerInteraction.java +++ b/src/scripting/AbstractPlayerInteraction.java @@ -269,6 +269,16 @@ public class AbstractPlayerInteraction { } } + public void setQuestProgress(int qid, int progress) { + MapleQuestStatus status = c.getPlayer().getQuest(MapleQuest.getInstance(qid)); + status.setProgress(status.getAnyProgressKey(), String.valueOf(progress)); + } + + public void setQuestProgress(int qid, int pid, int progress) { + MapleQuestStatus status = c.getPlayer().getQuest(MapleQuest.getInstance(qid)); + status.setProgress(pid, String.valueOf(progress)); + } + public int getQuestProgress(int qid) { MapleQuestStatus status = c.getPlayer().getQuest(MapleQuest.getInstance(qid)); String progress = status.getProgress(status.getAnyProgressKey()); diff --git a/src/server/quest/MapleQuest.java b/src/server/quest/MapleQuest.java index 7fa1e2021d..19700bd68c 100644 --- a/src/server/quest/MapleQuest.java +++ b/src/server/quest/MapleQuest.java @@ -256,9 +256,6 @@ public class MapleQuest { for (MapleQuestAction a : completeActs.values()) { a.run(c, selection); } - - c.getClient().getSession().write(MaplePacketCreator.showSpecialEffect(9)); // Quest completion - c.getMap().broadcastMessage(c, MaplePacketCreator.showForeignEffect(c.getId(), 9), false); //use 9 instead of 12 for both } } @@ -297,6 +294,9 @@ public class MapleQuest { newStatus.setForfeited(c.getQuest(this).getForfeited()); newStatus.setCompletionTime(System.currentTimeMillis()); c.updateQuest(newStatus); + + c.getClient().getSession().write(MaplePacketCreator.showSpecialEffect(9)); // Quest completion + c.getMap().broadcastMessage(c, MaplePacketCreator.showForeignEffect(c.getId(), 9), false); //use 9 instead of 12 for both return true; } diff --git a/wz/Quest.wz/Act.img.xml b/wz/Quest.wz/Act.img.xml index 9e9bfbb414..ce5235bf35 100644 --- a/wz/Quest.wz/Act.img.xml +++ b/wz/Quest.wz/Act.img.xml @@ -27426,10 +27426,8 @@ - - diff --git a/wz/Quest.wz/Check.img.xml b/wz/Quest.wz/Check.img.xml index 459c88e7e4..24cdfe8e95 100644 --- a/wz/Quest.wz/Check.img.xml +++ b/wz/Quest.wz/Check.img.xml @@ -48355,11 +48355,7 @@ - - - - - + diff --git a/wz/Quest.wz/Say.img.xml b/wz/Quest.wz/Say.img.xml index fb0fb43ed6..37e263bdd7 100644 --- a/wz/Quest.wz/Say.img.xml +++ b/wz/Quest.wz/Say.img.xml @@ -30133,23 +30133,6 @@ - - - - - - - - - - - - - - - - -