Пример #1
0
 void OnGameObjectCreate(GameObject* pGo, bool add)
 {
     AddDoor(pGo, add);
     switch(pGo->GetEntry())
     {
         case GO_Leviathan_DOOR: pLeviathanDoor = add ? pGo : NULL; break;
         case GO_Kologarn_CHEST_HERO: KologarnChest = add ? pGo : NULL; break;
         case GO_Kologarn_CHEST: KologarnChest = add ? pGo : NULL; break;
         case GO_Kologarn_BRIDGE: uiKologarnBridge = pGo->GetGUID(); HandleGameObject(NULL, true, pGo); break;
         case GO_Hodir_CHEST_HERO: HodirChest = add ? pGo : NULL; break;
         case GO_Hodir_CHEST: HodirChest = add ? pGo : NULL; break;
         case GO_Hodir_Rare_CHEST: HodirRareChest = add ? pGo : NULL; break;
         case GO_Runic_DOOR: pRunicDoor = add ? pGo : NULL; break;
         case GO_Stone_DOOR: pStoneDoor = add ? pGo : NULL; break;
         case GO_Thorim_LEVER: pThorimLever = add ? pGo : NULL; break;
         case GO_Mimiron_TRAM: MimironTram = add ? pGo : NULL; break;
         case GO_Mimiron_ELEVATOR: MimironElevator = add ? pGo : NULL; break;
         case GO_Keepers_DOOR: KeepersGateGUID = pGo->GetGUID();
         {
             InstanceData *data = pGo->GetInstanceData();
             pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_LOCKED);
             if (data)
                 for (uint32 i = BOSS_MIMIRON; i < BOSS_VEZAX; ++i)
                     if (data->GetBossState(i) != DONE)
                         pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_LOCKED);
             break;
         }
     }
 }
void Model::setup()
{
    nInstance = 500;
    
    for (int i = 0; i < nInstance; i++)
    {
        InstanceData id;
        id.setup(i);
        instanceDatas.push_back(id);
    }
    
    shader.load("shader/astroBoy");
    
    loader.loadModel("model/astroBoy_walk.dae", true);
    loader.setPosition(0, 0, 0);
    loader.setScale(0.5, 0.5, 0.5);
    loader.setRotation(0, 180, 1, 0, 0);
    ofLoadImage(diffuseTex, "model/texss/red.tga");
    modelMatrix = loader.getModelMatrix();
    
    genMeshPieces();
    bindBoneIDAndWeightToAttribute();
    populateEveryAnimationMatrix();
    
    modelTransTexture.allocate(nInstance * 4, 1, GL_RGBA32F, GL_RGBA, GL_FLOAT);
}
 void SetData(uint32 a, uint32 b)
 {
     if(a == 1 && b == 1 && pInstance->GetData(DATA_EREDAR_TWINS_INTRO) == NOT_STARTED)
     {
         IntroStepCounter = 0;
         pInstance->SetData(DATA_EREDAR_TWINS_INTRO, IN_PROGRESS);
     }
 }
    void EnterEvadeMode()
    {
        if (pInstance->GetData(DATA_ALYTHESS) == DONE)
        {
            if(Unit* Alythess = me->GetUnit(pInstance->GetData64(DATA_ALYTHESS)))
                Alythess->ToCreature()->Respawn();
            pInstance->SetData(DATA_ALYTHESS, NOT_STARTED);
        }

        ScriptedAI::EnterEvadeMode();
    }
Пример #5
0
int main(int argc, char** argv){
	g_InstanceData.read("D:/Projects/test_vrptw/c101_25.txt");
	SolutionLogger *logger = new SolutionLogger();
	VrptwMACS vrp(&g_InstanceData, logger);
	vrp.run(10);
	logger->write("log.txt");
	int vehicle;
	double dist;
	int *tours = g_InstanceData.getSolutionTours(&vehicle, &dist);
	return 0;
}
    void EnterEvadeMode()
    {
        if (pInstance->GetData(DATA_SACROLASH) == DONE)
        {
            if(Unit* Sacrolash = me->GetUnit(pInstance->GetData64(DATA_SACROLASH)))
               Sacrolash->ToCreature()->Respawn();
            pInstance->SetData(DATA_SACROLASH, NOT_STARTED);
        }

        ScriptedAI::EnterEvadeMode();
    }
    void JustDied(Unit* Killer)
    {
        if (pInstance->GetData(DATA_SACROLASH) == DONE)
        {
            DoScriptText(YELL_ALY_DEAD, me);
            pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE);
        }
        else
            me->SetLootRecipient(NULL);

        pInstance->SetData(DATA_ALYTHESS, DONE);
    }
