void AIUpdate() { PlayerPointer CurrentPlayer = objmgr.GetPlayer( mPlayerGuid ); if ( CurrentPlayer == NULLPLR ) { RemoveAIUpdateEvent(); mPlayerGuid = 0; return; }; if ( CurrentPlayer->GetMapId() == 530 ) // Shattrath { CurrentPlayer->SafeTeleport( 530, 0, -1742.640869f, 5454.712402f, -7.928009f, 4.606363f ); } else if ( CurrentPlayer->GetMapId() == 0 ) // Elwynn Forest { CurrentPlayer->SafeTeleport( 0, 0, -9569.150391f, -14.753426f, 68.051422f, 4.874008f ); } else if ( CurrentPlayer->GetMapId() == 1 ) // Mulgore { CurrentPlayer->SafeTeleport( 1, 0, -1326.711914f, 86.301125f, 133.093918f, 3.510725f ); }; CurrentPlayer->SetMovement( MOVE_UNROOT, 1 ); CurrentPlayer->CastSpell( CurrentPlayer, 42867, true ); // 24742 _gameobject->SetUInt32Value(GAMEOBJECT_FLAGS,0); mPlayerGuid = 0; RemoveAIUpdateEvent(); };
void OnActivate( PlayerPointer pPlayer ) { if ( pPlayer == NULLPLR || mPlayerGuid != 0 ) return; // Do you think we should look for ai owner ? /*GameObjectPointer BlastCannon = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 180515 ); if ( BlastCannon != NULLGOB ) BlastCannon->SetUInt32Value( GAMEOBJECT_FLAGS, 33 );*/ pPlayer->CastSpell( pPlayer, 24832, true ); pPlayer->SetMovement( MOVE_ROOT, 1 ); _gameobject->PlaySoundToSet( 8476 ); mPlayerGuid = pPlayer->GetGUID(); RegisterAIUpdateEvent( 2200 ); };