Exemple #1
0
        uint32 NextStep(uint32 Step)
        {
            Creature* Spark = Unit::GetCreature(*me, SparkGUID);

            switch(Step)
            {
            case 0:
                if (Spark)
                    Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f);
                me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f);
                return 9000; // NPCs are walking up to fire
            case 1:
                DespawnNagaFlag(true);
                DoScriptText(EMOTE_SPARK, Spark);
                return 1000;
            case 2:
                DoScriptText(GEEZLE_SAY_1, me, Spark);
                if (Spark)
                {
                    Spark->SetInFront(me);
                    me->SetInFront(Spark);
                }
                return 5000;
            case 3:
                DoScriptText(SPARK_SAY_2, Spark);
                return 7000;
            case 4:
                DoScriptText(SPARK_SAY_3, Spark);
                return 8000;
            case 5:
                DoScriptText(GEEZLE_SAY_4, me, Spark);
                return 8000;
            case 6:
                DoScriptText(SPARK_SAY_5, Spark);
                return 9000;
            case 7:
                DoScriptText(SPARK_SAY_6, Spark);
                return 8000;
            case 8:
                DoScriptText(GEEZLE_SAY_7, me, Spark);
                return 2000;
            case 9:
                me->GetMotionMaster()->MoveTargetedHome();
                if (Spark)
                    Spark->GetMotionMaster()->MovePoint(0, SparkPos[0], SparkPos[1], SparkPos[2]);
                CompleteQuest();
                return 9000;
            case 10:
                if (Spark)
                    Spark->DisappearAndDie();
                DespawnNagaFlag(false);
                me->DisappearAndDie();
            default:
                return 99999999;
            }
        }
        uint32 NextStep(uint8 Step)
        {
            Creature* Spark = ObjectAccessor::GetCreature(*me, SparkGUID);
            if (!Spark)
            {
                me->DespawnOrUnsummon(1);
                return 5000;
            }

            switch (Step)
            {
                case 0:
                    Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f);
                    me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f);
                    return 9000;
                case 1:
                    DespawnNagaFlag(true);
                    Spark->AI()->Talk(EMOTE_SPARK);
                    return 1000;
                case 2:
                    Talk(GEEZLE_SAY_1, Spark);
                    Spark->SetInFront(me);
                    me->SetInFront(Spark);
                    return 5000;
                case 3:
                    Spark->AI()->Talk(SPARK_SAY_2);
                    return 7000;
                case 4:
                    Spark->AI()->Talk(SPARK_SAY_3);
                    return 8000;
                case 5:
                    Talk(GEEZLE_SAY_4, Spark);
                    return 8000;
                case 6:
                    Spark->AI()->Talk(SPARK_SAY_5);
                    return 9000;
                case 7:
                    Spark->AI()->Talk(SPARK_SAY_6);
                    return 8000;
                case 8:
                    Talk(GEEZLE_SAY_7, Spark);
                    return 2000;
                case 9:
                    me->GetMotionMaster()->MoveTargetedHome();
                    Spark->GetMotionMaster()->MovePoint(0, SparkPos);
                    CompleteQuest();
                    return 9000;
                case 10:
                    Spark->DespawnOrUnsummon(1);
                    DespawnNagaFlag(false);
                    me->DespawnOrUnsummon(1);
                    return 5000;
                default: return 99999999;
            }
        }
Exemple #3
0
    uint32 NextStep(uint32 Step)
    {
        Creature* Spark = Unit::GetCreature((*me), SparkGUID);
        if (!Spark)
            return 99999999;

        switch (Step)
        {
        case 0:
            return 99999;
        case 1:
            DespawnNagaFlag(true);
            // @todo: this emote doesnt seem to include Spark's name
            DoScriptText(EMOTE_SPARK, Spark);
            return 1000;
        case 2:
            DoScriptText(GEEZLE_SAY_1, me, Spark);
            Spark->SetInFront(me);
            me->SetInFront(Spark);
            return 5000;
        case 3:
            DoScriptText(SPARK_SAY_2, Spark);
            return 7000;
        case 4:
            DoScriptText(SPARK_SAY_3, Spark);
            return 8000;
        case 5:
            DoScriptText(GEEZLE_SAY_4, me, Spark);
            return 8000;
        case 6:
            DoScriptText(SPARK_SAY_5, Spark);
            return 9000;
        case 7:
            DoScriptText(SPARK_SAY_6, Spark);
            return 8000;
        case 8:
            DoScriptText(GEEZLE_SAY_7, me, Spark);
            return 2000;
        case 9:
            me->GetMotionMaster()->MoveTargetedHome();
            Spark->GetMotionMaster()->MovePoint(0, -5030.95f, -11291.99f, 7.97f);
            CompleteQuest();
            return 9000;
        case 10:
            Spark->DisappearAndDie();
            DespawnNagaFlag(false);
            me->DisappearAndDie();
        default:
            return 99999999;
        }
    }
/*
 * Initialize GooglePlayGameServices
 */
