Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-06-19 14:32:16 +08:00
84 changed files with 3708 additions and 2951 deletions

View File

@@ -7833,19 +7833,17 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
triggered_spell_id = 31803;
// On target with 5 stacks of Holy Vengeance direct damage is done
if (Aura* aur = victim->GetAura(triggered_spell_id, GetGUID()))
{
if (aur->GetStackAmount() == 5)
{
if (stacker)
aur->RefreshDuration();
CastSpell(victim, 42463, true, castItem, triggeredByAura);
return true;
}
}
CastSpell(victim, 42463, true, castItem, triggeredByAura); // Seal of Vengeance
if (!stacker)
return false;
break;
@@ -7866,19 +7864,17 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
triggered_spell_id = 53742;
// On target with 5 stacks of Blood Corruption direct damage is done
if (Aura* aur = victim->GetAura(triggered_spell_id, GetGUID()))
{
if (aur->GetStackAmount() == 5)
{
if (stacker)
aur->RefreshDuration();
CastSpell(victim, 53739, true, castItem, triggeredByAura);
return true;
}
}
CastSpell(victim, 53739, true, castItem, triggeredByAura); // Seal of Corruption
if (!stacker)
return false;
break;
@@ -17051,13 +17047,16 @@ void Unit::RecalculateObjectScale()
SetObjectScale(std::max(scale, scaleMin));
}
void Unit::SetDisplayId(uint32 modelId)
void Unit::SetDisplayId(uint32 modelId, float displayScale /*=1.f*/)
{
SetUInt32Value(UNIT_FIELD_DISPLAYID, modelId);
// Set Gender by modelId
if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId))
SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender);
SetObjectScale(displayScale);
sScriptMgr->OnDisplayIdChange(this, modelId);
}
@@ -21264,17 +21263,11 @@ void Unit::PatchValuesUpdate(ByteBuffer& valuesUpdateBuf, BuildValuesCachePosPoi
{
if (target->IsGameMaster() && target->GetSession()->IsGMAccount())
{
if (cinfo->Modelid1)
displayId = cinfo->Modelid1; // Modelid1 is a visible model for gms
else
displayId = 17519; // world visible trigger's model
displayId = cinfo->GetFirstVisibleModel()->CreatureDisplayID;
}
else
{
if (cinfo->Modelid2)
displayId = cinfo->Modelid2; // Modelid2 is an invisible model for players
else
displayId = 11686; // world invisible trigger's model
displayId = cinfo->GetFirstInvisibleModel()->CreatureDisplayID;
}
}
}