Core/Misc: Implemented GetObjectScale function
This commit is contained in:
@@ -119,7 +119,7 @@ bool GameObjectModel::initialize(const GameObject& go, const GameObjectDisplayIn
|
||||
//ID = 0;
|
||||
iPos = Vector3(go.GetPositionX(), go.GetPositionY(), go.GetPositionZ());
|
||||
phasemask = go.GetPhaseMask();
|
||||
iScale = go.GetFloatValue(OBJECT_FIELD_SCALE_X);
|
||||
iScale = go.GetObjectScale();
|
||||
iInvScale = 1.f / iScale;
|
||||
|
||||
G3D::Matrix3 iRotation = G3D::Matrix3::fromEulerAnglesZYX(go.GetOrientation(), 0, 0);
|
||||
|
||||
@@ -2631,7 +2631,7 @@ void Creature::SetDisplayId(uint32 modelId)
|
||||
|
||||
if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId))
|
||||
{
|
||||
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius * GetFloatValue(OBJECT_FIELD_SCALE_X));
|
||||
SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach * GetFloatValue(OBJECT_FIELD_SCALE_X));
|
||||
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius * GetObjectScale());
|
||||
SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach * GetObjectScale());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ class Object
|
||||
uint32 GetEntry() const { return GetUInt32Value(OBJECT_FIELD_ENTRY); }
|
||||
void SetEntry(uint32 entry) { SetUInt32Value(OBJECT_FIELD_ENTRY, entry); }
|
||||
|
||||
float GetObjectScale() const { return GetFloatValue(OBJECT_FIELD_SCALE_X); }
|
||||
virtual void SetObjectScale(float scale) { SetFloatValue(OBJECT_FIELD_SCALE_X, scale); }
|
||||
|
||||
TypeID GetTypeId() const { return m_objectTypeId; }
|
||||
|
||||
@@ -26302,7 +26302,7 @@ float Player::GetCollisionHeight(bool mounted) const
|
||||
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelId);
|
||||
ASSERT(modelData);
|
||||
|
||||
float scaleMod = GetFloatValue(OBJECT_FIELD_SCALE_X); // 99% sure about this
|
||||
float scaleMod = GetObjectScale(); // 99% sure about this
|
||||
|
||||
return scaleMod * mountModelData->MountHeight + modelData->CollisionHeight * 0.5f;
|
||||
}
|
||||
|
||||
@@ -2069,7 +2069,7 @@ void AuraEffect::HandleAuraModScale(AuraApplication const* aurApp, uint8 mode, b
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
float scale = target->GetFloatValue(OBJECT_FIELD_SCALE_X);
|
||||
float scale = target->GetObjectScale();
|
||||
ApplyPercentModFloatVar(scale, float(GetAmount()), apply);
|
||||
target->SetObjectScale(scale);
|
||||
}
|
||||
@@ -2089,7 +2089,7 @@ void AuraEffect::HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode
|
||||
|
||||
// What must be cloned? at least display and scale
|
||||
target->SetDisplayId(caster->GetDisplayId());
|
||||
//target->SetObjectScale(caster->GetFloatValue(OBJECT_FIELD_SCALE_X)); // we need retail info about how scaling is handled (aura maybe?)
|
||||
//target->SetObjectScale(caster->GetObjectScale()); // we need retail info about how scaling is handled (aura maybe?)
|
||||
target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_MIRROR_IMAGE);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -955,7 +955,7 @@ class spell_putricide_slime_puddle : public SpellScriptLoader
|
||||
|
||||
void ScaleRange(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(ExactDistanceCheck(GetCaster(), 2.5f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X)));
|
||||
targets.remove_if(ExactDistanceCheck(GetCaster(), 2.5f * GetCaster()->GetObjectScale()));
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
|
||||
@@ -2445,12 +2445,12 @@ class spell_the_lich_king_defile : public SpellScriptLoader
|
||||
|
||||
void CorrectRange(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(ExactDistanceCheck(GetCaster(), 10.0f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X)));
|
||||
targets.remove_if(ExactDistanceCheck(GetCaster(), 10.0f * GetCaster()->GetObjectScale()));
|
||||
}
|
||||
|
||||
void ChangeDamageAndGrow()
|
||||
{
|
||||
SetHitDamage(int32(GetHitDamage() * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X)));
|
||||
SetHitDamage(int32(GetHitDamage() * GetCaster()->GetObjectScale()));
|
||||
// HACK: target player should cast this spell on defile
|
||||
// however with current aura handling auras cast by different units
|
||||
// cannot stack on the same aura object increasing the stack count
|
||||
|
||||
@@ -507,7 +507,7 @@ public:
|
||||
if (target && !target->IsCharmed() && (chained.find(target->GetGUID()) == chained.end()))
|
||||
{
|
||||
DoCast(target, SPELL_CHAINS_OF_KELTHUZAD);
|
||||
float scale = target->GetFloatValue(OBJECT_FIELD_SCALE_X);
|
||||
float scale = target->GetObjectScale();
|
||||
chained.insert(std::make_pair(target->GetGUID(), scale));
|
||||
target->SetObjectScale(scale * 2);
|
||||
events.ScheduleEvent(EVENT_CHAINED_SPELL, 2000); //core has 2000ms to set unit flag charm
|
||||
|
||||
@@ -1967,7 +1967,7 @@ class spell_arcane_overload : public SpellScriptLoader
|
||||
{
|
||||
Creature* arcaneOverload = GetCaster()->ToCreature();
|
||||
targets.remove_if(ExactDistanceCheck(arcaneOverload,
|
||||
GetSpellInfo()->Effects[EFFECT_0].CalcRadius(arcaneOverload) * arcaneOverload->GetFloatValue(OBJECT_FIELD_SCALE_X)));
|
||||
GetSpellInfo()->Effects[EFFECT_0].CalcRadius(arcaneOverload) * arcaneOverload->GetObjectScale()));
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
|
||||
@@ -408,7 +408,7 @@ class boss_alar : public CreatureScript
|
||||
if (Summoned)
|
||||
{
|
||||
Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Summoned->SetObjectScale(Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f);
|
||||
Summoned->SetObjectScale(Summoned->GetObjectScale() * 2.5f);
|
||||
Summoned->SetDisplayId(11686);
|
||||
Summoned->setFaction(me->getFaction());
|
||||
Summoned->SetLevel(me->getLevel());
|
||||
|
||||
@@ -104,7 +104,7 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
instance = creature->GetInstanceScript();
|
||||
|
||||
defaultarmor = creature->GetArmor();
|
||||
defaultsize = creature->GetFloatValue(OBJECT_FIELD_SCALE_X);
|
||||
defaultsize = creature->GetObjectScale();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
Reference in New Issue
Block a user