renamed tables for consistency

- added magic.lua (todo: enumerate modifiers and stuff)
- moved aggro handling to session position update
- some cleanup
This commit is contained in:
Tahir Akhlaq
2017-08-29 01:15:12 +01:00
parent 6c74222b68
commit f4016e1a12
25 changed files with 539 additions and 442 deletions

View File

@@ -1894,7 +1894,7 @@ namespace FFXIVClassic_Map_Server.Actors
charaWork.commandCategory[trueHotbarSlot] = 1;
//Set recast time
ushort maxRecastTime = (ushort)Server.GetWorldManager().GetAbility(commandId).recastTimeSeconds;
ushort maxRecastTime = (ushort)Server.GetWorldManager().GetBattleCommand(commandId).recastTimeSeconds;
uint recastEnd = Utils.UnixTimeStampUTC() + maxRecastTime;
charaWork.parameterTemp.maxCommandRecastTime[trueHotbarSlot - charaWork.commandBorder] = maxRecastTime;
charaWork.parameterSave.commandSlot_recastTime[trueHotbarSlot - charaWork.commandBorder] = recastEnd;
@@ -2064,23 +2064,20 @@ namespace FFXIVClassic_Map_Server.Actors
return true;
}
public override void OnAttack(State state, BattleAction action)
public override void OnAttack(State state, BattleAction action, ref SubPacket errorPacket)
{
// melee attack animation
uint battleAnimation = 0x19001000;
// todo: change animation based on equipped weapon
action.effectId |= (uint)HitEffect.HitVisual1; // melee
// todo: get hitrate and shit, handle protect effect and whatever
BattleUtils.TryAttack(this, state.GetTarget(), action);
action.amount = BattleUtils.CalculateAttackDamage(this, state.GetTarget(), action);
//var packet = BattleActionX01Packet.BuildPacket(owner.actorId, owner.actorId, target.actorId, (uint)0x19001000, (uint)0x8000604, (ushort)0x765D, (ushort)BattleActionX01PacketCommand.Attack, (ushort)damage, (byte)0x1);
zone.BroadcastPacketAroundActor(this, BattleActionX01Packet.BuildPacket(actorId, actorId, action.targetId, (uint)battleAnimation,
0x8000000 | action.effectId, (ushort)action.worldMasterTextId, (ushort)BattleActionX01PacketCommand.Attack, (ushort)action.amount, (byte)action.param)
);
base.OnAttack(state, action, ref errorPacket);
if (errorPacket == null)
{
// melee attack animation
action.animation = 0x19001000;
}
var target = state.GetTarget();
//if (target is BattleNpc)
{
((BattleNpc)target).hateContainer.UpdateHate(this, action.amount);
}
}
}
}