Misc fixes/missed stuff

This commit is contained in:
hondacrx
2021-12-27 18:11:38 -05:00
parent 1dbe035242
commit 74133edce1
6 changed files with 20 additions and 74 deletions
-1
View File
@@ -487,7 +487,6 @@ namespace Framework.Constants
Unattackable = InFlight,
Moving = RoamingMove | ConfusedMove | FleeingMove | ChaseMove | FollowMove,
Controlled = Confused | Stunned | Fleeing,
CantClientControl = Charmed | Fleeing | Confused | Possessed,
LostControl = Controlled | Possessed | Jumping | Charging,
CannotAutoattack = Controlled | Charging | Casting,
Sightless = LostControl | Evade,
+1 -1
View File
@@ -311,7 +311,7 @@ namespace Game
return eventId;
}
void FreeInviteId(ulong id)
public void FreeInviteId(ulong id)
{
if (id == _maxInviteId)
--_maxInviteId;
+2 -2
View File
@@ -7393,8 +7393,8 @@ namespace Game.Entities
}
}
public Gender GetNativeGender() { return (Gender)(byte)m_playerData.NativeSex; }
public void SetNativeGender(Gender sex) { SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.NativeSex), (byte)sex); }
public override Gender GetNativeGender() { return (Gender)(byte)m_playerData.NativeSex; }
public override void SetNativeGender(Gender sex) { SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.NativeSex), (byte)sex); }
public void SetPvpTitle(byte pvpTitle) { SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.PvpTitle), pvpTitle); }
public void SetArenaFaction(byte arenaFaction) { SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.ArenaFaction), arenaFaction); }
public void ApplyModFakeInebriation(int mod, bool apply) { ApplyModUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.FakeInebriation), mod, apply); }
+1 -14
View File
@@ -921,17 +921,10 @@ namespace Game.Entities
if (vehicle.GetBase().IsCreature())
{
// If a player entered a vehicle that is part of a formation, remove it from said formation and replace current movement generator with MoveIdle (no movement)
// If a player entered a vehicle that is part of a formation, remove it from said formation
CreatureGroup creatureGroup = vehicle.GetBase().ToCreature().GetFormation();
if (creatureGroup != null)
{
creatureGroup.RemoveMember(vehicle.GetBase().ToCreature());
vehicle.GetBase().GetMotionMaster().MoveIdle();
}
// If the vehicle has the random movement generator active, replace it with MoveIdle (no movement) so it won't override player control
if (vehicle.GetBase().GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Random)
vehicle.GetBase().GetMotionMaster().MoveIdle();
}
}
@@ -1040,14 +1033,8 @@ namespace Game.Entities
GetMotionMaster().LaunchMoveSpline(init, EventId.VehicleExit, MovementGeneratorPriority.Highest);
if (player != null)
{
player.ResummonPetTemporaryUnSummonedIfAny();
// When a player exits a creature vehicle, restore its default motion generator (if any)
if (vehicle.GetBase().IsCreature())
vehicle.GetBase().GetMotionMaster().InitializeDefault();
}
if (vehicle.GetBase().HasUnitTypeMask(UnitTypeMask.Minion) && vehicle.GetBase().IsTypeId(TypeId.Unit))
if (((Minion)vehicle.GetBase()).GetOwner() == this)
vehicle.GetBase().ToCreature().DespawnOrUnsummon(vehicle.GetDespawnDelay());
+2 -56
View File
@@ -639,34 +639,7 @@ namespace Game.Maps
{
var playerList = instance.GetPlayers();
foreach (var player in playerList)
{
player.RemoveAurasDueToSpell(spell);
if (!includePets)
continue;
for (byte i = 0; i < SharedConst.MaxSummonSlot; ++i)
{
ObjectGuid summonGUID = player.m_SummonSlot[i];
if (!summonGUID.IsEmpty())
{
Creature summon = instance.GetCreature(summonGUID);
if (summon != null)
summon.RemoveAurasDueToSpell(spell);
}
}
if (!includeControlled)
continue;
for (var i = 0; i < player.m_Controlled.Count; ++i)
{
Unit controlled = player.m_Controlled[i];
if (controlled != null)
if (controlled.IsInWorld && controlled.IsCreature())
controlled.RemoveAurasDueToSpell(spell);
}
}
DoRemoveAurasDueToSpellOnPlayer(player, spell, includePets, includeControlled);
}
public void DoRemoveAurasDueToSpellOnPlayer(Player player, uint spell, bool includePets = false, bool includeControlled = false)
@@ -707,34 +680,7 @@ namespace Game.Maps
{
var playerList = instance.GetPlayers();
foreach (var player in playerList)
{
player.CastSpell(player, spell, true);
if (!includePets)
continue;
for (var i = 0; i < SharedConst.MaxSummonSlot; ++i)
{
ObjectGuid summonGUID = player.m_SummonSlot[i];
if (!summonGUID.IsEmpty())
{
Creature summon = instance.GetCreature(summonGUID);
if (summon != null)
summon.CastSpell(player, spell, true);
}
}
if (!includeControlled)
continue;
for (var i = 0; i < player.m_Controlled.Count; ++i)
{
Unit controlled = player.m_Controlled[i];
if (controlled != null)
if (controlled.IsInWorld && controlled.IsCreature())
controlled.CastSpell(player, spell, true);
}
}
DoCastSpellOnPlayer(player, spell, includePets, includeControlled);
}
public void DoCastSpellOnPlayer(Player player, uint spell, bool includePets = false, bool includeControlled = false)
+14
View File
@@ -3543,6 +3543,7 @@ namespace Game.Entities
});
ApplySpellFix(new[] {
15538, // Gout of Flame
42490, // Energized!
42492, // Cast Energized
43115 // Plague Vial
@@ -3656,6 +3657,12 @@ namespace Game.Entities
spellInfo.RecoveryTime = 20000;
});
// Summon Frigid Bones
ApplySpellFix(new[] { 53525 }, spellInfo =>
{
spellInfo.DurationEntry = CliDB.SpellDurationStorage.LookupByKey(4); // 2 minutes
});
//
// VIOLET HOLD SPELLS
//
@@ -4260,6 +4267,13 @@ namespace Game.Entities
spellInfo.AttributesEx3 |= SpellAttr3.NoInitialAggro;
});
// Spore - Spore Visual
ApplySpellFix(new[] { 42525 }, spellInfo =>
{
spellInfo.AttributesEx3 |= SpellAttr3.DeathPersistent;
spellInfo.AttributesEx2 |= SpellAttr2.CanTargetDead;
});
//
// FIRELANDS SPELLS
//