这篇教程C++ GameobjectTypes函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GameobjectTypes函数的典型用法代码示例。如果您正苦于以下问题:C++ GameobjectTypes函数的具体用法?C++ GameobjectTypes怎么用?C++ GameobjectTypes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GameobjectTypes函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Relocatebool 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); 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); GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(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; TransportTemplate const* tInfo = sTransportMgr->GetTransportTemplate(entry); if (!tInfo) { sLog->outError("Transport %u (name: %s) will not be created, missing `transport_template` entry.", entry, goinfo->name.c_str()); return false; } _transportInfo = tInfo; // initialize waypoints _nextFrame = tInfo->keyFrames.begin(); _currentFrame = _nextFrame++; SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); SetUInt32Value(GAMEOBJECT_LEVEL, tInfo->pathTime); SetEntry(goinfo->entry); 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); return true;}
开发者ID:Devilcleave,项目名称:TrilliumEMU,代码行数:54,
示例2: Relocatebool MOTransport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint8 animprogress, uint16 dynamicLowValue){ Relocate(WorldLocation(mapid, x, y, z, ang)); // FIXME - 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(ObjectGuid(HIGHGUID_MO_TRANSPORT, guidlow)); GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(guidlow); 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; SetObjectScale(goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); //SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); SetUInt32Value(GAMEOBJECT_FLAGS, (GO_FLAG_TRANSPORT | GO_FLAG_NODESPAWN)); SetUInt32Value(GAMEOBJECT_LEVEL, GetPeriod(true)); SetEntry(goinfo->id); SetDisplayId(goinfo->displayId); SetGoState(GO_STATE_READY); SetGoType(GameobjectTypes(goinfo->type)); SetGoArtKit(0); SetGoAnimProgress(animprogress); SetUInt16Value(GAMEOBJECT_DYNAMIC, 0, dynamicLowValue); SetUInt16Value(GAMEOBJECT_DYNAMIC, 1, 0); SetName(goinfo->name); m_transportKit = new TransportKit(*this); m_anchorageTimer.SetInterval(0); m_anchorageTimer.Reset(); return true;}
开发者ID:beyourself,项目名称:RustEmu-Core,代码行数:51,
示例3: Relocatebool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint8 animprogress, uint16 dynamicHighValue){ 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(guidlow); 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; SetObjectScale(goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); // SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); SetUInt32Value(GAMEOBJECT_FLAGS, (GO_FLAG_TRANSPORT | GO_FLAG_NODESPAWN)); SetUInt32Value(GAMEOBJECT_LEVEL, m_period); SetEntry(goinfo->id); //SetDisplayId(goinfo->displayId); // Use SetDisplayId only if we have the GO assigned to a proper map! SetUInt32Value(GAMEOBJECT_DISPLAYID, goinfo->displayId); m_displayInfo = sGameObjectDisplayInfoStore.LookupEntry(goinfo->displayId); SetGoState(GO_STATE_READY); SetGoType(GameobjectTypes(goinfo->type)); SetGoArtKit(0); SetGoAnimProgress(animprogress); // low part always 0, dynamicHighValue is some kind of progression (not implemented) SetUInt16Value(GAMEOBJECT_DYNAMIC, 0, 0); SetUInt16Value(GAMEOBJECT_DYNAMIC, 1, dynamicHighValue); SetName(goinfo->name); return true;}
开发者ID:Astoz,项目名称:mangos-wotlk,代码行数:50,
示例4: Relocatebool 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;}
开发者ID:FrenchCORE,项目名称:Server,代码行数:48,
示例5: Relocatebool 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;}
开发者ID:Exodius,项目名称:chuspi,代码行数:47,
示例6: Relocatebool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags){ Relocate(x,y,z,ang); SetMapId(mapid); if (!IsPositionValid()) { sLog.outLog(LOG_DEFAULT, "ERROR: 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(guidlow); if (!goinfo) { sLog.outLog(LOG_DB_ERR, "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(OBJECT_FIELD_ENTRY, goinfo->id); SetUInt32Value(GAMEOBJECT_DISPLAYID, goinfo->displayId); SetGoState(GO_STATE_READY); SetGoType(GameobjectTypes(goinfo->type)); SetGoAnimProgress(animprogress); if (dynflags) SetUInt32Value(GAMEOBJECT_DYN_FLAGS, dynflags); SetName(goinfo->name); return true;}
开发者ID:Blumfield,项目名称:ptc2,代码行数:46,
示例7: Relocatebool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags){ Relocate(x,y,z,ang); SetMapId(mapid); if(!IsPositionValid()) { sLog.outError("ERROR: 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 = objmgr.GetGameObjectInfo(guidlow); 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(1); SetGoType(GameobjectTypes(goinfo->type)); SetGoAnimProgress(animprogress); if(dynflags) SetUInt32Value(GAMEOBJECT_DYNAMIC, MAKE_PAIR32(0, dynflags)); return true;}
开发者ID:Ledeet,项目名称:mangos,代码行数:44,
示例8: Relocatebool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, uint32 go_state){ Relocate(x,y,z,ang); SetMapId(map->GetId()); SetInstanceId(map->GetInstanceId()); if(!IsPositionValid()) { sLog.outError("ERROR: Gameobject (GUID: %u Entry: %u ) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y); return false; } GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(name_id); if (!goinfo) { sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3); return false; } Object::_Create(guidlow, goinfo->id, HIGHGUID_GAMEOBJECT); m_goInfo = goinfo; if (goinfo->type >= MAX_GAMEOBJECT_TYPE) { sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.",guidlow,name_id,goinfo->type); return false; } SetFloatValue(GAMEOBJECT_POS_X, x); SetFloatValue(GAMEOBJECT_POS_Y, y); SetFloatValue(GAMEOBJECT_POS_Z, z); SetFloatValue(GAMEOBJECT_FACING, ang); //this is not facing angle int64 rotation = 0; float f_rot1 = sin(ang / 2.0f); int64 i_rot1 = f_rot1 / atan(pow(2.0f, -20.0f)); rotation |= (i_rot1 << 43 >> 43) & 0x00000000001FFFFF; //float f_rot2 = sin(0.0f / 2.0f); //int64 i_rot2 = f_rot2 / atan(pow(2.0f, -20.0f)); //rotation |= (((i_rot2 << 22) >> 32) >> 11) & 0x000003FFFFE00000; //float f_rot3 = sin(0.0f / 2.0f); //int64 i_rot3 = f_rot3 / atan(pow(2.0f, -21.0f)); //rotation |= (i_rot3 >> 42) & 0x7FFFFC0000000000; SetUInt64Value(GAMEOBJECT_ROTATION, rotation); SetFloatValue(GAMEOBJECT_PARENTROTATION+0, rotation0); SetFloatValue(GAMEOBJECT_PARENTROTATION+1, rotation1); SetFloatValue(GAMEOBJECT_PARENTROTATION+2, rotation2); SetFloatValue(GAMEOBJECT_PARENTROTATION+3, rotation3); SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); SetEntry(goinfo->id); SetUInt32Value(GAMEOBJECT_DISPLAYID, goinfo->displayId); SetGoState(go_state); SetGoType(GameobjectTypes(goinfo->type)); SetGoAnimProgress(animprogress); // Spell charges for GAMEOBJECT_TYPE_SPELLCASTER (22) if (goinfo->type == GAMEOBJECT_TYPE_SPELLCASTER) m_charges = goinfo->spellcaster.charges; //Notify the map's instance data. //Only works if you create the object in it, not if it is moves to that map. //Normally non-players do not teleport to other maps. if(map->IsDungeon() && ((InstanceMap*)map)->GetInstanceData()) { ((InstanceMap*)map)->GetInstanceData()->OnObjectCreate(this); } return true;}
开发者ID:Actionfox,项目名称:mangos,代码行数:83,
示例9: Relocatebool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 ArtKit){ Relocate(x,y,z,ang); SetMapId(map->GetId()); SetInstanceId(map->GetInstanceId()); if(!IsPositionValid()) { sLog.outError("Gameobject (GUID: %u Entry: %u ) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y); return false; } GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(name_id); if (!goinfo) { sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3); return false; } Object::_Create(guidlow, goinfo->id, HIGHGUID_GAMEOBJECT); m_goInfo = goinfo; if (goinfo->type >= MAX_GAMEOBJECT_TYPE) { sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.",guidlow,name_id,goinfo->type); return false; } SetFloatValue(GAMEOBJECT_POS_X, x); SetFloatValue(GAMEOBJECT_POS_Y, y); SetFloatValue(GAMEOBJECT_POS_Z, z); SetFloatValue(GAMEOBJECT_ROTATION+0, rotation0); SetFloatValue(GAMEOBJECT_ROTATION+1, rotation1); UpdateRotationFields(rotation2,rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION+2/3 SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); SetEntry(goinfo->id); SetUInt32Value(GAMEOBJECT_DISPLAYID, goinfo->displayId); SetGoState(go_state); SetGoType(GameobjectTypes(goinfo->type)); SetGoAnimProgress(animprogress); SetUInt32Value (GAMEOBJECT_ARTKIT, ArtKit); // Spell charges for GAMEOBJECT_TYPE_SPELLCASTER (22) if (goinfo->type == GAMEOBJECT_TYPE_SPELLCASTER) m_charges = goinfo->spellcaster.charges; //Notify the map's instance data. //Only works if you create the object in it, not if it is moves to that map. //Normally non-players do not teleport to other maps. if(map->IsDungeon() && ((InstanceMap*)map)->GetInstanceData()) { ((InstanceMap*)map)->GetInstanceData()->OnObjectCreate(this); } return true;}
开发者ID:wk23,项目名称:tst,代码行数:68,
注:本文中的GameobjectTypes函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ Gamma函数代码示例 C++ Game_Flag_Set函数代码示例 |