Project update.

This commit is contained in:
MobiusDev
2015-12-31 23:53:41 +00:00
parent e0d681a17e
commit ad2bcd79be
4084 changed files with 83696 additions and 86998 deletions

View File

@ -0,0 +1,64 @@
/*
* 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 com.l2jmobius.gameserver.model.base;
/**
* Learning skill types.
* @author Zoey76
*/
public enum AcquireSkillType
{
CLASS(0),
DUMMY(1),
PLEDGE(2),
SUBPLEDGE(3),
TRANSFORM(4),
TRANSFER(5),
SUBCLASS(6),
COLLECT(7),
DUMMY2(8),
DUMMY3(9),
FISHING(10),
REVELATION(11), // Need proper ID
REVELATION_DUALCLASS(12), // Need proper ID
DUALCLASS(13), // Need proper ID
ALCHEMY(140);
private final int _id;
private AcquireSkillType(int id)
{
_id = id;
}
public int getId()
{
return _id;
}
public static AcquireSkillType getAcquireSkillType(int id)
{
for (AcquireSkillType type : values())
{
if (type.getId() == id)
{
return type;
}
}
return null;
}
}

View File

@ -0,0 +1,483 @@
/*
* 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 com.l2jmobius.gameserver.model.base;
import java.util.HashSet;
import java.util.Set;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.interfaces.IIdentifiable;
/**
* This class defines all classes (ex : human fighter, darkFighter...) that a player can chose.<br>
* Data:
* <ul>
* <li>id : The Identifier of the class</li>
* <li>isMage : True if the class is a mage class</li>
* <li>race : The race of this class</li>
* <li>parent : The parent ClassId or null if this class is the root</li>
* </ul>
* @version $Revision: 1.4.4.4 $ $Date: 2005/03/27 15:29:33 $
*/
public enum ClassId implements IIdentifiable
{
FIGHTER(0, false, Race.HUMAN, null),
WARRIOR(1, false, Race.HUMAN, FIGHTER),
GLADIATOR(2, false, Race.HUMAN, WARRIOR),
WARLORD(3, false, Race.HUMAN, WARRIOR),
KNIGHT(4, false, Race.HUMAN, FIGHTER),
PALADIN(5, false, Race.HUMAN, KNIGHT),
DARK_AVENGER(6, false, Race.HUMAN, KNIGHT),
ROGUE(7, false, Race.HUMAN, FIGHTER),
TREASURE_HUNTER(8, false, Race.HUMAN, ROGUE),
HAWKEYE(9, false, Race.HUMAN, ROGUE),
MAGE(10, true, Race.HUMAN, null),
WIZARD(11, true, Race.HUMAN, MAGE),
SORCERER(12, true, Race.HUMAN, WIZARD),
NECROMANCER(13, true, Race.HUMAN, WIZARD),
WARLOCK(14, true, true, Race.HUMAN, WIZARD),
CLERIC(15, true, Race.HUMAN, MAGE),
BISHOP(16, true, Race.HUMAN, CLERIC),
PROPHET(17, true, Race.HUMAN, CLERIC),
ELVEN_FIGHTER(18, false, Race.ELF, null),
ELVEN_KNIGHT(19, false, Race.ELF, ELVEN_FIGHTER),
TEMPLE_KNIGHT(20, false, Race.ELF, ELVEN_KNIGHT),
SWORDSINGER(21, false, Race.ELF, ELVEN_KNIGHT),
ELVEN_SCOUT(22, false, Race.ELF, ELVEN_FIGHTER),
PLAINS_WALKER(23, false, Race.ELF, ELVEN_SCOUT),
SILVER_RANGER(24, false, Race.ELF, ELVEN_SCOUT),
ELVEN_MAGE(25, true, Race.ELF, null),
ELVEN_WIZARD(26, true, Race.ELF, ELVEN_MAGE),
SPELLSINGER(27, true, Race.ELF, ELVEN_WIZARD),
ELEMENTAL_SUMMONER(28, true, true, Race.ELF, ELVEN_WIZARD),
ORACLE(29, true, Race.ELF, ELVEN_MAGE),
ELDER(30, true, Race.ELF, ORACLE),
DARK_FIGHTER(31, false, Race.DARK_ELF, null),
PALUS_KNIGHT(32, false, Race.DARK_ELF, DARK_FIGHTER),
SHILLIEN_KNIGHT(33, false, Race.DARK_ELF, PALUS_KNIGHT),
BLADEDANCER(34, false, Race.DARK_ELF, PALUS_KNIGHT),
ASSASSIN(35, false, Race.DARK_ELF, DARK_FIGHTER),
ABYSS_WALKER(36, false, Race.DARK_ELF, ASSASSIN),
PHANTOM_RANGER(37, false, Race.DARK_ELF, ASSASSIN),
DARK_MAGE(38, true, Race.DARK_ELF, null),
DARK_WIZARD(39, true, Race.DARK_ELF, DARK_MAGE),
SPELLHOWLER(40, true, Race.DARK_ELF, DARK_WIZARD),
PHANTOM_SUMMONER(41, true, true, Race.DARK_ELF, DARK_WIZARD),
SHILLIEN_ORACLE(42, true, Race.DARK_ELF, DARK_MAGE),
SHILLIEN_ELDER(43, true, Race.DARK_ELF, SHILLIEN_ORACLE),
ORC_FIGHTER(44, false, Race.ORC, null),
ORC_RAIDER(45, false, Race.ORC, ORC_FIGHTER),
DESTROYER(46, false, Race.ORC, ORC_RAIDER),
ORC_MONK(47, false, Race.ORC, ORC_FIGHTER),
TYRANT(48, false, Race.ORC, ORC_MONK),
ORC_MAGE(49, true, Race.ORC, null),
ORC_SHAMAN(50, true, Race.ORC, ORC_MAGE),
OVERLORD(51, true, Race.ORC, ORC_SHAMAN),
WARCRYER(52, true, Race.ORC, ORC_SHAMAN),
DWARVEN_FIGHTER(53, false, Race.DWARF, null),
SCAVENGER(54, false, Race.DWARF, DWARVEN_FIGHTER),
BOUNTY_HUNTER(55, false, Race.DWARF, SCAVENGER),
ARTISAN(56, false, Race.DWARF, DWARVEN_FIGHTER),
WARSMITH(57, false, Race.DWARF, ARTISAN),
DUMMY_ENTRY_1(58, false, null, null),
DUMMY_ENTRY_2(59, false, null, null),
DUMMY_ENTRY_3(60, false, null, null),
DUMMY_ENTRY_4(61, false, null, null),
DUMMY_ENTRY_5(62, false, null, null),
DUMMY_ENTRY_6(63, false, null, null),
DUMMY_ENTRY_7(64, false, null, null),
DUMMY_ENTRY_8(65, false, null, null),
DUMMY_ENTRY_9(66, false, null, null),
DUMMY_ENTRY_10(67, false, null, null),
DUMMY_ENTRY_11(68, false, null, null),
DUMMY_ENTRY_12(69, false, null, null),
DUMMY_ENTRY_13(70, false, null, null),
DUMMY_ENTRY_14(71, false, null, null),
DUMMY_ENTRY_15(72, false, null, null),
DUMMY_ENTRY_16(73, false, null, null),
DUMMY_ENTRY_17(74, false, null, null),
DUMMY_ENTRY_18(75, false, null, null),
DUMMY_ENTRY_19(76, false, null, null),
DUMMY_ENTRY_20(77, false, null, null),
DUMMY_ENTRY_21(78, false, null, null),
DUMMY_ENTRY_22(79, false, null, null),
DUMMY_ENTRY_23(80, false, null, null),
DUMMY_ENTRY_24(81, false, null, null),
DUMMY_ENTRY_25(82, false, null, null),
DUMMY_ENTRY_26(83, false, null, null),
DUMMY_ENTRY_27(84, false, null, null),
DUMMY_ENTRY_28(85, false, null, null),
DUMMY_ENTRY_29(86, false, null, null),
DUMMY_ENTRY_30(87, false, null, null),
DUELIST(88, false, Race.HUMAN, GLADIATOR),
DREADNOUGHT(89, false, Race.HUMAN, WARLORD),
PHOENIX_KNIGHT(90, false, Race.HUMAN, PALADIN),
HELL_KNIGHT(91, false, Race.HUMAN, DARK_AVENGER),
SAGITTARIUS(92, false, Race.HUMAN, HAWKEYE),
ADVENTURER(93, false, Race.HUMAN, TREASURE_HUNTER),
ARCHMAGE(94, true, Race.HUMAN, SORCERER),
SOULTAKER(95, true, Race.HUMAN, NECROMANCER),
ARCANA_LORD(96, true, true, Race.HUMAN, WARLOCK),
CARDINAL(97, true, Race.HUMAN, BISHOP),
HIEROPHANT(98, true, Race.HUMAN, PROPHET),
EVA_TEMPLAR(99, false, Race.ELF, TEMPLE_KNIGHT),
SWORD_MUSE(100, false, Race.ELF, SWORDSINGER),
WIND_RIDER(101, false, Race.ELF, PLAINS_WALKER),
MOONLIGHT_SENTINEL(102, false, Race.ELF, SILVER_RANGER),
MYSTIC_MUSE(103, true, Race.ELF, SPELLSINGER),
ELEMENTAL_MASTER(104, true, true, Race.ELF, ELEMENTAL_SUMMONER),
EVA_SAINT(105, true, Race.ELF, ELDER),
SHILLIEN_TEMPLAR(106, false, Race.DARK_ELF, SHILLIEN_KNIGHT),
SPECTRAL_DANCER(107, false, Race.DARK_ELF, BLADEDANCER),
GHOST_HUNTER(108, false, Race.DARK_ELF, ABYSS_WALKER),
GHOST_SENTINEL(109, false, Race.DARK_ELF, PHANTOM_RANGER),
STORM_SCREAMER(110, true, Race.DARK_ELF, SPELLHOWLER),
SPECTRAL_MASTER(111, true, true, Race.DARK_ELF, PHANTOM_SUMMONER),
SHILLIEN_SAINT(112, true, Race.DARK_ELF, SHILLIEN_ELDER),
TITAN(113, false, Race.ORC, DESTROYER),
GRAND_KHAVATARI(114, false, Race.ORC, TYRANT),
DOMINATOR(115, true, Race.ORC, OVERLORD),
DOOMCRYER(116, true, Race.ORC, WARCRYER),
FORTUNE_SEEKER(117, false, Race.DWARF, BOUNTY_HUNTER),
MAESTRO(118, false, Race.DWARF, WARSMITH),
DUMMY_ENTRY_31(119, false, null, null),
DUMMY_ENTRY_32(120, false, null, null),
DUMMY_ENTRY_33(121, false, null, null),
DUMMY_ENTRY_34(122, false, null, null),
MALE_SOLDIER(123, false, Race.KAMAEL, null),
FEMALE_SOLDIER(124, false, Race.KAMAEL, null),
TROOPER(125, false, Race.KAMAEL, MALE_SOLDIER),
WARDER(126, false, Race.KAMAEL, FEMALE_SOLDIER),
BERSERKER(127, false, Race.KAMAEL, TROOPER),
MALE_SOULBREAKER(128, false, Race.KAMAEL, TROOPER),
FEMALE_SOULBREAKER(129, false, Race.KAMAEL, WARDER),
ARBALESTER(130, false, Race.KAMAEL, WARDER),
DOOMBRINGER(131, false, Race.KAMAEL, BERSERKER),
MALE_SOUL_HOUND(132, false, Race.KAMAEL, MALE_SOULBREAKER),
FEMALE_SOUL_HOUND(133, false, Race.KAMAEL, FEMALE_SOULBREAKER),
TRICKSTER(134, false, Race.KAMAEL, ARBALESTER),
INSPECTOR(135, false, Race.KAMAEL, WARDER),
JUDICATOR(136, false, Race.KAMAEL, INSPECTOR),
DUMMY_ENTRY_35(137, false, null, null),
DUMMY_ENTRY_36(138, false, null, null),
SIGEL_KNIGHT(139, false, null, null),
TYRR_WARRIOR(140, false, null, null),
OTHELL_ROGUE(141, false, null, null),
YUL_ARCHER(142, false, null, null),
FEOH_WIZARD(143, false, null, null),
ISS_ENCHANTER(144, false, null, null),
WYNN_SUMMONER(145, false, null, null),
AEORE_HEALER(146, false, null, null),
DUMMY_ENTRY_37(147, false, null, null),
SIGEL_PHOENIX_KNIGHT(148, false, Race.HUMAN, PHOENIX_KNIGHT),
SIGEL_HELL_KNIGHT(149, false, Race.HUMAN, HELL_KNIGHT),
SIGEL_EVA_TEMPLAR(150, false, Race.ELF, EVA_TEMPLAR),
SIGEL_SHILLIEN_TEMPLAR(151, false, Race.DARK_ELF, SHILLIEN_TEMPLAR),
TYRR_DUELIST(152, false, Race.HUMAN, DUELIST),
TYRR_DREADNOUGHT(153, false, Race.HUMAN, DREADNOUGHT),
TYRR_TITAN(154, false, Race.ORC, TITAN),
TYRR_GRAND_KHAVATARI(155, false, Race.ORC, GRAND_KHAVATARI),
TYRR_MAESTRO(156, false, Race.DWARF, MAESTRO),
TYRR_DOOMBRINGER(157, false, Race.KAMAEL, DOOMBRINGER),
OTHELL_ADVENTURER(158, false, Race.HUMAN, ADVENTURER),
OTHELL_WIND_RIDER(159, false, Race.ELF, WIND_RIDER),
OTHELL_GHOST_HUNTER(160, false, Race.DARK_ELF, GHOST_HUNTER),
OTHELL_FORTUNE_SEEKER(161, false, Race.DWARF, FORTUNE_SEEKER),
YUL_SAGITTARIUS(162, false, Race.HUMAN, SAGITTARIUS),
YUL_MOONLIGHT_SENTINEL(163, false, Race.ELF, MOONLIGHT_SENTINEL),
YUL_GHOST_SENTINEL(164, false, Race.DARK_ELF, GHOST_SENTINEL),
YUL_TRICKSTER(165, false, Race.KAMAEL, TRICKSTER),
FEOH_ARCHMAGE(166, true, Race.HUMAN, ARCHMAGE),
FEOH_SOULTAKER(167, true, Race.HUMAN, SOULTAKER),
FEOH_MYSTIC_MUSE(168, true, Race.ELF, MYSTIC_MUSE),
FEOH_STORM_SCREAMER(169, true, Race.DARK_ELF, STORM_SCREAMER),
FEOH_SOUL_HOUND(170, false, Race.KAMAEL, MALE_SOUL_HOUND),
ISS_HIEROPHANT(171, true, Race.HUMAN, HIEROPHANT),
ISS_SWORD_MUSE(172, false, Race.ELF, SWORD_MUSE),
ISS_SPECTRAL_DANCER(173, false, Race.DARK_ELF, SPECTRAL_DANCER),
ISS_DOMINATOR(174, true, Race.ORC, DOMINATOR),
ISS_DOOMCRYER(175, true, Race.ORC, DOOMCRYER),
WYNN_ARCANA_LORD(176, true, true, Race.HUMAN, ARCANA_LORD),
WYNN_ELEMENTAL_MASTER(177, true, true, Race.ELF, ELEMENTAL_MASTER),
WYNN_SPECTRAL_MASTER(178, true, true, Race.DARK_ELF, SPECTRAL_MASTER),
AEORE_CARDINAL(179, true, Race.HUMAN, CARDINAL),
AEORE_EVA_SAINT(180, true, Race.ELF, EVA_SAINT),
AEORE_SHILLIEN_SAINT(181, true, Race.DARK_ELF, SHILLIEN_SAINT),
ERTHEIA_FIGHTER(182, false, Race.ERTHEIA, null),
ERTHEIA_WIZARD(183, true, Race.ERTHEIA, null),
MARAUDER(184, false, Race.ERTHEIA, ERTHEIA_FIGHTER),
CLOUD_BREAKER(185, true, Race.ERTHEIA, ERTHEIA_WIZARD),
RIPPER(186, false, Race.ERTHEIA, MARAUDER),
STRATOMANCER(187, true, Race.ERTHEIA, CLOUD_BREAKER),
EVISCERATOR(188, false, Race.ERTHEIA, RIPPER),
SAYHA_SEER(189, true, Race.ERTHEIA, STRATOMANCER);
/** The Identifier of the Class */
private final int _id;
/** True if the class is a mage class */
private final boolean _isMage;
/** True if the class is a summoner class */
private final boolean _isSummoner;
/** The Race object of the class */
private final Race _race;
/** The parent ClassId or null if this class is a root */
private final ClassId _parent;
/** List of available Class for next transfer **/
private final Set<ClassId> _nextClassIds = new HashSet<>(1);
/**
* Class constructor.
* @param pId the class Id.
* @param pIsMage {code true} if the class is mage class.
* @param race the race related to the class.
* @param pParent the parent class Id.
*/
private ClassId(int pId, boolean pIsMage, Race race, ClassId pParent)
{
_id = pId;
_isMage = pIsMage;
_isSummoner = false;
_race = race;
_parent = pParent;
if (_parent != null)
{
_parent.addNextClassId(this);
}
}
/**
* Class constructor.
* @param pId the class Id.
* @param pIsMage {code true} if the class is mage class.
* @param pIsSummoner {code true} if the class is summoner class.
* @param race the race related to the class.
* @param pParent the parent class Id.
*/
private ClassId(int pId, boolean pIsMage, boolean pIsSummoner, Race race, ClassId pParent)
{
_id = pId;
_isMage = pIsMage;
_isSummoner = pIsSummoner;
_race = race;
_parent = pParent;
if (_parent != null)
{
_parent.addNextClassId(this);
}
}
/**
* Gets the ID of the class.
* @return the ID of the class
*/
@Override
public final int getId()
{
return _id;
}
/**
* @return {code true} if the class is a mage class.
*/
public final boolean isMage()
{
return _isMage;
}
/**
* @return {code true} if the class is a summoner class.
*/
public final boolean isSummoner()
{
return _isSummoner;
}
/**
* @return the Race object of the class.
*/
public final Race getRace()
{
return _race;
}
/**
* @param cid the parent ClassId to check.
* @return {code true} if this Class is a child of the selected ClassId.
*/
public final boolean childOf(ClassId cid)
{
if (_parent == null)
{
return false;
}
if (_parent == cid)
{
return true;
}
return _parent.childOf(cid);
}
/**
* @param cid the parent ClassId to check.
* @return {code true} if this Class is equal to the selected ClassId or a child of the selected ClassId.
*/
public final boolean equalsOrChildOf(ClassId cid)
{
return (this == cid) || childOf(cid);
}
/**
* @return the level of this Class (0=initial, 4=awaken...)
*/
public final int level()
{
if (_parent == null)
{
return 0;
}
return 1 + _parent.level();
}
/**
* @return its parent Class Id
*/
public final ClassId getParent()
{
return _parent;
}
/**
* @return list of possible class transfer for this class
*/
public Set<ClassId> getNextClassIds()
{
return _nextClassIds;
}
public static ClassId getClassId(int cId)
{
try
{
return ClassId.values()[cId];
}
catch (Exception e)
{
return null;
}
}
private final void addNextClassId(ClassId cId)
{
_nextClassIds.add(cId);
}
public static int getInitialClassId(L2PcInstance player)
{
switch (player.getBaseClass().getRace())
{
case HUMAN:
{
if (player.getClassId().isMage())
{
return 10;
}
return 0;
}
case ELF:
{
if (player.getClassId().isMage())
{
return 25;
}
return 18;
}
case DARK_ELF:
{
if (player.getClassId().isMage())
{
return 38;
}
return 31;
}
case ORC:
{
if (player.getClassId().isMage())
{
return 49;
}
return 44;
}
case DWARF:
{
return 53;
}
case KAMAEL:
{
if (player.getAppearance().getSex())
{
return 124;
}
return 123;
}
case ERTHEIA:
{
if (player.getClassId().isMage())
{
return 183;
}
return 182;
}
}
return 0;
}
}

