From d8c8007487db22b97dbfd7abb1d0027dca31a1e0 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 22 Dec 2020 22:10:59 +0000 Subject: [PATCH] Support for Certificate - Dual Class (Enhanced). --- .../data/scripts/ai/areas/Aden/Gallias/34514-26.html | 3 +++ .../game/data/scripts/ai/areas/Aden/Gallias/Gallias.java | 9 ++++++--- .../scripts/ai/areas/TalkingIsland/Trandon/33490-26.html | 3 +++ .../scripts/ai/areas/TalkingIsland/Trandon/Trandon.java | 7 +++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Aden/Gallias/34514-26.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Aden/Gallias/34514-26.html index 3e2afa3065..a1fc73bb4f 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Aden/Gallias/34514-26.html +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Aden/Gallias/34514-26.html @@ -9,4 +9,7 @@ Now, what level of certification do you want?
+ + + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Aden/Gallias/Gallias.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Aden/Gallias/Gallias.java index f6fd4feefb..d228c270ff 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Aden/Gallias/Gallias.java +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Aden/Gallias/Gallias.java @@ -47,12 +47,13 @@ public class Gallias extends AbstractNpcAI // Items private static final int SUB_CERTIFICATE = 10280; private static final int DUAL_CERTIFICATE = 36078; + private static final int DUAL_CERTIFICATE_ENHANCED = 81731; private static final int ENERGY_OF_POWER = 80924; // Skills private static final int DUAL_CLASS_RENEWED_ENERGY_OF_POWER = 30820; // Misc @formatter:off private static final int[] SUB_SKILL_LEVELS = {65, 70, 75, 80}; - private static final int[] DUAL_SKILL_LEVELS = {85, 90, 95, 99, 101, 103, 105}; + private static final int[] DUAL_SKILL_LEVELS = {85, 90, 95, 99, 101, 103, 105, 107, 109, 110}; // @formatter:on private static final String SUB_CERTIFICATE_COUNT_VAR = "SUB_CERTIFICATE_COUNT"; private static final String DUAL_CERTIFICATE_COUNT_VAR = "DUAL_CERTIFICATE_COUNT"; @@ -275,7 +276,7 @@ public class Gallias extends AbstractNpcAI { player.getVariables().set(DUAL_CERTIFICATE_COUNT_VAR, currentCount + 1); vars.set(getDualSkillVariableName(level), true); - giveItems(player, DUAL_CERTIFICATE, 1); + giveItems(player, level < 7 ? DUAL_CERTIFICATE : DUAL_CERTIFICATE_ENHANCED, 1); } htmltext = getHtm(player, "34514-29.html"); } @@ -289,7 +290,7 @@ public class Gallias extends AbstractNpcAI { htmltext = "34514-30.html"; } - else if (!ownsAtLeastOneItem(player, DUAL_CERTIFICATE)) + else if (!ownsAtLeastOneItem(player, DUAL_CERTIFICATE) && !ownsAtLeastOneItem(player, DUAL_CERTIFICATE_ENHANCED)) { htmltext = "34514-31.html"; } @@ -323,7 +324,9 @@ public class Gallias extends AbstractNpcAI { htmltext = null; // TODO: Unknown html takeItems(player, DUAL_CERTIFICATE, -1); + takeItems(player, DUAL_CERTIFICATE_ENHANCED, -1); player.getWarehouse().destroyItemByItemId("Quest", DUAL_CERTIFICATE, -1, player, npc); + player.getWarehouse().destroyItemByItemId("Quest", DUAL_CERTIFICATE_ENHANCED, -1, player, npc); takeItems(player, Inventory.ADENA_ID, Config.FEE_DELETE_DUALCLASS_SKILLS); player.getVariables().remove(DUAL_CERTIFICATE_COUNT_VAR); diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/TalkingIsland/Trandon/33490-26.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/TalkingIsland/Trandon/33490-26.html index a7803c657d..12a1f9275f 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/TalkingIsland/Trandon/33490-26.html +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/TalkingIsland/Trandon/33490-26.html @@ -9,4 +9,7 @@ Now, what level of certification do you want?
+ + + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/TalkingIsland/Trandon/Trandon.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/TalkingIsland/Trandon/Trandon.java index b7ea4705d1..06009393e6 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/TalkingIsland/Trandon/Trandon.java +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/TalkingIsland/Trandon/Trandon.java @@ -48,6 +48,7 @@ public class Trandon extends AbstractNpcAI // Items private static final int SUB_CERTIFICATE = 10280; private static final int DUAL_CERTIFICATE = 36078; + private static final int DUAL_CERTIFICATE_ENHANCED = 81731; // Misc @formatter:off private static final int[] SUB_SKILL_LEVELS = {65, 70, 75, 80}; private static final int[] DUAL_SKILL_LEVELS = {85, 90, 95, 99, 101, 103, 105, 107, 109, 110}; @@ -270,7 +271,7 @@ public class Trandon extends AbstractNpcAI { player.getVariables().set(DUAL_CERTIFICATE_COUNT_VAR, currentCount + 1); vars.set(getDualSkillVariableName(level), true); - giveItems(player, DUAL_CERTIFICATE, 1); + giveItems(player, level < 7 ? DUAL_CERTIFICATE : DUAL_CERTIFICATE_ENHANCED, 1); } htmltext = getHtm(player, "33490-29.html"); } @@ -284,7 +285,7 @@ public class Trandon extends AbstractNpcAI { htmltext = "33490-30.html"; } - else if (!ownsAtLeastOneItem(player, DUAL_CERTIFICATE)) + else if (!ownsAtLeastOneItem(player, DUAL_CERTIFICATE) && !ownsAtLeastOneItem(player, DUAL_CERTIFICATE_ENHANCED)) { htmltext = "33490-31.html"; } @@ -318,7 +319,9 @@ public class Trandon extends AbstractNpcAI { htmltext = null; // TODO: Unknown html takeItems(player, DUAL_CERTIFICATE, -1); + takeItems(player, DUAL_CERTIFICATE_ENHANCED, -1); player.getWarehouse().destroyItemByItemId("Quest", DUAL_CERTIFICATE, -1, player, npc); + player.getWarehouse().destroyItemByItemId("Quest", DUAL_CERTIFICATE_ENHANCED, -1, player, npc); takeItems(player, Inventory.ADENA_ID, Config.FEE_DELETE_DUALCLASS_SKILLS); player.getVariables().remove(DUAL_CERTIFICATE_COUNT_VAR);