Combat fixes and additions

Add default status gain and loss ids for status effects so buffs and
debuffs can have different ids.
Add sleep, slow, and slowcast

Fix sacred prism not slowing casts
Fix some incorrect text ids in battle commands
This commit is contained in:
Yogurt 2019-06-05 18:57:21 -07:00
parent 8ba3c195f2
commit 2e906ae090
12 changed files with 166 additions and 112 deletions

View file

@ -2303,7 +2303,7 @@ namespace FFXIVClassic_Map_Server
{
conn.Open();
var query = @"SELECT id, name, flags, overwrite, tickMs, hidden, silentOnGain, silentOnLoss FROM server_statuseffects;";
var query = @"SELECT id, name, flags, overwrite, tickMs, hidden, silentOnGain, silentOnLoss, statusGainTextId, statusLossTextId FROM server_statuseffects;";
MySqlCommand cmd = new MySqlCommand(query, conn);
@ -2319,8 +2319,10 @@ namespace FFXIVClassic_Map_Server
var hidden = reader.GetBoolean("hidden");
var silentOnGain = reader.GetBoolean("silentOnGain");
var silentOnLoss = reader.GetBoolean("silentOnLoss");
var statusGainTextId = reader.GetUInt16("statusGainTextId");
var statusLossTextId = reader.GetUInt16("statusLossTextId");
var effect = new StatusEffect(id, name, flags, overwrite, tickMs, hidden, silentOnGain, silentOnLoss);
var effect = new StatusEffect(id, name, flags, overwrite, tickMs, hidden, silentOnGain, silentOnLoss, statusGainTextId, statusLossTextId);
lua.LuaEngine.LoadStatusEffectScript(effect);
effects.Add(id, effect);

View file

@ -404,8 +404,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
private bool silentOnGain = false; //Whether a message is sent when the status is gained
private bool silentOnLoss = false; //Whether a message is sent when the status is lost
private bool hidden = false; //Whether this status is shown. Used for things that aren't really status effects like exp chains and procs
private ushort statusGainTextId; //The text id used when the status is gained
private ushort statusLossTextId; //The text id used when the status effect falls off when its time runs out
private ushort statusGainTextId = 30328; //The text id used when the status is gained. 30328: [Command] grants you the effect of [status] (Used for buffs)
private ushort statusLossTextId = 30331; //The text id used when the status effect falls off when its time runs out. 30331: You are no longer under the effect of [status] (Used for buffs)
public LuaScript script;
HitEffect animationEffect;
@ -448,7 +448,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
this.hidden = effect.hidden;
}
public StatusEffect(uint id, string name, uint flags, uint overwrite, uint tickMs, bool hidden, bool silentOnGain, bool silentOnLoss)
public StatusEffect(uint id, string name, uint flags, uint overwrite, uint tickMs, bool hidden, bool silentOnGain, bool silentOnLoss, ushort statusGainTextId, ushort statusLossTextId)
{
this.id = (StatusEffectId)id;
this.name = name;
@ -458,6 +458,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
this.hidden = hidden;
this.silentOnGain = silentOnGain;
this.silentOnLoss = silentOnLoss;
this.statusGainTextId = statusGainTextId;
this.statusLossTextId = statusLossTextId;
}
// return true when duration has elapsed
@ -579,7 +581,6 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
public ushort GetStatusGainTextId()
{
return 30328;
return statusGainTextId;
}

View file

@ -57,7 +57,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
// remove effects from this list
foreach (var effect in removeEffects)
{
RemoveStatusEffect(effect, resultContainer);
RemoveStatusEffect(effect, resultContainer, effect.GetStatusLossTextId());
}
resultContainer.CombineLists();
@ -113,6 +113,11 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
{
var se = Server.GetWorldManager().GetStatusEffect(id);
if (se != null)
{
worldmasterTextId = se.GetStatusGainTextId();
}
return AddStatusEffect(se, owner, actionContainer, worldmasterTextId);
}
@ -120,7 +125,11 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
{
var se = Server.GetWorldManager().GetStatusEffect(id);
se.SetTier(tier);
if (se != null)
{
se.SetTier(tier);
worldmasterTextId = se.GetStatusGainTextId();
}
return AddStatusEffect(se, owner, actionContainer, worldmasterTextId);
}
@ -129,8 +138,12 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
{
var se = Server.GetWorldManager().GetStatusEffect(id);
se.SetMagnitude(magnitude);
se.SetTier(tier);
if (se != null)
{
se.SetMagnitude(magnitude);
se.SetTier(tier);
worldmasterTextId = se.GetStatusGainTextId();
}
return AddStatusEffect(se, owner, actionContainer, worldmasterTextId);
}
@ -138,10 +151,12 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
public bool AddStatusEffect(uint id, byte tier, double magnitude, uint duration, int tickMs, CommandResultContainer actionContainer = null, ushort worldmasterTextId = 30328)
{
var se = Server.GetWorldManager().GetStatusEffect(id);
if (se != null)
{
se.SetDuration(duration);
se.SetOwner(owner);
worldmasterTextId = se.GetStatusGainTextId();
}
return AddStatusEffect(se ?? new StatusEffect(this.owner, id, magnitude, 3000, duration, tier), owner, actionContainer, worldmasterTextId);
}

View file

@ -701,7 +701,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.utils
{
//If we need an extra action to show the status text
if (isAdditional)
results.AddAction(target.actorId, 30328, skill.statusId | (uint) HitEffect.StatusEffectType);
results.AddAction(target.actorId, effect.GetStatusGainTextId(), skill.statusId | (uint) HitEffect.StatusEffectType);
}
else
action.worldMasterTextId = 32002;//Is this right?