View File

@ -0,0 +1,112 @@
/*
* 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 com.l2jmobius.gameserver.model.base;
import java.util.regex.Matcher;
/**
* This class will hold the information of the player classes.
* @author Zoey76
*/
public final class ClassInfo
{
private final ClassId _classId;
private final String _className;
private final ClassId _parentClassId;
/**
* Constructor for ClassInfo.
* @param classId the class ID
* @param className the in game class name
* @param parentClassId the parent class for the given {@code classId}
*/
public ClassInfo(ClassId classId, String className, ClassId parentClassId)
{
_classId = classId;
_className = className;
_parentClassId = parentClassId;
}
/**
* @return the class ID
*/
public ClassId getClassId()
{
return _classId;
}
/**
* @return the hardcoded in-game class name
*/
public String getClassName()
{
return _className;
}
/**
* @return the class client ID
*/
private int getClassClientId()
{
int classClientId = _classId.getId();
if ((classClientId >= 0) && (classClientId <= 57))
{
classClientId += 247;
}
else if ((classClientId >= 88) && (classClientId <= 118))
{
classClientId += 1071;
}
else if ((classClientId >= 123) && (classClientId <= 136))
{
classClientId += 1438;
}
else if ((classClientId >= 148) && (classClientId <= 181))
{
classClientId += 2884;
}
else if ((classClientId >= 182) && (classClientId <= 189))
{
classClientId += 3121;
}
return classClientId;
}
/**
* @return the class client ID formatted to be displayed on a HTML.
*/
public String getClientCode()
{
return "&$" + getClassClientId() + ";";
}
/**
* @return the escaped class client ID formatted to be displayed on a HTML
*/
public String getEscapedClientCode()
{
return Matcher.quoteReplacement(getClientCode());
}
/**
* @return the parent class ID
*/
public ClassId getParentClassId()
{
return _parentClassId;
}
}

