Example #1
0
    void UpdateAI(const uint32 diff)
    {
		if (!m_creature->HasAura(SPELL_SUBDUED) && HasFollowState(STATE_FOLLOW_INPROGRESS))
		{
			m_creature->ForcedDespawn();
		}
        if (WithRedDragonBlood && HarpoonerGUID && !m_creature->HasAura(SPELL_RED_DRAGONBLOOD))
        {
            if (Player* pHarpooner = (Player*)Unit::GetUnit(*m_creature, HarpoonerGUID))
            {
                EnterEvadeMode();
                StartFollow(pHarpooner, 35, NULL);

                DoCast(m_creature, SPELL_SUBDUED, true);
                pHarpooner->CastSpell(pHarpooner, SPELL_DRAKE_HATCHLING_SUBDUED, true);

                m_creature->AttackStop();
                WithRedDragonBlood = false;
            }
        }

		if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        DoMeleeAttackIfReady();
    }
Example #2
0
        void ReceiveEmote(Player* player, uint32 emote)
        {
            if (following) 
                return;
			
            if (emote==TEXT_EMOTE_KISS)
            {
                if(roll_chance_i(10) && player->GetQuestStatus(QUEST_BLADE_HUMAN || QUEST_BLADE_ALLIANCE || QUEST_BLADE_HORDE || QUEST_BLADE_DWARF || QUEST_BLADE_GNOME || QUEST_BLADE_DRAENEI || QUEST_BLADE_NELF || QUEST_BLADE_ORC || QUEST_BLADE_TROLL || QUEST_BLADE_TAUREN || QUEST_BLADE_UNDEAD || QUEST_BLADE_BELF) == QUEST_STATUS_INCOMPLETE)
                {
                    if (Unit* pMaidem = me->SummonCreature(NPC_MAIDEN_OF_ASHWOOD_LAKE,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000))
                    {
                        // pMaidem->AI()->Talk(SAY_MAIDEM);
                        me->DisappearAndDie();		
                        me->Respawn(true); 
                    }
                }
                else
                {
                    player->RemoveAura(SPELL_WARTSBGONE_LIP_BALM);	
                    me->AddAura(SPELL_FROG_LOVE,me);
                    StartFollow(player, 35, NULL); 
                    following=true;
                }    
            }
        }
 void QuestAccept(Player* player, Quest const* quest) override
 {
     if (quest->GetQuestId() == QUEST_SLEEPER_AWAKENED)
     {
         me->SetStandState(UNIT_STAND_STATE_STAND);
         Talk(SAY_KER_START, player);
         StartFollow(player, FACTION_KER_ESCORTEE, quest);
     }
 }
Example #4
0
 void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override
 {
     if (eventType == AI_EVENT_START_EVENT && pInvoker->GetTypeId() == TYPEID_PLAYER)
     {
         // No idea why he has UNIT_STAND_STATE_DEAD in UDB ..
         m_creature->SetStandState(UNIT_STAND_STATE_STAND);
         StartFollow((Player*)pInvoker, 0, GetQuestTemplateStore(uiMiscValue));
     }
 }
        bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
        {
            uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
            ClearGossipMenuFor(player);
            if (action == GOSSIP_ACTION_INFO_DEF + 1)
            {
                CloseGossipMenuFor(player);

                Talk(EMOTE_START);
                StartFollow(player);
            }

            return true;
        }
Example #6
0
 void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override
 {
     // start following
     if (eventType == AI_EVENT_START_EVENT && pInvoker->GetTypeId() == TYPEID_PLAYER)
     {
         StartFollow((Player*)pInvoker, 0, GetQuestTemplateStore(uiMiscValue));
         m_uiWanderTimer = 30000;
     }
     else if (eventType == AI_EVENT_CUSTOM_A)
     {
         // resume following
         m_bIsRecalled = true;
         SetFollowPaused(false);
     }
 }
Example #7
0
    npc_kittenAI(Creature* pCreature) : FollowerAI(pCreature)
    {
        if (pCreature->GetOwner() && pCreature->GetOwner()->GetTypeId() == TYPEID_PLAYER)
        {
            StartFollow((Player*)pCreature->GetOwner());
            SetFollowPaused(true);
            DoScriptText(EMOTE_SAB_JUMP, m_creature);

            pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);

            // find a decent way to move to center of moonwell
        }

        m_uiMoonwellCooldown = 7500;
        Reset();
    }
