当前位置: 首页>>代码示例>>C++>>正文


C++ GameObjectPointer::SetUInt32Value方法代码示例

本文整理汇总了C++中GameObjectPointer::SetUInt32Value方法的典型用法代码示例。如果您正苦于以下问题:C++ GameObjectPointer::SetUInt32Value方法的具体用法?C++ GameObjectPointer::SetUInt32Value怎么用?C++ GameObjectPointer::SetUInt32Value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameObjectPointer的用法示例。


在下文中一共展示了GameObjectPointer::SetUInt32Value方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SpawnObjects

void SpawnObjects(shared_ptr<MapMgr> pmgr)
{
    if(!pmgr || pmgr->GetMapId() != 530)
        return;

    const static sgodata godata[] =
    {
        { 182173, -290.016f, 3702.42f, 56.6729f, 0.0349066f, 0, 0, 0.0174524f, 0.999848f, 1, 32, 0, 1 },            // stadium
        { 182174, -184.889f, 3476.93f, 38.205f, -0.0174535f, 0, 0, 0.00872664f, -0.999962f, 1, 32, 0, 1 },            // overlook
        { 182175, -471.462f, 3451.09f, 34.6432f, 0.174533f, 0, 0, 0.0871557f, 0.996195f, 1, 32, 0, 1 },                // brokenhill
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
    };

    const static sgodata godata_banner[] =
    {
        { 183515, -289.61f, 3696.83f, 75.9447f, 3.12414f, 0, 0, 0.999962f, 0.00872656f, 1, 32, 1375, 1 },                    // stadium
        { 182525, -187.887f, 3459.38f, 60.0403f, -3.12414f, 0, 0, 0.999962f, -0.00872653f, 1, 32, 1375, 1 },                // overlook
        { 183514, -467.078f, 3528.17f, 64.7121f, 3.14159f, 0, 0, 1, -4.37114E-8f, 1, 32, 1375, 1 },                        // brokenhill
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
    };

    uint32 i;
    const sgodata* p, *p2;
    for(i = 0; i < 3; ++i)
    {
        p = &godata[i];
        p2 = &godata_banner[i];

        GameObjectPointer pGo = pmgr->GetInterface()->SpawnGameObject(p->entry, p->posx, p->posy, p->posz, p->facing, false, 0, 0);
        if(pGo == NULL)
            continue;

        GameObjectPointer pGo2 = pmgr->GetInterface()->SpawnGameObject(p2->entry, p2->posx, p2->posy, p2->posz, p2->facing, false, 0, 0);
        if(pGo2 == NULL)
            continue;

        pGo->SetByte(GAMEOBJECT_BYTES_1, GAMEOBJECT_BYTES_STATE, p->state);
        pGo2->SetByte(GAMEOBJECT_BYTES_1, GAMEOBJECT_BYTES_STATE, p2->state);
        pGo->SetUInt32Value(GAMEOBJECT_FLAGS, p->flags);
        pGo2->SetUInt32Value(GAMEOBJECT_FLAGS, p2->flags);
        pGo->SetUInt32Value(GAMEOBJECT_FACTION, p->faction);
        pGo2->SetUInt32Value(GAMEOBJECT_FACTION, p2->faction);

        for(uint32 j = 0; j < 4; ++j)
        {
            pGo->SetFloatValue(GAMEOBJECT_ROTATION + j, p->orientation[j]);
            pGo2->SetFloatValue(GAMEOBJECT_ROTATION + j, p2->orientation[j]);
        }

        // now make his script
        pGo->SetScript(new HellfirePeninsulaBannerAI(pGo));
        ((HellfirePeninsulaBannerAI*)pGo->GetScript())->pBanner = pGo2;

        pGo->PushToWorld(pmgr);
        pGo2->PushToWorld(pmgr);

        pGo->GetScript()->OnSpawn();
        printf("Spawned gameobject entry %u for world pvp on hellfire.\n", p->entry);
    }
}
开发者ID:AriDEV,项目名称:AscEmu,代码行数:60,代码来源:ZoneHellfirePeninsula.cpp

示例2: TFSpawnObjects

