Skip to content

Commit

Permalink
suppress enchantment projectile hit messages from cloak procs (#3873)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmriggs authored Jul 13, 2022
1 parent ce782ce commit 3d5ff41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/ACE.Server/WorldObjects/SpellProjectile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public override void OnCollideObject(WorldObject target)
if (Spell.MetaSpellType == ACE.Entity.Enum.SpellType.EnchantmentProjectile)
{
// handle EnchantmentProjectile successfully landing on target
ProjectileSource.CreateEnchantment(creatureTarget, ProjectileSource, ProjectileLauncher, Spell);
ProjectileSource.CreateEnchantment(creatureTarget, ProjectileSource, ProjectileLauncher, Spell, false, FromProc);
}
else
{
Expand Down
10 changes: 9 additions & 1 deletion Source/ACE.Server/WorldObjects/WorldObject_Magic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ protected void DoSpellEffects(Spell spell, WorldObject caster, WorldObject targe
/// Handles casting SpellType.Enchantment / FellowEnchantment spells
/// this is also called if SpellType.EnchantmentProjectile successfully hits
/// </summary>
public void CreateEnchantment(WorldObject target, WorldObject caster, WorldObject weapon, Spell spell, bool equip = false)
public void CreateEnchantment(WorldObject target, WorldObject caster, WorldObject weapon, Spell spell, bool equip = false, bool fromProc = false)
{
// weird itemCaster -> caster collapsing going on here -- fixme

Expand All @@ -393,6 +393,14 @@ public void CreateEnchantment(WorldObject target, WorldObject caster, WorldObjec
cloakProc = true;
}
}
else if (fromProc)
{
// fromProc is assumed to be cloakProc currently
// todo: change fromProc from bool to WorldObject
// do we need separate concepts for itemCaster and fromProc objects?
caster = this;
cloakProc = true;
}

// create enchantment
var addResult = target.EnchantmentManager.Add(spell, caster, weapon, equip);
Expand Down

0 comments on commit 3d5ff41

Please sign in to comment.