From 449ec73f7baa13c9a29154dffee118840a76a3d1 Mon Sep 17 00:00:00 2001 From: St3eT <St3eT@users.noreply.github.com> Date: Sun, 2 Feb 2014 15:46:01 +0000 Subject: [PATCH] BETA: Misc fixes: * Reworked '''Eva's Gift Box''' AI. * Reviewed by: malyelfik, Adry_85 * Cleanup after [10159]. * Reported by: jurchiks, Zoey76 * Reviewed by: malyelfik, Adry_85 * Fixing teleport to '''Parnassus''' by admin panel. * Reported by: lion * Reviewed by: malyelfik, Adry_85 --- .../WorldAreas/InnadrilTerritory.htm | 2 +- L2J_DataPack_BETA/dist/game/data/scripts.cfg | 2 +- .../EvasGiftBox.java} | 72 ++++++++++--------- .../Q00457_LostAndFound.java | 2 +- 4 files changed, 40 insertions(+), 38 deletions(-) rename L2J_DataPack_BETA/dist/game/data/scripts/ai/{group_template/EvasGiftBoxes.java => individual/EvasGiftBox.java} (51%) diff --git a/L2J_DataPack_BETA/dist/game/data/html/admin/teleports/WorldAreas/InnadrilTerritory.htm b/L2J_DataPack_BETA/dist/game/data/html/admin/teleports/WorldAreas/InnadrilTerritory.htm index fcc4c7a01c..e8cfcd8f4d 100644 --- a/L2J_DataPack_BETA/dist/game/data/html/admin/teleports/WorldAreas/InnadrilTerritory.htm +++ b/L2J_DataPack_BETA/dist/game/data/html/admin/teleports/WorldAreas/InnadrilTerritory.htm @@ -32,7 +32,7 @@ <button action="bypass -h admin_move_to 111418 225960 -3624" value="Tour Boat Dock" width=210 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br> <font color="LEVEL">Others</font><br1> <button action="bypass -h admin_move_to 160074 167893 -3538" value="Coral Reef" width=210 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br1> -<button action="bypass -h admin_move_to 149532 1772243 -610" value="Parnassus" width=210 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br> +<button action="bypass -h admin_move_to 149363 172341 -946" value="Parnassus" width=210 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br> <font color="LEVEL">Not Verified</font><br1> <button action="bypass -h admin_move_to 80688 245566 -8926" value="Garden of Eva 1st Floor" width=210 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br1> <button action="bypass -h admin_move_to 80629 246420 -9331" value="Garden of Eva 2nd Floor" width=210 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br1> diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index e8564233fd..11cdcdbbbe 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -90,7 +90,6 @@ ai/group_template/Chimeras.java ai/group_template/DenOfEvil.java ai/group_template/DragonValley.java ai/group_template/EnergySeeds.java -ai/group_template/EvasGiftBoxes.java ai/group_template/FairyTrees.java ai/group_template/FeedableBeasts.java ai/group_template/FrozenLabyrinth.java @@ -140,6 +139,7 @@ ai/individual/DarkWaterDragon.java ai/individual/DemonPrince.java ai/individual/DrChaos.java ai/individual/Epidos.java +ai/individual/EvasGiftBox.java ai/individual/FleeNpc.java ai/individual/FrightenedRagnaOrc.java ai/individual/GeneralDilios.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/EvasGiftBoxes.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/EvasGiftBox.java similarity index 51% rename from L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/EvasGiftBoxes.java rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/EvasGiftBox.java index 26bbab7c9f..28b76b3349 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/EvasGiftBoxes.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/EvasGiftBox.java @@ -16,68 +16,70 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -package ai.group_template; +package ai.individual; import ai.npc.AbstractNpcAI; +import com.l2jserver.gameserver.datatables.SpawnTable; +import com.l2jserver.gameserver.model.L2Spawn; +import com.l2jserver.gameserver.model.actor.L2Attackable; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.gameserver.model.holders.ItemHolder; /** - * Evas Gift Boxes AI. - * @author Gigiikun + * Eva's Gift Box AI. + * @author St3eT */ -public class EvasGiftBoxes extends AbstractNpcAI +public final class EvasGiftBox extends AbstractNpcAI { - // Monster - private static final int GIFTBOX = 32342; + // NPC + private static final int BOX = 32342; // Eva's Gift Box // Skill - private static final int KISSOFEVA = 1073; - // @formatter:off - private static final int[][] CHANCES = - { - // chance,itemId,... - { 2, 9692, 1, 9693 }, // without kiss of eva - { 100, 9692, 50, 9693 } // with kiss of eva - }; - // @formatter:on - private EvasGiftBoxes() - { - super(EvasGiftBoxes.class.getSimpleName(), "ai/group_template"); - addKillId(GIFTBOX); - addSpawnId(GIFTBOX); - } + private static final int BUFF = 1073; // Kiss of Eva + // Items + private static final ItemHolder CORAL = new ItemHolder(9692, 1); // Red Coral + private static final ItemHolder CRYSTAL = new ItemHolder(9693, 1); // Crystal Fragment - @Override - public String onSpawn(L2Npc npc) + private EvasGiftBox() { - npc.setIsNoRndWalk(true); - return super.onSpawn(npc); + super(EvasGiftBox.class.getSimpleName(), "ai/individual"); + addKillId(BOX); + addSpawnId(BOX); + + for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(BOX)) + { + onSpawn(spawn.getLastSpawn()); + } } @Override public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) { - if (npc.getId() == GIFTBOX) + if (killer.isAffectedBySkill(BUFF)) { - int isKissOfEvaBuffed = 0; - if (killer.isAffectedBySkill(KISSOFEVA)) + if (getRandomBoolean()) { - isKissOfEvaBuffed = 1; + npc.dropItem(killer, CRYSTAL); } - for (int i = 0; i < CHANCES[isKissOfEvaBuffed].length; i += 2) + else if (getRandom(100) < 33) { - if (getRandom(100) < CHANCES[isKissOfEvaBuffed][i]) - { - giveItems(killer, CHANCES[isKissOfEvaBuffed][i + 1], 1); - } + npc.dropItem(killer, CORAL); } } return super.onKill(npc, killer, isSummon); } + @Override + public String onSpawn(L2Npc npc) + { + npc.setIsNoRndWalk(true); + ((L2Attackable) npc).setOnKillDelay(0); + return super.onSpawn(npc); + } + public static void main(String[] args) { - new EvasGiftBoxes(); + new EvasGiftBox(); } } \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/Q00457_LostAndFound.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/Q00457_LostAndFound.java index 4032bddb76..d0aaf1b483 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/Q00457_LostAndFound.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/Q00457_LostAndFound.java @@ -195,7 +195,7 @@ public final class Q00457_LostAndFound extends Quest @Override public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon) { - final QuestState st = (player.getQuestState(getName()) == null) ? newQuestState(player) : player.getQuestState(getName()); + final QuestState st = getQuestState(player, true); if ((getRandom(100) < CHANCE_SPAWN) && st.isNowAvailable() && (player.getLevel() >= MIN_LV)) { -- GitLab