void MovementInform(uint32 uiMoveType, uint32 uiPointId) override { if (uiMoveType != POINT_MOTION_TYPE) return; if (uiPointId == POINT_ID_EVADE) { m_creature->SetFacingTo(fIntroPosition[3]); if (m_pInstance) m_pInstance->SetData(TYPE_DEATHBRINGER_SAURFANG, FAIL); } else if (uiPointId == POINT_ID_INTRO) { if (m_pInstance) m_pInstance->DoUseDoorOrButton(GO_SAURFANG_DOOR); // Note: this should be done only after the intro event is finished // ToDo: move this to the proper place after the intro will be implemented // Also the faction needs to be checked if it should be handled in database m_creature->setFaction(FACTION_ID_UNDEAD); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE); m_creature->SetInCombatWithZone(); } }
void MoveInLineOfSight(Unit* pWho) override { if (!m_bIsIntroDone && pWho->GetTypeId() == TYPEID_PLAYER && !((Player*)pWho)->isGameMaster() && m_creature->GetDistance2d(pWho) < 50.0f) { m_creature->GetMotionMaster()->MovePoint(POINT_ID_INTRO, fIntroPosition[0], fIntroPosition[1], fIntroPosition[2]); if (m_pInstance) m_pInstance->DoUseDoorOrButton(GO_SAURFANG_DOOR); m_bIsIntroDone = true; } ScriptedAI::MoveInLineOfSight(pWho); }
void MovementInform(uint32 uiMoveType, uint32 uiPointId) override { if (uiMoveType != POINT_MOTION_TYPE) return; if (uiPointId == POINT_ID_INTRO) { if (m_pInstance) m_pInstance->DoUseDoorOrButton(GO_SAURFANG_DOOR); // Note: this should be done only after the intro event is finished // ToDo: move this to the proper place after the intro will be implemented // Also the faction needs to be checked if it should be handled in database m_creature->SetFactionTemporary(FACTION_ID_UNDEAD, TEMPFACTION_NONE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE | UNIT_FLAG_OOC_NOT_ATTACKABLE); m_creature->SetRespawnCoord(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation()); } }