Пример #8
0
 void CheckKeepersState()
 {
     if (GameObject* pGo = instance->GetGameObject(KeepersGateGUID))
     {
         InstanceData *data = pGo->GetInstanceData();
         pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_LOCKED);
         if (data)
             for (uint32 i = BOSS_MIMIRON; i < BOSS_VEZAX; ++i)
                 if (data->GetBossState(i) != DONE)
                     pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_LOCKED);
     }
 }
Пример #9
0
bool Expedition_commander_ulduar(Player* pPlayer, Creature* pCreature)
{
    InstanceData *data = pPlayer->GetInstanceData();
    ScriptedInstance *pInstance = (ScriptedInstance *) pCreature->GetInstanceData();
    
    if (pInstance && pPlayer && data->GetBossState(BOSS_RAZORSCALE) == NOT_STARTED)
    {
        pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_1,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF);
        pPlayer->SEND_GOSSIP_MENU(13853, pCreature->GetGUID());
    }else
        pPlayer->SEND_GOSSIP_MENU(13910, pCreature->GetGUID());
    return true;
}
Пример #10
0
bool AreaTrigger_at_naxxramas_frostwyrm_wing(Player* pPlayer, AreaTriggerEntry *at)
{
    if (pPlayer->isGameMaster())
        return false;

    InstanceData *data = pPlayer->GetInstanceData();
    if (data)
        for(uint32 i = BOSS_ANUBREKHAN; i < BOSS_SAPPHIRON; ++i)
            if (data->GetBossState(i) != DONE)
                return true;

    return false;
}
Пример #11
0
    void UpdateAI(const uint32 diff)
    {
                if(!pInstance)
                        return;

                ScriptedAI::UpdateAI(diff);

                UpdateTimer = pInstance->GetData(SPECHIAL_TIMER);

        if(UpdateTimer <= diff)
        {
                        switch(pInstance->GetData(PHASE_SPECHIAL))
                        {
                                case 5:
                                        DoScriptText(SAY_INTRO_GOMROK_START_1, me);
                                        pInstance->SetData(PHASE_SPECHIAL, 6);
                                        pInstance->SetData(SPECHIAL_TIMER, 5000);
                                        break;

                                case 33:
                                        if(pInstance->GetData(PHASE_4)==DONE)
                                        {
                                                DoScriptText(SAY_JARAXXUS_OUTRO_2, me);
                                                pInstance->SetData(PHASE_SPECHIAL, 34);
                                                pInstance->SetData(SPECHIAL_TIMER, 30500);
                                        }
                                break;
                        }
        }
                else
                {
                        UpdateTimer -= diff;
                        pInstance->SetData(SPECHIAL_TIMER, UpdateTimer);
                }
    }
Пример #12
0
/*
 * READTESTDATA: read a slice of a test data set
 */
