Core: Update to 10.1.5
Port From (https://github.com/TrinityCore/TrinityCore/commit/0cea730fa23473a85c47451c3bd13df816f2b6e4)
This commit is contained in:
@@ -4841,7 +4841,7 @@ namespace Game.Spells
|
||||
return;
|
||||
|
||||
if (apply)
|
||||
target.ToPlayer().GetSession().SendStablePet(target.GetGUID());
|
||||
target.ToPlayer().SetStableMaster(target.GetGUID());
|
||||
|
||||
// client auto close stable dialog at !apply aura
|
||||
}
|
||||
@@ -5959,6 +5959,28 @@ namespace Game.Spells
|
||||
playerTarget.SendMovementSetCollisionHeight(playerTarget.GetCollisionHeight(), UpdateCollisionHeightReason.Force);
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModRequiredMountCapabilityFlags)]
|
||||
void HandleModRequiredMountCapabilityFlags(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
|
||||
return;
|
||||
|
||||
Player playerTarget = aurApp.GetTarget().ToPlayer();
|
||||
if (playerTarget == null)
|
||||
return;
|
||||
|
||||
if (apply)
|
||||
playerTarget.SetRequiredMountCapabilityFlag((byte)GetMiscValue());
|
||||
else
|
||||
{
|
||||
int mountCapabilityFlags = 0;
|
||||
foreach (AuraEffect otherAura in playerTarget.GetAuraEffectsByType(GetAuraType()))
|
||||
mountCapabilityFlags |= otherAura.GetMiscValue();
|
||||
|
||||
playerTarget.ReplaceAllRequiredMountCapabilityFlags((byte)mountCapabilityFlags);
|
||||
}
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.SuppressItemPassiveEffectBySpellLabel)]
|
||||
void HandleSuppressItemPassiveEffectBySpellLabel(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
|
||||
@@ -4829,7 +4829,7 @@ namespace Game.Spells
|
||||
if (m_spellInfo.ExcludeCasterAuraType != 0 && unitCaster.HasAuraType(m_spellInfo.ExcludeCasterAuraType))
|
||||
return SpellCastResult.CasterAurastate;
|
||||
|
||||
if (reqCombat && unitCaster.IsInCombat() && !m_spellInfo.CanBeUsedInCombat())
|
||||
if (reqCombat && unitCaster.IsInCombat() && !m_spellInfo.CanBeUsedInCombat(unitCaster))
|
||||
return SpellCastResult.AffectingCombat;
|
||||
}
|
||||
|
||||
|
||||
@@ -518,9 +518,10 @@ namespace Game.Spells
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CanBeUsedInCombat()
|
||||
public bool CanBeUsedInCombat(Unit caster)
|
||||
{
|
||||
return !HasAttribute(SpellAttr0.NotInCombatOnlyPeaceful);
|
||||
return !HasAttribute(SpellAttr0.NotInCombatOnlyPeaceful)
|
||||
|| (caster.HasAuraType(AuraType.AllowMountInCombat) && HasAura(AuraType.Mounted));
|
||||
}
|
||||
|
||||
public bool IsPositive()
|
||||
@@ -3144,7 +3145,7 @@ namespace Game.Spells
|
||||
}
|
||||
case SpellProcsPerMinuteModType.Race:
|
||||
{
|
||||
if (SharedConst.GetMaskForRace(caster.GetRace()).HasAnyFlag((int)mod.Param))
|
||||
if ((caster.GetRaceMask() & mod.Param) != 0)
|
||||
ppm *= 1.0f + mod.Coeff;
|
||||
break;
|
||||
}
|
||||
@@ -4822,15 +4823,16 @@ namespace Game.Spells
|
||||
new StaticData(SpellEffectImplicitTargetTypes.Explicit, SpellTargetObjectTypes.Unit), // 303 SPELL_EFFECT_CREATE_TRAIT_TREE_CONFIG
|
||||
new StaticData(SpellEffectImplicitTargetTypes.Explicit, SpellTargetObjectTypes.Unit), // 304 SPELL_EFFECT_CHANGE_ACTIVE_COMBAT_TRAIT_CONFIG
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 305 SPELL_EFFECT_305
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 306 SPELL_EFFECT_306
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 306 SPELL_EFFECT_UPDATE_INTERACTIONS
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 307 SPELL_EFFECT_307
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 308 SPELL_EFFECT_308
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 309 SPELL_EFFECT_309
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 308 SPELL_EFFECT_CANCEL_PRELOAD_WORLD
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 309 SPELL_EFFECT_PRELOAD_WORLD
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 310 SPELL_EFFECT_310
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 311 SPELL_EFFECT_311
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 311 SPELL_EFFECT_ENSURE_WORLD_LOADED
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 312 SPELL_EFFECT_312
|
||||
new StaticData(SpellEffectImplicitTargetTypes.Explicit, SpellTargetObjectTypes.Item), // 313 SPELL_EFFECT_313
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 314 SPELL_EFFECT_314
|
||||
new StaticData(SpellEffectImplicitTargetTypes.Explicit, SpellTargetObjectTypes.Item), // 313 SPELL_EFFECT_CHANGE_ITEM_BONUSES_2
|
||||
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 314 SPELL_EFFECT_ADD_SOCKET_BONUS
|
||||
new StaticData(SpellEffectImplicitTargetTypes.Caster, SpellTargetObjectTypes.Unit), // 315 SPELL_EFFECT_LEARN_TRANSMOG_APPEARANCE_FROM_ITEM_MOD_APPEARANCE_GROUP
|
||||
};
|
||||
|
||||
#region Fields
|
||||
|
||||
@@ -8,6 +8,7 @@ using Game.BattleFields;
|
||||
using Game.BattleGrounds;
|
||||
using Game.BattlePets;
|
||||
using Game.DataStorage;
|
||||
using Game.Miscellaneous;
|
||||
using Game.Movement;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
@@ -1987,7 +1988,7 @@ namespace Game.Entities
|
||||
spellArea.questEndStatus = result.Read<uint>(4);
|
||||
spellArea.questEnd = result.Read<uint>(5);
|
||||
spellArea.auraSpell = result.Read<int>(6);
|
||||
spellArea.raceMask = result.Read<ulong>(7);
|
||||
spellArea.raceMask = new RaceMask<ulong>(result.Read<ulong>(7));
|
||||
spellArea.gender = (Gender)result.Read<uint>(8);
|
||||
spellArea.flags = (SpellAreaFlag)result.Read<byte>(9);
|
||||
|
||||
@@ -2016,7 +2017,7 @@ namespace Game.Entities
|
||||
continue;
|
||||
if (spellArea.auraSpell != bound.auraSpell)
|
||||
continue;
|
||||
if ((spellArea.raceMask & bound.raceMask) == 0)
|
||||
if ((spellArea.raceMask & bound.raceMask).IsEmpty())
|
||||
continue;
|
||||
if (spellArea.gender != bound.gender)
|
||||
continue;
|
||||
@@ -2107,7 +2108,7 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
if (spellArea.raceMask != 0 && (spellArea.raceMask & SharedConst.RaceMaskAllPlayable) == 0)
|
||||
if (!spellArea.raceMask.IsEmpty() && (spellArea.raceMask & RaceMask.AllPlayable).IsEmpty())
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "Spell {0} listed in `spell_area` have wrong race mask ({1}) requirement", spell, spellArea.raceMask);
|
||||
continue;
|
||||
@@ -4913,7 +4914,7 @@ namespace Game.Entities
|
||||
public uint questStart; // quest start (quest must be active or rewarded for spell apply)
|
||||
public uint questEnd; // quest end (quest must not be rewarded for spell apply)
|
||||
public int auraSpell; // spell aura must be applied for spell apply)if possitive) and it must not be applied in other case
|
||||
public ulong raceMask; // can be applied only to races
|
||||
public RaceMask<ulong> raceMask; // can be applied only to races
|
||||
public Gender gender; // can be applied only to gender
|
||||
public uint questStartStatus; // QuestStatus that quest_start must have in order to keep the spell
|
||||
public uint questEndStatus; // QuestStatus that the quest_end must have in order to keep the spell (if the quest_end's status is different than this, the spell will be dropped)
|
||||
@@ -4926,8 +4927,8 @@ namespace Game.Entities
|
||||
if (player == null || gender != player.GetNativeGender())
|
||||
return false;
|
||||
|
||||
if (raceMask != 0) // not in expected race
|
||||
if (player == null || !Convert.ToBoolean(raceMask & (ulong)SharedConst.GetMaskForRace(player.GetRace())))
|
||||
if (!raceMask.IsEmpty()) // not in expected race
|
||||
if (player == null || !raceMask.HasRace(player.GetRace()))
|
||||
return false;
|
||||
|
||||
if (areaId != 0) // not in expected zone
|
||||
|
||||
Reference in New Issue
Block a user