Add new hit effect flag for hit effects that only show animations

Fix SetMP setting MaxMP instead of MP

Fix substate updates not being sent
This commit is contained in:
Yogurt 2019-06-01 02:10:40 -07:00
parent e00bb48386
commit 97dcd765eb
5 changed files with 32 additions and 2 deletions

View File

@ -393,7 +393,7 @@ namespace FFXIVClassic_Map_Server.Actors
if ((updateFlags & ActorUpdateFlags.SubState) != 0) if ((updateFlags & ActorUpdateFlags.SubState) != 0)
{ {
//packets.Add(SetActorSubStatePacket.BuildPacket(actorId, currentSubState)); packets.Add(SetActorSubStatePacket.BuildPacket(actorId, currentSubState));
//packets.Add(CommandResultX00Packet.BuildPacket(actorId, 0x72000062, 0)); //packets.Add(CommandResultX00Packet.BuildPacket(actorId, 0x72000062, 0));
//packets.Add(CommandResultX01Packet.BuildPacket(actorId, 0x7C000062, 21001, new CommandResult(actorId, 0, 1))); //packets.Add(CommandResultX01Packet.BuildPacket(actorId, 0x7C000062, 21001, new CommandResult(actorId, 0, 1)));
@ -614,7 +614,7 @@ namespace FFXIVClassic_Map_Server.Actors
public void SetMP(uint mp) public void SetMP(uint mp)
{ {
charaWork.parameterSave.mpMax = (short)mp; charaWork.parameterSave.mp = (short)mp;
if (mp > charaWork.parameterSave.mpMax) if (mp > charaWork.parameterSave.mpMax)
SetMaxMP(mp); SetMaxMP(mp);

View File

@ -464,6 +464,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.utils
FinishActionStatus(caster, target, skill, action, actionContainer); FinishActionStatus(caster, target, skill, action, actionContainer);
break; break;
default: default:
action.effectId = (uint) HitEffect.AnimationEffectType;
actionContainer.AddAction(action); actionContainer.AddAction(action);
break; break;
} }

View File

@ -24,6 +24,8 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle
MagicEffectType = 48 << 24, MagicEffectType = 48 << 24,
//This places the number on the user regardless of the target this hit effect is for, used for things like bloodbath //This places the number on the user regardless of the target this hit effect is for, used for things like bloodbath
SelfHealType = 72 << 24, SelfHealType = 72 << 24,
//Plays the effect animation with no text or additional effects. Unsure if there are any flags. Used for things like Convert
AnimationEffectType = 96 << 24,
//Each Type has it's own set of flags. These should be split into their own enums, //Each Type has it's own set of flags. These should be split into their own enums,
//but for now just keep them all under HitEffect so we don't have to change anything. //but for now just keep them all under HitEffect so we don't have to change anything.

View File

@ -0,0 +1,5 @@
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.actorId, targetActor);
player:endEvent();
end

View File

@ -0,0 +1,22 @@
require("global");
require("magic");
require("battleutils");
function onMagicPrepare(caster, target, spell)
if not target.statusEffects.HasStatusEffectsByFlag(StatusEffectFlags.LoseOnDeath) then
return -1
end
return 0;
end;
function onMagicStart(caster, target, spell)
return 0;
end;
function onSkillFinish(caster, target, skill, action, actionContainer)
removeEffect = target.statusEffects.GetRandomEffectByFlag(StatusEffectFlags.LoseOnDeath)
target.statusEffects.RemoveStatusEffect(removeEffect, actionContainer, 30331);
end;