InstanceData* readtestdata(args_t a, const char *file, int size) {
    // determine start and stop indices for this processor
    int start, nextstart;
    myslice(a.myid, a.numProcs, size, start, nextstart);
    int N = nextstart - start;

    // read and return data
    InstanceData* data = new InstanceData(N, a.numFeatures, a.computeRankingMetrics, start, nextstart-1);

    // read and return data
    if (not data->read(file, size)) exit(1);
    if (a.computeRankingMetrics) data->initMetrics();
    return data;
}
Пример #13
0
bool GOHello_go_main_chambers_access_panel(Player* pPlayer, GameObject* pGo)
{
    InstanceData* pInstance = pGo->GetInstanceData();

    if (!pInstance)
        return false;

    if (pGo->GetEntry() == ACCESS_PANEL_HYDRO && pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE)
        pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL);

    if (pGo->GetEntry() == ACCESS_PANEL_MEK && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE)
        pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL);

    return true;
}
Пример #14
0
		void JustDied(Unit*)
        {
                if(pHalion->isAlive())
                    pHalion->DealDamage(pHalion, pHalion->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
				pInstance->SetData(DATA_HALION_EVENT, DONE);
                DoScriptText(SAY_DEATH, me);
        }
Пример #15
0
        void EnterCombat(Unit*)
        {
                pInstance->SetData(DATA_HALION_EVENT, IN_PROGRESS);
				DoCast(me, SPELL_TWILIGHT_PRECISION);
				pHalionTwilight->SetInCombatWithZone();              
                DoScriptText(SAY_AGGRO, me);
        }
Пример #16
0
    void Reset()
    {
        if (instance)
            instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);

        if (!IsCombatMovement())
            SetCombatMovement(true);

        m_uiPhase = PHASE_START;

        m_uiFlameBreathTimer = urand(10000, 20000);
        m_uiTailSweepTimer = urand(15000, 20000);
        m_uiCleaveTimer = urand(2000, 5000);
        m_uiWingBuffetTimer = urand(10000, 20000);

        m_uiMovePoint = urand(0, 5);
        m_uiMovementTimer = 20000;
        m_pPointData = GetMoveData();

        m_uiEngulfingFlamesTimer = 15000;
        m_uiSummonWhelpsTimer = 45000;
        m_uiBellowingRoarTimer = 30000;
        m_uiWhelpTimer = 1000;
        m_uiLairGuardTimer = 1000;

        m_uiSummonCount = 0;
        m_bIsSummoningWhelps = false;
        m_bIsSummoningLairGuards = false;
    }
    void UpdateAI(const uint32 diff)
    {
        if (IntroStepCounter < 10)
        {
            if (IntroYellTimer < diff)
            {
                IntroYellTimer = IntroStep(++IntroStepCounter);
            }
            else 
                IntroYellTimer -= diff;
        }

        if (!UpdateVictim())
            return;

        if (SpecialTimer < diff)
        {
            if (pInstance->GetData(DATA_SACROLASH) == DONE)
            {
                AddSpellToCastWithScriptText(SPELL_SHADOW_NOVA, CAST_RANDOM_WITHOUT_TANK, EMOTE_SHADOW_NOVA, false, true);
                SpecialTimer = urand(14000, 16000);
            }
            else
            {
                if(Unit* target = GetConflagTarget())
                    AddSpellToCastWithScriptText(target , SPELL_CONFLAGRATION, EMOTE_CONFLAGRATION, false, true);
                DoScriptText(YELL_CANFLAGRATION, me);
                SpecialTimer = urand(30000,35000);
            }
        }
        else
            SpecialTimer -= diff;

        if (FlamesearTimer < diff)
        {
            AddSpellToCast(SPELL_FLAME_SEAR, CAST_SELF);
            FlamesearTimer = 10000;
        }
        else
            FlamesearTimer -=diff;

        if (PyrogenicsTimer < diff)
        {
            AddSpellToCast(SPELL_PYROGENICS, CAST_SELF);
            PyrogenicsTimer = 15000;
        }
        else
            PyrogenicsTimer -= diff;

        if (EnrageTimer < diff)
        {
            AddSpellToCastWithScriptText(SPELL_ENRAGE, CAST_SELF, YELL_BERSERK);
            EnrageTimer = 360000;
        }
        else
            EnrageTimer -= diff;

        CastNextSpellIfAnyAndReady(diff);
        DoMeleeAttackIfReady();
    }
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (SpecialTimer < diff)
        {
            if (pInstance->GetData(DATA_ALYTHESS) == DONE)
            {
                AddSpellToCastWithScriptText(SPELL_CONFLAGRATION, CAST_RANDOM_WITHOUT_TANK, EMOTE_CONFLAGRATION, false, true);
                SpecialTimer = urand(14000, 16000);
            }
            else
            {
                if(Unit* target = GetNovaTarget())
                    AddSpellToCastWithScriptText(target, SPELL_SHADOW_NOVA, EMOTE_SHADOW_NOVA, false, true);
                DoScriptText(YELL_SHADOW_NOVA, me);
                SpecialTimer = urand(30000,35000);
            }
        }
        else
            SpecialTimer -= diff;

        if (ConfoundingblowTimer < diff)
        {
            AddSpellToCast(SPELL_CONFOUNDING_BLOW, CAST_TANK);
            ConfoundingblowTimer = urand(20000, 25000);
        }
        else
            ConfoundingblowTimer -= diff;

        if (ShadowimageTimer < diff)
        {
            for (int i = 0; i < 3; i++)
                DoSpawnCreature(MOB_SHADOW_IMAGE, 0, 0 , 0, frand(0, 2*M_PI), TEMPSUMMON_TIMED_DESPAWN, 15000);
            ShadowimageTimer = 20000;
        }
        else
            ShadowimageTimer -= diff;

        if (ShadowbladesTimer < diff)
        {
            AddSpellToCast(SPELL_SHADOW_BLADES, CAST_SELF);
            ShadowbladesTimer = 10000;
        }
        else
            ShadowbladesTimer -= diff;

        if (EnrageTimer < diff)
        {
            AddSpellToCastWithScriptText(SPELL_ENRAGE, CAST_SELF, YELL_ENRAGE);
            EnrageTimer = 360000;
        }
        else
            EnrageTimer -= diff;

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Пример #19
0
bool GossipHello_keeper_norgannon(Player* pPlayer, Creature* pCreature)
{
    InstanceData *data = pPlayer->GetInstanceData();
    ScriptedInstance *pInstance = (ScriptedInstance *) pCreature->GetInstanceData();
    
    if (pInstance && pPlayer)
       if (data->GetBossState(BOSS_LEVIATHAN) != DONE)
            if (data->GetBossState(BOSS_LEVIATHAN) != SPECIAL)
            {
                pPlayer->PrepareQuestMenu(pCreature->GetGUID());
                pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_1,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF);
                pPlayer->SEND_GOSSIP_MENU(13910, pCreature->GetGUID());
            }
    else pPlayer->SEND_GOSSIP_MENU(1, pCreature->GetGUID());

    return true;
}
Пример #20
0
/*
    Called from AddPersistentState
*/
void DungeonPersistentState::SaveToDB()
{
    // state instance data too
    std::string data;

    if (Map* map = GetMap())
    {
        InstanceData* iData = map->GetInstanceData();
        if (iData && iData->Save())
        {
            data = iData->Save();
            CharacterDatabase.escape_string(data);
        }
    }

    CharacterDatabase.PExecute("INSERT INTO instance VALUES ('%u', '%u', '" UI64FMTD "', '%u', '%u', '%s')", GetInstanceId(), GetMapId(), (uint64)GetResetTimeForDB(), GetDifficulty(), GetCompletedEncountersMask(), data.c_str());
}
    void Reset()
    {
        ShadowbladesTimer = 10000;
        SpecialTimer = 30000;
        ConfoundingblowTimer = 25000;
        ShadowimageTimer = 14000;
        EnrageTimer = 360000;
        DoCast(me, SPELL_SHADOWFORM);
        DoCast(me, SPELL_DUAL_WIELD);

        if (pInstance->GetData(DATA_EREDAR_TWINS_INTRO) == DONE)
            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
        else
            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
        pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED);
        pInstance->SetData(DATA_SACROLASH, NOT_STARTED);
    }
