This commit is contained in:
Filip Maj 2019-06-17 23:29:34 -04:00
commit 29ec6a9a88
5 changed files with 47 additions and 10 deletions

View File

@ -61,6 +61,9 @@ namespace FFXIVClassic_Lobby_Server
public void QueuePacket(BasePacket packet) public void QueuePacket(BasePacket packet)
{ {
if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1)
FlushQueuedSendPackets();
SendPacketQueue.Add(packet); SendPacketQueue.Add(packet);
} }

View File

@ -1044,6 +1044,13 @@ namespace FFXIVClassic_Map_Server.Actors
resultContainer.CombineLists(); resultContainer.CombineLists();
DoBattleAction(0, 0x7c000062, resultContainer.GetList()); DoBattleAction(0, 0x7c000062, resultContainer.GetList());
//If new class, init abilties and level
if (charaWork.battleSave.skillLevel[classId - 1] <= 0)
{
UpdateClassLevel(classId, 1);
EquipAbilitiesAtLevel(classId, 1);
}
//Set rested EXP //Set rested EXP
charaWork.parameterSave.state_mainSkill[0] = classId; charaWork.parameterSave.state_mainSkill[0] = classId;
charaWork.parameterSave.state_mainSkillLevel = charaWork.battleSave.skillLevel[classId-1]; charaWork.parameterSave.state_mainSkillLevel = charaWork.battleSave.skillLevel[classId-1];
@ -1054,13 +1061,6 @@ 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]");
@ -2143,7 +2143,7 @@ namespace FFXIVClassic_Map_Server.Actors
public void UnequipAbility(ushort hotbarSlot, bool printMessage = true) public void UnequipAbility(ushort hotbarSlot, bool printMessage = true)
{ {
ushort trueHotbarSlot = (ushort)(hotbarSlot + charaWork.commandBorder); ushort trueHotbarSlot = (ushort)(hotbarSlot + charaWork.commandBorder - 1);
uint commandId = charaWork.command[trueHotbarSlot]; uint commandId = charaWork.command[trueHotbarSlot];
Database.UnequipAbility(this, hotbarSlot); Database.UnequipAbility(this, hotbarSlot);
charaWork.command[trueHotbarSlot] = 0; charaWork.command[trueHotbarSlot] = 0;
@ -2501,7 +2501,7 @@ namespace FFXIVClassic_Map_Server.Actors
private void EquipAbilitiesAtLevel(byte classId, short level, List<CommandResult> actionList = null) private void EquipAbilitiesAtLevel(byte classId, short level, List<CommandResult> actionList = null)
{ {
//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, level);
foreach (ushort commandId in commandIds) foreach (ushort commandId in commandIds)
{ {
EquipAbilityInFirstOpenSlot(classId, commandId, false); EquipAbilityInFirstOpenSlot(classId, commandId, false);

View File

@ -41,11 +41,17 @@ namespace FFXIVClassic_World_Server
public void QueuePacket(BasePacket packet) public void QueuePacket(BasePacket packet)
{ {
if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1)
FlushQueuedSendPackets();
SendPacketQueue.Add(packet); SendPacketQueue.Add(packet);
} }
public void QueuePacket(SubPacket subpacket) public void QueuePacket(SubPacket subpacket)
{ {
if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1)
FlushQueuedSendPackets();
bool isAuthed = true; bool isAuthed = true;
bool isEncrypted = false; bool isEncrypted = false;
subpacket.SetTargetId(owner.sessionId); subpacket.SetTargetId(owner.sessionId);

View File

@ -0,0 +1,28 @@
require("global");
properties = {
permissions = 0,
parameters = "sss",
description =
[[
Plays animation on target.
!playanimation <animType> <modelAnim> <effectId>
]],
}
function onTrigger(player, argc, animType, modelAnim, effectId)
local sender = "[battleaction] ";
local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
if player and actor then
aid = tonumber(animType) or 0
mid = tonumber(modelAnim) or 0
eid = tonumber(effectId) or 0
local id = bit32.lshift(aid, 24);
id = bit32.bor(id, bit32.lshift(mid, 12));
id = bit32.bor(id, eid)
actor:PlayAnimation(id)
else
print(sender.."unable to add experience, ensure player name is valid.");
end;
end;

View File

@ -12,7 +12,7 @@ yolo
local modelIds = local modelIds =
{ {
["titan"] = 2107401, ["titan"] = 2107401,
["ifrit"] = 2107302, ["ifrit"] = 2207302,
["ifrithotair"] = 2207310, ["ifrithotair"] = 2207310,
["nail"] = 2207307, ["nail"] = 2207307,
["garuda"] = 2209501, ["garuda"] = 2209501,