actual freya branch

This commit is contained in:
2026-09-12 15:41:31 +00:00
parent 8049e0a882
commit 68c1cd27d4
3510 changed files with 336689 additions and 302906 deletions
@@ -0,0 +1,324 @@
/*
* 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.l2jserver.gameserver.model.base;
/**
* This class defines all classes (ex : human fighter, darkFighter...) that a player can chose.<BR>
* <BR>
* Data :<BR>
* <BR>
* <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><BR>
* <BR>
* @version $Revision: 1.4.4.4 $ $Date: 2005/03/27 15:29:33 $
*/
public enum ClassId
{
fighter(0x00, false, Race.Human, null),
warrior(0x01, false, Race.Human, fighter),
gladiator(0x02, false, Race.Human, warrior),
warlord(0x03, false, Race.Human, warrior),
knight(0x04, false, Race.Human, fighter),
paladin(0x05, false, Race.Human, knight),
darkAvenger(0x06, false, Race.Human, knight),
rogue(0x07, false, Race.Human, fighter),
treasureHunter(0x08, false, Race.Human, rogue),
hawkeye(0x09, false, Race.Human, rogue),
mage(0x0a, true, Race.Human, null),
wizard(0x0b, true, Race.Human, mage),
sorceror(0x0c, true, Race.Human, wizard),
necromancer(0x0d, true, Race.Human, wizard),
warlock(0x0e, true, true, Race.Human, wizard),
cleric(0x0f, true, Race.Human, mage),
bishop(0x10, true, Race.Human, cleric),
prophet(0x11, true, Race.Human, cleric),
elvenFighter(0x12, false, Race.Elf, null),
elvenKnight(0x13, false, Race.Elf, elvenFighter),
templeKnight(0x14, false, Race.Elf, elvenKnight),
swordSinger(0x15, false, Race.Elf, elvenKnight),
elvenScout(0x16, false, Race.Elf, elvenFighter),
plainsWalker(0x17, false, Race.Elf, elvenScout),
silverRanger(0x18, false, Race.Elf, elvenScout),
elvenMage(0x19, true, Race.Elf, null),
elvenWizard(0x1a, true, Race.Elf, elvenMage),
spellsinger(0x1b, true, Race.Elf, elvenWizard),
elementalSummoner(0x1c, true, true, Race.Elf, elvenWizard),
oracle(0x1d, true, Race.Elf, elvenMage),
elder(0x1e, true, Race.Elf, oracle),
darkFighter(0x1f, false, Race.DarkElf, null),
palusKnight(0x20, false, Race.DarkElf, darkFighter),
shillienKnight(0x21, false, Race.DarkElf, palusKnight),
bladedancer(0x22, false, Race.DarkElf, palusKnight),
assassin(0x23, false, Race.DarkElf, darkFighter),
abyssWalker(0x24, false, Race.DarkElf, assassin),
phantomRanger(0x25, false, Race.DarkElf, assassin),
darkMage(0x26, true, Race.DarkElf, null),
darkWizard(0x27, true, Race.DarkElf, darkMage),
spellhowler(0x28, true, Race.DarkElf, darkWizard),
phantomSummoner(0x29, true, true, Race.DarkElf, darkWizard),
shillienOracle(0x2a, true, Race.DarkElf, darkMage),
shillenElder(0x2b, true, Race.DarkElf, shillienOracle),
orcFighter(0x2c, false, Race.Orc, null),
orcRaider(0x2d, false, Race.Orc, orcFighter),
destroyer(0x2e, false, Race.Orc, orcRaider),
orcMonk(0x2f, false, Race.Orc, orcFighter),
tyrant(0x30, false, Race.Orc, orcMonk),
orcMage(0x31, false, Race.Orc, null),
orcShaman(0x32, true, Race.Orc, orcMage),
overlord(0x33, true, Race.Orc, orcShaman),
warcryer(0x34, true, Race.Orc, orcShaman),
dwarvenFighter(0x35, false, Race.Dwarf, null),
scavenger(0x36, false, Race.Dwarf, dwarvenFighter),
bountyHunter(0x37, false, Race.Dwarf, scavenger),
artisan(0x38, false, Race.Dwarf, dwarvenFighter),
warsmith(0x39, false, Race.Dwarf, artisan),
/*
* Dummy Entries (id's already in decimal format) btw FU NCSoft for the amount of work you put me through to do this!! <START>
*/
dummyEntry1(58, false, null, null),
dummyEntry2(59, false, null, null),
dummyEntry3(60, false, null, null),
dummyEntry4(61, false, null, null),
dummyEntry5(62, false, null, null),
dummyEntry6(63, false, null, null),
dummyEntry7(64, false, null, null),
dummyEntry8(65, false, null, null),
dummyEntry9(66, false, null, null),
dummyEntry10(67, false, null, null),
dummyEntry11(68, false, null, null),
dummyEntry12(69, false, null, null),
dummyEntry13(70, false, null, null),
dummyEntry14(71, false, null, null),
dummyEntry15(72, false, null, null),
dummyEntry16(73, false, null, null),
dummyEntry17(74, false, null, null),
dummyEntry18(75, false, null, null),
dummyEntry19(76, false, null, null),
dummyEntry20(77, false, null, null),
dummyEntry21(78, false, null, null),
dummyEntry22(79, false, null, null),
dummyEntry23(80, false, null, null),
dummyEntry24(81, false, null, null),
dummyEntry25(82, false, null, null),
dummyEntry26(83, false, null, null),
dummyEntry27(84, false, null, null),
dummyEntry28(85, false, null, null),
dummyEntry29(86, false, null, null),
dummyEntry30(87, false, null, null),
/*
* <END> Of Dummy entries
*/
/*
* Now the bad boys! new class ids :)) (3rd classes)
*/
duelist(0x58, false, Race.Human, gladiator),
dreadnought(0x59, false, Race.Human, warlord),
phoenixKnight(0x5a, false, Race.Human, paladin),
hellKnight(0x5b, false, Race.Human, darkAvenger),
sagittarius(0x5c, false, Race.Human, hawkeye),
adventurer(0x5d, false, Race.Human, treasureHunter),
archmage(0x5e, true, Race.Human, sorceror),
soultaker(0x5f, true, Race.Human, necromancer),
arcanaLord(0x60, true, true, Race.Human, warlock),
cardinal(0x61, true, Race.Human, bishop),
hierophant(0x62, true, Race.Human, prophet),
evaTemplar(0x63, false, Race.Elf, templeKnight),
swordMuse(0x64, false, Race.Elf, swordSinger),
windRider(0x65, false, Race.Elf, plainsWalker),
moonlightSentinel(0x66, false, Race.Elf, silverRanger),
mysticMuse(0x67, true, Race.Elf, spellsinger),
elementalMaster(0x68, true, true, Race.Elf, elementalSummoner),
evaSaint(0x69, true, Race.Elf, elder),
shillienTemplar(0x6a, false, Race.DarkElf, shillienKnight),
spectralDancer(0x6b, false, Race.DarkElf, bladedancer),
ghostHunter(0x6c, false, Race.DarkElf, abyssWalker),
ghostSentinel(0x6d, false, Race.DarkElf, phantomRanger),
stormScreamer(0x6e, true, Race.DarkElf, spellhowler),
spectralMaster(0x6f, true, true, Race.DarkElf, phantomSummoner),
shillienSaint(0x70, true, Race.DarkElf, shillenElder),
titan(0x71, false, Race.Orc, destroyer),
grandKhauatari(0x72, false, Race.Orc, tyrant),
dominator(0x73, true, Race.Orc, overlord),
doomcryer(0x74, true, Race.Orc, warcryer),
fortuneSeeker(0x75, false, Race.Dwarf, bountyHunter),
maestro(0x76, false, Race.Dwarf, warsmith),
dummyEntry31(0x77, false, null, null),
dummyEntry32(0x78, false, null, null),
dummyEntry33(0x79, false, null, null),
dummyEntry34(0x7a, false, null, null),
maleSoldier(0x7b, false, Race.Kamael, null),
femaleSoldier(0x7C, false, Race.Kamael, null),
trooper(0x7D, false, Race.Kamael, maleSoldier),
warder(0x7E, false, Race.Kamael, femaleSoldier),
berserker(0x7F, false, Race.Kamael, trooper),
maleSoulbreaker(0x80, false, Race.Kamael, trooper),
femaleSoulbreaker(0x81, false, Race.Kamael, warder),
arbalester(0x82, false, Race.Kamael, warder),
doombringer(0x83, false, Race.Kamael, berserker),
maleSoulhound(0x84, false, Race.Kamael, maleSoulbreaker),
femaleSoulhound(0x85, false, Race.Kamael, femaleSoulbreaker),
trickster(0x86, false, Race.Kamael, arbalester),
inspector(0x87, false, Race.Kamael, warder), // DS: yes, both male/female inspectors use skills from warder
judicator(0x88, false, Race.Kamael, inspector);
/** 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;
/**
* Constructor of ClassId.<BR>
* <BR>
*/
private ClassId(int pId, boolean pIsMage, Race pRace, ClassId pParent)
{
_id = pId;
_isMage = pIsMage;
_isSummoner = false;
_race = pRace;
_parent = pParent;
}
/**
* Constructor of ClassId.<BR>
* <BR>
*/
private ClassId(int pId, boolean pIsMage, boolean pIsSummoner, Race pRace, ClassId pParent)
{
_id = pId;
_isMage = pIsMage;
_isSummoner = pIsSummoner;
_race = pRace;
_parent = pParent;
}
/**
* Return the Identifier of the Class.<BR>
* <BR>
*/
public final int getId()
{
return _id;
}
/**
* Return True if the class is a mage class.<BR>
* <BR>
*/
public final boolean isMage()
{
return _isMage;
}
/**
* Return True if the class is a summoner class.<BR>
* <BR>
*/
public final boolean isSummoner()
{
return _isSummoner;
}
/**
* Return the Race object of the class.<BR>
* <BR>
*/
public final Race getRace()
{
return _race;
}
/**
* Return True if this Class is a child of the selected ClassId.<BR>
* <BR>
* @param cid The parent ClassId to check
*/
public final boolean childOf(ClassId cid)
{
if (_parent == null)
{
return false;
}
if (_parent == cid)
{
return true;
}
return _parent.childOf(cid);
}
/**
* Return True if this Class is equal to the selected ClassId or a child of the selected ClassId.<BR>
* <BR>
* @param cid The parent ClassId to check
*/
public final boolean equalsOrChildOf(ClassId cid)
{
return (this == cid) || childOf(cid);
}
/**
* Return the child level of this Class (0=root, 1=child leve 1...).<BR>
* <BR>
* @param cid The parent ClassId to check
*/
public final int level()
{
if (_parent == null)
{
return 0;
}
return 1 + _parent.level();
}
/**
* Return its parent ClassId<BR>
* <BR>
*/
public final ClassId getParent()
{
return _parent;
}
}
@@ -0,0 +1,38 @@
/*
* $Header: ClassLevel.java, 24/11/2005 15:56:45 luisantonioa Exp $
*
* $Author: luisantonioa $
* $Date: 24/11/2005 15:56:45 $
* $Revision: 1 $
* $Log: ClassLevel.java,v $
* Revision 1 24/11/2005 15:56:45 luisantonioa
* Added copyright notice
*
*
* 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.l2jserver.gameserver.model.base;
/**
* This class ...
* @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
*/
public enum ClassLevel
{
First,
Second,
Third,
Fourth
}
@@ -0,0 +1,27 @@
/*
* 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.l2jserver.gameserver.model.base;
/**
* ClassType Enum
* @author Tempy
*/
public enum ClassType
{
Fighter,
Mystic,
Priest
}
@@ -0,0 +1,126 @@
/*
* 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.l2jserver.gameserver.model.base;
/**
*
*/
public class Experience
{
public final static long LEVEL[] =
{
-1L, // level 0 (unreachable)
0L,
68L,
363L,
1168L,
2884L,
6038L,
11287L,
19423L,
31378L,
48229L, // level 10
71201L,
101676L,
141192L,
191452L,
254327L,
331864L,
426284L,
539995L,
675590L,
835854L, // level 20
1023775L,
1242536L,
1495531L,
1786365L,
2118860L,
2497059L,
2925229L,
3407873L,
3949727L,
4555766L, // level 30
5231213L,
5981539L,
6812472L,
7729999L,
8740372L,
9850111L,
11066012L,
12395149L,
13844879L,
15422851L, // level 40
17137002L,
18995573L,
21007103L,
23180442L,
25524751L,
28049509L,
30764519L,
33679907L,
36806133L,
40153995L, // level 50
45524865L,
51262204L,
57383682L,
63907585L,
70852742L,
80700339L,
91162131L,
102265326L,
114038008L,
126509030L, // level 60
146307211L,
167243291L,
189363788L,
212716741L,
237351413L,
271973532L,
308441375L,
346825235L,
387197529L,
429632402L, // level 70
474205751L,
532692055L,
606319094L,
696376867L,
804219972L,
931275828L,
1151275834L,
1511275834L,
2099275834L,
4200000000L, // level 80
6300000000L, // level 81
8820000000L, // level 82
11844000000L, // level 83
15472800000L, // level 84
19827360000L, // level 85
25314105600L, // level 86
32211728640L
// level 87
};
/**
* This is the first UNREACHABLE level.<BR>
* ex: If you want a max at 85 & 100.00%, you have to put 86.<BR>
* <BR>
*/
public final static byte MAX_LEVEL = 86;
public final static byte PET_MAX_LEVEL = 87;
public final static byte MIN_NEWBIE_LEVEL = 6;
public final static byte MAX_NEWBIE_LEVEL = 39;
}
@@ -0,0 +1,353 @@
/*
* $Header: PlayerClass.java, 24/11/2005 12:56:01 luisantonioa Exp $
*
* $Author: luisantonioa $
* $Date: 24/11/2005 12:56:01 $
* $Revision: 1 $
* $Log: PlayerClass.java,v $
* Revision 1 24/11/2005 12:56:01 luisantonioa
* Added copyright notice
*
*
* 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.l2jserver.gameserver.model.base;
import static com.l2jserver.gameserver.model.base.ClassLevel.First;
import static com.l2jserver.gameserver.model.base.ClassLevel.Fourth;
import static com.l2jserver.gameserver.model.base.ClassLevel.Second;
import static com.l2jserver.gameserver.model.base.ClassLevel.Third;
import static com.l2jserver.gameserver.model.base.ClassType.Fighter;
import static com.l2jserver.gameserver.model.base.ClassType.Mystic;
import static com.l2jserver.gameserver.model.base.ClassType.Priest;
import static com.l2jserver.gameserver.model.base.Race.DarkElf;
import static com.l2jserver.gameserver.model.base.Race.Dwarf;
import static com.l2jserver.gameserver.model.base.Race.Elf;
import static com.l2jserver.gameserver.model.base.Race.Human;
import static com.l2jserver.gameserver.model.base.Race.Kamael;
import static com.l2jserver.gameserver.model.base.Race.Orc;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.Set;
import com.l2jserver.Config;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
/**
* This class ...
* @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
*/
public enum PlayerClass
{
HumanFighter(Human, Fighter, First),
Warrior(Human, Fighter, Second),
Gladiator(Human, Fighter, Third),
Warlord(Human, Fighter, Third),
HumanKnight(Human, Fighter, Second),
Paladin(Human, Fighter, Third),
DarkAvenger(Human, Fighter, Third),
Rogue(Human, Fighter, Second),
TreasureHunter(Human, Fighter, Third),
Hawkeye(Human, Fighter, Third),
HumanMystic(Human, Mystic, First),
HumanWizard(Human, Mystic, Second),
Sorceror(Human, Mystic, Third),
Necromancer(Human, Mystic, Third),
Warlock(Human, Mystic, Third),
Cleric(Human, Priest, Second),
Bishop(Human, Priest, Third),
Prophet(Human, Priest, Third),
ElvenFighter(Elf, Fighter, First),
ElvenKnight(Elf, Fighter, Second),
TempleKnight(Elf, Fighter, Third),
Swordsinger(Elf, Fighter, Third),
ElvenScout(Elf, Fighter, Second),
Plainswalker(Elf, Fighter, Third),
SilverRanger(Elf, Fighter, Third),
ElvenMystic(Elf, Mystic, First),
ElvenWizard(Elf, Mystic, Second),
Spellsinger(Elf, Mystic, Third),
ElementalSummoner(Elf, Mystic, Third),
ElvenOracle(Elf, Priest, Second),
ElvenElder(Elf, Priest, Third),
DarkElvenFighter(DarkElf, Fighter, First),
PalusKnight(DarkElf, Fighter, Second),
ShillienKnight(DarkElf, Fighter, Third),
Bladedancer(DarkElf, Fighter, Third),
Assassin(DarkElf, Fighter, Second),
AbyssWalker(DarkElf, Fighter, Third),
PhantomRanger(DarkElf, Fighter, Third),
DarkElvenMystic(DarkElf, Mystic, First),
DarkElvenWizard(DarkElf, Mystic, Second),
Spellhowler(DarkElf, Mystic, Third),
PhantomSummoner(DarkElf, Mystic, Third),
ShillienOracle(DarkElf, Priest, Second),
ShillienElder(DarkElf, Priest, Third),
OrcFighter(Orc, Fighter, First),
OrcRaider(Orc, Fighter, Second),
Destroyer(Orc, Fighter, Third),
OrcMonk(Orc, Fighter, Second),
Tyrant(Orc, Fighter, Third),
OrcMystic(Orc, Mystic, First),
OrcShaman(Orc, Mystic, Second),
Overlord(Orc, Mystic, Third),
Warcryer(Orc, Mystic, Third),
DwarvenFighter(Dwarf, Fighter, First),
DwarvenScavenger(Dwarf, Fighter, Second),
BountyHunter(Dwarf, Fighter, Third),
DwarvenArtisan(Dwarf, Fighter, Second),
Warsmith(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(Human, Fighter, Fourth),
dreadnought(Human, Fighter, Fourth),
phoenixKnight(Human, Fighter, Fourth),
hellKnight(Human, Fighter, Fourth),
sagittarius(Human, Fighter, Fourth),
adventurer(Human, Fighter, Fourth),
archmage(Human, Mystic, Fourth),
soultaker(Human, Mystic, Fourth),
arcanaLord(Human, Mystic, Fourth),
cardinal(Human, Priest, Fourth),
hierophant(Human, Priest, Fourth),
evaTemplar(Elf, Fighter, Fourth),
swordMuse(Elf, Fighter, Fourth),
windRider(Elf, Fighter, Fourth),
moonlightSentinel(Elf, Fighter, Fourth),
mysticMuse(Elf, Mystic, Fourth),
elementalMaster(Elf, Mystic, Fourth),
evaSaint(Elf, Priest, Fourth),
shillienTemplar(DarkElf, Fighter, Fourth),
spectralDancer(DarkElf, Fighter, Fourth),
ghostHunter(DarkElf, Fighter, Fourth),
ghostSentinel(DarkElf, Fighter, Fourth),
stormScreamer(DarkElf, Mystic, Fourth),
spectralMaster(DarkElf, Mystic, Fourth),
shillienSaint(DarkElf, Priest, Fourth),
titan(Orc, Fighter, Fourth),
grandKhauatari(Orc, Fighter, Fourth),
dominator(Orc, Mystic, Fourth),
doomcryer(Orc, Mystic, Fourth),
fortuneSeeker(Dwarf, Fighter, Fourth),
maestro(Dwarf, Fighter, Fourth),
dummyEntry31(null, null, null),
dummyEntry32(null, null, null),
dummyEntry33(null, null, null),
dummyEntry34(null, null, null),
maleSoldier(Kamael, Fighter, First),
femaleSoldier(Kamael, Fighter, First),
trooper(Kamael, Fighter, Second),
warder(Kamael, Fighter, Second),
berserker(Kamael, Fighter, Third),
maleSoulbreaker(Kamael, Fighter, Third),
femaleSoulbreaker(Kamael, Fighter, Third),
arbalester(Kamael, Fighter, Third),
doombringer(Kamael, Fighter, Fourth),
maleSoulhound(Kamael, Fighter, Fourth),
femaleSoulhound(Kamael, Fighter, Fourth),
trickster(Kamael, Fighter, Fourth),
inspector(Kamael, Fighter, Third),
judicator(Kamael, Fighter, Fourth);
private Race _race;
private ClassLevel _level;
private ClassType _type;
private static final Set<PlayerClass> mainSubclassSet;
private static final Set<PlayerClass> neverSubclassed = EnumSet.of(Overlord, Warsmith);
private static final Set<PlayerClass> subclasseSet1 = EnumSet.of(DarkAvenger, Paladin, TempleKnight, ShillienKnight);
private static final Set<PlayerClass> subclasseSet2 = EnumSet.of(TreasureHunter, AbyssWalker, Plainswalker);
private static final Set<PlayerClass> subclasseSet3 = EnumSet.of(Hawkeye, SilverRanger, PhantomRanger);
private static final Set<PlayerClass> subclasseSet4 = EnumSet.of(Warlock, ElementalSummoner, PhantomSummoner);
private static final Set<PlayerClass> subclasseSet5 = EnumSet.of(Sorceror, Spellsinger, Spellhowler);
private static final EnumMap<PlayerClass, Set<PlayerClass>> subclassSetMap = new EnumMap<>(PlayerClass.class);
static
{
Set<PlayerClass> subclasses = getSet(null, Third);
subclasses.removeAll(neverSubclassed);
mainSubclassSet = subclasses;
subclassSetMap.put(DarkAvenger, subclasseSet1);
subclassSetMap.put(Paladin, subclasseSet1);
subclassSetMap.put(TempleKnight, subclasseSet1);
subclassSetMap.put(ShillienKnight, subclasseSet1);
subclassSetMap.put(TreasureHunter, subclasseSet2);
subclassSetMap.put(AbyssWalker, subclasseSet2);
subclassSetMap.put(Plainswalker, subclasseSet2);
subclassSetMap.put(Hawkeye, subclasseSet3);
subclassSetMap.put(SilverRanger, subclasseSet3);
subclassSetMap.put(PhantomRanger, subclasseSet3);
subclassSetMap.put(Warlock, subclasseSet4);
subclassSetMap.put(ElementalSummoner, subclasseSet4);
subclassSetMap.put(PhantomSummoner, subclasseSet4);
subclassSetMap.put(Sorceror, subclasseSet5);
subclassSetMap.put(Spellsinger, subclasseSet5);
subclassSetMap.put(Spellhowler, subclasseSet5);
}
PlayerClass(Race pRace, ClassType pType, ClassLevel pLevel)
{
_race = pRace;
_level = pLevel;
_type = pType;
}
public final Set<PlayerClass> getAvailableSubclasses(L2PcInstance player)
{
Set<PlayerClass> subclasses = null;
if (_level == Third)
{
if (player.getRace() != Kamael)
{
subclasses = EnumSet.copyOf(mainSubclassSet);
subclasses.remove(this);
switch (player.getRace())
{
case Elf:
subclasses.removeAll(getSet(DarkElf, Third));
break;
case DarkElf:
subclasses.removeAll(getSet(Elf, Third));
break;
}
subclasses.removeAll(getSet(Kamael, Third));
Set<PlayerClass> unavailableClasses = subclassSetMap.get(this);
if (unavailableClasses != null)
{
subclasses.removeAll(unavailableClasses);
}
}
else
{
subclasses = getSet(Kamael, Third);
subclasses.remove(this);
// Check sex, male subclasses female and vice versa
// If server owner set MaxSubclass > 3 some kamael's cannot take 4 sub
// So, in that situation we must skip sex check
if (Config.MAX_SUBCLASS <= 3)
{
if (player.getAppearance().getSex())
{
subclasses.removeAll(EnumSet.of(femaleSoulbreaker));
}
else
{
subclasses.removeAll(EnumSet.of(maleSoulbreaker));
}
}
if (!player.getSubClasses().containsKey(2) || (player.getSubClasses().get(2).getLevel() < 75))
{
subclasses.removeAll(EnumSet.of(inspector));
}
}
}
return subclasses;
}
public static final EnumSet<PlayerClass> getSet(Race race, ClassLevel level)
{
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;
}
}
@@ -0,0 +1,28 @@
/*
* 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.l2jserver.gameserver.model.base;
public enum PlayerState
{
RESTING,
MOVING,
RUNNING,
STANDING,
FLYING,
BEHIND,
FRONT,
CHAOTIC,
OLYMPIAD
}
@@ -0,0 +1,31 @@
/*
* 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.l2jserver.gameserver.model.base;
/**
* This class defines all races (human, elf, darkelf, orc, dwarf) that a player can chose.<BR>
* <BR>
* @version $Revision: 1.2.4.2 $ $Date: 2005/03/27 15:29:32 $
*/
public enum Race
{
Human,
Elf,
DarkElf,
Orc,
Dwarf,
Kamael;
}
@@ -0,0 +1,25 @@
/*
* 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.l2jserver.gameserver.model.base;
/**
* This class ...
* @version $Revision: 1.2.4.1 $ $Date: 2005/03/27 15:29:32 $
*/
public class Sex
{
public static final int MALE = 0;
public static final int FEMALE = 1;
}
@@ -0,0 +1,150 @@
/*
* 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.l2jserver.gameserver.model.base;
import com.l2jserver.Config;
/**
* 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 < Experience.MAX_LEVEL ? Config.MAX_SUBCLASS_LEVEL : Experience.MAX_LEVEL - 1;
private PlayerClass _class;
private long _exp = Experience.LEVEL[40];
private int _sp = 0;
private byte _level = 40;
private int _classIndex = 1;
public SubClass(int classId, long exp, int sp, byte level, int classIndex)
{
_class = PlayerClass.values()[classId];
_exp = exp;
_sp = sp;
_level = level;
_classIndex = classIndex;
}
public SubClass(int classId, int classIndex)
{
// Used for defining a sub class using default values for XP, SP and player level.
_class = PlayerClass.values()[classId];
_classIndex = classIndex;
}
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 int getSp()
{
return _sp;
}
public byte getLevel()
{
return _level;
}
/**
* 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 (expValue > (Experience.LEVEL[_maxLevel + 1] - 1))
{
expValue = (Experience.LEVEL[_maxLevel + 1] - 1);
}
_exp = expValue;
}
public void setSp(int spValue)
{
_sp = spValue;
}
public void setClassIndex(int classIndex)
{
_classIndex = classIndex;
}
public void setLevel(byte levelValue)
{
if (levelValue > _maxLevel)
{
levelValue = _maxLevel;
}
else if (levelValue < 40)
{
levelValue = 40;
}
_level = levelValue;
}
public void incLevel()
{
if (getLevel() == _maxLevel)
{
return;
}
_level++;
setExp(Experience.LEVEL[getLevel()]);
}
public void decLevel()
{
if (getLevel() == 40)
{
return;
}
_level--;
setExp(Experience.LEVEL[getLevel()]);
}
}