Small fixes

Fixed final message for multi-hit attacks.
Fixed self targeting for commands
Made it so player.lua doesn't skip over home points setting, just the quest setitng.
Began adding knockback effect handling
This commit is contained in:
yogurt
2018-06-25 18:20:20 -05:00
parent 79f2edf406
commit ace4dfe58f
8 changed files with 59 additions and 42 deletions

View File

@@ -75,6 +75,21 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
Spell = 4
}
public enum KnockbackType : ushort
{
None = 0,
Level1 = 1,
Level2 = 2,
Level3 = 3,
Level4 = 4,
Level5 = 5,
Clockwise1 = 6,
Clockwise2 = 7,
CounterClockwise1 = 8,
CounterClockwise2 = 9,
DrawIn = 10
}
class BattleCommand
{
public ushort id;
@@ -121,7 +136,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
public float accuracyModifier; //modifies accuracy
public float bonusCritRate; //extra crit rate
public bool isCombo;
public bool isRanged;
public bool isRanged = false;
public bool actionCrit; //Whether any actions were critical hits, used for Excruciate
@@ -365,28 +380,9 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
return targetFind?.GetTargets<Character>();
}
//Handles setting the correct target for self-targeted spells
public Character GetMainTarget(Character caster, Character target)
{
//If skill can only be used on self
if (mainTarget == ValidTarget.Self)
return caster;
//If skill can only be used on party members and the target is not a party member
else if (((mainTarget & ValidTarget.PartyMember) != 0) && (target.currentParty != caster.currentParty))
return caster;
//If skill can only be used on allys and the target is not an ally
else if (((mainTarget & ValidTarget.Ally) != 0) && (target.allegiance != caster.allegiance))
return caster;
//If skill can only be used on players and the target is not a player
else if (((mainTarget & ValidTarget.Player) != 0) && (!(target is Player)))
return caster;
return target;
}
public ushort GetCommandType()
{
return (ushort) commandType;
}
}
}
}

View File

@@ -129,12 +129,12 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
RoamingSoul = 223111,
Purge = 223112,
Spiritsong = 223113,
Resonance = 223114,
Resonance = 223114, //Old Resonance? Both have the same icons and description
Soughspeak = 223115,
PresenceofMind2 = 223116,
SanguineRite = 223117, //old effect
PunishingBarbs = 223118,
DarkSeal = 223119,
DarkSeal = 223119, //old effect
Emulate = 223120,
ParadigmShift = 223121,
ConcussiveBlowx1 = 223123,
@@ -241,7 +241,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
ShroudofSaints = 223226,
ClericStance = 223227,
BlissfulMind = 223228,
DarkSeal2 = 223229,
DarkSeal2 = 223229, //new effect
Resonance2 = 223230,
Excruciate = 223231,
Necrogenesis = 223232,

View File

@@ -23,7 +23,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
this.skill = Server.GetWorldManager().GetBattleCommand(skillId);
var returnCode = lua.LuaEngine.CallLuaBattleCommandFunction(owner, skill, "ability", "onAbilityPrepare", owner, target, skill);
this.target = skill.GetMainTarget(owner, target);
this.target = target != null ? target : owner;
if (returnCode == 0)
{

View File

@@ -26,7 +26,15 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
this.spell = Server.GetWorldManager().GetBattleCommand(spellId);
var returnCode = lua.LuaEngine.CallLuaBattleCommandFunction(owner, spell, "magic", "onMagicPrepare", owner, target, spell);
this.target = spell.GetMainTarget(owner, target);
//Modify spell based on status effects. Need to do it here because they can modify cast times
List<StatusEffect> effects = owner.statusEffects.GetStatusEffectsByFlag((uint)(StatusEffectFlags.ActivateOnCastStart));
//modify skill based on status effects
//Do this here to allow buffs like Resonance to increase range before checking CanCast()
foreach (var effect in effects)
lua.LuaEngine.CallLuaStatusEffectFunction(owner, effect, "onMagicCast", owner, effect, spell);
this.target = target != null ? target : owner;
if (returnCode == 0 && owner.CanCast(this.target, spell))
{
@@ -65,13 +73,6 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
spell.isCombo = true;
}
//Modify spell based on status effects. Need to do it here because they can modify cast times
List<StatusEffect> effects = owner.statusEffects.GetStatusEffectsByFlag((uint) (StatusEffectFlags.ActivateOnCastStart));
//modify skill based on status effects
foreach (var effect in effects)
lua.LuaEngine.CallLuaStatusEffectFunction(owner, effect, "onMagicCast", owner, effect, spell);
if (!spell.IsInstantCast())
{
// command casting duration

View File

@@ -50,6 +50,21 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.utils
{ HitType.Crit, HitEffect.Crit }
};
public static Dictionary<KnockbackType, HitEffect> KnockbackEffects = new Dictionary<KnockbackType, HitEffect>()
{
{ KnockbackType.None, 0 },
{ KnockbackType.Level1, HitEffect.KnockbackLv1 },
{ KnockbackType.Level2, HitEffect.KnockbackLv2 },
{ KnockbackType.Level3, HitEffect.KnockbackLv3 },
{ KnockbackType.Level4, HitEffect.KnockbackLv4 },
{ KnockbackType.Level5, HitEffect.KnockbackLv5 },
{ KnockbackType.Clockwise1, HitEffect.KnockbackClockwiseLv1 },
{ KnockbackType.Clockwise2, HitEffect.KnockbackClockwiseLv2 },
{ KnockbackType.CounterClockwise1, HitEffect.KnockbackCounterClockwiseLv1 },
{ KnockbackType.CounterClockwise2, HitEffect.KnockbackCounterClockwiseLv2 },
{ KnockbackType.DrawIn, HitEffect.DrawIn }
};
public static Dictionary<byte, ushort> ClassExperienceTextIds = new Dictionary<byte, ushort>()
{
{ 2, 33934 }, //Pugilist