void TFSpawnObjects(shared_ptr<MapMgr> pmgr)
{
    if(!pmgr || pmgr->GetMapId() != 530)
        return;

    const static sgodata godata[] =
    {
        { 183104, -3081.65f, 5335.03f, 17.1853f, -2.14675f, 0, 0, 0.878817f, -0.477159f, 1, 32, 0, 1 },
        { 183411, -2939.9f, 4788.73f, 18.987f, 2.77507f, 0, 0, 0.983255f, 0.182236f, 1, 32, 0, 1 },
        { 183412, -3174.94f, 4440.97f, 16.2281f, 1.86750f, 0, 0, 0.803857f, 0.594823f, 1, 32, 0, 1 },
        { 183413, -3603.31f, 4529.15f, 20.9077f, 0.994838f, 0, 0, 0.477159f, 0.878817f, 1, 32, 0, 1 },
        { 183414, -3812.37f, 4899.3f, 17.7249f, 0.087266f, 0, 0, 0.043619f, 0.999048f, 1, 32, 0, 1 },
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
    };

    uint32 i;
    const sgodata* p;
    for(i = 0; i < 5; ++i)
    {
        p = &godata[i];

        GameObjectPointer pGo = NULLGOB;
        pGo = pmgr->GetInterface()->SpawnGameObject(p->entry, p->posx, p->posy, p->posz, p->facing, false, 0, 0);
        if(!pGo)
            continue;

        pGo->SetByte(GAMEOBJECT_BYTES_1, GAMEOBJECT_BYTES_STATE, p->state);
        pGo->SetUInt32Value(GAMEOBJECT_FLAGS, p->flags);
        pGo->SetUInt32Value(GAMEOBJECT_FACTION, p->faction);

        for(uint32 j = 0; j < 4; ++j)
        {
            pGo->SetFloatValue(GAMEOBJECT_ROTATION + j, p->orientation[j]);
        }

        // now make his script
        pGo->SetScript(new TerokkarForestBannerAI(pGo));

        pGo->PushToWorld(pmgr);

        pGo->GetScript()->OnSpawn();
    }
}
开发者ID:AscEmu,项目名称:AscEmu,代码行数:43,代码来源:ZoneTerokkarForest.cpp

示例3: HandleGOEnable

bool ChatHandler::HandleGOEnable(const char *args, WorldSession *m_session)
{
	GameObjectPointer GObj = NULLGOB;

	GObj = m_session->GetPlayer()->m_GM_SelectedGO;
	if( !GObj )
	{
		RedSystemMessage(m_session, "No selected GameObject...");
		return true;
	}
	if(GObj->GetUInt32Value(GAMEOBJECT_DYNAMIC) == 1)
	{
		// Deactivate
		GObj->SetUInt32Value(GAMEOBJECT_DYNAMIC, 0);
	} else {
		// /Activate
		GObj->SetUInt32Value(GAMEOBJECT_DYNAMIC, 1);
	}
	BlueSystemMessage(m_session, "Gameobject activate/deactivated.");
	return true;
}
开发者ID:CadeLaRen,项目名称:Xeon-MMORPG-Emulator,代码行数:21,代码来源:Level2.cpp

示例4: HandleGOActivate

bool ChatHandler::HandleGOActivate(const char* args, WorldSession *m_session)
{
	GameObjectPointer GObj = NULLGOB;

	GObj = m_session->GetPlayer()->m_GM_SelectedGO;
	if( !GObj )
	{
		RedSystemMessage(m_session, "No selected GameObject...");
		return true;
	}
	if(GObj->GetByte(GAMEOBJECT_BYTES_1, GAMEOBJECT_BYTES_STATE) == 1)
	{
		// Close/Deactivate
		GObj->SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_STATE, 0);
		GObj->SetUInt32Value(GAMEOBJECT_FLAGS, (GObj->GetUInt32Value(GAMEOBJECT_FLAGS)-1));
	} else {
		// Open/Activate
		GObj->SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_STATE, 1);
		GObj->SetUInt32Value(GAMEOBJECT_FLAGS, (GObj->GetUInt32Value(GAMEOBJECT_FLAGS)+1));
	}
	BlueSystemMessage(m_session, "Gameobject opened/closed.");
	return true;
}
开发者ID:CadeLaRen,项目名称:Xeon-MMORPG-Emulator,代码行数:23,代码来源:Level2.cpp

示例5: OnActivate

	void OnActivate(PlayerPointer pPlayer)
	{

		CreaturePointer Ulag = NULLCREATURE;
		GameObjectPointer pDoor = NULLGOB;
		Ulag = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(2390.101807f, 336.676788f, 40.015614f, 6390);
		pDoor = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(2388.480029f, 338.3901f, 40.092899f, 176594);
		QuestLogEntry * en = pPlayer->GetQuestLogForEntry(1819);
		if(!en || pDoor==NULL || Ulag)
		return;

		CreaturePointer NewCreature = pPlayer->GetMapMgr()->GetInterface()->SpawnCreature(6390, 2390.101807f, 336.676788f, 40.015614f, 2.259590f, true, false, 0, 0);
		if ( NewCreature != NULL )
		{
			NewCreature->Despawn(180000, 0);
			NewCreature->GetAIInterface()->SetNextTarget(pPlayer);
			NewCreature->GetAIInterface()->AttackReaction(pPlayer, 1);
			pDoor->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
			pDoor->SetByte(GAMEOBJECT_BYTES_1, 0, 0);
		};
	}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:21,代码来源:GameObjects.cpp


注:本文中的GameObjectPointer::SetUInt32Value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。