Addition of Goddess of Luck AI.
Contributed by Index.
This commit is contained in:
parent
a20b209802
commit
73944c08d7
15
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html
vendored
Normal file
15
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<html><title>Grace</title><body>
|
||||
<table border=0 cellpadding=0 cellspacing=0 width=350 height=493 background="L2UI_CT1.GroupBox.GroupBox_DF">
|
||||
<tr>
|
||||
<td valign="center" align="center">
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Grace01"></td></tr>
|
||||
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Grace02"></td></tr>
|
||||
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Common01"></td></tr>
|
||||
<tr><td height="12"></td></tr>
|
||||
<tr><td><button align="LEFT" icon="NORMAL" action="bypass -h Quest Grace GRACE_BLESSING"><font color="LEVEL">Offer Roses to Lady Luck Grace (7kk Adena)</font></button></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>
|
125
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
vendored
Normal file
125
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
vendored
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
@ -35,7 +35,7 @@
|
||||
<npc id="30116" x="86912" y="148802" z="-3400" heading="40960" respawnTime="60sec" /> <!-- Dustin -->
|
||||
<npc id="30117" x="86472" y="148848" z="-3400" heading="49152" respawnTime="60sec" /> <!-- Primos -->
|
||||
<npc id="30118" x="86485" y="148384" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Pupina -->
|
||||
<npc id="30119" x="85828" y="148894" z="-3400" heading="49152" respawnTime="60sec" /> <!-- Isabellin -->
|
||||
<npc id="30119" x="85877" y="148370" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Isabellin -->
|
||||
<npc id="30120" x="87058" y="148634" z="-3400" heading="32938" respawnTime="60sec" /> <!-- Maximilian -->
|
||||
<npc id="30121" x="84027" y="147179" z="-3400" heading="18732" respawnTime="60sec" /> <!-- Jeronin -->
|
||||
<npc id="30122" x="81676" y="152980" z="-3528" heading="29686" respawnTime="60sec" /> <!-- Bane -->
|
||||
@ -48,7 +48,8 @@
|
||||
<npc id="30452" x="77026" y="148813" z="-3600" heading="42120" respawnTime="60sec" /> <!-- Kurt -->
|
||||
<npc id="30471" x="77712" y="148288" z="-3592" heading="28672" respawnTime="60sec" /> <!-- Rupio -->
|
||||
<npc id="30472" x="85231" y="146328" z="-3400" respawnTime="60sec" /> <!-- Rosheria -->
|
||||
<npc id="30473" x="85829" y="148365" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Bandellos -->
|
||||
<npc id="30473" x="85724" y="148370" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Bandellos -->
|
||||
<npc id="34544" x="85828" y="148894" z="-3400" heading="49152" respawnTime="60sec" /> <!-- Grace -->
|
||||
<npc id="30474" x="79059" y="149457" z="-3592" heading="41500" respawnTime="60sec" /> <!-- Angus -->
|
||||
<npc id="30475" x="78766" y="149239" z="-3592" heading="16384" respawnTime="60sec" /> <!-- Stapin -->
|
||||
<npc id="30476" x="78928" y="149041" z="-3592" respawnTime="60sec" /> <!-- Kaira -->
|
||||
|
@ -679,7 +679,24 @@
|
||||
<skill id="32967" toLevel="2" name="Grace's Shining Luck">
|
||||
<!-- By the will of Grace, the Goddess of Luck, LUC +$s1 for 10 sec. -->
|
||||
<icon>icon.skill0000</icon>
|
||||
<operateType>A1</operateType>
|
||||
<operateType>A2</operateType>
|
||||
<abnormalLevel>
|
||||
<value level="1">1</value>
|
||||
<value level="2">2</value>
|
||||
</abnormalLevel>
|
||||
<abnormalTime>10</abnormalTime>
|
||||
<isMagic>1</isMagic>
|
||||
<targetType>SELF</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="StatUp">
|
||||
<amount>
|
||||
<value level="1">1</value>
|
||||
<value level="2">3</value>
|
||||
</amount>
|
||||
<stat>LUC</stat>
|
||||
</effect>
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="32968" toLevel="1" name="Shield of Limit">
|
||||
<!-- Decreases received damage. -->
|
||||
|
@ -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;
|
||||
|
||||
|
15
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html
vendored
Normal file
15
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<html><title>Grace</title><body>
|
||||
<table border=0 cellpadding=0 cellspacing=0 width=350 height=493 background="L2UI_CT1.GroupBox.GroupBox_DF">
|
||||
<tr>
|
||||
<td valign="center" align="center">
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Grace01"></td></tr>
|
||||
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Grace02"></td></tr>
|
||||
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Common01"></td></tr>
|
||||
<tr><td height="12"></td></tr>
|
||||
<tr><td><button align="LEFT" icon="NORMAL" action="bypass -h Quest Grace GRACE_BLESSING"><font color="LEVEL">Offer Roses to Lady Luck Grace (7kk Adena)</font></button></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>
|
125
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
vendored
Normal file
125
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
vendored
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
@ -35,7 +35,7 @@
|
||||
<npc id="30116" x="86912" y="148802" z="-3400" heading="40960" respawnTime="60sec" /> <!-- Dustin -->
|
||||
<npc id="30117" x="86472" y="148848" z="-3400" heading="49152" respawnTime="60sec" /> <!-- Primos -->
|
||||
<npc id="30118" x="86485" y="148384" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Pupina -->
|
||||
<npc id="30119" x="85828" y="148894" z="-3400" heading="49152" respawnTime="60sec" /> <!-- Isabellin -->
|
||||
<npc id="30119" x="85877" y="148370" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Isabellin -->
|
||||
<npc id="30120" x="87058" y="148634" z="-3400" heading="32938" respawnTime="60sec" /> <!-- Maximilian -->
|
||||
<npc id="30121" x="84027" y="147179" z="-3400" heading="18732" respawnTime="60sec" /> <!-- Jeronin -->
|
||||
<npc id="30122" x="81676" y="152980" z="-3528" heading="29686" respawnTime="60sec" /> <!-- Bane -->
|
||||
@ -48,7 +48,8 @@
|
||||
<npc id="30452" x="77026" y="148813" z="-3600" heading="42120" respawnTime="60sec" /> <!-- Kurt -->
|
||||
<npc id="30471" x="77712" y="148288" z="-3592" heading="28672" respawnTime="60sec" /> <!-- Rupio -->
|
||||
<npc id="30472" x="85231" y="146328" z="-3400" respawnTime="60sec" /> <!-- Rosheria -->
|
||||
<npc id="30473" x="85829" y="148365" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Bandellos -->
|
||||
<npc id="30473" x="85724" y="148370" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Bandellos -->
|
||||
<npc id="34544" x="85828" y="148894" z="-3400" heading="49152" respawnTime="60sec" /> <!-- Grace -->
|
||||
<npc id="30474" x="79059" y="149457" z="-3592" heading="41500" respawnTime="60sec" /> <!-- Angus -->
|
||||
<npc id="30475" x="78766" y="149239" z="-3592" heading="16384" respawnTime="60sec" /> <!-- Stapin -->
|
||||
<npc id="30476" x="78928" y="149041" z="-3592" respawnTime="60sec" /> <!-- Kaira -->
|
||||
|
@ -686,7 +686,24 @@
|
||||
<skill id="32967" toLevel="2" name="Grace's Shining Luck">
|
||||
<!-- By the will of Grace, the Goddess of Luck, LUC +$s1 for 10 sec. -->
|
||||
<icon>icon.skill0000</icon>
|
||||
<operateType>A1</operateType>
|
||||
<operateType>A2</operateType>
|
||||
<abnormalLevel>
|
||||
<value level="1">1</value>
|
||||
<value level="2">2</value>
|
||||
</abnormalLevel>
|
||||
<abnormalTime>10</abnormalTime>
|
||||
<isMagic>1</isMagic>
|
||||
<targetType>SELF</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="StatUp">
|
||||
<amount>
|
||||
<value level="1">1</value>
|
||||
<value level="2">3</value>
|
||||
</amount>
|
||||
<stat>LUC</stat>
|
||||
</effect>
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="32968" toLevel="1" name="Shield of Limit">
|
||||
<!-- Decreases received damage. -->
|
||||
|
@ -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;
|
||||
|
||||
|
15
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html
vendored
Normal file
15
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Giran/Grace/34544.html
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<html><title>Grace</title><body>
|
||||
<table border=0 cellpadding=0 cellspacing=0 width=350 height=493 background="L2UI_CT1.GroupBox.GroupBox_DF">
|
||||
<tr>
|
||||
<td valign="center" align="center">
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Grace01"></td></tr>
|
||||
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Grace02"></td></tr>
|
||||
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Common01"></td></tr>
|
||||
<tr><td height="12"></td></tr>
|
||||
<tr><td><button align="LEFT" icon="NORMAL" action="bypass -h Quest Grace GRACE_BLESSING"><font color="LEVEL">Offer Roses to Lady Luck Grace (7kk Adena)</font></button></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>
|
125
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
vendored
Normal file
125
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Giran/Grace/Grace.java
vendored
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
@ -35,7 +35,7 @@
|
||||
<npc id="30116" x="86912" y="148802" z="-3400" heading="40960" respawnTime="60sec" /> <!-- Dustin -->
|
||||
<npc id="30117" x="86472" y="148848" z="-3400" heading="49152" respawnTime="60sec" /> <!-- Primos -->
|
||||
<npc id="30118" x="86485" y="148384" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Pupina -->
|
||||
<npc id="30119" x="85828" y="148894" z="-3400" heading="49152" respawnTime="60sec" /> <!-- Isabellin -->
|
||||
<npc id="30119" x="85877" y="148370" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Isabellin -->
|
||||
<npc id="30120" x="87058" y="148634" z="-3400" heading="32938" respawnTime="60sec" /> <!-- Maximilian -->
|
||||
<npc id="30121" x="84027" y="147179" z="-3400" heading="18732" respawnTime="60sec" /> <!-- Jeronin -->
|
||||
<npc id="30122" x="81676" y="152980" z="-3528" heading="29686" respawnTime="60sec" /> <!-- Bane -->
|
||||
@ -48,7 +48,8 @@
|
||||
<npc id="30452" x="77026" y="148813" z="-3600" heading="42120" respawnTime="60sec" /> <!-- Kurt -->
|
||||
<npc id="30471" x="77712" y="148288" z="-3592" heading="28672" respawnTime="60sec" /> <!-- Rupio -->
|
||||
<npc id="30472" x="85231" y="146328" z="-3400" respawnTime="60sec" /> <!-- Rosheria -->
|
||||
<npc id="30473" x="85829" y="148365" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Bandellos -->
|
||||
<npc id="30473" x="85724" y="148370" z="-3400" heading="16384" respawnTime="60sec" /> <!-- Bandellos -->
|
||||
<npc id="34544" x="85828" y="148894" z="-3400" heading="49152" respawnTime="60sec" /> <!-- Grace -->
|
||||
<npc id="30474" x="79059" y="149457" z="-3592" heading="41500" respawnTime="60sec" /> <!-- Angus -->
|
||||
<npc id="30475" x="78766" y="149239" z="-3592" heading="16384" respawnTime="60sec" /> <!-- Stapin -->
|
||||
<npc id="30476" x="78928" y="149041" z="-3592" respawnTime="60sec" /> <!-- Kaira -->
|
||||
|
@ -686,7 +686,24 @@
|
||||
<skill id="32967" toLevel="2" name="Grace's Shining Luck">
|
||||
<!-- By the will of Grace, the Goddess of Luck, LUC +$s1 for 10 sec. -->
|
||||
<icon>icon.skill0000</icon>
|
||||
<operateType>A1</operateType>
|
||||
<operateType>A2</operateType>
|
||||
<abnormalLevel>
|
||||
<value level="1">1</value>
|
||||
<value level="2">2</value>
|
||||
</abnormalLevel>
|
||||
<abnormalTime>10</abnormalTime>
|
||||
<isMagic>1</isMagic>
|
||||
<targetType>SELF</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="StatUp">
|
||||
<amount>
|
||||
<value level="1">1</value>
|
||||
<value level="2">3</value>
|
||||
</amount>
|
||||
<stat>LUC</stat>
|
||||
</effect>
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="32968" toLevel="1" name="Shield of Limit">
|
||||
<!-- Decreases received damage. -->
|
||||
|
Loading…
Reference in New Issue
Block a user