+
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
new file mode 100644
index 0000000000..122559c4be
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
@@ -0,0 +1,125 @@
+/*
+ * 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.Giran.Grace;
+
+import org.l2jmobius.commons.util.Rnd;
+import org.l2jmobius.gameserver.cache.HtmCache;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.events.EventType;
+import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
+import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
+import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
+import org.l2jmobius.gameserver.model.holders.SkillHolder;
+import org.l2jmobius.gameserver.model.skill.SkillCaster;
+import org.l2jmobius.gameserver.network.SystemMessageId;
+import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
+import org.l2jmobius.gameserver.network.serverpackets.ExPremiumManagerShowHtml;
+
+import ai.AbstractNpcAI;
+
+/**
+ * @author Index
+ */
+public class Grace extends AbstractNpcAI
+{
+ // NPC
+ private static final int GRACE = 34544;
+ // Skills
+ private static final SkillHolder GRACE_LUCK_LV1 = new SkillHolder(32967, 1);
+ private static final SkillHolder GRACE_LUCK_LV2 = new SkillHolder(32967, 2);
+ // Misc
+ private static final ConfirmDlg CONFIRM_DIALOG = new ConfirmDlg(SystemMessageId.I_CAN_GIVE_YOU_A_GOOD_LUCK_BUFF_WILL_YOU_ACCEPT_IT_IT_WILL_COST_YOU_7_000_000_ADENA);
+ private static final int ADENA_COST = 7000000;
+ private static final int BUFF_CHANCE = 30;
+ private static Npc _graceNpc;
+
+ private Grace()
+ {
+ addStartNpc(GRACE);
+ addFirstTalkId(GRACE);
+ addTalkId(GRACE);
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, Player player)
+ {
+ if (event.equals("GRACE_BLESSING") && (npc != null) && (npc.getId() == GRACE))
+ {
+ if ((_graceNpc != null) && _graceNpc.isDead())
+ {
+ _graceNpc = null;
+ }
+ if ((_graceNpc == null) && !npc.isDead())
+ {
+ _graceNpc = npc;
+ }
+ player.sendPacket(CONFIRM_DIALOG);
+ }
+ return null;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, Player player)
+ {
+ player.sendPacket(new ExPremiumManagerShowHtml(HtmCache.getInstance().getHtm(player, "data/scripts/ai/areas/Giran/Grace/34544.html")));
+ return null;
+ }
+
+ @RegisterEvent(EventType.ON_PLAYER_DLG_ANSWER)
+ @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
+ public void onPlayerDlgAnswer(OnPlayerDlgAnswer event)
+ {
+ final Player player = event.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ if (event.getMessageId() != SystemMessageId.I_CAN_GIVE_YOU_A_GOOD_LUCK_BUFF_WILL_YOU_ACCEPT_IT_IT_WILL_COST_YOU_7_000_000_ADENA.getId())
+ {
+ return;
+ }
+
+ if (event.getAnswer() != 1)
+ {
+ return;
+ }
+
+ if (_graceNpc == null)
+ {
+ return;
+ }
+
+ if (player.calculateDistance3D(_graceNpc) > Npc.INTERACTION_DISTANCE)
+ {
+ player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
+ return;
+ }
+
+ if (player.reduceAdena("Grace", ADENA_COST, _graceNpc, true))
+ {
+ SkillCaster.triggerCast(_graceNpc, player, Rnd.get(100) < BUFF_CHANCE ? GRACE_LUCK_LV2.getSkill() : GRACE_LUCK_LV1.getSkill());
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ new Grace();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/spawns/Giran/TownOfGiran.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/spawns/Giran/TownOfGiran.xml
index b6b9a3458d..2249c3af5f 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/data/spawns/Giran/TownOfGiran.xml
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/spawns/Giran/TownOfGiran.xml
@@ -35,7 +35,7 @@
-
+
@@ -48,7 +48,8 @@
-
+
+
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/32900-32999.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/32900-32999.xml
index 623be34bd3..caf211c119 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/32900-32999.xml
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/32900-32999.xml
@@ -679,7 +679,24 @@
icon.skill0000
- A1
+ A2
+
+ 1
+ 2
+
+ 10
+ 1
+ SELF
+ SINGLE
+
+
+
+ 1
+ 3
+
+ LUC
+
+
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/SystemMessageId.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/SystemMessageId.java
index 6b018bd92c..405f146bd4 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/SystemMessageId.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/SystemMessageId.java
@@ -17650,6 +17650,9 @@ public class SystemMessageId
@ClientString(id = 13136, message = "The enchant value is decreased by 1.")
public static SystemMessageId THE_ENCHANT_VALUE_IS_DECREASED_BY_1;
+ @ClientString(id = 13146, message = "I can give you a good luck buff. Will you accept it? (It will cost you 7,000,000 adena.)")
+ public static SystemMessageId I_CAN_GIVE_YOU_A_GOOD_LUCK_BUFF_WILL_YOU_ACCEPT_IT_IT_WILL_COST_YOU_7_000_000_ADENA;
+
@ClientString(id = 13213, message = "A new homunculus is created.")
public static SystemMessageId A_NEW_HOMUNCULUS_IS_CREATED;
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html
new file mode 100644
index 0000000000..0bc7ed1836
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html
@@ -0,0 +1,15 @@
+Grace
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
new file mode 100644
index 0000000000..122559c4be
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
@@ -0,0 +1,125 @@
+/*
+ * 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.Giran.Grace;
+
+import org.l2jmobius.commons.util.Rnd;
+import org.l2jmobius.gameserver.cache.HtmCache;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.events.EventType;
+import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
+import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
+import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
+import org.l2jmobius.gameserver.model.holders.SkillHolder;
+import org.l2jmobius.gameserver.model.skill.SkillCaster;
+import org.l2jmobius.gameserver.network.SystemMessageId;
+import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
+import org.l2jmobius.gameserver.network.serverpackets.ExPremiumManagerShowHtml;
+
+import ai.AbstractNpcAI;
+
+/**
+ * @author Index
+ */
+public class Grace extends AbstractNpcAI
+{
+ // NPC
+ private static final int GRACE = 34544;
+ // Skills
+ private static final SkillHolder GRACE_LUCK_LV1 = new SkillHolder(32967, 1);
+ private static final SkillHolder GRACE_LUCK_LV2 = new SkillHolder(32967, 2);
+ // Misc
+ private static final ConfirmDlg CONFIRM_DIALOG = new ConfirmDlg(SystemMessageId.I_CAN_GIVE_YOU_A_GOOD_LUCK_BUFF_WILL_YOU_ACCEPT_IT_IT_WILL_COST_YOU_7_000_000_ADENA);
+ private static final int ADENA_COST = 7000000;
+ private static final int BUFF_CHANCE = 30;
+ private static Npc _graceNpc;
+
+ private Grace()
+ {
+ addStartNpc(GRACE);
+ addFirstTalkId(GRACE);
+ addTalkId(GRACE);
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, Player player)
+ {
+ if (event.equals("GRACE_BLESSING") && (npc != null) && (npc.getId() == GRACE))
+ {
+ if ((_graceNpc != null) && _graceNpc.isDead())
+ {
+ _graceNpc = null;
+ }
+ if ((_graceNpc == null) && !npc.isDead())
+ {
+ _graceNpc = npc;
+ }
+ player.sendPacket(CONFIRM_DIALOG);
+ }
+ return null;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, Player player)
+ {
+ player.sendPacket(new ExPremiumManagerShowHtml(HtmCache.getInstance().getHtm(player, "data/scripts/ai/areas/Giran/Grace/34544.html")));
+ return null;
+ }
+
+ @RegisterEvent(EventType.ON_PLAYER_DLG_ANSWER)
+ @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
+ public void onPlayerDlgAnswer(OnPlayerDlgAnswer event)
+ {
+ final Player player = event.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ if (event.getMessageId() != SystemMessageId.I_CAN_GIVE_YOU_A_GOOD_LUCK_BUFF_WILL_YOU_ACCEPT_IT_IT_WILL_COST_YOU_7_000_000_ADENA.getId())
+ {
+ return;
+ }
+
+ if (event.getAnswer() != 1)
+ {
+ return;
+ }
+
+ if (_graceNpc == null)
+ {
+ return;
+ }
+
+ if (player.calculateDistance3D(_graceNpc) > Npc.INTERACTION_DISTANCE)
+ {
+ player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
+ return;
+ }
+
+ if (player.reduceAdena("Grace", ADENA_COST, _graceNpc, true))
+ {
+ SkillCaster.triggerCast(_graceNpc, player, Rnd.get(100) < BUFF_CHANCE ? GRACE_LUCK_LV2.getSkill() : GRACE_LUCK_LV1.getSkill());
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ new Grace();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/spawns/Giran/TownOfGiran.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/spawns/Giran/TownOfGiran.xml
index c3f576df21..c40b13d7dc 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/spawns/Giran/TownOfGiran.xml
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/spawns/Giran/TownOfGiran.xml
@@ -35,7 +35,7 @@
-
+
@@ -48,7 +48,8 @@
-
+
+
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/32900-32999.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/32900-32999.xml
index 35a9742c4f..f5643ad6f9 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/32900-32999.xml
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/32900-32999.xml
@@ -686,7 +686,24 @@
icon.skill0000
- A1
+ A2
+
+ 1
+ 2
+
+ 10
+ 1
+ SELF
+ SINGLE
+
+
+
+ 1
+ 3
+
+ LUC
+
+
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/SystemMessageId.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/SystemMessageId.java
index 0d40a1b2ef..981b1092bb 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/SystemMessageId.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/SystemMessageId.java
@@ -17653,6 +17653,9 @@ public class SystemMessageId
@ClientString(id = 13136, message = "The enchant value is decreased by 1.")
public static SystemMessageId THE_ENCHANT_VALUE_IS_DECREASED_BY_1;
+ @ClientString(id = 13146, message = "I can give you a good luck buff. Will you accept it? (It will cost you 7,000,000 adena.)")
+ public static SystemMessageId I_CAN_GIVE_YOU_A_GOOD_LUCK_BUFF_WILL_YOU_ACCEPT_IT_IT_WILL_COST_YOU_7_000_000_ADENA;
+
@ClientString(id = 13213, message = "A new homunculus is created.")
public static SystemMessageId A_NEW_HOMUNCULUS_IS_CREATED;
diff --git a/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html b/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html
new file mode 100644
index 0000000000..0bc7ed1836
--- /dev/null
+++ b/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html
@@ -0,0 +1,15 @@
+Grace
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java b/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
new file mode 100644
index 0000000000..122559c4be
--- /dev/null
+++ b/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
@@ -0,0 +1,125 @@
+/*
+ * 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.Giran.Grace;
+
+import org.l2jmobius.commons.util.Rnd;
+import org.l2jmobius.gameserver.cache.HtmCache;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.events.EventType;
+import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
+import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
+import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
+import org.l2jmobius.gameserver.model.holders.SkillHolder;
+import org.l2jmobius.gameserver.model.skill.SkillCaster;
+import org.l2jmobius.gameserver.network.SystemMessageId;
+import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
+import org.l2jmobius.gameserver.network.serverpackets.ExPremiumManagerShowHtml;
+
+import ai.AbstractNpcAI;
+
+/**
+ * @author Index
+ */
+public class Grace extends AbstractNpcAI
+{
+ // NPC
+ private static final int GRACE = 34544;
+ // Skills
+ private static final SkillHolder GRACE_LUCK_LV1 = new SkillHolder(32967, 1);
+ private static final SkillHolder GRACE_LUCK_LV2 = new SkillHolder(32967, 2);
+ // Misc
+ private static final ConfirmDlg CONFIRM_DIALOG = new ConfirmDlg(SystemMessageId.I_CAN_GIVE_YOU_A_GOOD_LUCK_BUFF_WILL_YOU_ACCEPT_IT_IT_WILL_COST_YOU_7_000_000_ADENA);
+ private static final int ADENA_COST = 7000000;
+ private static final int BUFF_CHANCE = 30;
+ private static Npc _graceNpc;
+
+ private Grace()
+ {
+ addStartNpc(GRACE);
+ addFirstTalkId(GRACE);
+ addTalkId(GRACE);
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, Player player)
+ {
+ if (event.equals("GRACE_BLESSING") && (npc != null) && (npc.getId() == GRACE))
+ {
+ if ((_graceNpc != null) && _graceNpc.isDead())
+ {
+ _graceNpc = null;
+ }
+ if ((_graceNpc == null) && !npc.isDead())
+ {
+ _graceNpc = npc;
+ }
+ player.sendPacket(CONFIRM_DIALOG);
+ }
+ return null;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, Player player)
+ {
+ player.sendPacket(new ExPremiumManagerShowHtml(HtmCache.getInstance().getHtm(player, "data/scripts/ai/areas/Giran/Grace/34544.html")));
+ return null;
+ }
+
+ @RegisterEvent(EventType.ON_PLAYER_DLG_ANSWER)
+ @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
+ public void onPlayerDlgAnswer(OnPlayerDlgAnswer event)
+ {
+ final Player player = event.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ if (event.getMessageId() != SystemMessageId.I_CAN_GIVE_YOU_A_GOOD_LUCK_BUFF_WILL_YOU_ACCEPT_IT_IT_WILL_COST_YOU_7_000_000_ADENA.getId())
+ {
+ return;
+ }
+
+ if (event.getAnswer() != 1)
+ {
+ return;
+ }
+
+ if (_graceNpc == null)
+ {
+ return;
+ }
+
+ if (player.calculateDistance3D(_graceNpc) > Npc.INTERACTION_DISTANCE)
+ {
+ player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
+ return;
+ }
+
+ if (player.reduceAdena("Grace", ADENA_COST, _graceNpc, true))
+ {
+ SkillCaster.triggerCast(_graceNpc, player, Rnd.get(100) < BUFF_CHANCE ? GRACE_LUCK_LV2.getSkill() : GRACE_LUCK_LV1.getSkill());
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ new Grace();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_10.0_MasterClass/dist/game/data/spawns/Giran/TownOfGiran.xml b/L2J_Mobius_10.0_MasterClass/dist/game/data/spawns/Giran/TownOfGiran.xml
index c3f576df21..c40b13d7dc 100644
--- a/L2J_Mobius_10.0_MasterClass/dist/game/data/spawns/Giran/TownOfGiran.xml
+++ b/L2J_Mobius_10.0_MasterClass/dist/game/data/spawns/Giran/TownOfGiran.xml
@@ -35,7 +35,7 @@
-
+
@@ -48,7 +48,8 @@
-
+
+
diff --git a/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/32900-32999.xml b/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/32900-32999.xml
index 77f4da9c04..e0812f0d62 100644
--- a/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/32900-32999.xml
+++ b/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/32900-32999.xml
@@ -686,7 +686,24 @@
icon.skill0000
- A1
+ A2
+
+ 1
+ 2
+
+ 10
+ 1
+ SELF
+ SINGLE
+
+
+
+ 1
+ 3
+
+ LUC
+
+