Ports from (https://github.com/TrinityCore/TrinityCore)
Core/Unit: don't clear low health aura states on death Core/Gossip: Fix gossip bug on modify money Core/Spells: Change the radius of PBAoEs following the feedback received on Core/Player: update interaction checks, some info taken from client Core/Spell: abort channeling if no valid targets are found after searching Core/Creature: fix _DespawnAtEvade saving wrong respawn time Core/Spell: fixed some problems with per caster aura states Quickfix a bug introduced by 2f19d97 which prevented GTAoE from being cast. Core/SmartAI: allow SMART_ACTION_SEND_GOSSIP_MENU to override default gossip Core/Spell: in case of immunity, check all effects to choose correct procFlags, as none has technically hit Fix evade issues when a spell hits the target just before evading. Scripts/Command: implement .debug play music command Partial revert, Unit::getAttackerForHelper() shouldn't return units that we aren't in combat with (victim can be such a unit for players/player pets, which can startattack from a distance without entering combat). Fix an issue where CanSpawn would never get invoked on creatures without per-guid script. Core/Players: fix null dereference crash
This commit is contained in:
@@ -1695,27 +1695,34 @@ namespace Game.Entities
|
||||
{
|
||||
if (timeMSToDespawn != 0)
|
||||
{
|
||||
ForcedDespawnDelayEvent pEvent = new ForcedDespawnDelayEvent(this, forceRespawnTimer);
|
||||
|
||||
m_Events.AddEvent(pEvent, m_Events.CalculateTime(timeMSToDespawn));
|
||||
m_Events.AddEvent(new ForcedDespawnDelayEvent(this, forceRespawnTimer), m_Events.CalculateTime(timeMSToDespawn));
|
||||
return;
|
||||
}
|
||||
|
||||
uint corpseDelay = GetCorpseDelay();
|
||||
uint respawnDelay = GetRespawnDelay();
|
||||
|
||||
// do it before killing creature
|
||||
DestroyForNearbyPlayers();
|
||||
|
||||
bool overrideRespawnTime = false;
|
||||
if (IsAlive())
|
||||
SetDeathState(DeathState.JustDied);
|
||||
|
||||
bool overrideRespawnTime = true;
|
||||
if (forceRespawnTimer > TimeSpan.Zero)
|
||||
{
|
||||
SetRespawnTime((uint)forceRespawnTimer.TotalSeconds);
|
||||
overrideRespawnTime = false;
|
||||
if (forceRespawnTimer > TimeSpan.Zero)
|
||||
{
|
||||
SetCorpseDelay(0);
|
||||
SetRespawnDelay((uint)forceRespawnTimer.TotalSeconds);
|
||||
overrideRespawnTime = false;
|
||||
}
|
||||
|
||||
SetDeathState(DeathState.JustDied);
|
||||
}
|
||||
|
||||
// Skip corpse decay time
|
||||
RemoveCorpse(overrideRespawnTime, false);
|
||||
|
||||
SetCorpseDelay(corpseDelay);
|
||||
SetRespawnDelay(respawnDelay);
|
||||
}
|
||||
|
||||
public void DespawnOrUnsummon(TimeSpan time, TimeSpan forceRespawnTimer = default) { DespawnOrUnsummon((uint)time.TotalMilliseconds, forceRespawnTimer); }
|
||||
@@ -2060,14 +2067,9 @@ namespace Game.Entities
|
||||
Unit targetVictim = target.GetAttackerForHelper();
|
||||
|
||||
// if I'm already fighting target, or I'm hostile towards the target, the target is acceptable
|
||||
if (GetVictim() == target || IsHostileTo(target))
|
||||
if (IsInCombatWith(target) || IsHostileTo(target))
|
||||
return true;
|
||||
|
||||
// a player is targeting me, but I'm not hostile towards it, and not currently attacking it, the target is not acceptable
|
||||
// (players may set their victim from a distance, and doesn't mean we should attack)
|
||||
if (target.GetTypeId() == TypeId.Player && targetVictim == this)
|
||||
return false;
|
||||
|
||||
// if the target's victim is friendly, and the target is neutral, the target is acceptable
|
||||
if (targetVictim != null && IsFriendlyTo(targetVictim))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user