mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-24 05:37:46 +00:00
Level 0 class fixes
Add level 1 abilities when switching to level 0 class Fix client error when switching to level 0 class
This commit is contained in:
parent
32330d557c
commit
a996797beb
1 changed files with 35 additions and 28 deletions
|
@ -992,10 +992,6 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
|
|
||||||
public void PrepareClassChange(byte classId)
|
public void PrepareClassChange(byte classId)
|
||||||
{
|
{
|
||||||
//If new class, init abilties and level
|
|
||||||
if (charaWork.battleSave.skillLevel[classId - 1] <= 0)
|
|
||||||
UpdateClassLevel(classId, 1);
|
|
||||||
|
|
||||||
SendCharaExpInfo();
|
SendCharaExpInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1037,6 +1033,13 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
charaWork.commandCategory[i] = 0;
|
charaWork.commandCategory[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If new class, init abilties and level
|
||||||
|
if (charaWork.battleSave.skillLevel[classId - 1] <= 0)
|
||||||
|
{
|
||||||
|
UpdateClassLevel(classId, 1);
|
||||||
|
EquipAbilitiesAtLevel(classId, 1);
|
||||||
|
}
|
||||||
|
|
||||||
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
|
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
|
||||||
|
|
||||||
propertyBuilder.AddProperty("charaWork.parameterSave.state_mainSkill[0]");
|
propertyBuilder.AddProperty("charaWork.parameterSave.state_mainSkill[0]");
|
||||||
|
@ -1071,7 +1074,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
{
|
{
|
||||||
Database.PlayerCharacterUpdateClassLevel(this, classId, level);
|
Database.PlayerCharacterUpdateClassLevel(this, classId, level);
|
||||||
charaWork.battleSave.skillLevel[classId - 1] = level;
|
charaWork.battleSave.skillLevel[classId - 1] = level;
|
||||||
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/exp", this);
|
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
|
||||||
propertyBuilder.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId-1));
|
propertyBuilder.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId-1));
|
||||||
List<SubPacket> packets = propertyBuilder.Done();
|
List<SubPacket> packets = propertyBuilder.Done();
|
||||||
QueuePackets(packets);
|
QueuePackets(packets);
|
||||||
|
@ -2453,12 +2456,10 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
//Set exp to current class to 0 so that exp is added correctly
|
//Set exp to current class to 0 so that exp is added correctly
|
||||||
charaWork.battleSave.skillPoint[classId - 1] = 0;
|
charaWork.battleSave.skillPoint[classId - 1] = 0;
|
||||||
//send new level
|
//send new level
|
||||||
ActorPropertyPacketUtil expPropertyPacket2 = new ActorPropertyPacketUtil("charaWork/exp", this);
|
ActorPropertyPacketUtil levelPropertyPacket = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
|
||||||
ActorPropertyPacketUtil expPropertyPacket3 = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
|
levelPropertyPacket.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId - 1));
|
||||||
expPropertyPacket2.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId - 1));
|
levelPropertyPacket.AddProperty("charaWork.parameterSave.state_mainSkillLevel");
|
||||||
expPropertyPacket2.AddProperty("charaWork.parameterSave.state_mainSkillLevel");
|
QueuePackets(levelPropertyPacket.Done());
|
||||||
QueuePackets(expPropertyPacket2.Done());
|
|
||||||
QueuePackets(expPropertyPacket3.Done());
|
|
||||||
|
|
||||||
Database.SetLevel(this, classId, GetLevel());
|
Database.SetLevel(this, classId, GetLevel());
|
||||||
Database.SavePlayerCurrentClass(this);
|
Database.SavePlayerCurrentClass(this);
|
||||||
|
@ -2475,19 +2476,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
return actionList;
|
return actionList;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Increaess level of current class and equips new abilities earned at that level
|
//Equips any abilities for the given classId at the given level. If actionList is not null, adds a "You learn Command" message
|
||||||
public void LevelUp(byte classId, List<CommandResult> actionList = null)
|
private void EquipAbilitiesAtLevel(byte classId, short level, List<CommandResult> actionList = null)
|
||||||
{
|
{
|
||||||
if (charaWork.battleSave.skillLevel[classId - 1] < charaWork.battleSave.skillLevelCap[classId])
|
|
||||||
{
|
|
||||||
//Increase level
|
|
||||||
charaWork.battleSave.skillLevel[classId - 1]++;
|
|
||||||
charaWork.parameterSave.state_mainSkillLevel++;
|
|
||||||
|
|
||||||
//33909: You attain level [level].
|
|
||||||
if (actionList != null)
|
|
||||||
actionList.Add(new CommandResult(actorId, 33909, 0, (ushort)charaWork.battleSave.skillLevel[classId - 1]));
|
|
||||||
|
|
||||||
//If there's any abilites that unlocks at this level, equip them.
|
//If there's any abilites that unlocks at this level, equip them.
|
||||||
List<ushort> commandIds = Server.GetWorldManager().GetBattleCommandIdByLevel(classId, GetLevel());
|
List<ushort> commandIds = Server.GetWorldManager().GetBattleCommandIdByLevel(classId, GetLevel());
|
||||||
foreach (ushort commandId in commandIds)
|
foreach (ushort commandId in commandIds)
|
||||||
|
@ -2505,6 +2496,22 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Increaess level of current class and equips new abilities earned at that level
|
||||||
|
public void LevelUp(byte classId, List<CommandResult> actionList = null)
|
||||||
|
{
|
||||||
|
if (charaWork.battleSave.skillLevel[classId - 1] < charaWork.battleSave.skillLevelCap[classId])
|
||||||
|
{
|
||||||
|
//Increase level
|
||||||
|
charaWork.battleSave.skillLevel[classId - 1]++;
|
||||||
|
charaWork.parameterSave.state_mainSkillLevel++;
|
||||||
|
|
||||||
|
//33909: You attain level [level].
|
||||||
|
if (actionList != null)
|
||||||
|
actionList.Add(new CommandResult(actorId, 33909, 0, (ushort)charaWork.battleSave.skillLevel[classId - 1]));
|
||||||
|
|
||||||
|
EquipAbilitiesAtLevel(classId, GetLevel(), actionList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte ConvertClassIdToJobId(byte classId)
|
public static byte ConvertClassIdToJobId(byte classId)
|
||||||
|
|
Loading…
Add table
Reference in a new issue