Dimensional Manager AI.

Contributed by Stayway.
This commit is contained in:
MobiusDev
2015-10-22 09:26:53 +00:00
parent 1a750ba084
commit ad889659fa
32 changed files with 534 additions and 12 deletions

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
<font color="LEVEL">You can exchange a Minion Coupon, Superior Minion Coupon, and Rose Spirit Coupon</font> for a Minion Pet. You just need to select the pet that you want.<br><br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-02.htm">Exchange a Minion Coupon for a Minion Pet</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-07.htm">Exchange Superior Minion Coupon for a Superior Minion Pet</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-08.htm">Exchange a Rose Spirit Coupon for a Rose Spirit</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Dimensional Merchant:<br>
You Can obtain A Minion pet with a Minion Coupon. Please select the Minion pet you want.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-05.htm">White Weasel Pet Whistle</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-06.htm">Fairy Princess Pet Whistle</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-03.htm">Wild Beast Fighter Pet Whistle</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-04.htm">Fox Shaman Pet Whistle</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
You selected a Wild Beast Fighter Pet Whistle.<br>
A Wild Beast Fighter will help you in battle with <font color="LEVEL">fierce attacks</FONT>.<br>
Would you like to exchange the coupon for a Wild Beast Fighter Pet Whistle?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager wildbeastfighter">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
You selected a Fox Shaman Pet Whistle.<br>
A Fox Shaman will help you in battle with <font color="LEVEL">strong magic</FONT>.<br>
Would you like to exchange the coupon for a Fox Shaman Pet Whistle?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager foxshaman">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
You selected a White Weasel Pet Whistle.<br>
A White Weasel will help you in battle with <font color="LEVEL">fighter buffs and healing</FONT>.<br>
Would you like to exchange the coupon for a White Weasel Pet Whistle?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager whiteweasel">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
You selected a Fairy Princess Pet Whistle.<br>
A Fairy Princess will help you in battle with <font color="LEVEL">wizard buffs and healing</FONT>.<br>
Would you like to exchange the coupon for a Fairy Princess Pet Whistle?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager fairyprincess">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
Please select a Superior Minion you would like to receive in exchange for the Superior Minion Coupon.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-09.htm">Toy Knight Summon Whistle</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-10.htm">Spirit Shaman Summon Whistle</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-11.htm">Turtle Ascetic Summon Necklace</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,11 @@
<html><body>Dimensional Merchant:<br>
Which improved Rose Spirit would you like?<br>
(When the inventory is full, you can't receive the item.)<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-12.htm">Male, Warrior Type</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-13.htm">Male, Wizard Type</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-14.htm">Male, Warsmith Type</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-15.htm">Female, Warrior Type</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-16.htm">Female, Wizard Type</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-17.htm">Female, Warsmith Type</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
You selected a Toy Knight Summon Whistle.<br>
<font color="LEVEL">A Toy Knight will attack your enemies with a sword while using fighter buffs and healing, to help you in battle.</FONT>.<br>
Would you like to exchange the coupon for a a Toy Knight?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager toyknight">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
You selected a Turtle Ascetic Summon Necklace.<br>
<font color="LEVEL">A Turtle Ascetic will help you in battle with warsmith buffs, heals and recharges.</FONT>.<br>
Would you like to exchange the coupon for a Turtle Ascetic?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager turtleascetic">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
You selected a Spirit Shaman Summon Whistle.<br>
<font color="LEVEL">A Spirit Shaman will help you in battle with wizard buffs, heals and recharges.</FONT>.<br>
Would you like to exchange the coupon for a a Spirit Shaman Whistle?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager spiritshaman">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Dimensional Merchant:<br>
You have chosen the warrior type Rose Spirit.<br><br>
The name of the spirit is Desheloph.<br>
<font color="LEVEL">Desheloph is a Rose Spirit that uses various warrior type buffs and healing while attacking enemies with a sword.</FONT>.<br>
Will you exchange to Desheloph?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager desheloph">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Dimensional Merchant:<br>
You have chosen the wizard type Rose Spirit.<br><br>
The name of the spirit is Hyum.<br>
<font color="LEVEL">Hyum is a Rose Spirit that uses wizard type buffs, healing, and recharges while attacking enemies with magic.</FONT>.<br>
Will you exchange to Hyum?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager hyum">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Dimensional Merchant:<br>
You have chosen the warsmith type Rose Spirit.<br><br>
The name of the spirit is Lekang.<br>
<font color="LEVEL">Lekang is a Rose Spirit that uses a weapon or magic to attack enemies as well as healing and recharges while managing (warsmith buff) the owner's weapon and armor.</FONT>.<br>
Will you exchange to Lekang?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager lekang">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Dimensional Merchant:<br>
You have chosen the warrior type Rose Spirit.<br><br>
The name of the spirit is Lilias.<br>
<font color="LEVEL">Lilias is a Rose Spirit that uses various warrior type buffs and healing while attacking enemies with a sword.</FONT>.<br>
Will you exchange to Lilias?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager lilias">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Dimensional Merchant:<br>
You have chosen the wizard type Rose Spirit.<br><br>
The name of the spirit is Lapham.<br>
<font color="LEVEL">Lapham is a Rose Spirit that uses wizard type buffs, healing, and recharges while attacking enemies with magic.</FONT>.<br>
Will you exchange to Lapham?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager lapham">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Dimensional Merchant:<br>
You have chosen the warsmith type Rose Spirit.<br><br>
The name of the spirit is Mafum.<br>
<font color="LEVEL">Mafum is a Rose Spirit that uses a weapon or magic to attack enemies as well as healing and recharges while managing (warsmith buff) the owner's weapon and armor.</FONT>.<br>
Will you exchange to Mafum?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager mafum">"Yes."</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,6 @@
<html><body>Dimensional Merchant:<br>
To exchange Vitality items, <font color="LEVEL">You need to have vitality-related items in your inventory.</font> You may exchange: <font color="LEVEL">Birthday Vitality Potion, Freya's Refreshing Breeze, Pa'agrio's Warm Breeze, Sweet Chocolate, Returning Hero's Vitality replenishing Juice and Pirate Elixir and XP Buff 505.</font><br>
Keep in mind, you cannot cancel any item exchange.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 0 ">Exchange Vitality Items</Button><!-- No idea about items needs create a multisell -->
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,6 @@
<html><body>Dimensional Merchant:<br>
In order to seal or unseal the Power Shirt, you must have a<font color="LEVEL"> Power Shirt or a Sealed Power Shirt in the character's inventory.</font><br1>
A Sealed Power Shirt can be transferred to another character within the account trough the Dimensional Merchant. <font color="LEVEL">But, when the seal is removed on a Sealed Power Shirt, you can no longer use seal/unseal.</font><br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 0 ">Seal/Unseal a Power Shirt</Button><!-- Core need be done -->
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
Which coupon would you like to use?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 3247801">"I want to exchange an Requiem Weapon Coupon for a weapon."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest DimensionalManager 32478-21.htm">"I want to exchange an Immortal Armor Set Coupon for a armor."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 3247805">"I want to use a Lv.3 Giant Dye Exchange Coupon."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 3247806">"I want to use a Lv.4 Legendary Dye Exchange Coupon"</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Dimensional Merchant:<br>
What type of armor would you like?<br>
You can only choose once, so think carefully.
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 3247802">"I want a Heavy Armor."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 3247803">"I want a Light Armor."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 3247804">"I want a Robe."</Button>
</body></html>

View File

@ -0,0 +1,11 @@
<html><body>Dimensional Merchant:<br>
We are the <font color="LEVEL">Dimensional Merchants</font>. Get your Dimensional items from the Product Inventory. You can't get your items if your inventory is full, and any items you get cannot moved, sold, exchanged, or dropped.<br>
Oh, we are also upgrading products from the past L2Store, so exchange them as well.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 0">"I want a Dimensional Item."</Button> <!-- Must be fixed no info...-->
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalManager 32478-01.htm">"I want to exchange a Minion Coupon or Rose Spirit Coupon Pack for a Minion pet."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_package_deposit" msg="1040"><font color="LEVEL">Transfer a Dimensional Item to another character on this account.</font></Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_package_withdraw"><font color="LEVEL">Withdraw a transfered Dimensional Item.</font></Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalManager 32478-18.htm">"I want to exchange a Vitality item or XP Buff."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalManager 32478-19.htm">"I want to know about the Power Shirt."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalManager 32478-20.htm">"I want an Exchange Coupon."</Button>
</body></html>

View File

@ -0,0 +1,141 @@
/*
* Copyright (C) 2004-2015 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack 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.npc.DimensionalManager;
import java.util.HashMap;
import java.util.Map;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
* Dimensional Manager AI.
* @author Stayway, Mobius
*/
public final class DimensionalManager extends AbstractNpcAI
{
// Npc
private static final int DIMENSIONAL_MANAGER = 32478;
// Items
private static final int MINION_COUPON = 21275;
private static final int SUPERIOR_MINION_COUPON = 21279;
private static final int ROSE_SPIRIT = 21887;
// Rewards
private static final Map<String, SkillHolder> TICKET_REWARDS = new HashMap<>();
{
// Using SkillHolder to store ticket and reward ids.
// buypass - coupon(skillId) - reward(skillLvl)
TICKET_REWARDS.put("whiteweasel", new SkillHolder(MINION_COUPON, 13017));
TICKET_REWARDS.put("fairyprincess", new SkillHolder(MINION_COUPON, 13018));
TICKET_REWARDS.put("wildbeastfighter", new SkillHolder(MINION_COUPON, 16044));
TICKET_REWARDS.put("foxshaman", new SkillHolder(MINION_COUPON, 13020));
TICKET_REWARDS.put("turtleascetic", new SkillHolder(SUPERIOR_MINION_COUPON, 14064));
TICKET_REWARDS.put("spiritshaman", new SkillHolder(SUPERIOR_MINION_COUPON, 14062));
TICKET_REWARDS.put("toyknight", new SkillHolder(SUPERIOR_MINION_COUPON, 14061));
TICKET_REWARDS.put("desheloph", new SkillHolder(ROSE_SPIRIT, 20915));
TICKET_REWARDS.put("hyum", new SkillHolder(ROSE_SPIRIT, 20916));
TICKET_REWARDS.put("lekang", new SkillHolder(ROSE_SPIRIT, 20917));
TICKET_REWARDS.put("lilias", new SkillHolder(ROSE_SPIRIT, 20918));
TICKET_REWARDS.put("lapham", new SkillHolder(ROSE_SPIRIT, 20919));
TICKET_REWARDS.put("mafum", new SkillHolder(ROSE_SPIRIT, 20920));
}
private DimensionalManager()
{
super(DimensionalManager.class.getSimpleName(), "ai/npc");
addStartNpc(DIMENSIONAL_MANAGER);
addTalkId(DIMENSIONAL_MANAGER);
addFirstTalkId(DIMENSIONAL_MANAGER);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
switch (event)
{
case "32478-01.htm":
case "32478-02.htm":
case "32478-03.htm":
case "32478-04.htm":
case "32478-05.htm":
case "32478-06.htm":
case "32478-07.htm":
case "32478-08.htm":
case "32478-09.htm":
case "32478-10.htm":
case "32478-11.htm":
case "32478-12.htm":
case "32478-13.htm":
case "32478-14.htm":
case "32478-15.htm":
case "32478-16.htm":
case "32478-17.htm":
case "32478-18.htm":
case "32478-19.htm":
case "32478-20.htm":
case "32478-21.htm":
{
htmltext = event;
break;
}
case "turtleascetic":
case "spiritshaman":
case "desheloph":
case "hyum":
case "lekang":
case "lilias":
case "lapham":
case "mafum":
case "foxshaman":
case "whiteweasel":
case "fairyprincess":
case "toyknight":
case "wildbeastfighter":
{
if (hasQuestItems(player, TICKET_REWARDS.get(event).getSkillId()))
{
takeItems(player, TICKET_REWARDS.get(event).getSkillId(), 1);
giveItems(player, TICKET_REWARDS.get(event).getSkillLvl(), 1);
}
else
{
player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_ENOUGH_REQUIRED_ITEMS);
}
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return "32478.htm";
}
public static void main(String[] args)
{
new DimensionalManager();
}
}