mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-11 06:54:43 +02:00
Bug fixes
Fixed some bugs with targeting flags Fixed action equip bug for real this time Fixed server crash when commands hit no targets
This commit is contained in:
parent
0f7e6f359d
commit
79f2edf406
7 changed files with 46 additions and 39 deletions
|
@ -1274,6 +1274,7 @@ namespace FFXIVClassic_Map_Server
|
|||
}
|
||||
public static void EquipAbility(Player player, byte classId, ushort hotbarSlot, uint commandId, uint recastTime)
|
||||
{
|
||||
commandId ^= 0xA0F00000;
|
||||
if (commandId > 0)
|
||||
{
|
||||
using (MySqlConnection conn = new MySqlConnection(
|
||||
|
|
|
@ -1098,7 +1098,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
else
|
||||
{
|
||||
actions.AddAction(new BattleAction(target.actorId, 30202, 0));
|
||||
actions.AddAction(new BattleAction(actorId, 30202, 0));
|
||||
}
|
||||
|
||||
//Now that we know if we hit the target we can check if the combo continues
|
||||
|
@ -1109,6 +1109,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
player.SetCombos();
|
||||
|
||||
BattleAction error = new BattleAction(actorId, 0, 0);
|
||||
DelMP(command.CalculateMpCost(this));
|
||||
DelTP(command.CalculateTpCost(this));
|
||||
actions.CombineLists();
|
||||
DoBattleAction(command.id, command.battleAnimation, actions.GetList());
|
||||
}
|
||||
|
|
|
@ -101,11 +101,11 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
|||
return effects.ContainsKey((uint)id);
|
||||
}
|
||||
|
||||
public BattleAction AddStatusForBattleAction(uint id, byte tier = 1)
|
||||
public BattleAction AddStatusForBattleAction(uint id, byte tier = 1, ulong magnitude = 0, uint duration = 0)
|
||||
{
|
||||
BattleAction action = null;
|
||||
|
||||
if (AddStatusEffect(id, tier))
|
||||
if (AddStatusEffect(id, tier, magnitude, duration))
|
||||
action = new BattleAction(owner.actorId, 30328, id | (uint)HitEffect.StatusEffectType);
|
||||
|
||||
return action;
|
||||
|
|
|
@ -356,29 +356,34 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
|||
if (target == null || !retarget && targets.Contains(target))
|
||||
return false;
|
||||
|
||||
if ((validTarget & ValidTarget.Player) != 0 && target is Player)
|
||||
return true;
|
||||
|
||||
if ((validTarget & ValidTarget.PartyMember) != 0 && target.currentParty == owner.currentParty)
|
||||
return true;
|
||||
|
||||
// cant target dead
|
||||
if ((validTarget & ValidTarget.Corpse) == 0 && target.IsDead())
|
||||
//This skill can't be used on self and target is self, return false
|
||||
if ((validTarget & ValidTarget.Self) == 0 && target == owner)
|
||||
return false;
|
||||
|
||||
//This skill can't be used on NPCs and target is an NPC, return false
|
||||
if ((validTarget & ValidTarget.NPC) == 0 && target.isStatic)
|
||||
return false;
|
||||
|
||||
//This skill must be used on Allies and target is not an ally, return false
|
||||
if ((validTarget & ValidTarget.Ally) != 0 && target.allegiance != owner.allegiance)
|
||||
return false;
|
||||
|
||||
//This skill can't be used on players and target is a player, return false
|
||||
//Do we need a player flag? Ally/Enemy flags probably serve the same purpose
|
||||
//if ((validTarget & ValidTarget.Player) == 0 && target is Player)
|
||||
//return false;
|
||||
|
||||
|
||||
//This skill must be used on enemies an target is not an enemy
|
||||
if ((validTarget & ValidTarget.Enemy) != 0 && target.allegiance == owner.allegiance)
|
||||
return false;
|
||||
|
||||
if (((validTarget & ValidTarget.PartyMember) == 0) && ((validTarget & ValidTarget.Self) == 0) && target.currentParty == owner.currentParty)
|
||||
return false;
|
||||
|
||||
//This skill must be used on a party member and target is not in owner's party, return false
|
||||
if ((validTarget & ValidTarget.PartyMember) != 0 && target.currentParty != owner.currentParty)
|
||||
return false;
|
||||
|
||||
if ((validTarget & ValidTarget.NPC) != 0 && target.isStatic)
|
||||
//This skill must be used on a corpse and target is alive, return false
|
||||
if ((validTarget & ValidTarget.CorpseOnly) != 0 && target.IsAlive())
|
||||
return false;
|
||||
|
||||
// todo: why is player always zoning?
|
||||
|
@ -395,14 +400,11 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
|||
if (validTarget == ValidTarget.Self && aoeType == TargetFindAOEType.None && owner != target)
|
||||
return false;
|
||||
|
||||
if ((validTarget & ValidTarget.Self) == 0 && target == owner)
|
||||
return false;
|
||||
|
||||
// this is fuckin retarded, think of a better way l8r
|
||||
if (!ignoreAOE)
|
||||
{
|
||||
// hit everything within zone or within aoe region
|
||||
if (maxDistance == -1.0f || aoeType == TargetFindAOEType.Circle && !IsWithinCircle(target, maxDistance))
|
||||
if (param == -1.0f || aoeType == TargetFindAOEType.Circle && !IsWithinCircle(target, param))
|
||||
return false;
|
||||
|
||||
if (aoeType == TargetFindAOEType.Cone && !IsWithinCone(target, withPet))
|
||||
|
|
|
@ -640,6 +640,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.utils
|
|||
effect.SetTier(skill.statusTier);
|
||||
effect.SetMagnitude(skill.statusMagnitude);
|
||||
effect.SetOwner(target);
|
||||
effect.SetSource(caster);
|
||||
|
||||
if (target.statusEffects.AddStatusEffect(effect, caster))
|
||||
{
|
||||
//If we need an extra action to show the status text
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
|||
|
||||
binWriter.Seek(0xAA, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((Byte)actionList[listOffset + i].hitNum);
|
||||
binWriter.Write((Byte) actionList[listOffset + i].hitNum);
|
||||
|
||||
listOffset += max;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue