Addition of Additional Services Advisor.

This commit is contained in:
MobiusDevelopment
2022-10-20 21:32:21 +00:00
parent eba7966d32
commit a39737a423
81 changed files with 1626 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<instance id="190" name="Additional Services Lab" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<time empty="0" />
<locations>
<enter type="FIXED">
<location x="-111378" y="-116546" z="-5768" />
</enter>
<exit type="ORIGIN" />
</locations>
<spawnlist>
<group>
<npc id="34153" x="-110656" y="-116551" z="-5728" heading="32000" respawnTime="60sec" /> <!-- Hermin - Additional Services' Researcher -->
</group>
</spawnlist>
</instance>

View File

@@ -0,0 +1,9 @@
<html><head><body>Additional Services' Advisor Juni:<br>
With our class change service you can choose a different class for your character. You need to prepare for it, however<br>
First, you need a <font color="LEVEL">Class Change Coupon</font> that's sold in the Adena store section of the L-Coin Store.<br>
Second, you have to <font color="LEVEL">unequip</font> all <font color="LEVEL">items.</font><br>
Third, you need to free up your <font color="LEVEL">inventory.</font>You will need <font color="LEVEL">at least 30 slots.</font><br>
What's more, <font color="LEVEL">Heroes can't change their class,</font> so a character with this title is ineligible for the service.<br>
Tell me once you're ready, I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="RETURN" action="bypass -h Quest AdditionalServicesAdvisor 34152.htm">Back</button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
You can change class only after <font color="LEVEL">the 3rd class change</font>.<br>
Come back once you have your <font color="LEVEL">3rd class</font>.<br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
You don't have a <font color="LEVEL">Class Change Coupon</font>!<br>
It's necessary if you want to <font color="LEVEL">change your class.</font> You can buy it in the Adena store section of the L-Coin Store.<br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Additional Services' Advisor Juni:<br>
Please, check your <font color="LEVEL">inventory</font>.<br>
To change class, in your <font color="LEVEL">inventory</font> must be <font color="LEVEL">free space</font> and <font color="LEVEL">weight</font>.<br>
Keep unnecessary items in the warehouse, to free 50% weight and at least 30 slots. <br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</Button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
It looks like you have an <font color="LEVEL">item equipped</font>!<br>
To change class, you need to <font color="LEVEL">unequip all items</font>.<br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
If you need help with additional services, ask me anytime! I'll explain it all to you.<br>
The Additional Services Lab provides the <font color="LEVEL">class change</font> service. Would you be interested in that?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask about the class change service</button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor teleport_inside"><font color="LEVEL">Teleport to the Additional Services Lab</font></button>
</body></html>

View File

@@ -0,0 +1,8 @@
<html><body>Additional Services' Researcher Hermin:<br>
In order to change a class, several conditions must be met. Changing a class requires care and attention, so it is only done in this laboratory.<br>
First, you need <font color="LEVEL">Class Change Coupon</font>, that's sold in the Adena store section of the L-Coin Store.<br>
Second, you have to <font color="LEVEL">unequip</font> all <font color="LEVEL">items</font>.<br>
Third, you need to free up your <font color="LEVEL">inventory</font> You will need <font color="LEVEL">at least 30 slots</font>.<br>
You should also know that only warriors can change classes, <font color="LEVEL">not holding the title of Hero</font>.<br>
So, are you ready?<br><Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-race.htm"><font color="LEVEL">Application for class change</font></button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
You can change class only after <font color="LEVEL">the 3rd class change</font>.<br>
Come back once you have your <font color="LEVEL">3rd class</font>.<br>
Tell me once you're ready.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Additional Services' Researcher Hermin:<br>
So you want to be <font color="LEVEL">%class_name%</font>.<br>
Now choose the gender of your character. Close your eyes and imagine what you will become when you change classes.<br>
What <font color="LEVEL">gender</font> will be your Duelist?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_gender %class_id% male"><font color="LEVEL">Male</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_gender %class_id% female"><font color="LEVEL">Female</font></button>
</body></html>

View File

@@ -0,0 +1,8 @@
<html><body>Additional Services' Researcher Hermin:<br>
Your choice of <font color="LEVEL">class</font> - <font color="LEVEL">%class_name%</font>.<br>
The character will be <font color="LEVEL">%sex%</font>.<br>Are you sure about your decision?<br>
After <font color="LEVEL">confirmations</font> the character will get <font color="LEVEL">selected race and gender</font>, as well as <font color="LEVEL">will change to the class of your choice</font>.<br>
<font color="LEVEL">After agreeing, you will be briefly disconnected from the game</font>. Are you confirming your choice?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor confirm_class %class_id% %sex%"><font color="LEVEL">Confirm choice</font></button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153.htm">Select other</Button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
So you want to be %class_name%. Now you have to choose the gender of the character. Unfortunately, <font color="LEVEL">gender selection is not available for the %class_name%</font>.
<br>%class_name% can only be men. Now close your eyes and concentrate.
<br>Imagine what it would be like to be %class_name%?
<br><Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_gender %class_id% male"><font color="LEVEL">Select %class_name%</font></button>
</body></html>

View File

@@ -0,0 +1,11 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, the Dark Elf! So you want to be a Dark Elf. Now choose... <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 106"><font color="LEVEL">Shillien Templar</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 107"><font color="LEVEL">Spectral Dancer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 108"><font color="LEVEL">Ghost Hunter</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 109"><font color="LEVEL">Ghost Sentinel</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 110"><font color="LEVEL">Storm Screamer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 111"><font color="LEVEL">Spectral Master</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 112"><font color="LEVEL">Shillien Saint</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 207"><font color="LEVEL">Death Knight (Dark Elf)</font></button>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Dwarf! So you want to be a Dwarf. Now choose... <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 117"><font color="LEVEL">Fortune Seeker</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 118"><font color="LEVEL">Maestro</font></button>
</body></html>

View File

@@ -0,0 +1,11 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Elf! So you want to be an Elf. Now choose. <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 99"><font color="LEVEL">Eva's Templar</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 100"><font color="LEVEL">Sword Muse</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 101"><font color="LEVEL">Wind Rider</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 102"><font color="LEVEL">Moonlight Sentinel</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 103"><font color="LEVEL">Mystic Muse</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 104"><font color="LEVEL">Elemental Master</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 105"><font color="LEVEL">Eva's Saint</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 203"><font color="LEVEL">Death Knight (Elf)</font></button>
</body></html>

View File

@@ -0,0 +1,15 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, a Man! So you want to be Human. Now choose <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 88"><font color="LEVEL">Duelist</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 89"><font color="LEVEL">Dreadnought</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 90"><font color="LEVEL">Phoenix Knight</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 91"><font color="LEVEL">Hell Knight</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 93"><font color="LEVEL">Adventurer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 92"><font color="LEVEL">Sagittarius</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 94"><font color="LEVEL">Archmage</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 95"><font color="LEVEL">Soultaker</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 96"><font color="LEVEL">Arcana Lord</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 97"><font color="LEVEL">Cardinal</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 98"><font color="LEVEL">Hierophant</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 199"><font color="LEVEL">Death Knight (Human)</font></button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Kamael! So you want to be Kamael! Now choose... <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 131"><font color="LEVEL">Doombringer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 195"><font color="LEVEL">Soul Hound</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 134"><font color="LEVEL">Trickster</font></button>
</body></html>

View File

@@ -0,0 +1,8 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Orc! So you want to be an Orc. Now choose <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 113"><font color="LEVEL">Titan</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 114"><font color="LEVEL">Grand Khavatari</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 115"><font color="LEVEL">Dominator</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 116"><font color="LEVEL">Doomcryer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 220"><font color="LEVEL">Vanguard Rider</font></button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Additional Services' Researcher Hermin:<br>
Sylph, that's it! So you've chosen the Sylph race. Now select <font color="LEVEL">class</font> for your character, available to the Sylph race.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 211"><font color="LEVEL">Storm Blaster</font></button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
You don't have a <font color="LEVEL">Class Change Coupon</font>!<br>
It's necessary if you want to <font color="LEVEL">change your class.</font> You can buy it in the Adena store section of the L-Coin Store.<br>
Tell me once you're ready.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Additional Services' Researcher Hermin:<br>
Please, check your <font color="LEVEL">inventory</font>.<br>
To change class, in your <font color="LEVEL">inventory</font> must be <font color="LEVEL">free space</font> and <font color="LEVEL">weight</font>.<br>
Keep unnecessary items in the warehouse, to free 50% weight and at least 30 slots. <br>
Tell me once you're ready.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm">Ask what is needed for changing class</Button>
</body></html>

