void StrandOfTheAncient::SpawnControlPoint(SOTAControlPoints point, SOTACPStates state) { if (state >= MAX_SOTA_CP_STATES) return; SOTAControlPoint &cp = controlpoint[point]; if (cp.worldstate != 0) SetWorldState(cp.worldstate, 0); uint32 team = TEAM_ALLIANCE; uint32 faction = 0; switch (state) { case SOTA_CP_STATE_ALLY_CONTROL: team = TEAM_ALLIANCE; faction = 2; break; case SOTA_CP_STATE_HORDE_CONTROL: team = TEAM_HORDE; faction = 1; break; default: return; break; } // First time spawning if (cp.pole == NULL) { cp.pole = SpawnGameObject(SOTA_FLAGPOLE_ID, FlagPolePositions[point], 0, 35, 1.0f); cp.pole->PushToWorld(m_mapMgr); } else { if (cp.banner->IsInWorld()) cp.banner->RemoveFromWorld(false); } cp.banner = SpawnGameObject(FlagIDs[point][team], FlagPositions[point], 0, faction, 1.0f); cp.banner->PushToWorld(m_mapMgr); cp.state = state; cp.worldstate = CPWorldstates[point][team]; SetWorldState(cp.worldstate, 1); //Spawn graveyard SpawnGraveyard(SOTAGraveyards(uint32(point)), team); }
void StrandOfTheAncient::PrepareRound(){ roundprogress = SOTA_ROUND_PREPARATION; if( BattleRound == 1 ){ Attackers = RandomUInt( 1 ); if( Attackers == TEAM_ALLIANCE ) Defenders = TEAM_HORDE; else Defenders = TEAM_ALLIANCE; }else{ std::swap( Attackers, Defenders ); } for( uint32 i = 0; i < GATE_COUNT; i++ ){ m_gates[ i ]->Rebuild(); m_gates[ i ]->SetFaction( TeamFactions[ Defenders ] ); } m_endgate->Rebuild(); m_endgate->SetFaction( TeamFactions[ Defenders ] ); m_relic->SetFaction( TeamFactions[ Attackers ] ); for( uint32 i = 0; i < GATE_COUNT; i++ ) m_gateTransporters[ i ]->SetFaction( TeamFactions[ Defenders ] ); for( uint32 i = 0; i < SOTA_NUM_CANONS; i++ ){ if( canon[ i ] != NULL ) canon[ i ]->Despawn( 0, 0 ); canon[ i ] = SpawnCreature( 27894, CanonLocations[ i ], TeamFactions[ Defenders ] ); } for( uint32 i = 0; i < SOTA_NUM_DOCK_DEMOLISHERS; i++ ){ Creature *c = demolisher[ i ]; demolisher[ i ] = SpawnCreature( 28781, DemolisherLocations[ i ], TeamFactions[ Attackers ] ); if( c != NULL ) c->Despawn( 0, 0 ); } for( uint32 i = SOTA_WEST_WS_DEMOLISHER_INDEX; i < SOTA_NUM_DEMOLISHERS; i++ ){ if( demolisher[ i ] != NULL ){ demolisher[ i ]->Despawn( 0, 0 ); demolisher[ i ] = NULL; } } SOTACPStates state; if( Attackers == TEAM_ALLIANCE ){ state = SOTA_CP_STATE_HORDE_CONTROL; SetWorldState( WORLDSTATE_SOTA_HORDE_ATTACKER, 0 ); SetWorldState( WORLDSTATE_SOTA_ALLIANCE_ATTACKER, 1 ); SetWorldState( WORLDSTATE_SOTA_SHOW_ALLY_ROUND, 1 ); SetWorldState( WORLDSTATE_SOTA_SHOW_HORDE_ROUND, 0 ); SetWorldState( WORLDSTATE_SOTA_SHOW_ALLY_DEFENSE, 0 ); SetWorldState( WORLDSTATE_SOTA_SHOW_HORDE_DEFENSE, 1 ); SetWorldState( WORLDSTATE_SOTA_SHOW_ALLY_BEACHHEAD1, 1 ); SetWorldState( WORLDSTATE_SOTA_SHOW_ALLY_BEACHHEAD2, 1 ); SetWorldState( WORLDSTATE_SOTA_SHOW_HORDE_BEACHHEAD1, 0 ); SetWorldState( WORLDSTATE_SOTA_SHOW_HORDE_BEACHHEAD2, 0 ); }else{ state = SOTA_CP_STATE_ALLY_CONTROL; SetWorldState( WORLDSTATE_SOTA_HORDE_ATTACKER, 1 ); SetWorldState( WORLDSTATE_SOTA_ALLIANCE_ATTACKER, 0 ); SetWorldState( WORLDSTATE_SOTA_SHOW_ALLY_ROUND, 0 ); SetWorldState( WORLDSTATE_SOTA_SHOW_HORDE_ROUND, 1 ); SetWorldState( WORLDSTATE_SOTA_SHOW_ALLY_DEFENSE, 1 ); SetWorldState( WORLDSTATE_SOTA_SHOW_HORDE_DEFENSE, 0 ); SetWorldState( WORLDSTATE_SOTA_SHOW_ALLY_BEACHHEAD1, 0 ); SetWorldState( WORLDSTATE_SOTA_SHOW_ALLY_BEACHHEAD2, 0 ); SetWorldState( WORLDSTATE_SOTA_SHOW_HORDE_BEACHHEAD1, 1 ); SetWorldState( WORLDSTATE_SOTA_SHOW_HORDE_BEACHHEAD2, 1 ); } SpawnControlPoint( SOTA_CONTROL_POINT_EAST_GY, state ); SpawnControlPoint( SOTA_CONTROL_POINT_WEST_GY, state ); SpawnControlPoint( SOTA_CONTROL_POINT_SOUTH_GY, state ); SpawnGraveyard( SOTA_GY_ATTACKER_BEACH, Attackers ); SpawnGraveyard( SOTA_GY_DEFENDER, Defenders ); if( BattleRound == 2 ){ // Teleport players to their place and cast preparation on them m_mainLock.Acquire(); for( std::set< Player* >::iterator itr = m_players[ Attackers ].begin(); itr != m_players[ Attackers ].end(); ++itr ){ Player *p = *itr; p->SafeTeleport( p->GetMapId(), p->GetInstanceID(), sotaAttackerStartingPosition[ 0 ] ); p->CastSpell( p, BG_PREPARATION, true ); } for( std::set< Player* >::iterator itr = m_players[ Defenders ].begin(); itr != m_players[ Defenders ].end(); ++itr ){ Player *p = *itr; p->SafeTeleport( p->GetMapId(), p->GetInstanceID(), sotaDefenderStartingPosition ); p->CastSpell( p, BG_PREPARATION, true ); } m_mainLock.Release(); sEventMgr.AddEvent( this, &StrandOfTheAncient::StartRound, EVENT_SOTA_START_ROUND, 1 * 10 * 1000, 1, 0 ); } };
void IsleOfConquest::SpawnControlPoint(uint32 Id, uint32 Type) { if( Id >= IOC_NUM_CONTROL_POINTS ) return; GameObjectInfo * gi, * gi_aura; gi = GameObjectNameStorage.LookupEntry(ControlPointGoIds[Id][Type]); if(gi == NULL) return; controlpoint[ Id ].state = ControlPointTypes( Type ); // remove old worldstate if( controlpoint[ Id ].worldstate != 0 ) SetWorldState( controlpoint[ Id ].worldstate, 0 ); gi_aura = gi->sound3 ? GameObjectNameStorage.LookupEntry(gi->sound3) : NULL; if( controlpoint[ Id ].banner == NULL) { controlpoint[ Id ].banner = SpawnGameObject(gi->ID, m_mapMgr->GetMapId(), ControlPointCoordinates[Id][0], ControlPointCoordinates[Id][1], ControlPointCoordinates[Id][2], ControlPointCoordinates[Id][3], 0, 35, 1.0f); controlpoint[ Id ].banner->SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_STATE, 1); controlpoint[ Id ].banner->SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_TYPE_ID, gi->Type); controlpoint[ Id ].banner->SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_ANIMPROGRESS, 100); controlpoint[ Id ].banner->SetUInt32Value(GAMEOBJECT_DYNAMIC, 1); controlpoint[ Id ].banner->SetUInt32Value(GAMEOBJECT_DISPLAYID, gi->DisplayID); switch(Type) { case IOC_SPAWN_TYPE_ALLIANCE_ASSAULT: case IOC_SPAWN_TYPE_ALLIANCE_CONTROLLED: controlpoint[ Id ].banner->SetUInt32Value(GAMEOBJECT_FACTION, 2); break; case IOC_SPAWN_TYPE_HORDE_ASSAULT: case IOC_SPAWN_TYPE_HORDE_CONTROLLED: controlpoint[ Id ].banner->SetUInt32Value(GAMEOBJECT_FACTION, 1); break; default: controlpoint[ Id ].banner->SetUInt32Value(GAMEOBJECT_FACTION, 35); // neutral break; } controlpoint[ Id ].banner->bannerslot = static_cast<uint8>( Id ); controlpoint[ Id ].banner->PushToWorld(m_mapMgr); } else { if(controlpoint[ Id ].banner->IsInWorld()) controlpoint[ Id ].banner->RemoveFromWorld(false); // assign it a new guid (client needs this to see the entry change?) controlpoint[ Id ].banner->SetNewGuid(m_mapMgr->GenerateGameobjectGuid()); controlpoint[ Id ].banner->SetUInt32Value(OBJECT_FIELD_ENTRY, gi->ID); controlpoint[ Id ].banner->SetUInt32Value(GAMEOBJECT_DISPLAYID, gi->DisplayID); controlpoint[ Id ].banner->SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_TYPE_ID, gi->Type); switch(Type) { case IOC_SPAWN_TYPE_ALLIANCE_ASSAULT: case IOC_SPAWN_TYPE_ALLIANCE_CONTROLLED: controlpoint[ Id ].banner->SetUInt32Value(GAMEOBJECT_FACTION, 2); break; case IOC_SPAWN_TYPE_HORDE_ASSAULT: case IOC_SPAWN_TYPE_HORDE_CONTROLLED: controlpoint[ Id ].banner->SetUInt32Value(GAMEOBJECT_FACTION, 1); break; default: controlpoint[ Id ].banner->SetUInt32Value(GAMEOBJECT_FACTION, 35); // neutral break; } controlpoint[ Id ].banner->SetInfo(gi); controlpoint[ Id ].banner->PushToWorld(m_mapMgr); } switch( Type ){ case IOC_SPAWN_TYPE_NEUTRAL: controlpoint[ Id ].worldstate = NeutralFields[ Id ]; break; case IOC_SPAWN_TYPE_ALLIANCE_ASSAULT: controlpoint[ Id ].worldstate = AssaultFields[ Id ][ TEAM_ALLIANCE ]; break; case IOC_SPAWN_TYPE_HORDE_ASSAULT: controlpoint[ Id ].worldstate = AssaultFields[ Id ][ TEAM_HORDE ]; break; case IOC_SPAWN_TYPE_ALLIANCE_CONTROLLED: controlpoint[ Id ].worldstate = OwnedFields[ Id ][ TEAM_ALLIANCE ]; SpawnGraveyard( cptogy[ Id ], TEAM_ALLIANCE ); break; case IOC_SPAWN_TYPE_HORDE_CONTROLLED: controlpoint[ Id ].worldstate = OwnedFields[ Id ][ TEAM_HORDE ]; SpawnGraveyard( cptogy[ Id ], TEAM_HORDE ); break; } // set new worldstate SetWorldState( controlpoint[ Id ].worldstate, 1 ); if(gi_aura==NULL) { // remove it if it exists if(controlpoint[ Id ].aura!=NULL && controlpoint[ Id ].aura->IsInWorld()) controlpoint[ Id ].aura->RemoveFromWorld(false); return; } if(controlpoint[ Id ].aura == NULL) { controlpoint[ Id ].aura = SpawnGameObject(gi_aura->ID, 628, ControlPointCoordinates[Id][0], ControlPointCoordinates[Id][1], ControlPointCoordinates[Id][2], ControlPointCoordinates[Id][3], 0, 35, 5.0f); controlpoint[ Id ].aura->SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_STATE, 1); controlpoint[ Id ].aura->SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_TYPE_ID, 6); controlpoint[ Id ].aura->SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_ANIMPROGRESS, 100); controlpoint[ Id ].aura->bannerauraslot = Id; controlpoint[ Id ].aura->PushToWorld(m_mapMgr); } else { if(controlpoint[ Id ].aura->IsInWorld()) controlpoint[ Id ].aura->RemoveFromWorld(false); // re-spawn the aura controlpoint[ Id ].aura->SetNewGuid(m_mapMgr->GenerateGameobjectGuid()); controlpoint[ Id ].aura->SetUInt32Value(OBJECT_FIELD_ENTRY, gi_aura->ID); controlpoint[ Id ].aura->SetUInt32Value(GAMEOBJECT_DISPLAYID, gi_aura->DisplayID); controlpoint[ Id ].aura->SetInfo(gi_aura); controlpoint[ Id ].aura->PushToWorld(m_mapMgr); } }
void IsleOfConquest::OnCreate(){ // generals/leaders! generals[ TEAM_ALLIANCE ] = SpawnCreature(34924, 214.77f, -830.73f, 60.81f, 0.07f, 1 ); // High Commander Halford Wyrmbane (ALLIANCE) generals[ TEAM_HORDE ] = SpawnCreature(34922, 1296.57f, -765.78f, 69.98f, 6.22f, 2 ); // Overlord Agmar (not sure this is the good general) (HORDE) // Spawn const spiritguides SpawnGraveyard( IOC_GY_ALLIANCE, TEAM_ALLIANCE ); SpawnGraveyard( IOC_GY_HORDE, TEAM_HORDE ); // Spawn Teleporters for( uint32 i = 0; i < 3; i++ ){ teleporter[ i ].teleporter = SpawnGameObject( IOC_TELEPORTER_A_IN, 628, iocTransporterLocation[i][0], iocTransporterLocation[i][1], iocTransporterLocation[i][2], iocTransporterLocation[i][3], 0, 1, 1.0f); teleporter[ i ].teleporter->PushToWorld(m_mapMgr); } for( uint32 i = 3; i < 6; i++ ){ teleporter[ i ].teleporter = SpawnGameObject( IOC_TELEPORTER_A_OUT, 628, iocTransporterLocation[i][0], iocTransporterLocation[i][1], iocTransporterLocation[i][2], iocTransporterLocation[i][3], 0, 1, 1.0f); teleporter[ i ].teleporter->PushToWorld(m_mapMgr); } for( uint32 i = 6; i < 9; i++ ){ teleporter[ i ].teleporter = SpawnGameObject( IOC_TELEPORTER_H_IN, 628, iocTransporterLocation[i][0], iocTransporterLocation[i][1], iocTransporterLocation[i][2], iocTransporterLocation[i][3], 0, 2, 1.0f); teleporter[ i ].teleporter->PushToWorld(m_mapMgr); } for( uint32 i = 9; i < 12; i++ ){ teleporter[ i ].teleporter = SpawnGameObject( IOC_TELEPORTER_H_OUT, 628, iocTransporterLocation[i][0], iocTransporterLocation[i][1], iocTransporterLocation[i][2], iocTransporterLocation[i][3], 0, 2, 1.0f); teleporter[ i ].teleporter->PushToWorld(m_mapMgr); } // spawn teleporter effects for( uint32 i = 0; i < 6; i++ ){ teleporter[ i ].effect = SpawnGameObject(TELEPORTER_EFFECT_A, 628, iocTransporterLocation[i][0], iocTransporterLocation[i][1], iocTransporterLocation[i][2], iocTransporterLocation[i][3], 0, 1, 1.0f); teleporter[ i ].effect->PushToWorld(m_mapMgr); } for( uint32 i = 6; i < 12; i++ ){ teleporter[ i ].effect = SpawnGameObject(TELEPORTER_EFFECT_H, 628, iocTransporterLocation[i][0], iocTransporterLocation[i][1], iocTransporterLocation[i][2], iocTransporterLocation[i][3], 0, 1, 1.0f); teleporter[ i ].effect->PushToWorld(m_mapMgr); } // Spawn Alliance gates for( uint32 i = 0; i < 3; i++ ){ gates[ TEAM_ALLIANCE ][ i ].gate = SpawnGameObject( allygateids[ i ], 628, allygatelocations[ i ][ 0 ], allygatelocations[ i ][ 1 ], allygatelocations[ i ][ 2 ], allygatelocations[ i ][ 3 ], 0, 1, 1.0f ); gates[ TEAM_ALLIANCE ][ i ].gate->PushToWorld( m_mapMgr ); gates[ TEAM_ALLIANCE ][ i ].dyngate = SpawnGameObject( IOC_DYNAMIC_GATE_ALLY, 628, allygatelocations[ i ][ 0 ], allygatelocations[ i ][ 1 ], allygatelocations[ i ][ 2 ], allygatelocations[ i ][ 3 ], 0, 1, 1.0f ); gates[ TEAM_ALLIANCE ][ i ].dyngate->SetFlags( GAMEOBJECT_FLAG_UNTARGETABLE ); gates[ TEAM_ALLIANCE ][ i ].dyngate->PushToWorld( m_mapMgr ); } //Spawn Horde gates for( uint32 i = 0; i < 3; i++ ){ gates[ TEAM_HORDE ][ i ].gate = SpawnGameObject( hordegateids[ i ], 628, hordegatelocations[ i ][ 0 ], hordegatelocations[ i ][ 1 ], hordegatelocations[ i ][ 2 ], hordegatelocations[ i ][ 3 ], 0, 2, 1.0f ); gates[ TEAM_HORDE ][ i ].gate->PushToWorld( m_mapMgr ); gates[ TEAM_HORDE ][ i ].dyngate = SpawnGameObject( IOC_DYNAMIC_GATE_HORDE, 628, hordegatelocations[ i ][ 0 ], hordegatelocations[ i ][ 1 ], hordegatelocations[ i ][ 2 ], hordegatelocations[ i ][ 3 ], 0, 2, 1.0f ); gates[ TEAM_HORDE ][ i ].dyngate->SetFlags( GAMEOBJECT_FLAG_UNTARGETABLE ); gates[ TEAM_HORDE ][ i ].dyngate->PushToWorld( m_mapMgr ); } //Spawn ally towergates for( uint32 i = 0; i < 2; i++ ){ towergates[ TEAM_ALLIANCE ][ i ] = SpawnGameObject( 195436, AllyTowerGates[ i ], 0, 35, 1.0f ); towergates[ TEAM_ALLIANCE ][ i ]->SetFlags( GAMEOBJECT_FLAG_UNTARGETABLE ); towergates[ TEAM_ALLIANCE ][ i ]->PushToWorld( m_mapMgr ); } //Spawn horde towergates for( uint32 i = 0; i < 2; i++ ){ towergates[ TEAM_HORDE ][ i ] = SpawnGameObject( 195437, HordeTowerGates[ i ], 0, 35, 0.5f ); towergates[ TEAM_HORDE ][ i ]->SetFlags( GAMEOBJECT_FLAG_UNTARGETABLE ); towergates[ TEAM_HORDE ][ i ]->PushToWorld( m_mapMgr ); } //Spawn Alliance keep canons for( uint32 i = 0; i < 12; i++ ) SpawnCreature( 34944, AllyKeepCanons[ i ], 1 ); //Spawn Horde keep canons for( uint32 i = 0; i < 13; i++ ) SpawnCreature( 34944, HordeKeepCanons[ i ], 2 ); //Spawn Alliance Keep guards for( uint32 i = 0; i < 4; i++ ) SpawnCreature( 34919, AllyGuards[ i ], 1 ); //Spawn Horde Keep guards for( uint32 i = 0; i < 4; i++ ) SpawnCreature( 34918, HordeGuards[ i ], 2 ); // Flagpole for( uint32 i = 0; i < IOC_NUM_CONTROL_POINTS; ++i ){ controlpoint[ i ].pole = SpawnGameObject(IOC_FLAGPOLE, 628, ControlPointCoordinates[i][0], ControlPointCoordinates[i][1], ControlPointCoordinates[i][2], ControlPointCoordinates[i][3], 0, 35, 1.0f); controlpoint[ i ].pole->PushToWorld(m_mapMgr); } SpawnControlPoint(IOC_CONTROL_POINT_REFINERY, IOC_SPAWN_TYPE_NEUTRAL); SpawnControlPoint(IOC_CONTROL_POINT_QUARRY, IOC_SPAWN_TYPE_NEUTRAL); SpawnControlPoint(IOC_CONTROL_POINT_DOCKS, IOC_SPAWN_TYPE_NEUTRAL); SpawnControlPoint(IOC_CONTROL_POINT_HANGAR, IOC_SPAWN_TYPE_NEUTRAL); SpawnControlPoint(IOC_CONTROL_POINT_WORKSHOP, IOC_SPAWN_TYPE_NEUTRAL); SpawnControlPoint(IOC_CONTROL_POINT_ALLIANCE_KEEP, IOC_SPAWN_TYPE_ALLIANCE_CONTROLLED); SpawnControlPoint(IOC_CONTROL_POINT_HORDE_KEEP, IOC_SPAWN_TYPE_HORDE_CONTROLLED); }
void IsleOfConquest::SpawnControlPoint(uint32 Id, uint32 Type) { if (Id >= IOC_NUM_CONTROL_POINTS) return; auto gameobject_info = sMySQLStore.GetGameObjectInfo(ControlPointGoIds[Id][Type]); if (gameobject_info == nullptr) return; controlpoint[Id].state = ControlPointTypes(Type); // remove old worldstate if (controlpoint[Id].worldstate != 0) SetWorldState(controlpoint[Id].worldstate, 0); auto gi_aura = gameobject_info->raw.parameter_3 ? sMySQLStore.GetGameObjectInfo(gameobject_info->raw.parameter_3) : nullptr; if (controlpoint[Id].banner == nullptr) { controlpoint[Id].banner = SpawnGameObject(gameobject_info->entry, m_mapMgr->GetMapId(), ControlPointCoordinates[Id][0], ControlPointCoordinates[Id][1], ControlPointCoordinates[Id][2], ControlPointCoordinates[Id][3], 0, 35, 1.0f); controlpoint[Id].banner->SetState(GO_STATE_CLOSED); controlpoint[Id].banner->SetType(static_cast<uint8>(gameobject_info->type)); controlpoint[Id].banner->SetAnimProgress(100); controlpoint[Id].banner->Activate(); controlpoint[Id].banner->SetDisplayId(gameobject_info->display_id); switch (Type) { case IOC_SPAWN_TYPE_ALLIANCE_ASSAULT: case IOC_SPAWN_TYPE_ALLIANCE_CONTROLLED: controlpoint[Id].banner->SetFaction(2); break; case IOC_SPAWN_TYPE_HORDE_ASSAULT: case IOC_SPAWN_TYPE_HORDE_CONTROLLED: controlpoint[Id].banner->SetFaction(1); break; default: controlpoint[Id].banner->SetFaction(35); // neutral break; } controlpoint[Id].banner->PushToWorld(m_mapMgr); } else { if (controlpoint[Id].banner->IsInWorld()) controlpoint[Id].banner->RemoveFromWorld(false); // assign it a new guid (client needs this to see the entry change?) controlpoint[Id].banner->SetNewGuid(m_mapMgr->GenerateGameobjectGuid()); controlpoint[Id].banner->SetEntry(gameobject_info->entry); controlpoint[Id].banner->SetDisplayId(gameobject_info->display_id); controlpoint[Id].banner->SetType(static_cast<uint8>(gameobject_info->type)); switch (Type) { case IOC_SPAWN_TYPE_ALLIANCE_ASSAULT: case IOC_SPAWN_TYPE_ALLIANCE_CONTROLLED: controlpoint[Id].banner->SetUInt32Value(GAMEOBJECT_FACTION, 2); break; case IOC_SPAWN_TYPE_HORDE_ASSAULT: case IOC_SPAWN_TYPE_HORDE_CONTROLLED: controlpoint[Id].banner->SetUInt32Value(GAMEOBJECT_FACTION, 1); break; default: controlpoint[Id].banner->SetUInt32Value(GAMEOBJECT_FACTION, 35); // neutral break; } controlpoint[Id].banner->SetInfo(gameobject_info); controlpoint[Id].banner->PushToWorld(m_mapMgr); } switch (Type) { case IOC_SPAWN_TYPE_NEUTRAL: controlpoint[Id].worldstate = NeutralFields[Id]; break; case IOC_SPAWN_TYPE_ALLIANCE_ASSAULT: controlpoint[Id].worldstate = AssaultFields[Id][TEAM_ALLIANCE]; break; case IOC_SPAWN_TYPE_HORDE_ASSAULT: controlpoint[Id].worldstate = AssaultFields[Id][TEAM_HORDE]; break; case IOC_SPAWN_TYPE_ALLIANCE_CONTROLLED: controlpoint[Id].worldstate = OwnedFields[Id][TEAM_ALLIANCE]; SpawnGraveyard(cptogy[Id], TEAM_ALLIANCE); break; case IOC_SPAWN_TYPE_HORDE_CONTROLLED: controlpoint[Id].worldstate = OwnedFields[Id][TEAM_HORDE]; SpawnGraveyard(cptogy[Id], TEAM_HORDE); break; } // set new worldstate SetWorldState(controlpoint[Id].worldstate, 1); if (gi_aura == nullptr) { // remove it if it exists if (controlpoint[Id].aura != nullptr && controlpoint[Id].aura->IsInWorld()) controlpoint[Id].aura->RemoveFromWorld(false); return; } if (controlpoint[Id].aura == nullptr) { controlpoint[Id].aura = SpawnGameObject(gi_aura->entry, 628, ControlPointCoordinates[Id][0], ControlPointCoordinates[Id][1], ControlPointCoordinates[Id][2], ControlPointCoordinates[Id][3], 0, 35, 5.0f); controlpoint[Id].aura->SetState(GO_STATE_CLOSED); controlpoint[Id].aura->SetType(GAMEOBJECT_TYPE_TRAP); controlpoint[Id].aura->SetAnimProgress(100); controlpoint[Id].aura->PushToWorld(m_mapMgr); } else { if (controlpoint[Id].aura->IsInWorld()) controlpoint[Id].aura->RemoveFromWorld(false); // re-spawn the aura controlpoint[Id].aura->SetNewGuid(m_mapMgr->GenerateGameobjectGuid()); controlpoint[Id].aura->SetEntry(gi_aura->entry); controlpoint[Id].aura->SetDisplayId(gi_aura->display_id); controlpoint[Id].aura->SetInfo(gi_aura); controlpoint[Id].aura->PushToWorld(m_mapMgr); } }