Add function for SetObjectScale
Author: NoFantasy Source: Mangos
This commit is contained in:
@@ -89,7 +89,7 @@ bool Corpse::Create(uint32 guidlow, Player* owner)
|
||||
|
||||
WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask());
|
||||
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, 1);
|
||||
SetObjectScale(1);
|
||||
SetUInt64Value(CORPSE_FIELD_OWNER, owner->GetGUID());
|
||||
|
||||
_gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
@@ -333,7 +333,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
|
||||
SetSpeed(MOVE_SWIM, 1.0f); // using 1.0 rate
|
||||
SetSpeed(MOVE_FLIGHT, 1.0f); // using 1.0 rate
|
||||
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, cinfo->scale);
|
||||
SetObjectScale(cinfo->scale);
|
||||
|
||||
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, cinfo->HoverHeight);
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spe
|
||||
WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask());
|
||||
|
||||
SetEntry(spellId);
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, 1);
|
||||
SetObjectScale(1);
|
||||
SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID());
|
||||
|
||||
// The lower word of DYNAMICOBJECT_BYTES must be 0x0001. This value means that the visual radius will be overriden
|
||||
|
||||
@@ -206,7 +206,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
|
||||
|
||||
UpdateRotationFields(rotation2, rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3
|
||||
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size);
|
||||
SetObjectScale(goinfo->size);
|
||||
|
||||
SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
|
||||
|
||||
@@ -78,7 +78,7 @@ bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner)
|
||||
Object::_Create(guidlow, 0, HIGHGUID_CONTAINER);
|
||||
|
||||
SetEntry(itemid);
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
|
||||
SetObjectScale(1.0f);
|
||||
|
||||
SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0);
|
||||
SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0);
|
||||
|
||||
@@ -258,7 +258,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner)
|
||||
Object::_Create(guidlow, 0, HIGHGUID_ITEM);
|
||||
|
||||
SetEntry(itemid);
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
|
||||
SetObjectScale(1.0f);
|
||||
|
||||
SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0);
|
||||
SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0);
|
||||
@@ -400,7 +400,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entr
|
||||
|
||||
// Set entry, MUST be before proto check
|
||||
SetEntry(entry);
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
|
||||
SetObjectScale(1.0f);
|
||||
|
||||
ItemTemplate const* proto = GetTemplate();
|
||||
if (!proto)
|
||||
|
||||
@@ -137,6 +137,8 @@ class Object
|
||||
uint32 GetEntry() const { return GetUInt32Value(OBJECT_FIELD_ENTRY); }
|
||||
void SetEntry(uint32 entry) { SetUInt32Value(OBJECT_FIELD_ENTRY, entry); }
|
||||
|
||||
void SetObjectScale(float scale) { SetFloatValue(OBJECT_FIELD_SCALE_X, scale); }
|
||||
|
||||
TypeID GetTypeId() const { return m_objectTypeId; }
|
||||
bool isType(uint16 mask) const { return (mask & m_objectType); }
|
||||
|
||||
|
||||
@@ -870,7 +870,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
else
|
||||
scale = cFamily->minScale + float(getLevel() - cFamily->minScaleLevel) / cFamily->maxScaleLevel * (cFamily->maxScale - cFamily->minScale);
|
||||
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, scale);
|
||||
SetObjectScale(scale);
|
||||
}
|
||||
|
||||
// Resistance
|
||||
|
||||
@@ -3153,7 +3153,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
||||
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
|
||||
|
||||
// reset size before reapply auras
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
|
||||
SetObjectScale(1.0f);
|
||||
|
||||
// save base values (bonuses already included in stored stats
|
||||
for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
|
||||
|
||||
@@ -214,7 +214,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
|
||||
|
||||
m_goInfo = goinfo;
|
||||
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size);
|
||||
SetObjectScale(goinfo->size);
|
||||
|
||||
SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
|
||||
|
||||
@@ -2425,7 +2425,7 @@ void AuraEffect::HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode
|
||||
|
||||
// What must be cloned? at least display and scale
|
||||
target->SetDisplayId(caster->GetDisplayId());
|
||||
//target->SetFloatValue(OBJECT_FIELD_SCALE_X, caster->GetFloatValue(OBJECT_FIELD_SCALE_X)); // we need retail info about how scaling is handled (aura maybe?)
|
||||
//target->SetObjectScale(caster->GetFloatValue(OBJECT_FIELD_SCALE_X)); // we need retail info about how scaling is handled (aura maybe?)
|
||||
target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_MIRROR_IMAGE);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user