void Engine::InitGooglePlayGameServices() {
  gpg::AndroidInitialization::android_main(app_);

  if (service_ == nullptr) {
    // Game Services have not been initialized, create a new Game Services.
    gpg::AndroidPlatformConfiguration platform_configuration;
    platform_configuration.SetActivity(app_->activity->clazz);

    gpg::GameServices::Builder builder;
    service_ = builder.SetOnAuthActionStarted([this](gpg::AuthOperation op) {
      OnAuthActionStarted(op);
    })
        .SetOnAuthActionFinished(
            [this](gpg::AuthOperation op, gpg::AuthStatus status) {
      OnAuthActionFinished(op, status);
    })
    .SetOnQuestCompleted([this](gpg::Quest quest){
      LOGI("Completed a quest!!");
      CompleteQuest(quest);
    })
    .Create(platform_configuration);
  }
}
    void UpdateAI(const uint32 uiDiff)
    {
        npc_escortAI::UpdateAI(uiDiff);

        if (m_bIsIntro)
        {
            if(m_uiSpeech_Timer < uiDiff)
            {
                switch(m_uiIntro_Phase)
                {
                case 0:
                    if(TeamInInstance == ALLIANCE)
                        DoScriptText(SAY_LICH_KING_INTRO_ALY, m_creature);
                    if(TeamInInstance == HORDE)
                        DoScriptText(SAY_LICH_KING_INTRO_HORDE, m_creature);
                    ++m_uiIntro_Phase;
                    m_uiSpeech_Timer = 15000;
                    break;
                case 1:
                    if(TeamInInstance == ALLIANCE)
                    {
                        if(Creature* pJaina = m_pInstance->instance->GetCreature(m_uiJainaGuid))
                            pJaina->CastSpell(m_creature, SPELL_ICE_PRISON, false);
                    }
                    if(TeamInInstance == HORDE)
                    {
                        if(Creature* pSylvanas = m_pInstance->instance->GetCreature(m_uiSylvanasGuid))
                            pSylvanas->CastSpell(m_creature, SPELL_DARK_BINDING, false);
                    }
                    //DoCast(m_creature, SPELL_STUN);
                    ++m_uiIntro_Phase;
                    m_uiSpeech_Timer = 5000;
                    break;
                case 2:
                    if(GameObject* pDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_SHADOW_DOOR_EXIT)))
                        m_pInstance->DoUseDoorOrButton(pDoor->GetGUID());
                    if(TeamInInstance == ALLIANCE)
                    {
                        if(Creature* pJaina = m_pInstance->instance->GetCreature(m_uiJainaGuid))
                        {
                            DoScriptText(SAY_JAINA_INTRO, pJaina);
                            pJaina->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
                            pJaina->GetMotionMaster()->MovePoint(0, 5577.909f, 2235.264f, 733.012f);
                            pJaina->AttackStop();
                            pJaina->DeleteThreatList();
                        }
                    }
                    if(TeamInInstance == HORDE)
                    {
                        if(Creature* pSylvanas = m_pInstance->instance->GetCreature(m_uiSylvanasGuid))
                        {
                            DoScriptText(SAY_SYLVANAS_INTRO, pSylvanas);
                            pSylvanas->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
                            pSylvanas->GetMotionMaster()->MovePoint(0, 5577.909f, 2235.264f, 733.012f);
                            pSylvanas->AttackStop();
                            pSylvanas->DeleteThreatList();
                        }
                    }
                    ++m_uiIntro_Phase;
                    m_uiSpeech_Timer = 10000;
                    break;
                case 3:
                    if(TeamInInstance == ALLIANCE)
                        if(Creature* pJaina = m_pInstance->instance->GetCreature(m_uiJainaGuid))
                            pJaina->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                    if(TeamInInstance == HORDE)
                        if(Creature* pSylvanas = m_pInstance->instance->GetCreature(m_uiSylvanasGuid))
                            pSylvanas->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                    m_creature->AttackStop();
                    m_creature->DeleteThreatList();
                    CompleteQuest();
                    m_bIsIntro = false;
                    ++m_uiIntro_Phase;
                    m_uiSpeech_Timer = 15000;
                    break;

                default:
                    m_uiSpeech_Timer = 100000;
                }
            }else m_uiSpeech_Timer -= uiDiff;
        }

        if(!m_bIsIntro && m_bIsEventInProgress)
        {
            //Return since we have no target
            if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
                return;

            // wipe check
            if (Check_Timer < uiDiff && !m_bHasWiped)
            {
                if(TeamInInstance == ALLIANCE)
                {
                    if(Creature* pJaina = m_pInstance->instance->GetCreature(m_uiJainaGuid))
                    {
                        if (m_creature->IsWithinDistInMap(pJaina, 5))
                        {
                            m_creature->DealDamage(pJaina, pJaina->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                            DoCast(m_creature, SPELL_FURY_OF_FROSTMOURNE);
                            Reset();
                            m_bHasWiped = true;
                        }
                    }
                }
                if(TeamInInstance == HORDE)
                {
                    if(Creature* pSylvanas = m_pInstance->instance->GetCreature(m_uiSylvanasGuid))
                    {
                        if (m_creature->IsWithinDistInMap(pSylvanas, 10))
                        {
                            DoCast(m_creature, SPELL_FURY_OF_FROSTMOURNE);
                            m_creature->DealDamage(pSylvanas, pSylvanas->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                            Reset();
                            m_bHasWiped = true;
                        }
                    }
                }
                Check_Timer = 500;
            }else Check_Timer -= uiDiff;
        }

        DoMeleeAttackIfReady();
    }