From 4da2db352bd0c1d900d2eeba509b97ff2239cd23 Mon Sep 17 00:00:00 2001 From: malyelfik <malyelfik@users.noreply.github.com> Date: Sun, 16 Sep 2012 17:14:11 +0000 Subject: [PATCH] BETA: Queen Shyeed AI Review by: !UnAfraid, Adry_85 '''NOTE:''' Remember to run the SQL update query to delete Shyeed old spawn. --- L2J_DataPack_BETA/dist/game/data/scripts.cfg | 1 + .../scripts/ai/individual/QueenShyeed.java | 110 ++++++++++++++++++ .../dist/game/data/zones/effect.xml | 53 +++++---- .../dist/sql/game/raidboss_spawnlist.sql | 2 +- .../dist/sql/game/updates/20120913update.sql | 1 + 5 files changed, 141 insertions(+), 26 deletions(-) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/QueenShyeed.java create mode 100644 L2J_DataPack_BETA/dist/sql/game/updates/20120913update.sql diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index 74bcb3d934..ba1a90ff57 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -100,6 +100,7 @@ ai/individual/NecromancerValley.java ai/individual/Orfen.java ai/individual/OutpostCaptain.java ai/individual/QueenAnt.java +ai/individual/QueenShyeed.java ai/individual/Ranku.java ai/individual/SandDrake.java ai/individual/SinWardens.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/QueenShyeed.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/QueenShyeed.java new file mode 100644 index 0000000000..4d40f2febd --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/QueenShyeed.java @@ -0,0 +1,110 @@ +/* + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * 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 General Public License for more + * details. + * + * 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.individual; + +import ai.npc.AbstractNpcAI; + +import com.l2jserver.gameserver.instancemanager.ZoneManager; +import com.l2jserver.gameserver.model.Location; +import com.l2jserver.gameserver.model.actor.L2Npc; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.gameserver.model.zone.type.L2EffectZone; +import com.l2jserver.gameserver.network.NpcStringId; +import com.l2jserver.gameserver.network.clientpackets.Say2; + +/** + * Queen Shyeed AI + * @author malyelfik + */ +public class QueenShyeed extends AbstractNpcAI +{ + // NPC + private static final int SHYEED = 25671; + private static final Location SHYEED_LOC = new Location(79634, -55428, -6104, 0); + + // Respawn + private static final int RESPAWN = 86400000; // 24 h + private static final int RANDOM_RESPAWN = 43200000; // 12 h + + // Zones + private static final L2EffectZone MOB_BUFF_ZONE = ZoneManager.getInstance().getZoneById(200103, L2EffectZone.class); + private static final L2EffectZone MOB_BUFF_DISPLAY_ZONE = ZoneManager.getInstance().getZoneById(200104, L2EffectZone.class); + private static final L2EffectZone PC_BUFF_ZONE = ZoneManager.getInstance().getZoneById(200105, L2EffectZone.class); + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + switch (event) + { + case "respawn": + spawnShyeed(); + break; + case "despawn": + if (!npc.isDead()) + { + npc.deleteMe(); + startRespawn(); + } + break; + } + return null; + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) + { + broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.SHYEEDS_CRY_IS_STEADILY_DYING_DOWN); + startRespawn(); + PC_BUFF_ZONE.setZoneEnabled(true); + return super.onKill(npc, killer, isPet); + } + + public QueenShyeed(String name, String descr) + { + super(name, descr); + addKillId(SHYEED); + spawnShyeed(); + } + + private void spawnShyeed() + { + String respawn = loadGlobalQuestVar("Respawn"); + long remain = (!respawn.isEmpty()) ? Long.parseLong(respawn) - System.currentTimeMillis() : 0; + if (remain > 0) + { + startQuestTimer("respawn", remain, null, null); + return; + } + final L2Npc npc = addSpawn(SHYEED, SHYEED_LOC, false, 0); + startQuestTimer("despawn", 10800000, npc, null); + PC_BUFF_ZONE.setZoneEnabled(false); + MOB_BUFF_ZONE.setZoneEnabled(true); + MOB_BUFF_DISPLAY_ZONE.setZoneEnabled(true); + } + + private void startRespawn() + { + int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN); + saveGlobalQuestVar("Respawn", Long.toString(System.currentTimeMillis() + respawnTime)); + startQuestTimer("respawn", respawnTime, null, null); + MOB_BUFF_ZONE.setZoneEnabled(false); + MOB_BUFF_DISPLAY_ZONE.setZoneEnabled(false); + } + + public static void main(String[] args) + { + new QueenShyeed(QueenShyeed.class.getSimpleName(), "ai"); + } +} \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/zones/effect.xml b/L2J_DataPack_BETA/dist/game/data/zones/effect.xml index c53ff91374..c29c897fd3 100644 --- a/L2J_DataPack_BETA/dist/game/data/zones/effect.xml +++ b/L2J_DataPack_BETA/dist/game/data/zones/effect.xml @@ -2060,35 +2060,38 @@ <node X="131" Y="242444" /> </zone> <!-- Stakato Nest Buff --> - <!-- zone name="22_16_stakato_mob_buff" type="EffectZone" shape="NPoly" minZ="-6368" maxZ="-3296" --> - <!-- stat name="skillIdLvl" val="6170-1;" / --> <!-- s_area_stakato_nest_fury --> - <!-- stat name="chance" val="100" / --> - <!-- stat name="unitTick" val="90" / --> - <!-- stat name="targetClass" val="L2Npc" / --> - <!-- stat name="default_enabled" val="false" / --> - <!-- stat name="reuse" val="60000" / --> <!-- Guess --> - <!-- node X="73945" Y="-57263" / --> - <!-- node X="90046" Y="-57259" / --> - <!-- node X="89999" Y="-41698" / --> - <!-- node X="73982" Y="-41655" / --> - <!-- /zone --> - <!-- zone name="22_16_stakato_mob_buff_display" type="EffectZone" shape="NPoly" minZ="-6368" maxZ="-3296" --> - <!-- stat name="skillIdLvl" val="6169-1;" / --> <!-- s_area_stakato_nest_fury_for_pc --> - <!-- stat name="chance" val="100" / --> - <!-- stat name="unitTick" val="90" / --> - <!-- stat name="default_enabled" val="false" / --> - <!-- stat name="reuse" val="60000" / --> <!-- Guess --> - <!-- node X="73945" Y="-57263" / --> - <!-- node X="90046" Y="-57259" / --> - <!-- node X="89999" Y="-41698" / --> - <!-- node X="73982" Y="-41655" / --> - <!-- /zone --> - <zone name="22_16_stakato_pc_buff" type="EffectZone" shape="NPoly" minZ="-6368" maxZ="-3296"> + <zone name="22_16_stakato_mob_buff" id="200103" type="EffectZone" shape="NPoly" minZ="-6368" maxZ="-3296"> + <stat name="skillIdLvl" val="6170-1;" /> <!-- s_area_stakato_nest_fury --> + <stat name="chance" val="100" /> + <!-- stat name="unitTick" val="90" / --> + <stat name="targetClass" val="L2Npc" /> + <stat name="default_enabled" val="false" /> + <stat name="reuse" val="3000" /> <!-- Guess --> + <stat name="showDangerIcon" val="false" /> <!-- Guess --> + <node X="73945" Y="-57263" /> + <node X="90046" Y="-57259" /> + <node X="89999" Y="-41698" /> + <node X="73982" Y="-41655" /> + </zone> + <zone name="22_16_stakato_mob_buff_display" id="200104" type="EffectZone" shape="NPoly" minZ="-6368" maxZ="-3296"> + <stat name="skillIdLvl" val="6169-1;" /> <!-- s_area_stakato_nest_fury_for_pc --> + <stat name="chance" val="100" /> + <!-- stat name="unitTick" val="90" / --> + <stat name="default_enabled" val="false" /> + <stat name="reuse" val="3000" /> <!-- Guess --> + <stat name="showDangerIcon" val="false" /> <!-- Guess --> + <node X="73945" Y="-57263" /> + <node X="90046" Y="-57259" /> + <node X="89999" Y="-41698" /> + <node X="73982" Y="-41655" /> + </zone> + <zone name="22_16_stakato_pc_buff" id="200105" type="EffectZone" shape="NPoly" minZ="-6368" maxZ="-3296"> <stat name="skillIdLvl" val="6171-1;" /> <!-- s_area_stakato_nest_replete_power --> <stat name="chance" val="100" /> <!-- stat name="unitTick" val="90" / --> <stat name="default_enabled" val="false" /> - <stat name="reuse" val="60000" /> <!-- Guess --> + <stat name="reuse" val="3000" /> <!-- Guess --> + <stat name="showDangerIcon" val="false" /> <!-- Guess --> <node X="73945" Y="-57263" /> <node X="90046" Y="-57259" /> <node X="89999" Y="-41698" /> diff --git a/L2J_DataPack_BETA/dist/sql/game/raidboss_spawnlist.sql b/L2J_DataPack_BETA/dist/sql/game/raidboss_spawnlist.sql index 768b12dc7f..fcd108f42c 100644 --- a/L2J_DataPack_BETA/dist/sql/game/raidboss_spawnlist.sql +++ b/L2J_DataPack_BETA/dist/sql/game/raidboss_spawnlist.sql @@ -284,7 +284,7 @@ INSERT IGNORE INTO `raidboss_spawnlist` (`boss_id`,`loc_x`,`loc_y`,`loc_z`,`head -- (25668,0,0,0,0,43200,129600,9999,9999), -- Cannibalistic Stakato Chief (82) (stats to be done) -- (25669,0,0,0,0,43200,129600,9999,9999), -- Cannibalistic Stakato Chief (82) (stats to be done) -- (25670,0,0,0,0,43200,129600,9999,9999), -- Cannibalistic Stakato Chief (82) (stats to be done) -(25671,79634,-55428,-6104,0,43200,86400,743801,4022), -- Queen Shyeed (84) +-- (25671,79634,-55428,-6104,0,43200,86400,743801,4022), -- Queen Shyeed (84) (Spawn by AI) (25674,86534,216888,-3176,0,43200,129600,736436,3945), -- Gwindorr (83) (25677,83056,183232,-3616,0,43200,129600,743801,4022), -- Water Spirit Lian (84) (25680,193902,54135,-4184,0,0,21600,2035459,3869), -- Giant Marpanak (82) diff --git a/L2J_DataPack_BETA/dist/sql/game/updates/20120913update.sql b/L2J_DataPack_BETA/dist/sql/game/updates/20120913update.sql new file mode 100644 index 0000000000..7f51063455 --- /dev/null +++ b/L2J_DataPack_BETA/dist/sql/game/updates/20120913update.sql @@ -0,0 +1 @@ +DELETE FROM raidboss_spawnlist WHERE boss_id = 25671; \ No newline at end of file -- GitLab