mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
Combat additions
Added formulas for base EXP gain and chain experience Added basic scripts for most player abilities and effects Added stat gains for some abilities Changed status flags Fixed bug with player death Fixed bug where auto attacks didnt work when not locked on Added traits
This commit is contained in:
@@ -32,9 +32,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
||||
|
||||
public override bool Update(DateTime tick)
|
||||
{
|
||||
|
||||
if ((target == null || owner.target != target || owner.target?.actorId != owner.currentLockedTarget) && owner.isAutoAttackEnabled)
|
||||
owner.aiContainer.ChangeTarget(target = owner.zone.FindActorInArea<Character>(owner.currentLockedTarget));
|
||||
owner.aiContainer.ChangeTarget(target = owner.zone.FindActorInArea<Character>(owner.currentTarget));
|
||||
|
||||
if (target == null || target.IsDead())
|
||||
{
|
||||
@@ -101,25 +100,30 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
||||
// handle paralyze/intimidate/sleep/whatever in Character.OnAttack
|
||||
|
||||
|
||||
List<BattleAction> actions = new List<BattleAction>();
|
||||
// todo: Change this to use a BattleCommand like the other states
|
||||
|
||||
//List<BattleAction> actions = new List<BattleAction>();
|
||||
BattleActionContainer actions = new BattleActionContainer();
|
||||
target.SetMod((uint) Modifier.MinimumHpLock, 0);
|
||||
|
||||
var i = 0;
|
||||
for (int hitNum = 0; hitNum < owner.GetMod((uint) Modifier.HitCount); hitNum++)
|
||||
for (int hitNum = 0; hitNum < 1 /* owner.GetMod((uint) Modifier.HitCount)*/; hitNum++)
|
||||
{
|
||||
BattleAction action = new BattleAction(target.actorId, 0x765D, (uint)HitEffect.Hit, 100, (byte)HitDirection.None, (byte) hitNum);
|
||||
action.battleActionType = BattleActionType.AttackPhysical;
|
||||
action.commandType = CommandType.AutoAttack;
|
||||
action.actionType = ActionType.Physical;
|
||||
action.actionProperty = (ActionProperty) owner.GetMod(Modifier.AttackType);
|
||||
// evasion, miss, dodge, etc to be handled in script, calling helpers from scripts/weaponskills.lua
|
||||
// temporary evade/miss/etc function to test hit effects
|
||||
utils.BattleUtils.CalcHitType(owner, target, null, action);
|
||||
actions.AddRange(action.GetAllActions());
|
||||
action.DoAction(owner, target, null, actions);
|
||||
}
|
||||
|
||||
// todo: this is fuckin stupid, probably only need *one* error packet, not an error for each action
|
||||
BattleAction[] errors = (BattleAction[])actions.ToArray().Clone();
|
||||
|
||||
owner.OnAttack(this, actions[0], ref errorResult);
|
||||
owner.DoBattleAction(22104, 0x19001000, actions);
|
||||
target.SetMod((uint) Modifier.MinimumHpLock, 0);
|
||||
BattleAction[] errors = (BattleAction[])actions.GetList().ToArray().Clone();
|
||||
BattleAction error = null;// new BattleAction(0, null, 0, 0);
|
||||
//owner.DoActions(null, actions.GetList(), ref error);
|
||||
//owner.OnAttack(this, actions[0], ref errorResult);
|
||||
owner.DoBattleAction(22104, 0x19001000, actions.GetList());
|
||||
}
|
||||
|
||||
public override void TryInterrupt()
|
||||
@@ -148,7 +152,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
||||
|
||||
private bool CanAttack()
|
||||
{
|
||||
if (!owner.isAutoAttackEnabled)
|
||||
if (!owner.isAutoAttackEnabled || target.allegiance == owner.allegiance)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user