CBasicEngine::CBasicEngine() { m_AI=0; m_AIFuncArr[0]=RandomScheme; m_AIFuncArr[1]=EatMost; m_AIFuncArr[2]=MobilityPrior; m_AIFuncArr[3]=StaticEvaluate; m_AIFuncArr[4]=StabEvaluate; SetAI(m_AI); }
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (affected) remove(); auto p = GetTarget()->ToPlayer(); if (!p) return; oldAI = p->GetAI().get(); oldAIState = GetTarget()->IsAIEnabled; p->SetAI(new player_overlord_brandAI(p)); p->GetAI()->SetGUID(GetCasterGUID()); p->IsAIEnabled = true; affected = p; }
void Dino::AddToGame() { Npc::AddToGame(); // Try making dinos stationary. This solves several problems. AddAI(new AIIdle); // AddAI(new AIGoHighGround); AddAI(new AIEatPet); // AddAI(new AIChasePet); AddAI(new AIFalling); AddAI(new AITurnToFace); // AddAI(new AIStunned); SetAI(AIIdle::NAME); // can set now that we have created scene node // (when AI state is activated, it will set animation) }
void Dino::Eat(OnFloorCharacter* pet) { Assert(!IsEating()); Assert(!IsDead()); Assert(!pet->IsDead()); Assert(pet->CanBeEaten()); SetAnim("eat"); // Change to eating behaviour SetAI(AITurnToFace::NAME); m_ai->SetTarget(pet); m_ais[AIEatPet::NAME]->SetTarget(pet); // Change texture to bloody version. BlinkCharacter* bc = dynamic_cast<BlinkCharacter*>(GetSceneNode()); Assert(bc); bc->LoadTextures(m_bloodTex[0], m_bloodTex[1]); // TODO Load the textures up front as this will hit frame rate on first load. pet->StartBeingEaten(this); // Pause action and zoom camera on Dino?? }
Dialog::Dialog(std::shared_ptr<GOCAI> ai) { SetAI(ai); JoinNewsgroup(GlobalMessageIDs::PHYSICS_BEGIN); }