Core/Misc: Implemented GetObjectScale function

This commit is contained in:
Vincent-Michael
2013-08-17 23:46:36 +02:00
parent 865353e4a6
commit da1e466bd5
11 changed files with 14 additions and 13 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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());

View File

@@ -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;