Addition of Cherub of Luck AI.
Contributed by Index.
This commit is contained in:
15
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Aden/Lulu/34545.html
vendored
Normal file
15
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Aden/Lulu/34545.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<html><title>Lulu</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_Lullu01"></td></tr>
|
||||||
|
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Lullu02"></td></tr>
|
||||||
|
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Common01"></td></tr>
|
||||||
|
<tr><td height="5"></td></tr>
|
||||||
|
<tr><td><button align="LEFT" icon="NORMAL" action="bypass -h Quest Lulu LULU_BLESSING"><font color="LEVEL">Present Boots of Luck to Lulu, the Cherub of Luck (7kk Adena)</font></button></td></tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body></html>
|
3
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Aden/Lulu/34546.html
vendored
Normal file
3
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Aden/Lulu/34546.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<html><body>Wael:<br>
|
||||||
|
Lulu is born! I've become a daddy! I'll be the best father ever! Let's grant our love to Lulu.
|
||||||
|
</body></html>
|
3
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Aden/Lulu/34547.html
vendored
Normal file
3
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Aden/Lulu/34547.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<html><body>Eileen:<br>
|
||||||
|
Cherub Lulu is born! What a blessing! If you present boots of Luck to lovely Lulu, lady Luck will always be on your side.
|
||||||
|
</body></html>
|
138
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Aden/Lulu/Lulu.java
vendored
Normal file
138
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/areas/Aden/Lulu/Lulu.java
vendored
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
/*
|
||||||
|
* 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.Aden.Lulu;
|
||||||
|
|
||||||
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
|
import org.l2jmobius.gameserver.model.World;
|
||||||
|
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 Lulu extends AbstractNpcAI
|
||||||
|
{
|
||||||
|
// NPCs
|
||||||
|
private static final int LULU = 34545;
|
||||||
|
private static final int WAEL = 34546;
|
||||||
|
private static final int EILEEN = 34547;
|
||||||
|
// Skills
|
||||||
|
private static final SkillHolder LULU_LUCK_LV1 = new SkillHolder(32966, 1);
|
||||||
|
private static final SkillHolder LULU_LUCK_LV2 = new SkillHolder(32966, 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 _luluNpc;
|
||||||
|
|
||||||
|
private Lulu()
|
||||||
|
{
|
||||||
|
addStartNpc(LULU);
|
||||||
|
addFirstTalkId(LULU, WAEL, EILEEN);
|
||||||
|
addTalkId(LULU, WAEL, EILEEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String onAdvEvent(String event, Npc npc, Player player)
|
||||||
|
{
|
||||||
|
if (event.equals("LULU_BLESSING") && (npc != null) && (npc.getId() == LULU))
|
||||||
|
{
|
||||||
|
if ((_luluNpc != null) && _luluNpc.isDead())
|
||||||
|
{
|
||||||
|
_luluNpc = null;
|
||||||
|
}
|
||||||
|
if ((_luluNpc == null) && !npc.isDead())
|
||||||
|
{
|
||||||
|
_luluNpc = npc;
|
||||||
|
}
|
||||||
|
player.sendPacket(CONFIRM_DIALOG);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String onFirstTalk(Npc npc, Player player)
|
||||||
|
{
|
||||||
|
final int npcId = npc.getId();
|
||||||
|
if (npcId == LULU)
|
||||||
|
{
|
||||||
|
player.sendPacket(new ExPremiumManagerShowHtml(HtmCache.getInstance().getHtm(player, "data/scripts/ai/areas/Aden/Lulu/34545.html")));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return npcId + ".html";
|
||||||
|
}
|
||||||
|
|
||||||
|
@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 (_luluNpc == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!World.getInstance().getVisibleObjects(player, Npc.class).contains(_luluNpc))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.calculateDistance3D(_luluNpc) > Npc.INTERACTION_DISTANCE)
|
||||||
|
{
|
||||||
|
player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.reduceAdena("Lulu", ADENA_COST, _luluNpc, true))
|
||||||
|
{
|
||||||
|
SkillCaster.triggerCast(_luluNpc, player, Rnd.get(100) < BUFF_CHANCE ? LULU_LUCK_LV2.getSkill() : LULU_LUCK_LV1.getSkill());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
new Lulu();
|
||||||
|
}
|
||||||
|
}
|
@@ -18,6 +18,7 @@ package ai.areas.Giran.Grace;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.events.EventType;
|
import org.l2jmobius.gameserver.model.events.EventType;
|
||||||
@@ -106,6 +107,11 @@ public class Grace extends AbstractNpcAI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!World.getInstance().getVisibleObjects(player, Npc.class).contains(_graceNpc))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (player.calculateDistance3D(_graceNpc) > Npc.INTERACTION_DISTANCE)
|
if (player.calculateDistance3D(_graceNpc) > Npc.INTERACTION_DISTANCE)
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
|
player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
|
||||||
|
@@ -119,6 +119,9 @@
|
|||||||
<npc id="30981" x="146632" y="25000" z="-2021" heading="16383" respawnTime="60sec" /> <!-- Dark Judge -->
|
<npc id="30981" x="146632" y="25000" z="-2021" heading="16383" respawnTime="60sec" /> <!-- Dark Judge -->
|
||||||
<npc id="31126" x="146873" y="29448" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Blacksmith of Mammon -->
|
<npc id="31126" x="146873" y="29448" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Blacksmith of Mammon -->
|
||||||
<npc id="33737" x="146872" y="29569" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Merchant of Mammon -->
|
<npc id="33737" x="146872" y="29569" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Merchant of Mammon -->
|
||||||
|
<npc id="34547" x="147841" y="23783" z="-1984" heading="32768" respawnTime="60sec" /> <!-- Eileen -->
|
||||||
|
<npc id="34546" x="147841" y="23727" z="-1984" heading="32768" respawnTime="60sec" /> <!-- Wael -->
|
||||||
|
<npc id="34545" x="147799" y="23755" z="-1984" heading="32768" respawnTime="60sec" /> <!-- Lulu -->
|
||||||
</group>
|
</group>
|
||||||
</spawn>
|
</spawn>
|
||||||
</list>
|
</list>
|
||||||
|
@@ -674,7 +674,24 @@
|
|||||||
<skill id="32966" toLevel="2" name="Angel Lulu's Shining Luck">
|
<skill id="32966" toLevel="2" name="Angel Lulu's Shining Luck">
|
||||||
<!-- By the will of Lulu, the Angel of Luck, LUC +$s1 for 10 sec. -->
|
<!-- By the will of Lulu, the Angel of Luck, LUC +$s1 for 10 sec. -->
|
||||||
<icon>icon.skill0000</icon>
|
<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>
|
||||||
<skill id="32967" toLevel="2" name="Grace's Shining Luck">
|
<skill id="32967" toLevel="2" name="Grace's Shining Luck">
|
||||||
<!-- By the will of Grace, the Goddess of Luck, LUC +$s1 for 10 sec. -->
|
<!-- By the will of Grace, the Goddess of Luck, LUC +$s1 for 10 sec. -->
|
||||||
|
15
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Aden/Lulu/34545.html
vendored
Normal file
15
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Aden/Lulu/34545.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<html><title>Lulu</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_Lullu01"></td></tr>
|
||||||
|
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Lullu02"></td></tr>
|
||||||
|
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Common01"></td></tr>
|
||||||
|
<tr><td height="5"></td></tr>
|
||||||
|
<tr><td><button align="LEFT" icon="NORMAL" action="bypass -h Quest Lulu LULU_BLESSING"><font color="LEVEL">Present Boots of Luck to Lulu, the Cherub of Luck (7kk Adena)</font></button></td></tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body></html>
|
3
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Aden/Lulu/34546.html
vendored
Normal file
3
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Aden/Lulu/34546.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<html><body>Wael:<br>
|
||||||
|
Lulu is born! I've become a daddy! I'll be the best father ever! Let's grant our love to Lulu.
|
||||||
|
</body></html>
|
3
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Aden/Lulu/34547.html
vendored
Normal file
3
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Aden/Lulu/34547.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<html><body>Eileen:<br>
|
||||||
|
Cherub Lulu is born! What a blessing! If you present boots of Luck to lovely Lulu, lady Luck will always be on your side.
|
||||||
|
</body></html>
|
138
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Aden/Lulu/Lulu.java
vendored
Normal file
138
L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Aden/Lulu/Lulu.java
vendored
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
/*
|
||||||
|
* 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.Aden.Lulu;
|
||||||
|
|
||||||
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
|
import org.l2jmobius.gameserver.model.World;
|
||||||
|
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 Lulu extends AbstractNpcAI
|
||||||
|
{
|
||||||
|
// NPCs
|
||||||
|
private static final int LULU = 34545;
|
||||||
|
private static final int WAEL = 34546;
|
||||||
|
private static final int EILEEN = 34547;
|
||||||
|
// Skills
|
||||||
|
private static final SkillHolder LULU_LUCK_LV1 = new SkillHolder(32966, 1);
|
||||||
|
private static final SkillHolder LULU_LUCK_LV2 = new SkillHolder(32966, 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 _luluNpc;
|
||||||
|
|
||||||
|
private Lulu()
|
||||||
|
{
|
||||||
|
addStartNpc(LULU);
|
||||||
|
addFirstTalkId(LULU, WAEL, EILEEN);
|
||||||
|
addTalkId(LULU, WAEL, EILEEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String onAdvEvent(String event, Npc npc, Player player)
|
||||||
|
{
|
||||||
|
if (event.equals("LULU_BLESSING") && (npc != null) && (npc.getId() == LULU))
|
||||||
|
{
|
||||||
|
if ((_luluNpc != null) && _luluNpc.isDead())
|
||||||
|
{
|
||||||
|
_luluNpc = null;
|
||||||
|
}
|
||||||
|
if ((_luluNpc == null) && !npc.isDead())
|
||||||
|
{
|
||||||
|
_luluNpc = npc;
|
||||||
|
}
|
||||||
|
player.sendPacket(CONFIRM_DIALOG);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String onFirstTalk(Npc npc, Player player)
|
||||||
|
{
|
||||||
|
final int npcId = npc.getId();
|
||||||
|
if (npcId == LULU)
|
||||||
|
{
|
||||||
|
player.sendPacket(new ExPremiumManagerShowHtml(HtmCache.getInstance().getHtm(player, "data/scripts/ai/areas/Aden/Lulu/34545.html")));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return npcId + ".html";
|
||||||
|
}
|
||||||
|
|
||||||
|
@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 (_luluNpc == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!World.getInstance().getVisibleObjects(player, Npc.class).contains(_luluNpc))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.calculateDistance3D(_luluNpc) > Npc.INTERACTION_DISTANCE)
|
||||||
|
{
|
||||||
|
player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.reduceAdena("Lulu", ADENA_COST, _luluNpc, true))
|
||||||
|
{
|
||||||
|
SkillCaster.triggerCast(_luluNpc, player, Rnd.get(100) < BUFF_CHANCE ? LULU_LUCK_LV2.getSkill() : LULU_LUCK_LV1.getSkill());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
new Lulu();
|
||||||
|
}
|
||||||
|
}
|
@@ -18,6 +18,7 @@ package ai.areas.Giran.Grace;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.events.EventType;
|
import org.l2jmobius.gameserver.model.events.EventType;
|
||||||
@@ -106,6 +107,11 @@ public class Grace extends AbstractNpcAI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!World.getInstance().getVisibleObjects(player, Npc.class).contains(_graceNpc))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (player.calculateDistance3D(_graceNpc) > Npc.INTERACTION_DISTANCE)
|
if (player.calculateDistance3D(_graceNpc) > Npc.INTERACTION_DISTANCE)
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
|
player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
|
||||||
|
@@ -119,6 +119,9 @@
|
|||||||
<npc id="30981" x="146632" y="25000" z="-2021" heading="16383" respawnTime="60sec" /> <!-- Dark Judge -->
|
<npc id="30981" x="146632" y="25000" z="-2021" heading="16383" respawnTime="60sec" /> <!-- Dark Judge -->
|
||||||
<npc id="31126" x="146873" y="29448" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Blacksmith of Mammon -->
|
<npc id="31126" x="146873" y="29448" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Blacksmith of Mammon -->
|
||||||
<npc id="33737" x="146872" y="29569" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Merchant of Mammon -->
|
<npc id="33737" x="146872" y="29569" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Merchant of Mammon -->
|
||||||
|
<npc id="34547" x="147841" y="23783" z="-1984" heading="32768" respawnTime="60sec" /> <!-- Eileen -->
|
||||||
|
<npc id="34546" x="147841" y="23727" z="-1984" heading="32768" respawnTime="60sec" /> <!-- Wael -->
|
||||||
|
<npc id="34545" x="147799" y="23755" z="-1984" heading="32768" respawnTime="60sec" /> <!-- Lulu -->
|
||||||
</group>
|
</group>
|
||||||
</spawn>
|
</spawn>
|
||||||
</list>
|
</list>
|
||||||
|
@@ -681,7 +681,24 @@
|
|||||||
<skill id="32966" toLevel="2" name="Angel Lulu's Shining Luck">
|
<skill id="32966" toLevel="2" name="Angel Lulu's Shining Luck">
|
||||||
<!-- By the will of Lulu, the Angel of Luck, LUC +$s1 for 10 sec. -->
|
<!-- By the will of Lulu, the Angel of Luck, LUC +$s1 for 10 sec. -->
|
||||||
<icon>icon.skill0000</icon>
|
<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>
|
||||||
<skill id="32967" toLevel="2" name="Grace's Shining Luck">
|
<skill id="32967" toLevel="2" name="Grace's Shining Luck">
|
||||||
<!-- By the will of Grace, the Goddess of Luck, LUC +$s1 for 10 sec. -->
|
<!-- By the will of Grace, the Goddess of Luck, LUC +$s1 for 10 sec. -->
|
||||||
|
15
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Aden/Lulu/34545.html
vendored
Normal file
15
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Aden/Lulu/34545.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<html><title>Lulu</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_Lullu01"></td></tr>
|
||||||
|
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Lullu02"></td></tr>
|
||||||
|
<tr><td width=350 height=160 background="L2UI_CT1.HtmlWnd.HtmlWnd_LuckyBuff_Img_Common01"></td></tr>
|
||||||
|
<tr><td height="5"></td></tr>
|
||||||
|
<tr><td><button align="LEFT" icon="NORMAL" action="bypass -h Quest Lulu LULU_BLESSING"><font color="LEVEL">Present Boots of Luck to Lulu, the Cherub of Luck (7kk Adena)</font></button></td></tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body></html>
|
3
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Aden/Lulu/34546.html
vendored
Normal file
3
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Aden/Lulu/34546.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<html><body>Wael:<br>
|
||||||
|
Lulu is born! I've become a daddy! I'll be the best father ever! Let's grant our love to Lulu.
|
||||||
|
</body></html>
|
3
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Aden/Lulu/34547.html
vendored
Normal file
3
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Aden/Lulu/34547.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<html><body>Eileen:<br>
|
||||||
|
Cherub Lulu is born! What a blessing! If you present boots of Luck to lovely Lulu, lady Luck will always be on your side.
|
||||||
|
</body></html>
|
138
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Aden/Lulu/Lulu.java
vendored
Normal file
138
L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/ai/areas/Aden/Lulu/Lulu.java
vendored
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
/*
|
||||||
|
* 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.Aden.Lulu;
|
||||||
|
|
||||||
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
|
import org.l2jmobius.gameserver.model.World;
|
||||||
|
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 Lulu extends AbstractNpcAI
|
||||||
|
{
|
||||||
|
// NPCs
|
||||||
|
private static final int LULU = 34545;
|
||||||
|
private static final int WAEL = 34546;
|
||||||
|
private static final int EILEEN = 34547;
|
||||||
|
// Skills
|
||||||
|
private static final SkillHolder LULU_LUCK_LV1 = new SkillHolder(32966, 1);
|
||||||
|
private static final SkillHolder LULU_LUCK_LV2 = new SkillHolder(32966, 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 _luluNpc;
|
||||||
|
|
||||||
|
private Lulu()
|
||||||
|
{
|
||||||
|
addStartNpc(LULU);
|
||||||
|
addFirstTalkId(LULU, WAEL, EILEEN);
|
||||||
|
addTalkId(LULU, WAEL, EILEEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String onAdvEvent(String event, Npc npc, Player player)
|
||||||
|
{
|
||||||
|
if (event.equals("LULU_BLESSING") && (npc != null) && (npc.getId() == LULU))
|
||||||
|
{
|
||||||
|
if ((_luluNpc != null) && _luluNpc.isDead())
|
||||||
|
{
|
||||||
|
_luluNpc = null;
|
||||||
|
}
|
||||||
|
if ((_luluNpc == null) && !npc.isDead())
|
||||||
|
{
|
||||||
|
_luluNpc = npc;
|
||||||
|
}
|
||||||
|
player.sendPacket(CONFIRM_DIALOG);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String onFirstTalk(Npc npc, Player player)
|
||||||
|
{
|
||||||
|
final int npcId = npc.getId();
|
||||||
|
if (npcId == LULU)
|
||||||
|
{
|
||||||
|
player.sendPacket(new ExPremiumManagerShowHtml(HtmCache.getInstance().getHtm(player, "data/scripts/ai/areas/Aden/Lulu/34545.html")));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return npcId + ".html";
|
||||||
|
}
|
||||||
|
|
||||||
|
@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 (_luluNpc == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!World.getInstance().getVisibleObjects(player, Npc.class).contains(_luluNpc))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.calculateDistance3D(_luluNpc) > Npc.INTERACTION_DISTANCE)
|
||||||
|
{
|
||||||
|
player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.reduceAdena("Lulu", ADENA_COST, _luluNpc, true))
|
||||||
|
{
|
||||||
|
SkillCaster.triggerCast(_luluNpc, player, Rnd.get(100) < BUFF_CHANCE ? LULU_LUCK_LV2.getSkill() : LULU_LUCK_LV1.getSkill());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
new Lulu();
|
||||||
|
}
|
||||||
|
}
|
@@ -18,6 +18,7 @@ package ai.areas.Giran.Grace;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.events.EventType;
|
import org.l2jmobius.gameserver.model.events.EventType;
|
||||||
@@ -106,6 +107,11 @@ public class Grace extends AbstractNpcAI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!World.getInstance().getVisibleObjects(player, Npc.class).contains(_graceNpc))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (player.calculateDistance3D(_graceNpc) > Npc.INTERACTION_DISTANCE)
|
if (player.calculateDistance3D(_graceNpc) > Npc.INTERACTION_DISTANCE)
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
|
player.sendPacket(SystemMessageId.YOU_ARE_TOO_FAR_FROM_THE_NPC_FOR_THAT_TO_WORK);
|
||||||
|
@@ -119,6 +119,9 @@
|
|||||||
<npc id="30981" x="146632" y="25000" z="-2021" heading="16383" respawnTime="60sec" /> <!-- Dark Judge -->
|
<npc id="30981" x="146632" y="25000" z="-2021" heading="16383" respawnTime="60sec" /> <!-- Dark Judge -->
|
||||||
<npc id="31126" x="146873" y="29448" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Blacksmith of Mammon -->
|
<npc id="31126" x="146873" y="29448" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Blacksmith of Mammon -->
|
||||||
<npc id="33737" x="146872" y="29569" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Merchant of Mammon -->
|
<npc id="33737" x="146872" y="29569" z="-2259" heading="1297" respawnTime="60sec" /> <!-- Merchant of Mammon -->
|
||||||
|
<npc id="34547" x="147841" y="23783" z="-1984" heading="32768" respawnTime="60sec" /> <!-- Eileen -->
|
||||||
|
<npc id="34546" x="147841" y="23727" z="-1984" heading="32768" respawnTime="60sec" /> <!-- Wael -->
|
||||||
|
<npc id="34545" x="147799" y="23755" z="-1984" heading="32768" respawnTime="60sec" /> <!-- Lulu -->
|
||||||
</group>
|
</group>
|
||||||
</spawn>
|
</spawn>
|
||||||
</list>
|
</list>
|
||||||
|
@@ -681,7 +681,24 @@
|
|||||||
<skill id="32966" toLevel="2" name="Angel Lulu's Shining Luck">
|
<skill id="32966" toLevel="2" name="Angel Lulu's Shining Luck">
|
||||||
<!-- By the will of Lulu, the Angel of Luck, LUC +$s1 for 10 sec. -->
|
<!-- By the will of Lulu, the Angel of Luck, LUC +$s1 for 10 sec. -->
|
||||||
<icon>icon.skill0000</icon>
|
<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>
|
||||||
<skill id="32967" toLevel="2" name="Grace's Shining Luck">
|
<skill id="32967" toLevel="2" name="Grace's Shining Luck">
|
||||||
<!-- By the will of Grace, the Goddess of Luck, LUC +$s1 for 10 sec. -->
|
<!-- By the will of Grace, the Goddess of Luck, LUC +$s1 for 10 sec. -->
|
||||||
|
Reference in New Issue
Block a user