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