Example #8
0
 void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 /*uiMiscValue*/) override
 {
     // start following
     if (eventType == AI_EVENT_START_EVENT && pInvoker->GetTypeId() == TYPEID_PLAYER)
     {
         StartFollow((Player*)pInvoker);
         m_uiSubduedTimer = 3 * MINUTE * IN_MILLISECONDS;
     }
     // timeout; quest failed
     else if (eventType == AI_EVENT_CUSTOM_A)
     {
         // check if the quest isn't already completed
         if (!HasFollowState(STATE_FOLLOW_COMPLETE))
         {
             // force reset
             JustRespawned();
             ScriptedAI::EnterEvadeMode();
         }
     }
 }
    void SpellHit(Unit* pCaster, const SpellEntry* pSpell)
    {
        if (pSpell->Id == SPELL_FLUTE && pCaster->GetTypeId() == TYPEID_PLAYER && m_creature->GetEntry() == NPC_RAT)
        {
            if (((Player*)pCaster)->GetQuestStatus(QUEST_ROUNDUP) == QUEST_STATUS_INCOMPLETE ||
                ((Player*)pCaster)->GetQuestStatus(QUEST_ROUNDUP) == QUEST_STATUS_COMPLETE)
            {
                m_creature->UpdateEntry(NPC_RAT_F);
                m_creature->CastSpell(m_creature, SPELL_ENTHRALLED, false);

                StartFollow((Player*)pCaster);

                if (m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE))
                    m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
            }

        }
        else if (pSpell->Id == SPELL_BASH_RATS && m_creature->GetEntry() == NPC_RAT_F)
            SetFollowComplete();
        else if (pSpell->Id == SPELL_ENTHRALLED && m_creature->getFaction() != FACTION_ESCORT_A_PASSIVE)
            m_creature->setFaction(FACTION_ESCORT_A_PASSIVE);
    }
Example #10
0
		void ReceiveEmote(Player* pPlayer, uint32 emote)
		{
			if(following) //Si la grenouille a dГ©ja recu un /bisou il ne se passe rien
				return;

			if(emote==TEXTEMOTE_KISS) // Si on fait /bisou
			{
				if(!pPlayer->HasAura(SPELL_WARTSBGONE_LIP_BALM))
					pPlayer->AddAura(SPELL_WARTS,pPlayer);
				else if(roll_chance_i(10)) // 10% de chance de trouver la grenouille
				{
					pPlayer->SummonCreature(NPC_MAIDEN_OF_ASHWOOD_LAKE,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000);
					me->DisappearAndDie();		//dГ©pop
					me->Respawn(true); //Repop 15 secondes plus tard
				}
				else
				{
					pPlayer->RemoveAura(SPELL_WARTSBGONE_LIP_BALM);	//On enleve le buff mis par l'objet de quete
					me->AddAura(SPELL_FROG_LOVE,me); //On ajoute l'aura a la grenouille (les coeurs)
					StartFollow(pPlayer, 35, NULL); //La grenouille suis le joueur
					following=true;
				}
			}
		}
Example #11
0
        void UpdateFollowerAI(const uint32 uiDiff)
        {
            if (!m_bFollowStarted)
            {
                if (Player* pSummoner = m_creature->GetCharmerOrOwnerPlayerOrPlayerItself())
                {
                    StartFollow(pSummoner, pSummoner->getFaction(), GetQuestTemplateStore(QUEST_ID_LOADER_UP));

                    if (DoCastSpellIfCan(m_creature, SPELL_CREATES_CARRIED) == CAST_OK)
                        m_bFollowStarted = true;
                }
            }

            if (m_uiDropDelayTimer)
            {
                if (m_uiDropDelayTimer <= uiDiff)
                    m_uiDropDelayTimer = 0;
                else
                    m_uiDropDelayTimer -= uiDiff;
            }

            if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
                return;
        }
Example #12
0
        void ReceiveEmote(Player* player, uint32 emote)
        {
            if(following) // If the frog has already received a /kiss, nothing happens
                return;

            if(emote==TEXT_EMOTE_KISS) // If player use emote /kiss
            {
                if(!player->HasAura(SPELL_WARTSBGONE_LIP_BALM))
                    player->AddAura(SPELL_WARTS,player);
                else if(roll_chance_i(10)) // 10% chance spawn Maiden
                {
                    player->SummonCreature(NPC_MAIDEN_OF_ASHWOOD_LAKE,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000);
                    me->DisappearAndDie();		//Despawn
                    me->Respawn(true);
                }
                else
                {
                    player->RemoveAura(SPELL_WARTSBGONE_LIP_BALM);	//It removes the buff set by the object of quest
                    me->AddAura(SPELL_FROG_LOVE,me); //It adds the aura of a frog (hearts)
                    StartFollow(player, 35, NULL); //The frog following the player
                    following=true;
                }
            }
        }
 void QuestAccept(Player* player, Quest const* quest) override
 {
     if (quest->GetQuestId() == QUEST_TOOGA)
         StartFollow(player, FACTION_TOOG_ESCORTEE, quest);
 }