View File

@ -0,0 +1,30 @@
/*
* 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 com.l2jmobius.gameserver.model.base;
/**
* This class ...
* @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
*/
public enum ClassLevel
{
FIRST,
SECOND,
THIRD,
FOURTH,
AWAKEN
}

View File

@ -0,0 +1,28 @@
/*
* 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 com.l2jmobius.gameserver.model.base;
/**
* ClassType Enum
* @author Tempy
*/
public enum ClassType
{
Fighter,
Mystic,
Priest
}

View File

@ -0,0 +1,296 @@
/*
* 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 com.l2jmobius.gameserver.model.base;
import static com.l2jmobius.gameserver.model.base.ClassLevel.FIRST;
import static com.l2jmobius.gameserver.model.base.ClassLevel.FOURTH;
import static com.l2jmobius.gameserver.model.base.ClassLevel.SECOND;
import static com.l2jmobius.gameserver.model.base.ClassLevel.THIRD;
import static com.l2jmobius.gameserver.model.base.ClassType.Fighter;
import static com.l2jmobius.gameserver.model.base.ClassType.Mystic;
import static com.l2jmobius.gameserver.model.base.ClassType.Priest;
import java.util.EnumSet;
import com.l2jmobius.gameserver.enums.Race;
/**
* @author luisantonioa
*/
public enum PlayerClass
{
HumanFighter(Race.HUMAN, Fighter, FIRST),
Warrior(Race.HUMAN, Fighter, SECOND),
Gladiator(Race.HUMAN, Fighter, THIRD),
Warlord(Race.HUMAN, Fighter, THIRD),
HumanKnight(Race.HUMAN, Fighter, SECOND),
Paladin(Race.HUMAN, Fighter, THIRD),
DarkAvenger(Race.HUMAN, Fighter, THIRD),
Rogue(Race.HUMAN, Fighter, SECOND),
TreasureHunter(Race.HUMAN, Fighter, THIRD),
Hawkeye(Race.HUMAN, Fighter, THIRD),
HumanMystic(Race.HUMAN, Mystic, FIRST),
HumanWizard(Race.HUMAN, Mystic, SECOND),
Sorceror(Race.HUMAN, Mystic, THIRD),
Necromancer(Race.HUMAN, Mystic, THIRD),
Warlock(Race.HUMAN, Mystic, THIRD),
Cleric(Race.HUMAN, Priest, SECOND),
Bishop(Race.HUMAN, Priest, THIRD),
Prophet(Race.HUMAN, Priest, THIRD),
ElvenFighter(Race.ELF, Fighter, FIRST),
ElvenKnight(Race.ELF, Fighter, SECOND),
TempleKnight(Race.ELF, Fighter, THIRD),
Swordsinger(Race.ELF, Fighter, THIRD),
ElvenScout(Race.ELF, Fighter, SECOND),
Plainswalker(Race.ELF, Fighter, THIRD),
SilverRanger(Race.ELF, Fighter, THIRD),
ElvenMystic(Race.ELF, Mystic, FIRST),
ElvenWizard(Race.ELF, Mystic, SECOND),
Spellsinger(Race.ELF, Mystic, THIRD),
ElementalSummoner(Race.ELF, Mystic, THIRD),
ElvenOracle(Race.ELF, Priest, SECOND),
ElvenElder(Race.ELF, Priest, THIRD),
DarkElvenFighter(Race.DARK_ELF, Fighter, FIRST),
PalusKnight(Race.DARK_ELF, Fighter, SECOND),
ShillienKnight(Race.DARK_ELF, Fighter, THIRD),
Bladedancer(Race.DARK_ELF, Fighter, THIRD),
Assassin(Race.DARK_ELF, Fighter, SECOND),
AbyssWalker(Race.DARK_ELF, Fighter, THIRD),
PhantomRanger(Race.DARK_ELF, Fighter, THIRD),
DarkElvenMystic(Race.DARK_ELF, Mystic, FIRST),
DarkElvenWizard(Race.DARK_ELF, Mystic, SECOND),
Spellhowler(Race.DARK_ELF, Mystic, THIRD),
PhantomSummoner(Race.DARK_ELF, Mystic, THIRD),
ShillienOracle(Race.DARK_ELF, Priest, SECOND),
ShillienElder(Race.DARK_ELF, Priest, THIRD),
OrcFighter(Race.ORC, Fighter, FIRST),
OrcRaider(Race.ORC, Fighter, SECOND),
Destroyer(Race.ORC, Fighter, THIRD),
OrcMonk(Race.ORC, Fighter, SECOND),
Tyrant(Race.ORC, Fighter, THIRD),
OrcMystic(Race.ORC, Mystic, FIRST),
OrcShaman(Race.ORC, Mystic, SECOND),
Overlord(Race.ORC, Mystic, THIRD),
Warcryer(Race.ORC, Mystic, THIRD),
DwarvenFighter(Race.DWARF, Fighter, FIRST),
DwarvenScavenger(Race.DWARF, Fighter, SECOND),
BountyHunter(Race.DWARF, Fighter, THIRD),
DwarvenArtisan(Race.DWARF, Fighter, SECOND),
Warsmith(Race.DWARF, Fighter, THIRD),
dummyEntry1(null, null, null),
dummyEntry2(null, null, null),
dummyEntry3(null, null, null),
dummyEntry4(null, null, null),
dummyEntry5(null, null, null),
dummyEntry6(null, null, null),
dummyEntry7(null, null, null),
dummyEntry8(null, null, null),
dummyEntry9(null, null, null),
dummyEntry10(null, null, null),
dummyEntry11(null, null, null),
dummyEntry12(null, null, null),
dummyEntry13(null, null, null),
dummyEntry14(null, null, null),
dummyEntry15(null, null, null),
dummyEntry16(null, null, null),
dummyEntry17(null, null, null),
dummyEntry18(null, null, null),
dummyEntry19(null, null, null),
dummyEntry20(null, null, null),
dummyEntry21(null, null, null),
dummyEntry22(null, null, null),
dummyEntry23(null, null, null),
dummyEntry24(null, null, null),
dummyEntry25(null, null, null),
dummyEntry26(null, null, null),
dummyEntry27(null, null, null),
dummyEntry28(null, null, null),
dummyEntry29(null, null, null),
dummyEntry30(null, null, null),
/*
* (3rd classes)
*/
duelist(Race.HUMAN, Fighter, FOURTH),
dreadnought(Race.HUMAN, Fighter, FOURTH),
phoenixKnight(Race.HUMAN, Fighter, FOURTH),
hellKnight(Race.HUMAN, Fighter, FOURTH),
sagittarius(Race.HUMAN, Fighter, FOURTH),
adventurer(Race.HUMAN, Fighter, FOURTH),
archmage(Race.HUMAN, Mystic, FOURTH),
soultaker(Race.HUMAN, Mystic, FOURTH),
arcanaLord(Race.HUMAN, Mystic, FOURTH),
cardinal(Race.HUMAN, Priest, FOURTH),
hierophant(Race.HUMAN, Priest, FOURTH),
evaTemplar(Race.ELF, Fighter, FOURTH),
swordMuse(Race.ELF, Fighter, FOURTH),
windRider(Race.ELF, Fighter, FOURTH),
moonlightSentinel(Race.ELF, Fighter, FOURTH),
mysticMuse(Race.ELF, Mystic, FOURTH),
elementalMaster(Race.ELF, Mystic, FOURTH),
evaSaint(Race.ELF, Priest, FOURTH),
shillienTemplar(Race.DARK_ELF, Fighter, FOURTH),
spectralDancer(Race.DARK_ELF, Fighter, FOURTH),
ghostHunter(Race.DARK_ELF, Fighter, FOURTH),
ghostSentinel(Race.DARK_ELF, Fighter, FOURTH),
stormScreamer(Race.DARK_ELF, Mystic, FOURTH),
spectralMaster(Race.DARK_ELF, Mystic, FOURTH),
shillienSaint(Race.DARK_ELF, Priest, FOURTH),
titan(Race.ORC, Fighter, FOURTH),
grandKhavatari(Race.ORC, Fighter, FOURTH),
dominator(Race.ORC, Mystic, FOURTH),
doomcryer(Race.ORC, Mystic, FOURTH),
fortuneSeeker(Race.DWARF, Fighter, FOURTH),
maestro(Race.DWARF, Fighter, FOURTH),
dummyEntry31(null, null, null),
dummyEntry32(null, null, null),
dummyEntry33(null, null, null),
dummyEntry34(null, null, null),
maleSoldier(Race.KAMAEL, Fighter, FIRST),
femaleSoldier(Race.KAMAEL, Fighter, FIRST),
trooper(Race.KAMAEL, Fighter, SECOND),
warder(Race.KAMAEL, Fighter, SECOND),
berserker(Race.KAMAEL, Fighter, THIRD),
maleSoulbreaker(Race.KAMAEL, Fighter, THIRD),
femaleSoulbreaker(Race.KAMAEL, Fighter, THIRD),
arbalester(Race.KAMAEL, Fighter, THIRD),
doombringer(Race.KAMAEL, Fighter, FOURTH),
maleSoulhound(Race.KAMAEL, Fighter, FOURTH),
femaleSoulhound(Race.KAMAEL, Fighter, FOURTH),
trickster(Race.KAMAEL, Fighter, FOURTH),
inspector(Race.KAMAEL, Fighter, THIRD),
judicator(Race.KAMAEL, Fighter, FOURTH),
dummyEntry35(null, null, null),
dummyEntry36(null, null, null),
sigelKnight(null, Fighter, null),
tyrWarrior(null, Fighter, null),
otherRogue(null, Fighter, null),
yrArcher(null, Fighter, null),
feohWizard(null, Mystic, null),
issEnchanter(null, Priest, null),
wynnSummoner(null, Mystic, null),
eolhHealer(null, Priest, null),
dummyEntry37(null, null, null),
sigelPhoenixKnight(Race.HUMAN, Fighter, ClassLevel.AWAKEN),
sigelHellKnight(Race.HUMAN, Fighter, ClassLevel.AWAKEN),
sigelEvasTemplar(Race.ELF, Fighter, ClassLevel.AWAKEN),
sigelShilenTemplar(Race.DARK_ELF, Fighter, ClassLevel.AWAKEN),
tyrrDuelist(Race.HUMAN, Fighter, ClassLevel.AWAKEN),
tyrrDreadnought(Race.HUMAN, Fighter, ClassLevel.AWAKEN),
tyrrTitan(Race.ORC, Fighter, ClassLevel.AWAKEN),
tyrrGrandKhavatari(Race.ORC, Fighter, ClassLevel.AWAKEN),
tyrrMaestro(Race.DWARF, Fighter, ClassLevel.AWAKEN),
tyrrDoombringer(Race.KAMAEL, Fighter, ClassLevel.AWAKEN),
othellAdventurer(Race.HUMAN, Fighter, ClassLevel.AWAKEN),
othellWindRider(Race.ELF, Fighter, ClassLevel.AWAKEN),
othellGhostHunter(Race.DARK_ELF, Fighter, ClassLevel.AWAKEN),
othellFortuneSeeker(Race.DWARF, Fighter, ClassLevel.AWAKEN),
yulSagittarius(Race.HUMAN, Fighter, ClassLevel.AWAKEN),
yulMoonlightSentinel(Race.ELF, Fighter, ClassLevel.AWAKEN),
yulGhostSentinel(Race.DARK_ELF, Fighter, ClassLevel.AWAKEN),
yulTrickster(Race.KAMAEL, Fighter, ClassLevel.AWAKEN),
feohArchmage(Race.HUMAN, Mystic, ClassLevel.AWAKEN),
feohSoultaker(Race.HUMAN, Mystic, ClassLevel.AWAKEN),
feohMysticMuse(Race.ELF, Mystic, ClassLevel.AWAKEN),
feoStormScreamer(Race.DARK_ELF, Mystic, ClassLevel.AWAKEN),
feohSoulHound(Race.KAMAEL, Mystic, ClassLevel.AWAKEN), // fix me
issHierophant(Race.HUMAN, Priest, ClassLevel.AWAKEN),
issSwordMuse(Race.ELF, Fighter, ClassLevel.AWAKEN),
issSpectralDancer(Race.DARK_ELF, Fighter, ClassLevel.AWAKEN),
issDominator(Race.ORC, Priest, ClassLevel.AWAKEN),
issDoomcryer(Race.ORC, Priest, ClassLevel.AWAKEN),
wynnArcanaLord(Race.HUMAN, Mystic, ClassLevel.AWAKEN),
wynnElementalMaster(Race.ELF, Mystic, ClassLevel.AWAKEN),
wynnSpectralMaster(Race.DARK_ELF, Mystic, ClassLevel.AWAKEN),
aeoreCardinal(Race.HUMAN, Priest, ClassLevel.AWAKEN),
aeoreEvaSaint(Race.ELF, Priest, ClassLevel.AWAKEN),
aeoreShillienSaint(Race.DARK_ELF, Priest, ClassLevel.AWAKEN),
ertheiaFighter(Race.ERTHEIA, Fighter, ClassLevel.FIRST),
ertheiaWizzard(Race.ERTHEIA, Mystic, ClassLevel.FIRST),
marauder(Race.ERTHEIA, Fighter, ClassLevel.THIRD),
cloudBreaker(Race.ERTHEIA, Mystic, ClassLevel.THIRD),
ripper(Race.ERTHEIA, Fighter, ClassLevel.FOURTH),
Stratomancer(Race.ERTHEIA, Mystic, ClassLevel.FOURTH),
eviscerator(Race.ERTHEIA, Fighter, ClassLevel.AWAKEN),
sayhaSeer(Race.ERTHEIA, Mystic, ClassLevel.AWAKEN);
private Race _race;
private ClassLevel _level;
private ClassType _type;
private PlayerClass(Race race, ClassType pType, ClassLevel pLevel)
{
_race = race;
_level = pLevel;
_type = pType;
}
public static final EnumSet<PlayerClass> getSet(Race race, ClassLevel level)
{
final EnumSet<PlayerClass> allOf = EnumSet.noneOf(PlayerClass.class);
for (PlayerClass playerClass : EnumSet.allOf(PlayerClass.class))
{
if ((race == null) || playerClass.isOfRace(race))
{
if ((level == null) || playerClass.isOfLevel(level))
{
allOf.add(playerClass);
}
}
}
return allOf;
}
public final boolean isOfRace(Race pRace)
{
return _race == pRace;
}
public final boolean isOfType(ClassType pType)
{
return _type == pType;
}
public final boolean isOfLevel(ClassLevel pLevel)
{
return _level == pLevel;
}
public final ClassLevel getLevel()
{
return _level;
}
}

