void MovementInform(uint32 uiMovementType, uint32 uiPointId) override { if (uiMovementType != POINT_MOTION_TYPE) return; if (uiPointId == RIMEFANG_POINT_INITIAL_LAND_AIR) { m_creature->GetMotionMaster()->MovePoint(RIMEFANG_POINT_INITIAL_LAND, SindragosaPosition[3][0], SindragosaPosition[3][1], SindragosaPosition[3][2], false); } else if (uiPointId == RIMEFANG_POINT_INITIAL_LAND) { m_creature->GetMotionMaster()->MoveIdle(); m_creature->SetFacingTo(M_PI_F); m_bIsReady = true; SetFlying(false); } else if (uiPointId == RIMEFANG_POINT_GROUND) { m_uiPhase = RIMEFANG_PHASE_GROUND; SetFlying(false); SetCombatMovement(true); if (Unit* pVictim = m_creature->getVictim()) m_creature->GetMotionMaster()->MoveChase(pVictim); } else if (uiPointId == RIMEFANG_POINT_AIR) { m_uiPhase = RIMEFANG_PHASE_AIR; } }
void MovementInform(uint32 uiMovementType, uint32 uiPointId) { if (uiMovementType != POINT_MOTION_TYPE) return; if (uiPointId == SINDRAGOSA_POINT_GROUND_CENTER) { // fly up if (m_uiPhase == SINDRAGOSA_PHASE_GROUND) { m_uiPhase = SINDRAGOSA_PHASE_FLYING_TO_AIR; SetFlying(true); m_creature->GetMotionMaster()->MovePoint(SINDRAGOSA_POINT_AIR_CENTER, SindragosaPosition[1][0], SindragosaPosition[1][1], SindragosaPosition[1][2], false); } else // land and attack { // on aggro, after landing: set instance data and cast initial spells if (m_uiPhase == SINDRAGOSA_PHASE_AGGRO) { DoCastSpellIfCan(m_creature, SPELL_FROST_AURA, CAST_TRIGGERED); DoCastSpellIfCan(m_creature, SPELL_PERMEATING_CHILL, CAST_TRIGGERED); if (m_pInstance) m_pInstance->SetData(TYPE_SINDRAGOSA, IN_PROGRESS); } m_uiPhase = SINDRAGOSA_PHASE_GROUND; SetFlying(false); SetCombatMovement(true); if (Unit *pVictim = m_creature->getVictim()) m_creature->GetMotionMaster()->MoveChase(pVictim); } } else if (uiPointId == SINDRAGOSA_POINT_AIR_CENTER) { if (m_uiPhase == SINDRAGOSA_PHASE_AGGRO || m_uiPhase == SINDRAGOSA_PHASE_FLYING_TO_GROUND) { // land m_creature->GetMotionMaster()->MovePoint(SINDRAGOSA_POINT_GROUND_CENTER, SindragosaPosition[0][0], SindragosaPosition[0][1], SindragosaPosition[0][2], false); } else if (m_uiPhase == SINDRAGOSA_PHASE_FLYING_TO_AIR) { // fly up (air phase) m_creature->GetMotionMaster()->MovePoint(SINDRAGOSA_POINT_AIR_PHASE_2, SindragosaPosition[2][0], SindragosaPosition[2][1], SindragosaPosition[2][2], false); } } else if (uiPointId == SINDRAGOSA_POINT_AIR_PHASE_2) { // face the platform m_creature->SetOrientation(M_PI_F); m_uiPhase = SINDRAGOSA_PHASE_AIR; } }
void cPlayer::SetGameMode(eGameMode a_GameMode) { if ((a_GameMode < gmMin) || (a_GameMode >= gmMax)) { LOGWARNING("%s: Setting invalid gamemode: %d", GetName().c_str(), a_GameMode); return; } if (m_GameMode == a_GameMode) { // Gamemode already set return; } m_GameMode = a_GameMode; m_ClientHandle->SendGameMode(a_GameMode); if (!(IsGameModeCreative() || IsGameModeSpectator())) { SetFlying(false); SetCanFly(false); } m_World->BroadcastPlayerListUpdateGameMode(*this); }
void Game_Vehicle::GetOn() { if (type == Airship) { data()->remaining_ascent = SCREEN_TILE_SIZE; SetFlying(true); Main_Data::game_player->SetFlying(true); } Game_System::BgmPlay(GetBGM()); }
void UpdateAI(const uint32 uiDiff) override { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; if (m_uiPhase == RIMEFANG_PHASE_GROUND) { // Frost Breath if (m_uiFrostBreathTimer <= uiDiff) { if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_RIMEFANG_FROST_BREATH) == CAST_OK) m_uiFrostBreathTimer = urand(5000, 8000); } else m_uiFrostBreathTimer -= uiDiff; // Icy Blast - air phase if (m_uiPhaseTimer <= uiDiff) { m_uiPhaseTimer = 40000; m_uiPhase = RIMEFANG_PHASE_FLYING; SetFlying(true); SetCombatMovement(false); m_creature->GetMotionMaster()->MovePoint(RIMEFANG_POINT_AIR, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 20.0f, false); return; } else m_uiPhaseTimer -= uiDiff; DoMeleeAttackIfReady(); } else if (m_uiPhase == RIMEFANG_PHASE_AIR) { // Icy Blast if (m_uiIcyBlastTimer <= uiDiff) { if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, SPELL_RIMEFANG_ICY_BLAST, SELECT_FLAG_PLAYER)) { if (DoCastSpellIfCan(pTarget, SPELL_RIMEFANG_ICY_BLAST) == CAST_OK) { m_uiIcyBlastTimer = 3000; ++m_uiIcyBlastCounter; // phase end if (m_uiIcyBlastCounter >= m_uiIcyBlastMaxCount) { m_uiIcyBlastCounter = 0; m_uiIcyBlastTimer = 0; m_uiPhase = RIMEFANG_PHASE_FLYING; m_creature->GetMotionMaster()->MovePoint(RIMEFANG_POINT_GROUND, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() - 20.0f, false); } } } } else m_uiIcyBlastTimer -= uiDiff; } }
void MovementInform(uint32 uiMovementType, uint32 uiPointId) override { if (uiMovementType != POINT_MOTION_TYPE) return; if (uiPointId == SPINESTALKER_POINT_INITIAL_LAND_AIR) { m_creature->GetMotionMaster()->MovePoint(SPINESTALKER_POINT_INITIAL_LAND, SindragosaPosition[5][0], SindragosaPosition[5][1], SindragosaPosition[5][2], false); } else if (uiPointId == SPINESTALKER_POINT_INITIAL_LAND) { m_creature->GetMotionMaster()->MoveIdle(); m_creature->SetFacingTo(M_PI_F); m_bIsReady = true; SetFlying(false); } }
void Game_Vehicle::Update(bool process_movement) { if (!process_movement) { return; } if (IsAboard()) { SyncWithPlayer(); } else { Game_Character::UpdateMovement(); } if (type == Airship) { if (IsStopping()) { if (IsAscending()) { data()->remaining_ascent = data()->remaining_ascent - 8; } else if (IsDescending()) { data()->remaining_descent = data()->remaining_descent - 8; if (!IsDescending()) { if (CanLand()) { Main_Data::game_player->UnboardingFinished(); SetFlying(false); Main_Data::game_player->SetFlying(false); } else { // Can't land here, ascend again data()->remaining_ascent = SCREEN_TILE_SIZE; } } } } } if (type == Airship) { UpdateAnimationAirship(); } else { UpdateAnimationShip(); } }
void cPlayer::SetGameMode(eGameMode a_GameMode) { if ((a_GameMode < gmMin) || (a_GameMode >= gmMax)) { LOGWARNING("%s: Setting invalid gamemode: %d", GetName().c_str(), a_GameMode); return; } if (m_GameMode == a_GameMode) { // Gamemode already set return; } m_GameMode = a_GameMode; m_ClientHandle->SendGameMode(a_GameMode); if (!IsGameModeCreative()) { SetFlying(false); SetCanFly(false); } }
void EnterEvadeMode() { SetFlying(true); ScriptedAI::EnterEvadeMode(); }