diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java new file mode 100644 index 0000000000..5c5a048e49 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java @@ -0,0 +1,105 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package ai.areas.GardenOfGenesis; + +import com.l2jmobius.gameserver.geoengine.GeoEngine; +import com.l2jmobius.gameserver.model.L2World; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.holders.SkillHolder; + +import ai.AbstractNpcAI; + +/** + * Garden Watchman AI + * @author Gigi + * @date 2018-08-26 - [12:27:45] + */ +public class GardenWatchman extends AbstractNpcAI +{ + // NPCs + private static final int GARDEN_WATCHMAN = 22952; + private static final int GENESIS_TRAP_1 = 18985; + private static final int GENESIS_TRAP_2 = 18986; + // Skills + private static final SkillHolder TRAP_SETUP = new SkillHolder(14418, 1); + private static final SkillHolder HARMFUL_TRAP_1 = new SkillHolder(14075, 1); + private static final SkillHolder HARMFUL_TRAP_2 = new SkillHolder(14076, 1); + + public GardenWatchman() + { + addSpawnId(GARDEN_WATCHMAN); + addSeeCreatureId(GENESIS_TRAP_1, GENESIS_TRAP_2); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + switch (event) + { + case "SPAWN_TRAP": + { + if (!npc.isInCombat()) + { + npc.doCast(TRAP_SETUP.getSkill()); + final L2Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false); + trap.setDisplayEffect(1); + startQuestTimer("SPAWN_TRAP", getRandom(50000, 100000), npc, null); + } + break; + } + case "DEBUFF": + { + L2World.getInstance().forEachVisibleObjectInRange(npc, L2PcInstance.class, 100, nearby -> + { + if ((npc != null) && npc.isScriptValue(0) && nearby.isPlayer() && GeoEngine.getInstance().canSeeTarget(npc, nearby)) + { + npc.setScriptValue(1); + npc.setTarget(nearby); + npc.doCast((getRandom(10) < 5) ? HARMFUL_TRAP_1.getSkill() : HARMFUL_TRAP_2.getSkill()); + npc.deleteMe(); + } + }); + break; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onSpawn(L2Npc npc) + { + startQuestTimer("SPAWN_TRAP", 50000, npc, null); + return super.onSpawn(npc); + } + + @Override + public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon) + { + if (creature.isPlayer()) + { + startQuestTimer("DEBUFF", 3000, npc, null, true); + } + return super.onSeeCreature(npc, creature, isSummon); + } + + public static void main(String[] args) + { + new GardenWatchman(); + } +} diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/18900-18999.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/18900-18999.xml index 31d0035a5e..7d6c426c18 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/18900-18999.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/18900-18999.xml @@ -3550,7 +3550,7 @@ - + @@ -3584,7 +3584,7 @@ - + @@ -3611,7 +3611,7 @@ - + @@ -3637,7 +3637,7 @@ - + diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14000-14099.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14000-14099.xml index 027f3f4793..3521d7c02a 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14000-14099.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14000-14099.xml @@ -2797,9 +2797,8 @@ 180 100 true - SELF - POINT_BLANK - NOT_FRIEND + TARGET + SINGLE -20 @@ -2825,9 +2824,8 @@ 180 100 true - SELF - POINT_BLANK - NOT_FRIEND + TARGET + SINGLE -15 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14400-14499.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14400-14499.xml index 0bfa7f18df..2631bfd7c4 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14400-14499.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14400-14499.xml @@ -476,7 +476,7 @@ NONE -5 0 - 95 + 90 2000 SELF SINGLE diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java new file mode 100644 index 0000000000..5c5a048e49 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java @@ -0,0 +1,105 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package ai.areas.GardenOfGenesis; + +import com.l2jmobius.gameserver.geoengine.GeoEngine; +import com.l2jmobius.gameserver.model.L2World; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.holders.SkillHolder; + +import ai.AbstractNpcAI; + +/** + * Garden Watchman AI + * @author Gigi + * @date 2018-08-26 - [12:27:45] + */ +public class GardenWatchman extends AbstractNpcAI +{ + // NPCs + private static final int GARDEN_WATCHMAN = 22952; + private static final int GENESIS_TRAP_1 = 18985; + private static final int GENESIS_TRAP_2 = 18986; + // Skills + private static final SkillHolder TRAP_SETUP = new SkillHolder(14418, 1); + private static final SkillHolder HARMFUL_TRAP_1 = new SkillHolder(14075, 1); + private static final SkillHolder HARMFUL_TRAP_2 = new SkillHolder(14076, 1); + + public GardenWatchman() + { + addSpawnId(GARDEN_WATCHMAN); + addSeeCreatureId(GENESIS_TRAP_1, GENESIS_TRAP_2); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + switch (event) + { + case "SPAWN_TRAP": + { + if (!npc.isInCombat()) + { + npc.doCast(TRAP_SETUP.getSkill()); + final L2Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false); + trap.setDisplayEffect(1); + startQuestTimer("SPAWN_TRAP", getRandom(50000, 100000), npc, null); + } + break; + } + case "DEBUFF": + { + L2World.getInstance().forEachVisibleObjectInRange(npc, L2PcInstance.class, 100, nearby -> + { + if ((npc != null) && npc.isScriptValue(0) && nearby.isPlayer() && GeoEngine.getInstance().canSeeTarget(npc, nearby)) + { + npc.setScriptValue(1); + npc.setTarget(nearby); + npc.doCast((getRandom(10) < 5) ? HARMFUL_TRAP_1.getSkill() : HARMFUL_TRAP_2.getSkill()); + npc.deleteMe(); + } + }); + break; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onSpawn(L2Npc npc) + { + startQuestTimer("SPAWN_TRAP", 50000, npc, null); + return super.onSpawn(npc); + } + + @Override + public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon) + { + if (creature.isPlayer()) + { + startQuestTimer("DEBUFF", 3000, npc, null, true); + } + return super.onSeeCreature(npc, creature, isSummon); + } + + public static void main(String[] args) + { + new GardenWatchman(); + } +} diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/18900-18999.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/18900-18999.xml index 14a585eee0..9c5dd0ab7e 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/18900-18999.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/18900-18999.xml @@ -3550,7 +3550,7 @@ - + @@ -3584,7 +3584,7 @@ - + @@ -3611,7 +3611,7 @@ - + @@ -3637,7 +3637,7 @@ - + diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14000-14099.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14000-14099.xml index 93611541f6..9c323bddd7 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14000-14099.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14000-14099.xml @@ -2797,9 +2797,8 @@ 180 100 true - SELF - POINT_BLANK - NOT_FRIEND + TARGET + SINGLE -20 @@ -2825,9 +2824,8 @@ 180 100 true - SELF - POINT_BLANK - NOT_FRIEND + TARGET + SINGLE -15 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14400-14499.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14400-14499.xml index b00414a240..a1e09ce953 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14400-14499.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14400-14499.xml @@ -476,7 +476,7 @@ NONE -5 0 - 95 + 90 2000 SELF SINGLE diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java new file mode 100644 index 0000000000..5c5a048e49 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java @@ -0,0 +1,105 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package ai.areas.GardenOfGenesis; + +import com.l2jmobius.gameserver.geoengine.GeoEngine; +import com.l2jmobius.gameserver.model.L2World; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.holders.SkillHolder; + +import ai.AbstractNpcAI; + +/** + * Garden Watchman AI + * @author Gigi + * @date 2018-08-26 - [12:27:45] + */ +public class GardenWatchman extends AbstractNpcAI +{ + // NPCs + private static final int GARDEN_WATCHMAN = 22952; + private static final int GENESIS_TRAP_1 = 18985; + private static final int GENESIS_TRAP_2 = 18986; + // Skills + private static final SkillHolder TRAP_SETUP = new SkillHolder(14418, 1); + private static final SkillHolder HARMFUL_TRAP_1 = new SkillHolder(14075, 1); + private static final SkillHolder HARMFUL_TRAP_2 = new SkillHolder(14076, 1); + + public GardenWatchman() + { + addSpawnId(GARDEN_WATCHMAN); + addSeeCreatureId(GENESIS_TRAP_1, GENESIS_TRAP_2); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + switch (event) + { + case "SPAWN_TRAP": + { + if (!npc.isInCombat()) + { + npc.doCast(TRAP_SETUP.getSkill()); + final L2Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false); + trap.setDisplayEffect(1); + startQuestTimer("SPAWN_TRAP", getRandom(50000, 100000), npc, null); + } + break; + } + case "DEBUFF": + { + L2World.getInstance().forEachVisibleObjectInRange(npc, L2PcInstance.class, 100, nearby -> + { + if ((npc != null) && npc.isScriptValue(0) && nearby.isPlayer() && GeoEngine.getInstance().canSeeTarget(npc, nearby)) + { + npc.setScriptValue(1); + npc.setTarget(nearby); + npc.doCast((getRandom(10) < 5) ? HARMFUL_TRAP_1.getSkill() : HARMFUL_TRAP_2.getSkill()); + npc.deleteMe(); + } + }); + break; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onSpawn(L2Npc npc) + { + startQuestTimer("SPAWN_TRAP", 50000, npc, null); + return super.onSpawn(npc); + } + + @Override + public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon) + { + if (creature.isPlayer()) + { + startQuestTimer("DEBUFF", 3000, npc, null, true); + } + return super.onSeeCreature(npc, creature, isSummon); + } + + public static void main(String[] args) + { + new GardenWatchman(); + } +} diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/18900-18999.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/18900-18999.xml index 066f3158ed..4e022bc6a0 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/18900-18999.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/18900-18999.xml @@ -3379,7 +3379,7 @@ - + @@ -3413,7 +3413,7 @@ - + @@ -3440,7 +3440,7 @@ - + @@ -3466,7 +3466,7 @@ - + diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14000-14099.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14000-14099.xml index 93611541f6..9c323bddd7 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14000-14099.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14000-14099.xml @@ -2797,9 +2797,8 @@ 180 100 true - SELF - POINT_BLANK - NOT_FRIEND + TARGET + SINGLE -20 @@ -2825,9 +2824,8 @@ 180 100 true - SELF - POINT_BLANK - NOT_FRIEND + TARGET + SINGLE -15 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14400-14499.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14400-14499.xml index b00414a240..a1e09ce953 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14400-14499.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14400-14499.xml @@ -476,7 +476,7 @@ NONE -5 0 - 95 + 90 2000 SELF SINGLE diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java new file mode 100644 index 0000000000..5c5a048e49 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GardenOfGenesis/GardenWatchman.java @@ -0,0 +1,105 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 . + */ +package ai.areas.GardenOfGenesis; + +import com.l2jmobius.gameserver.geoengine.GeoEngine; +import com.l2jmobius.gameserver.model.L2World; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.holders.SkillHolder; + +import ai.AbstractNpcAI; + +/** + * Garden Watchman AI + * @author Gigi + * @date 2018-08-26 - [12:27:45] + */ +public class GardenWatchman extends AbstractNpcAI +{ + // NPCs + private static final int GARDEN_WATCHMAN = 22952; + private static final int GENESIS_TRAP_1 = 18985; + private static final int GENESIS_TRAP_2 = 18986; + // Skills + private static final SkillHolder TRAP_SETUP = new SkillHolder(14418, 1); + private static final SkillHolder HARMFUL_TRAP_1 = new SkillHolder(14075, 1); + private static final SkillHolder HARMFUL_TRAP_2 = new SkillHolder(14076, 1); + + public GardenWatchman() + { + addSpawnId(GARDEN_WATCHMAN); + addSeeCreatureId(GENESIS_TRAP_1, GENESIS_TRAP_2); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + switch (event) + { + case "SPAWN_TRAP": + { + if (!npc.isInCombat()) + { + npc.doCast(TRAP_SETUP.getSkill()); + final L2Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false); + trap.setDisplayEffect(1); + startQuestTimer("SPAWN_TRAP", getRandom(50000, 100000), npc, null); + } + break; + } + case "DEBUFF": + { + L2World.getInstance().forEachVisibleObjectInRange(npc, L2PcInstance.class, 100, nearby -> + { + if ((npc != null) && npc.isScriptValue(0) && nearby.isPlayer() && GeoEngine.getInstance().canSeeTarget(npc, nearby)) + { + npc.setScriptValue(1); + npc.setTarget(nearby); + npc.doCast((getRandom(10) < 5) ? HARMFUL_TRAP_1.getSkill() : HARMFUL_TRAP_2.getSkill()); + npc.deleteMe(); + } + }); + break; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onSpawn(L2Npc npc) + { + startQuestTimer("SPAWN_TRAP", 50000, npc, null); + return super.onSpawn(npc); + } + + @Override + public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon) + { + if (creature.isPlayer()) + { + startQuestTimer("DEBUFF", 3000, npc, null, true); + } + return super.onSeeCreature(npc, creature, isSummon); + } + + public static void main(String[] args) + { + new GardenWatchman(); + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/18900-18999.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/18900-18999.xml index 95c9032b49..c52bec47c7 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/18900-18999.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/18900-18999.xml @@ -3379,7 +3379,7 @@ - + @@ -3413,7 +3413,7 @@ - + @@ -3440,7 +3440,7 @@ - + @@ -3466,7 +3466,7 @@ - + diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14000-14099.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14000-14099.xml index 04020fecec..276c240ba4 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14000-14099.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14000-14099.xml @@ -2801,9 +2801,8 @@ 180 100 true - SELF - POINT_BLANK - NOT_FRIEND + TARGET + SINGLE -20 @@ -2829,9 +2828,8 @@ 180 100 true - SELF - POINT_BLANK - NOT_FRIEND + TARGET + SINGLE -15 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14400-14499.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14400-14499.xml index b00414a240..a1e09ce953 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14400-14499.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14400-14499.xml @@ -476,7 +476,7 @@ NONE -5 0 - 95 + 90 2000 SELF SINGLE