View File

@ -0,0 +1,30 @@
/*
* 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 com.l2jmobius.gameserver.model.base;
public enum PlayerState
{
RESTING,
MOVING,
RUNNING,
STANDING,
FLYING,
BEHIND,
FRONT,
CHAOTIC,
OLYMPIAD
}

View File

@ -0,0 +1,39 @@
/*
* 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 com.l2jmobius.gameserver.model.base;
/**
* Enumerated for Social Classes.
* @author Zoey76
*/
public enum SocialClass
{
VAGABOND,
VASSAL,
APPRENTICE,
HEIR,
KNIGHT,
ELDER,
BARON,
VISCOUNT,
COUNT,
MARQUIS,
DUKE,
GRAND_DUKE,
DISTINGUISHED_KING,
EMPEROR
}

View File

@ -0,0 +1,160 @@
/*
* 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 com.l2jmobius.gameserver.model.base;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.data.xml.impl.ExperienceData;
/**
* Character Sub-Class Definition <BR>
* Used to store key information about a character's sub-class.
* @author Tempy
*/
public final class SubClass
{
private static final byte _maxLevel = Config.MAX_SUBCLASS_LEVEL < ExperienceData.getInstance().getMaxLevel() ? Config.MAX_SUBCLASS_LEVEL : (byte) (ExperienceData.getInstance().getMaxLevel() - 1);
private PlayerClass _class;
private long _exp = ExperienceData.getInstance().getExpForLevel(Config.BASE_SUBCLASS_LEVEL);
private long _sp = 0;
private byte _level = Config.BASE_SUBCLASS_LEVEL;
private int _classIndex = 1;
private int _vitalityPoints = 140000;
private boolean _dualClass = false;
public SubClass()
{
// Used for specifying ALL attributes of a sub class directly,
// using the preset default values.
}
public PlayerClass getClassDefinition()
{
return _class;
}
public int getClassId()
{
return _class.ordinal();
}
public long getExp()
{
return _exp;
}
public long getSp()
{
return _sp;
}
public byte getLevel()
{
return _level;
}
public int getVitalityPoints()
{
return _vitalityPoints;
}
/**
* First Sub-Class is index 1.
* @return int _classIndex
*/
public int getClassIndex()
{
return _classIndex;
}
public void setClassId(int classId)
{
_class = PlayerClass.values()[classId];
}
public void setExp(long expValue)
{
if (!_dualClass && (expValue > (ExperienceData.getInstance().getExpForLevel(_maxLevel + 1) - 1)))
{
expValue = ExperienceData.getInstance().getExpForLevel(_maxLevel + 1) - 1;
}
_exp = expValue;
}
public void setSp(long spValue)
{
_sp = spValue;
}
public void setClassIndex(int classIndex)
{
_classIndex = classIndex;
}
public boolean isDualClass()
{
return _dualClass;
}
public void setIsDualClass(boolean dualClass)
{
_dualClass = dualClass;
}
public void setLevel(byte levelValue)
{
if (!_dualClass && (levelValue > _maxLevel))
{
levelValue = _maxLevel;
}
else if (levelValue < Config.BASE_SUBCLASS_LEVEL)
{
levelValue = Config.BASE_SUBCLASS_LEVEL;
}
_level = levelValue;
}
public void setVitalityPoints(int vit)
{
_vitalityPoints = vit;
}
public void incLevel()
{
if (!_dualClass && (getLevel() == _maxLevel))
{
return;
}
_level++;
setExp(ExperienceData.getInstance().getExpForLevel(getLevel()));
}
public void decLevel()
{
if (getLevel() == Config.BASE_SUBCLASS_LEVEL)
{
return;
}
_level--;
setExp(ExperienceData.getInstance().getExpForLevel(getLevel()));
}
}