Пример #1
0
bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x,
		float y, float z, float ang, uint32 animprogress, uint32 dynflags) {
	Relocate(x, y, z, ang);
	// instance id and phaseMask isn't set to values different from std.

	if (!IsPositionValid()) {
		sLog->outError(
				"Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
				guidlow, x, y);
		return false;
	}

	Object::_Create(guidlow, 0, HIGHGUID_MO_TRANSPORT);

	GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(entry);

	if (!goinfo) {
		sLog->outErrorDb(
				"Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u  (X: %f Y: %f Z: %f) ang: %f",
				guidlow, mapid, x, y, z, ang);
		return false;
	}

	m_goInfo = goinfo;

	SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size);

	SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
	//SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
	SetUInt32Value(GAMEOBJECT_FLAGS, MAKE_PAIR32(0x28, 0x64));
	SetUInt32Value(GAMEOBJECT_LEVEL, m_period);
	SetEntry(goinfo->id);

	SetUInt32Value(GAMEOBJECT_DISPLAYID, goinfo->displayId);

	SetGoState(GO_STATE_READY);
	SetGoType(GameobjectTypes(goinfo->type));

	SetGoAnimProgress(animprogress);
	if (dynflags)
		SetUInt32Value(GAMEOBJECT_DYNAMIC, MAKE_PAIR32(0, dynflags));

	SetName(goinfo->name);

	SetZoneScript();

	return true;
}
Пример #2
0
bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags)
{
    Relocate(x, y, z, ang);
    // instance id and phaseMask isn't set to values different from std.

    if (!IsPositionValid())
    {
        TC_LOG_ERROR("entities.transport", "Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
            guidlow, x, y);
        return false;
    }

    Object::_Create(guidlow, 0, HIGHGUID_MO_TRANSPORT);

    GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);

    if (!goinfo)
    {
        TC_LOG_ERROR("sql.sql", "Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u  (X: %f Y: %f Z: %f) ang: %f", guidlow, mapid, x, y, z, ang);
        return false;
    }

    m_goInfo = goinfo;

    SetObjectScale(goinfo->size);

    SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
    //SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); -- gunship
    SetUInt32Value(GAMEOBJECT_FLAGS, MAKE_PAIR32(0x28, 0x64));
    SetUInt32Value(GAMEOBJECT_LEVEL, m_period);
    SetEntry(goinfo->entry);

    SetDisplayId(goinfo->displayId);

    SetGoState(GO_STATE_READY);
    SetGoType(GameobjectTypes(goinfo->type));

    SetGoAnimProgress(animprogress);
    if (dynflags)
        SetUInt32Value(GAMEOBJECT_FIELD_ANIM_PROGRESS, MAKE_PAIR32(0, dynflags));

    SetName(goinfo->name);

    SetZoneScript();

    return true;
}