View File

@@ -0,0 +1,13 @@
<html><body>Additional Services' Researcher Hermin:<br>
If you are ready, let's begin the procedure for changing classes.<br>
Please choose carefully and calmly, weighing the pros and cons.<br>
Close your eyes and imagine what you will become when you change classes.<br>
What <font color="LEVEL">race</font> will be a character?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_human.htm"><font color="LEVEL">Human</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_elf.htm"><font color="LEVEL">Elf</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_darkelf.htm"><font color="LEVEL">Dark Elf</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_orc.htm"><font color="LEVEL">Orc</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_dwarf.htm"><font color="LEVEL">Dwarf</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_kamael.htm"><font color="LEVEL">Kamael</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_sylph.htm"><font color="LEVEL">Sylph</font></button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Additional Services' Researcher Hermin:<br>
It looks like you have an <font color="LEVEL">item equipped</font>!<br>
To change class, you need to <font color="LEVEL">unequip all items</font>.
</body></html>

View File

@@ -0,0 +1,15 @@
<html><body>Additional Services' Researcher Hermin:<br>
Hello, my name is Hermine, and I am a researcher of value-added services..<br1>
Now the class change service is available.<br1>When you change class, some items will be dropped. Remember.<br>
<font color="LEVEL">All previously learned skills</font><br1><font color="LEVEL">Distributed characteristics</font><br1>
<font color="LEVEL">Bonuses for ranking</font><br1><font color="LEVEL">3 vs 3 Olympiad points and rank</font><br1>
<font color="LEVEL">All positive effects</font><br>When you change classes you get <font color="LEVEL">Scrolls SP</font> for each level.<br>
Note that <font color="LEVEL">all skills learned with the Spell Books and the books themselves will not return</font>.<br>
When <font color="LEVEL">you change classes to the one you had before, all learned skills are retained, so SP Scrolls are not issued</font>.<br>
<font color="LEVEL">The Dragon Slayer Shape, the White Guardian Transformation, the Extended Paint Potential, the Wyvern Transformation from 3 and 4 star skills, and skills gained through one-time quests will be issued as Sealed Spell Books.</font><br>
Changing classes is a very important step, so think about it carefully.<br>
Do you want to change classes?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm"><font color="LEVEL">Application for class change</font></button>
<Button ALIGN="LEFT" ICON="TELEPORT" action="bypass -h Quest AdditionalServicesAdvisor teleport_aden">Move to Aden</button>
<Button ALIGN="LEFT" ICON="TELEPORT" action="bypass -h Quest AdditionalServicesAdvisor teleport_giran">Move to Giran</button>
</body></html>

View File

