class DefiasCannon : public GameObjectAIScript { public: DefiasCannon(GameObject* pGameObject) : GameObjectAIScript(pGameObject) { } void OnActivate(Player * pPlayer) { GameObject *pCannonDoor = _gameobject->GetMapMgr()->GetInterface()->GetObjectNearestCoords( 16397, -101.344f, -665.815f, 7.422f); if(pCannonDoor == 0) return; else { // Open the door pCannonDoor->SetUInt32Value(GAMEOBJECT_FLAGS, 33); pCannonDoor->SetUInt32Value(GAMEOBJECT_STATE, 0); pCannonDoor->GetMapMgr()->GetInterface()->SpawnCreature(657, -102.617, -668.745, 7.416, 1.832, true, false, 0, 0); } } static GameObjectAIScript * Create(GameObject * g) { return new DefiasCannon(g); } };