bool GOHello_go_orb_of_the_blue_flight(Player *plr, GameObject* go)
{
    if(go->GetUInt32Value(GAMEOBJECT_FACTION) == 35){
        ScriptedInstance* pInstance = (go->GetInstanceData());
        float x,y,z, dx,dy,dz;
        go->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
        plr->CastSpell(plr, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, true);
        go->SetUInt32Value(GAMEOBJECT_FACTION, 0);
        Unit* Kalec = CAST_CRE(Unit::GetUnit(*plr, pInstance->GetData64(DATA_KALECGOS_KJ)));
        //Kalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
        go->GetPosition(x,y,z);
        for(uint8 i = 0; i < 4; ++i){
            DynamicObject* Dyn = Kalec->GetDynObject(SPELL_RING_OF_BLUE_FLAMES);
            if(Dyn){
                Dyn->GetPosition(dx,dy,dz);
                if(x == dx && dy == y && dz == z){
                    Dyn->RemoveFromWorld();
                    break;
                }
            }
        }
        go->Refresh();
    }
    return true;
}
Exemple #2
0
    void EmpowerOrb(bool all)
    {
        if(!Orb[OrbsEmpowered])
            return;
        uint8 random = rand()%3;
        if(all) {
            m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
            for(uint8 i = 0; i < 4; ++i) {
                if(!Orb[i]) return;
                Orb[i]->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES);
                Orb[i]->SetUInt32Value(GAMEOBJECT_FACTION, 35);
                Orb[i]->setActive(true);
                Orb[i]->Refresh();
            }
        } else {
            float x,y,z, dx,dy,dz;
            Orb[random]->GetPosition(x,y,z);
            for(uint8 i = 0; i < 4; ++i) {
                DynamicObject* Dyn = m_creature->GetDynObject(SPELL_RING_OF_BLUE_FLAMES);
                if(Dyn) {
                    Dyn->GetPosition(dx,dy,dz);
                    if(x == dx && dy == y && dz == z) {
                        Dyn->RemoveFromWorld();
                        break;
                    }
                }
            }
            Orb[random]->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES);
            Orb[random]->SetUInt32Value(GAMEOBJECT_FACTION, 35);
            Orb[random]->setActive(true);
            Orb[random]->Refresh();
            ++OrbsEmpowered;
        }
        ++EmpowerCount;

        switch(EmpowerCount) {
        case 1:
            DoScriptText(SAY_KALEC_ORB_READY1, m_creature);
            break;
        case 2:
            DoScriptText(SAY_KALEC_ORB_READY2, m_creature);
            break;
        case 3:
            DoScriptText(SAY_KALEC_ORB_READY3, m_creature);
            break;
        case 4:
            DoScriptText(SAY_KALEC_ORB_READY4, m_creature);
            break;
        }
    }