@@ -0,0 +1,340 @@
/*
* 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.others.AdditionalServicesAdvisor;
import java.sql.Connection;
import java.sql.PreparedStatement;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.gameserver.data.xml.ClassListData;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.enums.SubclassInfoType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.olympiad.Hero;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
import ai.AbstractNpcAI;
/**
* @author Mobius
*/
public class AdditionalServicesAdvisor extends AbstractNpcAI
{
// NPCs
private static final int JUNI = 34152;
private static final int HERMIN = 34153;
// Items
private static final int CLASS_CHANGE_COUPON = 94828;
private static final int SP_SCROLL = 94829;
private static final int SPELLBOOK_HUMAN = 90038; // Spellbook: Mount Golden Lion
private static final int SPELLBOOK_ELF = 90039; // Spellbook: Mount Pegasus
private static final int SPELLBOOK_DELF = 90040; // Spellbook: Mount Saber Tooth Cougar
private static final int SPELLBOOK_ORC = 90042; // Spellbook: Mount Black Bear
private static final int SPELLBOOK_DWARF = 90041; // Spellbook: Mount Kukuru
private static final int SPELLBOOK_KAMAEL = 91946; // Spellbook: Mount Griffin
private static final int SPELLBOOK_DEATH_KNIGHT = 93383; // Spellbook: Mount Nightmare Steed
// Misc
private static final Location TELEPORT_ADEN_LOCATION = new Location(146856, 25803, -2008);
private static final Location TELEPORT_GIRAN_LOCATION = new Location(83386, 148014, -3400);
private static final int INSTANCE_ID = 190;
private AdditionalServicesAdvisor()
{
addStartNpc(JUNI, HERMIN);
addFirstTalkId(JUNI, HERMIN);
addTalkId(JUNI, HERMIN);
}
@Override
public String onAdvEvent(String event, Npc npc, Player player)
{
String html = null;
switch (npc.getId())
{
case JUNI:
{
switch (event)
{
case "34152.htm":
case "34152-1.htm":
{
html = event;
break;
}
case "teleport_inside":
{
html = checkConditions(npc, player);
if (html == null)
{
final Instance instance = InstanceManager.getInstance().createInstance(INSTANCE_ID, player);
player.teleToLocation(instance.getEnterLocation(), instance);
}
break;
}
}
break;
}
case HERMIN:
{
switch (event)
{
case "34153.htm":
case "34153-1.htm":
case "34153-class_darkelf.htm":
case "34153-class_dwarf.htm":
case "34153-class_elf.htm":
case "34153-class_human.htm":
case "34153-class_kamael.htm":
case "34153-class_orc.htm":
case "34153-class_sylph.htm":
case "34153-race.htm":
{
html = event;
break;
}
case "teleport_aden":
{
player.teleToLocation(TELEPORT_ADEN_LOCATION, null);
break;
}
case "teleport_giran":
{
player.teleToLocation(TELEPORT_GIRAN_LOCATION, null);
break;
}
}
if (event.startsWith("choose_class"))
{
final int classId = Integer.parseInt(event.split(" ")[1]);
if (classId > 195)
{
html = getHtm(player, "34153-choose_gender_unavailable.htm");
}
else
{
html = getHtm(player, "34153-choose_gender.htm");
}
html = html.replace("%class_id%", String.valueOf(classId));
html = html.replace("%class_name%", ClassListData.getInstance().getClass(classId).getClassName());
return html;
}
else if (event.startsWith("choose_gender"))
{
final String[] split = event.split(" ");
final int classId = Integer.parseInt(split[1]);
final boolean female = split[2].equals("female");
if (female && (classId > 195))
{
return null;
}
html = getHtm(player, "34153-choose_gender_confirm.htm");
html = html.replace("%class_id%", String.valueOf(classId));
html = html.replace("%class_name%", ClassListData.getInstance().getClass(classId).getClassName());
html = html.replace("%sex%", female ? "female" : "male");
}
else if (event.startsWith("choose_gender_confirm"))
{
final String[] split = event.split(" ");
final int classId = Integer.parseInt(split[1]);
final boolean female = split[2].equals("female");
if (female && (classId > 195))
{
break;
}
html = getHtm(player, "34153-choose_gender_unavailable.htm");
html = html.replace("%class_id%", String.valueOf(classId));
html = html.replace("%class_name%", ClassListData.getInstance().getClass(classId).getClassName());
html = html.replace("%sex%", female ? "female" : "male");
}
else if (event.startsWith("confirm_class"))
{
html = checkConditions(npc, player);
if (html != null)
{
break;
}
final String[] split = event.split(" ");
final int classId = Integer.parseInt(split[1]);
final boolean female = split[2].equals("female");
if (female && (classId > 195))
{
break;
}
if (hasQuestItems(player, CLASS_CHANGE_COUPON))
{
takeItems(player, CLASS_CHANGE_COUPON, 1);
for (Skill skill : player.getAllSkills())
{
player.removeSkill(skill);
}
player.setVitalityPoints(0, true);
player.setExpBeforeDeath(0);
if (female)
{
player.getAppearance().setFemale();
}
else
{
player.getAppearance().setMale();
}
player.setClassId(classId);
player.setBaseClass(player.getActiveClass());
giveItems(player, SP_SCROLL, 20);
if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
{
player.getVariables().set("3rdClassMountRewarded", true);
if (player.isDeathKnight())
{
giveItems(player, SPELLBOOK_DEATH_KNIGHT, 1);
}
else
{
switch (player.getRace())
{
case ELF:
{
giveItems(player, SPELLBOOK_ELF, 1);
break;
}
case DARK_ELF:
{
giveItems(player, SPELLBOOK_DELF, 1);
break;
}
case ORC:
{
giveItems(player, SPELLBOOK_ORC, 1);
break;
}
case DWARF:
{
giveItems(player, SPELLBOOK_DWARF, 1);
break;
}
case KAMAEL:
{
giveItems(player, SPELLBOOK_KAMAEL, 1);
break;
}
case HUMAN:
{
giveItems(player, SPELLBOOK_HUMAN, 1);
break;
}
}
}
}
player.getServitorsAndPets().forEach(s -> s.unSummon(player));
player.getEffectList().stopAllEffects(true);
player.getInventory().getItems().forEach(item ->
{
if (item.isEquipped())
{
player.getInventory().unEquipItemInSlot(item.getLocationSlot());
}
});
// Appearance after class change.
player.getAppearance().setHairStyle(0);
player.getAppearance().setHairColor(0);
player.getAppearance().setFace(0);
// Set new classId and reset olympiad points.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE olympiad_nobles SET olympiad_points=?, class_id=? WHERE charId='" + player.getObjectId() + "'"))
{
ps.setInt(1, Config.ALT_OLY_START_POINTS);
ps.setInt(2, classId);
ps.executeUpdate();
}
catch (Exception e)
{
LOGGER.warning(this.getClass().getSimpleName() + ": Set new classId and reset olympiad points: " + e.getMessage());
}
player.store(false);
player.broadcastUserInfo();
player.sendSkillList();
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
player.sendPacket(new ExUserInfoInvenWeight(player));
}
else
{
html = "34152-no_coupon.htm";
}
}
break;
}
}
return html;
}
@Override
public String onFirstTalk(Npc npc, Player player)
{
return npc.getId() + ".htm";
}
private String checkConditions(Npc npc, Player player)
{
if (!hasQuestItems(player, CLASS_CHANGE_COUPON))
{
return npc.getId() + "-no_coupon.htm";
}
for (Item item : player.getInventory().getItems())
{
if (item.isEquipped())
{
return npc.getId() + "-unequip_items.htm";
}
}
if (!player.isInventoryUnder80(false) || (player.getWeightPenalty() >= 3))
{
return npc.getId() + "-no_inventory.htm";
}
if (!player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
{
return npc.getId() + "-3rd_class.htm";
}
if (player.isInOlympiadMode() || player.isHero() || Hero.getInstance().isHero(player.getObjectId()) || Hero.getInstance().isUnclaimedHero(player.getObjectId()))
{
return npc.getId() + "-1.htm";
}
return null;
}
public static void main(String[] args)
{
new AdditionalServicesAdvisor();
}
}

View File

@@ -2,6 +2,7 @@
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/spawns.xsd"> <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/spawns.xsd">
<spawn name="AdenSquareMerchants"> <spawn name="AdenSquareMerchants">
<group> <group>
<npc id="34152" x="147656" y="27340" z="-2200" heading="48562" respawnTime="1min" /> <!-- Juni -->
<npc id="30869" x="147259" y="27356" z="-2200" heading="47094" respawnTime="1min" /> <!-- Lemper - Pet Manager --> <npc id="30869" x="147259" y="27356" z="-2200" heading="47094" respawnTime="1min" /> <!-- Lemper - Pet Manager -->
<npc id="30936" x="147321" y="27315" z="-2200" heading="41794" respawnTime="1min" /> <!-- Pona - Collector --> <npc id="30936" x="147321" y="27315" z="-2200" heading="41794" respawnTime="1min" /> <!-- Pona - Collector -->
<npc id="30843" x="147402" y="27277" z="-2200" heading="44416" respawnTime="1min" /> <!-- Romp - Warehouse Keeper --> <npc id="30843" x="147402" y="27277" z="-2200" heading="44416" respawnTime="1min" /> <!-- Romp - Warehouse Keeper -->

View File

@@ -8,6 +8,7 @@
<npc id="30095" x="82524" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Randolf - Warehouse Keeper --> <npc id="30095" x="82524" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Randolf - Warehouse Keeper -->
<npc id="30300" x="82624" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Pushkin - Blacksmith --> <npc id="30300" x="82624" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Pushkin - Blacksmith -->
<npc id="31049" x="82724" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Pepper - Tattoo Master --> <npc id="31049" x="82724" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Pepper - Tattoo Master -->
<npc id="34152" x="82824" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Juni - Additional Services Advisor -->
</group> </group>
</spawn> </spawn>
</list> </list>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<instance id="190" name="Additional Services Lab" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<time empty="0" />
<locations>
<enter type="FIXED">
<location x="-111378" y="-116546" z="-5768" />
</enter>
<exit type="ORIGIN" />
</locations>
<spawnlist>
<group>
<npc id="34153" x="-110656" y="-116551" z="-5728" heading="32000" respawnTime="60sec" /> <!-- Hermin - Additional Services' Researcher -->
</group>
</spawnlist>
</instance>

View File

@@ -0,0 +1,9 @@
<html><head><body>Additional Services' Advisor Juni:<br>
With our class change service you can choose a different class for your character. You need to prepare for it, however<br>
First, you need a <font color="LEVEL">Class Change Coupon</font> that's sold in the Adena store section of the L-Coin Store.<br>
Second, you have to <font color="LEVEL">unequip</font> all <font color="LEVEL">items.</font><br>
Third, you need to free up your <font color="LEVEL">inventory.</font>You will need <font color="LEVEL">at least 30 slots.</font><br>
What's more, <font color="LEVEL">Heroes can't change their class,</font> so a character with this title is ineligible for the service.<br>
Tell me once you're ready, I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="RETURN" action="bypass -h Quest AdditionalServicesAdvisor 34152.htm">Back</button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
You can change class only after <font color="LEVEL">the 3rd class change</font>.<br>
Come back once you have your <font color="LEVEL">3rd class</font>.<br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
You don't have a <font color="LEVEL">Class Change Coupon</font>!<br>
It's necessary if you want to <font color="LEVEL">change your class.</font> You can buy it in the Adena store section of the L-Coin Store.<br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Additional Services' Advisor Juni:<br>
Please, check your <font color="LEVEL">inventory</font>.<br>
To change class, in your <font color="LEVEL">inventory</font> must be <font color="LEVEL">free space</font> and <font color="LEVEL">weight</font>.<br>
Keep unnecessary items in the warehouse, to free 50% weight and at least 30 slots. <br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</Button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
It looks like you have an <font color="LEVEL">item equipped</font>!<br>
To change class, you need to <font color="LEVEL">unequip all items</font>.<br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
If you need help with additional services, ask me anytime! I'll explain it all to you.<br>
The Additional Services Lab provides the <font color="LEVEL">class change</font> service. Would you be interested in that?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask about the class change service</button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor teleport_inside"><font color="LEVEL">Teleport to the Additional Services Lab</font></button>
</body></html>

View File

@@ -0,0 +1,8 @@
<html><body>Additional Services' Researcher Hermin:<br>
In order to change a class, several conditions must be met. Changing a class requires care and attention, so it is only done in this laboratory.<br>
First, you need <font color="LEVEL">Class Change Coupon</font>, that's sold in the Adena store section of the L-Coin Store.<br>
Second, you have to <font color="LEVEL">unequip</font> all <font color="LEVEL">items</font>.<br>
Third, you need to free up your <font color="LEVEL">inventory</font> You will need <font color="LEVEL">at least 30 slots</font>.<br>
You should also know that only warriors can change classes, <font color="LEVEL">not holding the title of Hero</font>.<br>
So, are you ready?<br><Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-race.htm"><font color="LEVEL">Application for class change</font></button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
You can change class only after <font color="LEVEL">the 3rd class change</font>.<br>
Come back once you have your <font color="LEVEL">3rd class</font>.<br>
Tell me once you're ready.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Additional Services' Researcher Hermin:<br>
So you want to be <font color="LEVEL">%class_name%</font>.<br>
Now choose the gender of your character. Close your eyes and imagine what you will become when you change classes.<br>
What <font color="LEVEL">gender</font> will be your Duelist?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_gender %class_id% male"><font color="LEVEL">Male</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_gender %class_id% female"><font color="LEVEL">Female</font></button>
</body></html>

View File

@@ -0,0 +1,8 @@
<html><body>Additional Services' Researcher Hermin:<br>
Your choice of <font color="LEVEL">class</font> - <font color="LEVEL">%class_name%</font>.<br>
The character will be <font color="LEVEL">%sex%</font>.<br>Are you sure about your decision?<br>
After <font color="LEVEL">confirmations</font> the character will get <font color="LEVEL">selected race and gender</font>, as well as <font color="LEVEL">will change to the class of your choice</font>.<br>
<font color="LEVEL">After agreeing, you will be briefly disconnected from the game</font>. Are you confirming your choice?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor confirm_class %class_id% %sex%"><font color="LEVEL">Confirm choice</font></button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153.htm">Select other</Button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
So you want to be %class_name%. Now you have to choose the gender of the character. Unfortunately, <font color="LEVEL">gender selection is not available for the %class_name%</font>.
<br>%class_name% can only be men. Now close your eyes and concentrate.
<br>Imagine what it would be like to be %class_name%?
<br><Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_gender %class_id% male"><font color="LEVEL">Select %class_name%</font></button>
</body></html>

View File

@@ -0,0 +1,11 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, the Dark Elf! So you want to be a Dark Elf. Now choose... <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 106"><font color="LEVEL">Shillien Templar</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 107"><font color="LEVEL">Spectral Dancer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 108"><font color="LEVEL">Ghost Hunter</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 109"><font color="LEVEL">Ghost Sentinel</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 110"><font color="LEVEL">Storm Screamer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 111"><font color="LEVEL">Spectral Master</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 112"><font color="LEVEL">Shillien Saint</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 207"><font color="LEVEL">Death Knight (Dark Elf)</font></button>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Dwarf! So you want to be a Dwarf. Now choose... <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 117"><font color="LEVEL">Fortune Seeker</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 118"><font color="LEVEL">Maestro</font></button>
</body></html>

View File

@@ -0,0 +1,11 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Elf! So you want to be an Elf. Now choose. <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 99"><font color="LEVEL">Eva's Templar</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 100"><font color="LEVEL">Sword Muse</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 101"><font color="LEVEL">Wind Rider</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 102"><font color="LEVEL">Moonlight Sentinel</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 103"><font color="LEVEL">Mystic Muse</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 104"><font color="LEVEL">Elemental Master</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 105"><font color="LEVEL">Eva's Saint</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 203"><font color="LEVEL">Death Knight (Elf)</font></button>
</body></html>

View File

@@ -0,0 +1,15 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, a Man! So you want to be Human. Now choose <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 88"><font color="LEVEL">Duelist</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 89"><font color="LEVEL">Dreadnought</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 90"><font color="LEVEL">Phoenix Knight</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 91"><font color="LEVEL">Hell Knight</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 93"><font color="LEVEL">Adventurer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 92"><font color="LEVEL">Sagittarius</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 94"><font color="LEVEL">Archmage</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 95"><font color="LEVEL">Soultaker</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 96"><font color="LEVEL">Arcana Lord</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 97"><font color="LEVEL">Cardinal</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 98"><font color="LEVEL">Hierophant</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 199"><font color="LEVEL">Death Knight (Human)</font></button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Kamael! So you want to be Kamael! Now choose... <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 131"><font color="LEVEL">Doombringer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 195"><font color="LEVEL">Soul Hound</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 134"><font color="LEVEL">Trickster</font></button>
</body></html>

View File

@@ -0,0 +1,8 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Orc! So you want to be an Orc. Now choose <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 113"><font color="LEVEL">Titan</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 114"><font color="LEVEL">Grand Khavatari</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 115"><font color="LEVEL">Dominator</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 116"><font color="LEVEL">Doomcryer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 220"><font color="LEVEL">Vanguard Rider</font></button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Additional Services' Researcher Hermin:<br>
Sylph, that's it! So you've chosen the Sylph race. Now select <font color="LEVEL">class</font> for your character, available to the Sylph race.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 211"><font color="LEVEL">Storm Blaster</font></button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
You don't have a <font color="LEVEL">Class Change Coupon</font>!<br>
It's necessary if you want to <font color="LEVEL">change your class.</font> You can buy it in the Adena store section of the L-Coin Store.<br>
Tell me once you're ready.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Additional Services' Researcher Hermin:<br>
Please, check your <font color="LEVEL">inventory</font>.<br>
To change class, in your <font color="LEVEL">inventory</font> must be <font color="LEVEL">free space</font> and <font color="LEVEL">weight</font>.<br>
Keep unnecessary items in the warehouse, to free 50% weight and at least 30 slots. <br>
Tell me once you're ready.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm">Ask what is needed for changing class</Button>
</body></html>

View File

@@ -0,0 +1,13 @@
<html><body>Additional Services' Researcher Hermin:<br>
If you are ready, let's begin the procedure for changing classes.<br>
Please choose carefully and calmly, weighing the pros and cons.<br>
Close your eyes and imagine what you will become when you change classes.<br>
What <font color="LEVEL">race</font> will be a character?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_human.htm"><font color="LEVEL">Human</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_elf.htm"><font color="LEVEL">Elf</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_darkelf.htm"><font color="LEVEL">Dark Elf</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_orc.htm"><font color="LEVEL">Orc</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_dwarf.htm"><font color="LEVEL">Dwarf</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_kamael.htm"><font color="LEVEL">Kamael</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_sylph.htm"><font color="LEVEL">Sylph</font></button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Additional Services' Researcher Hermin:<br>
It looks like you have an <font color="LEVEL">item equipped</font>!<br>
To change class, you need to <font color="LEVEL">unequip all items</font>.
</body></html>

View File

@@ -0,0 +1,15 @@
<html><body>Additional Services' Researcher Hermin:<br>
Hello, my name is Hermine, and I am a researcher of value-added services..<br1>
Now the class change service is available.<br1>When you change class, some items will be dropped. Remember.<br>
<font color="LEVEL">All previously learned skills</font><br1><font color="LEVEL">Distributed characteristics</font><br1>
<font color="LEVEL">Bonuses for ranking</font><br1><font color="LEVEL">3 vs 3 Olympiad points and rank</font><br1>
<font color="LEVEL">All positive effects</font><br>When you change classes you get <font color="LEVEL">Scrolls SP</font> for each level.<br>
Note that <font color="LEVEL">all skills learned with the Spell Books and the books themselves will not return</font>.<br>
When <font color="LEVEL">you change classes to the one you had before, all learned skills are retained, so SP Scrolls are not issued</font>.<br>
<font color="LEVEL">The Dragon Slayer Shape, the White Guardian Transformation, the Extended Paint Potential, the Wyvern Transformation from 3 and 4 star skills, and skills gained through one-time quests will be issued as Sealed Spell Books.</font><br>
Changing classes is a very important step, so think about it carefully.<br>
Do you want to change classes?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm"><font color="LEVEL">Application for class change</font></button>
<Button ALIGN="LEFT" ICON="TELEPORT" action="bypass -h Quest AdditionalServicesAdvisor teleport_aden">Move to Aden</button>
<Button ALIGN="LEFT" ICON="TELEPORT" action="bypass -h Quest AdditionalServicesAdvisor teleport_giran">Move to Giran</button>
</body></html>

View File

@@ -0,0 +1,346 @@
/*
* 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.others.AdditionalServicesAdvisor;
import java.sql.Connection;
import java.sql.PreparedStatement;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.gameserver.data.xml.ClassListData;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.enums.SubclassInfoType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.olympiad.Hero;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
import ai.AbstractNpcAI;
/**
* @author Mobius
*/
public class AdditionalServicesAdvisor extends AbstractNpcAI
{
// NPCs
private static final int JUNI = 34152;
private static final int HERMIN = 34153;
// Items
private static final int CLASS_CHANGE_COUPON = 94828;
private static final int SP_SCROLL = 94829;
private static final int SPELLBOOK_HUMAN = 90038; // Spellbook: Mount Golden Lion
private static final int SPELLBOOK_ELF = 90039; // Spellbook: Mount Pegasus
private static final int SPELLBOOK_DELF = 90040; // Spellbook: Mount Saber Tooth Cougar
private static final int SPELLBOOK_ORC = 90042; // Spellbook: Mount Black Bear
private static final int SPELLBOOK_DWARF = 90041; // Spellbook: Mount Kukuru
private static final int SPELLBOOK_KAMAEL = 91946; // Spellbook: Mount Griffin
private static final int SPELLBOOK_DEATH_KNIGHT = 93383; // Spellbook: Mount Nightmare Steed
private static final int SPELLBOOK_SYLPH = 95367; // Spellbook: Mount Elemental Lyn Draco
// Misc
private static final Location TELEPORT_ADEN_LOCATION = new Location(146856, 25803, -2008);
private static final Location TELEPORT_GIRAN_LOCATION = new Location(83386, 148014, -3400);
private static final int INSTANCE_ID = 190;
private AdditionalServicesAdvisor()
{
addStartNpc(JUNI, HERMIN);
addFirstTalkId(JUNI, HERMIN);
addTalkId(JUNI, HERMIN);
}
@Override
public String onAdvEvent(String event, Npc npc, Player player)
{
String html = null;
switch (npc.getId())
{
case JUNI:
{
switch (event)
{
case "34152.htm":
case "34152-1.htm":
{
html = event;
break;
}
case "teleport_inside":
{
html = checkConditions(npc, player);
if (html == null)
{
final Instance instance = InstanceManager.getInstance().createInstance(INSTANCE_ID, player);
player.teleToLocation(instance.getEnterLocation(), instance);
}
break;
}
}
break;
}
case HERMIN:
{
switch (event)
{
case "34153.htm":
case "34153-1.htm":
case "34153-class_darkelf.htm":
case "34153-class_dwarf.htm":
case "34153-class_elf.htm":
case "34153-class_human.htm":
case "34153-class_kamael.htm":
case "34153-class_orc.htm":
case "34153-class_sylph.htm":
case "34153-race.htm":
{
html = event;
break;
}
case "teleport_aden":
{
player.teleToLocation(TELEPORT_ADEN_LOCATION, null);
break;
}
case "teleport_giran":
{
player.teleToLocation(TELEPORT_GIRAN_LOCATION, null);
break;
}
}
if (event.startsWith("choose_class"))
{
final int classId = Integer.parseInt(event.split(" ")[1]);
if (classId > 195)
{
html = getHtm(player, "34153-choose_gender_unavailable.htm");
}
else
{
html = getHtm(player, "34153-choose_gender.htm");
}
html = html.replace("%class_id%", String.valueOf(classId));
html = html.replace("%class_name%", ClassListData.getInstance().getClass(classId).getClassName());
return html;
}
else if (event.startsWith("choose_gender"))
{
final String[] split = event.split(" ");
final int classId = Integer.parseInt(split[1]);
final boolean female = split[2].equals("female");
if (female && (classId > 195))
{
return null;
}
html = getHtm(player, "34153-choose_gender_confirm.htm");
html = html.replace("%class_id%", String.valueOf(classId));
html = html.replace("%class_name%", ClassListData.getInstance().getClass(classId).getClassName());
html = html.replace("%sex%", female ? "female" : "male");
}
else if (event.startsWith("choose_gender_confirm"))
{
final String[] split = event.split(" ");
final int classId = Integer.parseInt(split[1]);
final boolean female = split[2].equals("female");
if (female && (classId > 195))
{
break;
}
html = getHtm(player, "34153-choose_gender_unavailable.htm");
html = html.replace("%class_id%", String.valueOf(classId));
html = html.replace("%class_name%", ClassListData.getInstance().getClass(classId).getClassName());
html = html.replace("%sex%", female ? "female" : "male");
}
else if (event.startsWith("confirm_class"))
{
html = checkConditions(npc, player);
if (html != null)
{
break;
}
final String[] split = event.split(" ");
final int classId = Integer.parseInt(split[1]);
final boolean female = split[2].equals("female");
if (female && (classId > 195))
{
break;
}
if (hasQuestItems(player, CLASS_CHANGE_COUPON))
{
takeItems(player, CLASS_CHANGE_COUPON, 1);
for (Skill skill : player.getAllSkills())
{
player.removeSkill(skill);
}
player.setVitalityPoints(0, true);
player.setExpBeforeDeath(0);
if (female)
{
player.getAppearance().setFemale();
}
else
{
player.getAppearance().setMale();
}
player.setClassId(classId);
player.setBaseClass(player.getActiveClass());
giveItems(player, SP_SCROLL, 20);
if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
{
player.getVariables().set("3rdClassMountRewarded", true);
if (player.isDeathKnight())
{
giveItems(player, SPELLBOOK_DEATH_KNIGHT, 1);
}
else
{
switch (player.getRace())
{
case ELF:
{
giveItems(player, SPELLBOOK_ELF, 1);
break;
}
case DARK_ELF:
{
giveItems(player, SPELLBOOK_DELF, 1);
break;
}
case ORC:
{
giveItems(player, SPELLBOOK_ORC, 1);
break;
}
case DWARF:
{
giveItems(player, SPELLBOOK_DWARF, 1);
break;
}
case KAMAEL:
{
giveItems(player, SPELLBOOK_KAMAEL, 1);
break;
}
case HUMAN:
{
giveItems(player, SPELLBOOK_HUMAN, 1);
break;
}
case SYLPH:
{
giveItems(player, SPELLBOOK_SYLPH, 1);
break;
}
}
}
}
player.getServitorsAndPets().forEach(s -> s.unSummon(player));
player.getEffectList().stopAllEffects(true);
player.getInventory().getItems().forEach(item ->
{
if (item.isEquipped())
{
player.getInventory().unEquipItemInSlot(item.getLocationSlot());
}
});
// Appearance after class change.
player.getAppearance().setHairStyle(0);
player.getAppearance().setHairColor(0);
player.getAppearance().setFace(0);
// Set new classId and reset olympiad points.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE olympiad_nobles SET olympiad_points=?, class_id=? WHERE charId='" + player.getObjectId() + "'"))
{
ps.setInt(1, Config.ALT_OLY_START_POINTS);
ps.setInt(2, classId);
ps.executeUpdate();
}
catch (Exception e)
{
LOGGER.warning(this.getClass().getSimpleName() + ": Set new classId and reset olympiad points: " + e.getMessage());
}
player.store(false);
player.broadcastUserInfo();
player.sendSkillList();
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
player.sendPacket(new ExUserInfoInvenWeight(player));
}
else
{
html = "34152-no_coupon.htm";
}
}
break;
}
}
return html;
}
@Override
public String onFirstTalk(Npc npc, Player player)
{
return npc.getId() + ".htm";
}
private String checkConditions(Npc npc, Player player)
{
if (!hasQuestItems(player, CLASS_CHANGE_COUPON))
{
return npc.getId() + "-no_coupon.htm";
}
for (Item item : player.getInventory().getItems())
{
if (item.isEquipped())
{
return npc.getId() + "-unequip_items.htm";
}
}
if (!player.isInventoryUnder80(false) || (player.getWeightPenalty() >= 3))
{
return npc.getId() + "-no_inventory.htm";
}
if (!player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
{
return npc.getId() + "-3rd_class.htm";
}
if (player.isInOlympiadMode() || player.isHero() || Hero.getInstance().isHero(player.getObjectId()) || Hero.getInstance().isUnclaimedHero(player.getObjectId()))
{
return npc.getId() + "-1.htm";
}
return null;
}
public static void main(String[] args)
{
new AdditionalServicesAdvisor();
}
}

View File

@@ -2,6 +2,7 @@
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/spawns.xsd"> <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/spawns.xsd">
<spawn name="AdenSquareMerchants"> <spawn name="AdenSquareMerchants">
<group> <group>
<npc id="34152" x="147656" y="27340" z="-2200" heading="48562" respawnTime="1min" /> <!-- Juni -->
<npc id="30869" x="147259" y="27356" z="-2200" heading="47094" respawnTime="1min" /> <!-- Lemper - Pet Manager --> <npc id="30869" x="147259" y="27356" z="-2200" heading="47094" respawnTime="1min" /> <!-- Lemper - Pet Manager -->
<npc id="34218" x="147321" y="27315" z="-2200" heading="41794" respawnTime="1min" /> <!-- Greno - Equipment Merchant --> <npc id="34218" x="147321" y="27315" z="-2200" heading="41794" respawnTime="1min" /> <!-- Greno - Equipment Merchant -->
<npc id="30843" x="147402" y="27277" z="-2200" heading="44416" respawnTime="1min" /> <!-- Romp - Warehouse Keeper --> <npc id="30843" x="147402" y="27277" z="-2200" heading="44416" respawnTime="1min" /> <!-- Romp - Warehouse Keeper -->

View File

@@ -8,6 +8,7 @@
<npc id="30095" x="82524" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Randolf - Warehouse Keeper --> <npc id="30095" x="82524" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Randolf - Warehouse Keeper -->
<npc id="30300" x="82624" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Pushkin - Blacksmith --> <npc id="30300" x="82624" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Pushkin - Blacksmith -->
<!-- <npc id="31049" x="82724" y="149712" z="-3464" heading="53501" respawnTime="1min" /> Pepper - Tattoo Master --> <!-- <npc id="31049" x="82724" y="149712" z="-3464" heading="53501" respawnTime="1min" /> Pepper - Tattoo Master -->
<npc id="34152" x="82824" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Juni - Additional Services Advisor -->
</group> </group>
</spawn> </spawn>
</list> </list>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<instance id="190" name="Additional Services Lab" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<time empty="0" />
<locations>
<enter type="FIXED">
<location x="-111378" y="-116546" z="-5768" />
</enter>
<exit type="ORIGIN" />
</locations>
<spawnlist>
<group>
<npc id="34153" x="-110656" y="-116551" z="-5728" heading="32000" respawnTime="60sec" /> <!-- Hermin - Additional Services' Researcher -->
</group>
</spawnlist>
</instance>

View File

@@ -0,0 +1,9 @@
<html><head><body>Additional Services' Advisor Juni:<br>
With our class change service you can choose a different class for your character. You need to prepare for it, however<br>
First, you need a <font color="LEVEL">Class Change Coupon</font> that's sold in the Adena store section of the L-Coin Store.<br>
Second, you have to <font color="LEVEL">unequip</font> all <font color="LEVEL">items.</font><br>
Third, you need to free up your <font color="LEVEL">inventory.</font>You will need <font color="LEVEL">at least 30 slots.</font><br>
What's more, <font color="LEVEL">Heroes can't change their class,</font> so a character with this title is ineligible for the service.<br>
Tell me once you're ready, I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="RETURN" action="bypass -h Quest AdditionalServicesAdvisor 34152.htm">Back</button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
You can change class only after <font color="LEVEL">the 3rd class change</font>.<br>
Come back once you have your <font color="LEVEL">3rd class</font>.<br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
You don't have a <font color="LEVEL">Class Change Coupon</font>!<br>
It's necessary if you want to <font color="LEVEL">change your class.</font> You can buy it in the Adena store section of the L-Coin Store.<br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Additional Services' Advisor Juni:<br>
Please, check your <font color="LEVEL">inventory</font>.<br>
To change class, in your <font color="LEVEL">inventory</font> must be <font color="LEVEL">free space</font> and <font color="LEVEL">weight</font>.<br>
Keep unnecessary items in the warehouse, to free 50% weight and at least 30 slots. <br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</Button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
It looks like you have an <font color="LEVEL">item equipped</font>!<br>
To change class, you need to <font color="LEVEL">unequip all items</font>.<br>
Tell me once you're ready. I'll send you to the Additional Services Lab. Talk to the Researcher Hermin there to change class.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Advisor Juni:<br>
If you need help with additional services, ask me anytime! I'll explain it all to you.<br>
The Additional Services Lab provides the <font color="LEVEL">class change</font> service. Would you be interested in that?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34152-1.htm">Ask about the class change service</button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor teleport_inside"><font color="LEVEL">Teleport to the Additional Services Lab</font></button>
</body></html>

View File

@@ -0,0 +1,8 @@
<html><body>Additional Services' Researcher Hermin:<br>
In order to change a class, several conditions must be met. Changing a class requires care and attention, so it is only done in this laboratory.<br>
First, you need <font color="LEVEL">Class Change Coupon</font>, that's sold in the Adena store section of the L-Coin Store.<br>
Second, you have to <font color="LEVEL">unequip</font> all <font color="LEVEL">items</font>.<br>
Third, you need to free up your <font color="LEVEL">inventory</font> You will need <font color="LEVEL">at least 30 slots</font>.<br>
You should also know that only warriors can change classes, <font color="LEVEL">not holding the title of Hero</font>.<br>
So, are you ready?<br><Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-race.htm"><font color="LEVEL">Application for class change</font></button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
You can change class only after <font color="LEVEL">the 3rd class change</font>.<br>
Come back once you have your <font color="LEVEL">3rd class</font>.<br>
Tell me once you're ready.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Additional Services' Researcher Hermin:<br>
So you want to be <font color="LEVEL">%class_name%</font>.<br>
Now choose the gender of your character. Close your eyes and imagine what you will become when you change classes.<br>
What <font color="LEVEL">gender</font> will be your Duelist?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_gender %class_id% male"><font color="LEVEL">Male</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_gender %class_id% female"><font color="LEVEL">Female</font></button>
</body></html>

View File

@@ -0,0 +1,8 @@
<html><body>Additional Services' Researcher Hermin:<br>
Your choice of <font color="LEVEL">class</font> - <font color="LEVEL">%class_name%</font>.<br>
The character will be <font color="LEVEL">%sex%</font>.<br>Are you sure about your decision?<br>
After <font color="LEVEL">confirmations</font> the character will get <font color="LEVEL">selected race and gender</font>, as well as <font color="LEVEL">will change to the class of your choice</font>.<br>
<font color="LEVEL">After agreeing, you will be briefly disconnected from the game</font>. Are you confirming your choice?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor confirm_class %class_id% %sex%"><font color="LEVEL">Confirm choice</font></button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153.htm">Select other</Button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
So you want to be %class_name%. Now you have to choose the gender of the character. Unfortunately, <font color="LEVEL">gender selection is not available for the %class_name%</font>.
<br>%class_name% can only be men. Now close your eyes and concentrate.
<br>Imagine what it would be like to be %class_name%?
<br><Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_gender %class_id% male"><font color="LEVEL">Select %class_name%</font></button>
</body></html>

View File

@@ -0,0 +1,11 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, the Dark Elf! So you want to be a Dark Elf. Now choose... <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 106"><font color="LEVEL">Shillien Templar</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 107"><font color="LEVEL">Spectral Dancer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 108"><font color="LEVEL">Ghost Hunter</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 109"><font color="LEVEL">Ghost Sentinel</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 110"><font color="LEVEL">Storm Screamer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 111"><font color="LEVEL">Spectral Master</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 112"><font color="LEVEL">Shillien Saint</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 207"><font color="LEVEL">Death Knight (Dark Elf)</font></button>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Dwarf! So you want to be a Dwarf. Now choose... <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 117"><font color="LEVEL">Fortune Seeker</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 118"><font color="LEVEL">Maestro</font></button>
</body></html>

View File

@@ -0,0 +1,11 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Elf! So you want to be an Elf. Now choose. <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 99"><font color="LEVEL">Eva's Templar</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 100"><font color="LEVEL">Sword Muse</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 101"><font color="LEVEL">Wind Rider</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 102"><font color="LEVEL">Moonlight Sentinel</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 103"><font color="LEVEL">Mystic Muse</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 104"><font color="LEVEL">Elemental Master</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 105"><font color="LEVEL">Eva's Saint</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 203"><font color="LEVEL">Death Knight (Elf)</font></button>
</body></html>

View File

@@ -0,0 +1,15 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, a Man! So you want to be Human. Now choose <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 88"><font color="LEVEL">Duelist</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 89"><font color="LEVEL">Dreadnought</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 90"><font color="LEVEL">Phoenix Knight</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 91"><font color="LEVEL">Hell Knight</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 93"><font color="LEVEL">Adventurer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 92"><font color="LEVEL">Sagittarius</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 94"><font color="LEVEL">Archmage</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 95"><font color="LEVEL">Soultaker</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 96"><font color="LEVEL">Arcana Lord</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 97"><font color="LEVEL">Cardinal</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 98"><font color="LEVEL">Hierophant</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 199"><font color="LEVEL">Death Knight (Human)</font></button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Kamael! So you want to be Kamael! Now choose... <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 131"><font color="LEVEL">Doombringer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 195"><font color="LEVEL">Soul Hound</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 134"><font color="LEVEL">Trickster</font></button>
</body></html>

View File

@@ -0,0 +1,8 @@
<html><body>Additional Services' Researcher Hermin:<br>
Aha, Orc! So you want to be an Orc. Now choose <font color="LEVEL">class</font> for your character.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 113"><font color="LEVEL">Titan</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 114"><font color="LEVEL">Grand Khavatari</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 115"><font color="LEVEL">Dominator</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 116"><font color="LEVEL">Doomcryer</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 220"><font color="LEVEL">Vanguard Rider</font></button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Additional Services' Researcher Hermin:<br>
Sylph, that's it! So you've chosen the Sylph race. Now select <font color="LEVEL">class</font> for your character, available to the Sylph race.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor choose_class 211"><font color="LEVEL">Storm Blaster</font></button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Additional Services' Researcher Hermin:<br>
You don't have a <font color="LEVEL">Class Change Coupon</font>!<br>
It's necessary if you want to <font color="LEVEL">change your class.</font> You can buy it in the Adena store section of the L-Coin Store.<br>
Tell me once you're ready.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm">Ask what is needed for changing class</button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Additional Services' Researcher Hermin:<br>
Please, check your <font color="LEVEL">inventory</font>.<br>
To change class, in your <font color="LEVEL">inventory</font> must be <font color="LEVEL">free space</font> and <font color="LEVEL">weight</font>.<br>
Keep unnecessary items in the warehouse, to free 50% weight and at least 30 slots. <br>
Tell me once you're ready.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm">Ask what is needed for changing class</Button>
</body></html>

View File

@@ -0,0 +1,13 @@
<html><body>Additional Services' Researcher Hermin:<br>
If you are ready, let's begin the procedure for changing classes.<br>
Please choose carefully and calmly, weighing the pros and cons.<br>
Close your eyes and imagine what you will become when you change classes.<br>
What <font color="LEVEL">race</font> will be a character?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_human.htm"><font color="LEVEL">Human</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_elf.htm"><font color="LEVEL">Elf</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_darkelf.htm"><font color="LEVEL">Dark Elf</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_orc.htm"><font color="LEVEL">Orc</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_dwarf.htm"><font color="LEVEL">Dwarf</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_kamael.htm"><font color="LEVEL">Kamael</font></button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-class_sylph.htm"><font color="LEVEL">Sylph</font></button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Additional Services' Researcher Hermin:<br>
It looks like you have an <font color="LEVEL">item equipped</font>!<br>
To change class, you need to <font color="LEVEL">unequip all items</font>.
</body></html>

View File

@@ -0,0 +1,15 @@
<html><body>Additional Services' Researcher Hermin:<br>
Hello, my name is Hermine, and I am a researcher of value-added services..<br1>
Now the class change service is available.<br1>When you change class, some items will be dropped. Remember.<br>
<font color="LEVEL">All previously learned skills</font><br1><font color="LEVEL">Distributed characteristics</font><br1>
<font color="LEVEL">Bonuses for ranking</font><br1><font color="LEVEL">3 vs 3 Olympiad points and rank</font><br1>
<font color="LEVEL">All positive effects</font><br>When you change classes you get <font color="LEVEL">Scrolls SP</font> for each level.<br>
Note that <font color="LEVEL">all skills learned with the Spell Books and the books themselves will not return</font>.<br>
When <font color="LEVEL">you change classes to the one you had before, all learned skills are retained, so SP Scrolls are not issued</font>.<br>
<font color="LEVEL">The Dragon Slayer Shape, the White Guardian Transformation, the Extended Paint Potential, the Wyvern Transformation from 3 and 4 star skills, and skills gained through one-time quests will be issued as Sealed Spell Books.</font><br>
Changing classes is a very important step, so think about it carefully.<br>
Do you want to change classes?<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h Quest AdditionalServicesAdvisor 34153-1.htm"><font color="LEVEL">Application for class change</font></button>
<Button ALIGN="LEFT" ICON="TELEPORT" action="bypass -h Quest AdditionalServicesAdvisor teleport_aden">Move to Aden</button>
<Button ALIGN="LEFT" ICON="TELEPORT" action="bypass -h Quest AdditionalServicesAdvisor teleport_giran">Move to Giran</button>
</body></html>

View File

@@ -0,0 +1,349 @@
/*
* 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.others.AdditionalServicesAdvisor;
import java.sql.Connection;
import java.sql.PreparedStatement;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.gameserver.data.xml.ClassListData;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.enums.SubclassInfoType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.olympiad.Hero;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
import ai.AbstractNpcAI;
/**
* @author Mobius
*/
public class AdditionalServicesAdvisor extends AbstractNpcAI
{
// NPCs
private static final int JUNI = 34152;
private static final int HERMIN = 34153;
// Items
private static final int CLASS_CHANGE_COUPON = 94828;
private static final int SP_SCROLL = 94829;
private static final int SPELLBOOK_HUMAN = 90038; // Spellbook: Mount Golden Lion
private static final int SPELLBOOK_ELF = 90039; // Spellbook: Mount Pegasus
private static final int SPELLBOOK_DELF = 90040; // Spellbook: Mount Saber Tooth Cougar
private static final int SPELLBOOK_ORC = 90042; // Spellbook: Mount Black Bear
private static final int SPELLBOOK_DWARF = 90041; // Spellbook: Mount Kukuru
private static final int SPELLBOOK_KAMAEL = 91946; // Spellbook: Mount Griffin
private static final int SPELLBOOK_DEATH_KNIGHT = 93383; // Spellbook: Mount Nightmare Steed
private static final int SPELLBOOK_SYLPH = 95367; // Spellbook: Mount Elemental Lyn Draco
// Misc
private static final Location TELEPORT_ADEN_LOCATION = new Location(146856, 25803, -2008);
private static final Location TELEPORT_GIRAN_LOCATION = new Location(83386, 148014, -3400);
private static final int INSTANCE_ID = 190;
private AdditionalServicesAdvisor()
{
addStartNpc(JUNI, HERMIN);
addFirstTalkId(JUNI, HERMIN);
addTalkId(JUNI, HERMIN);
}
@Override
public String onAdvEvent(String event, Npc npc, Player player)
{
String html = null;
switch (npc.getId())
{
case JUNI:
{
switch (event)
{
case "34152.htm":
case "34152-1.htm":
{
html = event;
break;
}
case "teleport_inside":
{
html = checkConditions(npc, player);
if (html == null)
{
final Instance instance = InstanceManager.getInstance().createInstance(INSTANCE_ID, player);
player.teleToLocation(instance.getEnterLocation(), instance);
}
break;
}
}
break;
}
case HERMIN:
{
switch (event)
{
case "34153.htm":
case "34153-1.htm":
case "34153-class_darkelf.htm":
case "34153-class_dwarf.htm":
case "34153-class_elf.htm":
case "34153-class_human.htm":
case "34153-class_kamael.htm":
case "34153-class_orc.htm":
case "34153-class_sylph.htm":
case "34153-race.htm":
{
html = event;
break;
}
case "teleport_aden":
{
player.teleToLocation(TELEPORT_ADEN_LOCATION, null);
break;
}
case "teleport_giran":
{
player.teleToLocation(TELEPORT_GIRAN_LOCATION, null);
break;
}
}
if (event.startsWith("choose_class"))
{
final int classId = Integer.parseInt(event.split(" ")[1]);
if (classId > 195)
{
html = getHtm(player, "34153-choose_gender_unavailable.htm");
}
else
{
html = getHtm(player, "34153-choose_gender.htm");
}
html = html.replace("%class_id%", String.valueOf(classId));
html = html.replace("%class_name%", ClassListData.getInstance().getClass(classId).getClassName());
return html;
}
else if (event.startsWith("choose_gender"))
{
final String[] split = event.split(" ");
final int classId = Integer.parseInt(split[1]);
final boolean female = split[2].equals("female");
if (female && (classId > 195))
{
return null;
}
html = getHtm(player, "34153-choose_gender_confirm.htm");
html = html.replace("%class_id%", String.valueOf(classId));
html = html.replace("%class_name%", ClassListData.getInstance().getClass(classId).getClassName());
html = html.replace("%sex%", female ? "female" : "male");
}
else if (event.startsWith("choose_gender_confirm"))
{
final String[] split = event.split(" ");
final int classId = Integer.parseInt(split[1]);
final boolean female = split[2].equals("female");
if (female && (classId > 195))
{
break;
}
html = getHtm(player, "34153-choose_gender_unavailable.htm");
html = html.replace("%class_id%", String.valueOf(classId));
html = html.replace("%class_name%", ClassListData.getInstance().getClass(classId).getClassName());
html = html.replace("%sex%", female ? "female" : "male");
}
else if (event.startsWith("confirm_class"))
{
html = checkConditions(npc, player);
if (html != null)
{
break;
}
final String[] split = event.split(" ");
final int classId = Integer.parseInt(split[1]);
final boolean female = split[2].equals("female");
if (female && (classId > 195))
{
break;
}
if (hasQuestItems(player, CLASS_CHANGE_COUPON))
{
takeItems(player, CLASS_CHANGE_COUPON, 1);
for (Skill skill : player.getAllSkills())
{
player.removeSkill(skill);
}
player.setVitalityPoints(0, true);
player.setExpBeforeDeath(0);
if (female)
{
player.getAppearance().setFemale();
}
else
{
player.getAppearance().setMale();
}
player.setClassId(classId);
player.setBaseClass(player.getActiveClass());
giveItems(player, SP_SCROLL, 20);
if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
{
player.getVariables().set("3rdClassMountRewarded", true);
if (player.isDeathKnight())
{
giveItems(player, SPELLBOOK_DEATH_KNIGHT, 1);
}
else
{
switch (player.getRace())
{
case ELF:
{
giveItems(player, SPELLBOOK_ELF, 1);
break;
}
case DARK_ELF:
{
giveItems(player, SPELLBOOK_DELF, 1);
break;
}
case ORC:
{
if (!player.isVanguard())
{
giveItems(player, SPELLBOOK_ORC, 1);
}
break;
}
case DWARF:
{
giveItems(player, SPELLBOOK_DWARF, 1);
break;
}
case KAMAEL:
{
giveItems(player, SPELLBOOK_KAMAEL, 1);
break;
}
case HUMAN:
{
giveItems(player, SPELLBOOK_HUMAN, 1);
break;
}
case SYLPH:
{
giveItems(player, SPELLBOOK_SYLPH, 1);
break;
}
}
}
}
player.getServitorsAndPets().forEach(s -> s.unSummon(player));
player.getEffectList().stopAllEffects(true);
player.getInventory().getItems().forEach(item ->
{
if (item.isEquipped())
{
player.getInventory().unEquipItemInSlot(item.getLocationSlot());
}
});
// Appearance after class change.
player.getAppearance().setHairStyle(0);
player.getAppearance().setHairColor(0);
player.getAppearance().setFace(0);
// Set new classId and reset olympiad points.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE olympiad_nobles SET olympiad_points=?, class_id=? WHERE charId='" + player.getObjectId() + "'"))
{
ps.setInt(1, Config.ALT_OLY_START_POINTS);
ps.setInt(2, classId);
ps.executeUpdate();
}
catch (Exception e)
{
LOGGER.warning(this.getClass().getSimpleName() + ": Set new classId and reset olympiad points: " + e.getMessage());
}
player.store(false);
player.broadcastUserInfo();
player.sendSkillList();
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
player.sendPacket(new ExUserInfoInvenWeight(player));
}
else
{
html = "34152-no_coupon.htm";
}
}
break;
}
}
return html;
}
@Override
public String onFirstTalk(Npc npc, Player player)
{
return npc.getId() + ".htm";
}
private String checkConditions(Npc npc, Player player)
{
if (!hasQuestItems(player, CLASS_CHANGE_COUPON))
{
return npc.getId() + "-no_coupon.htm";
}
for (Item item : player.getInventory().getItems())
{
if (item.isEquipped())
{
return npc.getId() + "-unequip_items.htm";
}
}
if (!player.isInventoryUnder80(false) || (player.getWeightPenalty() >= 3))
{
return npc.getId() + "-no_inventory.htm";
}
if (!player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
{
return npc.getId() + "-3rd_class.htm";
}
if (player.isInOlympiadMode() || player.isHero() || Hero.getInstance().isHero(player.getObjectId()) || Hero.getInstance().isUnclaimedHero(player.getObjectId()))
{
return npc.getId() + "-1.htm";
}
return null;
}
public static void main(String[] args)
{
new AdditionalServicesAdvisor();
}
}

View File

@@ -2,6 +2,7 @@
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/spawns.xsd"> <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/spawns.xsd">
<spawn name="AdenSquareMerchants"> <spawn name="AdenSquareMerchants">
<group> <group>
<npc id="34152" x="147656" y="27340" z="-2200" heading="48562" respawnTime="1min" /> <!-- Juni -->
<npc id="30869" x="147259" y="27356" z="-2200" heading="47094" respawnTime="1min" /> <!-- Lemper - Pet Manager --> <npc id="30869" x="147259" y="27356" z="-2200" heading="47094" respawnTime="1min" /> <!-- Lemper - Pet Manager -->
<npc id="34218" x="147321" y="27315" z="-2200" heading="41794" respawnTime="1min" /> <!-- Greno - Equipment Merchant --> <npc id="34218" x="147321" y="27315" z="-2200" heading="41794" respawnTime="1min" /> <!-- Greno - Equipment Merchant -->
<npc id="30843" x="147402" y="27277" z="-2200" heading="44416" respawnTime="1min" /> <!-- Romp - Warehouse Keeper --> <npc id="30843" x="147402" y="27277" z="-2200" heading="44416" respawnTime="1min" /> <!-- Romp - Warehouse Keeper -->

View File

@@ -8,6 +8,7 @@
<npc id="30095" x="82524" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Randolf - Warehouse Keeper --> <npc id="30095" x="82524" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Randolf - Warehouse Keeper -->
<npc id="30300" x="82624" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Pushkin - Blacksmith --> <npc id="30300" x="82624" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Pushkin - Blacksmith -->
<!-- <npc id="31049" x="82724" y="149712" z="-3464" heading="53501" respawnTime="1min" /> Pepper - Tattoo Master --> <!-- <npc id="31049" x="82724" y="149712" z="-3464" heading="53501" respawnTime="1min" /> Pepper - Tattoo Master -->
<npc id="34152" x="82824" y="149712" z="-3464" heading="53501" respawnTime="1min" /> <!-- Juni - Additional Services Advisor -->
</group> </group>
</spawn> </spawn>
</list> </list>