Пример #22
0
    void EnterCombat(Unit* /*pWho*/)
    {
        DoScriptText(SAY_AGGRO, me);
        me->SetInCombatWithZone();

        if (instance)
            instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
    }
Пример #23
0
    void JustReachedHome()
    {
        if(pInstance)
            pInstance->SetData(DATA_HALION_EVENT, FAIL);

        GameObject *pGOTemp = GetClosestGameObjectWithEntry(me, 7999000, 100.0f);
        if(pGOTemp)
            pGOTemp->RemoveFromWorld();
    }
 // searches for one of 5 top threat targets from sisters' threat list, but not her main target
 Unit* GetNovaTarget()
 {
     if(Creature* Alythess = me->GetCreature(pInstance->GetData64(DATA_ALYTHESS)))
     {
         Unit* target = Alythess->AI()->SelectUnit(SELECT_TARGET_TOPAGGRO, urand(0,4), 300.0f, true, Alythess->getVictimGUID());
         if(target && target->isAlive())
             return target;
     }
     return NULL;
 }
Пример #25
0
/*
    Called from AddInstanceSave
*/
void InstanceSave::SaveToDB()
{
    // save instance data too
    std::string data;

    Map *map = sMapMgr.FindMap(GetMapId(),m_instanceid);
    if(map)
    {
        ASSERT(map->IsDungeon());
        InstanceData *iData = ((InstanceMap *)map)->GetInstanceData();
        if(iData && iData->Save())
        {
            data = iData->Save();
            CharacterDatabase.escape_string(data);
        }
    }

    CharacterDatabase.PExecute("INSERT INTO instance VALUES ('%u', '%u', '"UI64FMTD"', '%u', '%s')", m_instanceid, GetMapId(), (uint64)GetResetTimeForDB(), GetDifficulty(), data.c_str());
}
Пример #26
0
bool GossipSelect_keeper_norgannon(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
    InstanceData *data = pPlayer->GetInstanceData();
    ScriptedInstance* pInstance = pCreature->GetInstanceData();
    switch(uiAction)
    {
        case GOSSIP_ACTION_INFO_DEF:
            if (pPlayer)
                pPlayer->CLOSE_GOSSIP_MENU();
            if (Creature* Norgannon = Unit::GetCreature(*pCreature, pInstance ? pInstance->GetData64(DATA_NORGANNON) : 0))
                if (Norgannon->isAlive())
                {
                    Norgannon->AI()->DoAction(ACTION_VEHICLE_RESPAWN);
                    data->SetBossState(BOSS_LEVIATHAN, SPECIAL);
               }
            break;
    }
    return true;
}
Пример #27
0
void RegisterInstance(VkInstance instance, const InstanceData &data) {
  uint32_t num_devices = 0;
  data.vkEnumeratePhysicalDevices(instance, &num_devices, nullptr);

  std::vector<VkPhysicalDevice> physical_devices(num_devices);
  data.vkEnumeratePhysicalDevices(instance, &num_devices,
                                  physical_devices.data());

  auto physical_device_map = GetGlobalContext().GetPhysicalDeviceMap();

  for (VkPhysicalDevice physical_device : physical_devices) {
    PhysicalDeviceData dat{instance};
    data.vkGetPhysicalDeviceMemoryProperties(physical_device,
                                             &dat.memory_properties_);
    data.vkGetPhysicalDeviceProperties(physical_device,
                                       &dat.physical_device_properties_);
    (*physical_device_map)[physical_device] = dat;
  }
}
Пример #28
0
    void EnterCombat(Unit*)
    {
        me->SummonGameObject(7999000, 3154.56, 535.418, 72.8889, 4.47206, 0, 0, 0.786772, -0.617243, 0);

        if (pInstance)
        {
            pInstance->SetData(DATA_HALION_EVENT, IN_PROGRESS);
            DoScriptText(SAY_AGGRO, me);
        }
    }
 // searches for one of 5 top threat targets from sisters' threat list, but not her main target
 Unit* GetConflagTarget()
 {
     if(Creature* Sacrolash = me->GetCreature(pInstance->GetData64(DATA_SACROLASH)))
     {
         
         Unit* target = Sacrolash->AI()->SelectUnit(SELECT_TARGET_TOPAGGRO, urand(0,4), 300.0f, true, Sacrolash->getVictimGUID());
         if(target && target->isAlive())
             return target;
     }
     return NULL;
 }
Пример #30
0
bool GossipSelect_npc_tcrus_announcer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
        InstanceData* pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
        if(!pInstance)
                return false;

    if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
    {
        pPlayer->CLOSE_GOSSIP_MENU();
                pInstance->SetData(PHASE_SPECHIAL, 1);
    }

    if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
    {
        pPlayer->CLOSE_GOSSIP_MENU();
                CAST_AI(npc_tcrus_announcerAI, pCreature->AI())->StartEvent();
    }

    return true;
}