• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetPlayerInMap函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetPlayerInMap函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPlayerInMap函数的具体用法?C++ GetPlayerInMap怎么用?C++ GetPlayerInMap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetPlayerInMap函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch

void instance_stratholme::DoScarletBastionDefense(uint8 uiStep, Creature* pCreature)
{
    if (!pCreature)
        return;

    switch (uiStep)
    {
        case BARRICADE:
        case STAIRS:
            DoMoveBackDefenders(uiStep, pCreature);
            return;
        case TIMMY:
            pCreature->SummonCreature(NPC_TIMMY_THE_CRUEL, aScourgeInvaders[0].m_fX, aScourgeInvaders[0].m_fY, aScourgeInvaders[0].m_fZ, aScourgeInvaders[0].m_fO, TEMPSPAWN_DEAD_DESPAWN, 0);
            return;
        // Scarlet guards spawned
        case HALL_OF_LIGHTS:
        case INNER_BASTION_2:
            DoScriptText(ScarletEventYells[uiStep], pCreature);
            if (Player* pPlayer = GetPlayerInMap())
                DoSpawnScarletGuards(uiStep, pPlayer);
            return;
        // Scourge invading
        case ENTRANCE:
        case INNER_BASTION_1:
            DoScriptText(ScarletEventYells[uiStep], pCreature);
        case CRIMSON_THRONE:
            if (Player* pPlayer = GetPlayerInMap())
                DoSpawnScourgeInvaders(uiStep, pPlayer);
    }
}
开发者ID:michalpolko,项目名称:cmangos,代码行数:30,代码来源:instance_stratholme.cpp


示例2: switch

void instance_trial_of_the_crusader::JustDidDialogueStep(int32 iEntry)
{
    switch (iEntry)
    {
        case NPC_RAMSEY_1:
        case NPC_RAMSEY_2:
        case NPC_RAMSEY_3:
        case NPC_RAMSEY_4:
        case NPC_RAMSEY_5:
            DoSummonRamsey(iEntry);
            break;
        case SAY_VARIAN_BEAST_1:
            if (Player* pPlayer = GetPlayerInMap())
            {
                if (Creature* pBeasts = pPlayer->SummonCreature(NPC_BEAST_COMBAT_STALKER, aSpawnPositions[0][0], aSpawnPositions[0][1], aSpawnPositions[0][2], aSpawnPositions[0][3], TEMPSUMMON_DEAD_DESPAWN, 0))
                    pBeasts->SummonCreature(NPC_GORMOK, aSpawnPositions[1][0], aSpawnPositions[1][1], aSpawnPositions[1][2], aSpawnPositions[1][3], TEMPSUMMON_DEAD_DESPAWN, 0);
            }
            break;
        case NPC_FIZZLEBANG:
            if (Player* pPlayer = GetPlayerInMap())
                pPlayer->SummonCreature(NPC_FIZZLEBANG, aSpawnPositions[5][0], aSpawnPositions[5][1], aSpawnPositions[5][2], aSpawnPositions[5][3], TEMPSUMMON_DEAD_DESPAWN, 0);
            break;
        case SAY_WILFRED_JARAXXUS_INTRO_3:
            if (Player* pPlayer = GetPlayerInMap())
                pPlayer->SummonCreature(NPC_JARAXXUS, aSpawnPositions[6][0], aSpawnPositions[6][1], aSpawnPositions[6][2], aSpawnPositions[6][3], TEMPSUMMON_DEAD_DESPAWN, 0);
            break;
        case NPC_FJOLA:
            if (Player* pPlayer = GetPlayerInMap())
            {
                pPlayer->SummonCreature(NPC_FJOLA, aSpawnPositions[7][0], aSpawnPositions[7][1], aSpawnPositions[7][2], aSpawnPositions[7][3], TEMPSUMMON_DEAD_DESPAWN, 0);
                pPlayer->SummonCreature(NPC_EYDIS, aSpawnPositions[8][0], aSpawnPositions[8][1], aSpawnPositions[8][2], aSpawnPositions[8][3], TEMPSUMMON_DEAD_DESPAWN, 0);
            }
            break;
    }
}
开发者ID:deadmaruss,项目名称:scriptdev2,代码行数:35,代码来源:instance_trial_of_the_crusader.cpp


示例3: DoTaunt

void instance_naxxramas::Update(uint32 uiDiff)
{
    if (m_uiTauntTimer)
    {
        if (m_uiTauntTimer <= uiDiff)
        {
            DoTaunt();
            m_uiTauntTimer = 0;
        }
        else
            m_uiTauntTimer -= uiDiff;
    }

    if (m_uiSapphSpawnTimer)
    {
        if (m_uiSapphSpawnTimer <= uiDiff)
        {
            if (Player* pPlayer = GetPlayerInMap())
                pPlayer->SummonCreature(NPC_SAPPHIRON, aSapphPositions[0], aSapphPositions[1], aSapphPositions[2], aSapphPositions[3], TEMPSUMMON_DEAD_DESPAWN, 0);

            m_uiSapphSpawnTimer = 0;
        }
        else
            m_uiSapphSpawnTimer -= uiDiff;
    }

    m_dialogueHelper.DialogueUpdate(uiDiff);
}
开发者ID:kotishe,项目名称:server-1,代码行数:28,代码来源:instance_naxxramas.cpp


示例4: DoSpawnBridgeWave

void instance_mechanar::DoSpawnBridgeWave()
{
    if (Player* pPlayer = GetPlayerInMap(true, false))
    {
        for (uint8 i = 0; i < MAX_BRIDGE_TRASH; ++i)
        {
            // Skip the blank entries
            if (aBridgeEventLocs[m_uiBridgeEventPhase][i].m_uiSpawnEntry == 0)
                break;

            if (Creature* pTemp = pPlayer->SummonCreature(aBridgeEventLocs[m_uiBridgeEventPhase][i].m_uiSpawnEntry, aBridgeEventLocs[m_uiBridgeEventPhase][i].m_fX, aBridgeEventLocs[m_uiBridgeEventPhase][i].m_fY, aBridgeEventLocs[m_uiBridgeEventPhase][i].m_fZ, aBridgeEventLocs[m_uiBridgeEventPhase][i].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0))
            {
                pTemp->CastSpell(pTemp, SPELL_ETHEREAL_TELEPORT, false);

                switch (m_uiBridgeEventPhase)
                {
                    case 1:                                 // These waves should attack the player directly
                    case 2:
                    case 4:
                    case 5:
                        pTemp->AI()->AttackStart(pPlayer);
                        break;
                    case 6:                                 // Pathaleon
                        DoScriptText(SAY_PATHALEON_INTRO, pTemp);
                        break;
                }
            }
        }
    }
    ++m_uiBridgeEventPhase;
}
开发者ID:Stylerdk,项目名称:GaryMoveOut_2.4.3_Backup,代码行数:31,代码来源:instance_mechanar.cpp


示例5: Update

    void Update(uint32 diff)
    {
        if (BaronRun_Timer)
        {
            if (BaronRun_Timer <= diff)
            {
                if (GetData(TYPE_BARON_RUN) != DONE)
                    SetData(TYPE_BARON_RUN, FAIL);
                BaronRun_Timer = 0;
                debug_log("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN));
            }else BaronRun_Timer -= diff;
        }

        if (SlaugtherSquare_Timer)
        {
            if (SlaugtherSquare_Timer <= diff)
            {
                if (Player *p = GetPlayerInMap())
                {
                    for(uint8 i = 0; i < 4; i++)
                        p->SummonCreature(C_BLACK_GUARD,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000);

                    UpdateGoState(ziggurat4GUID,0,false);
                    UpdateGoState(ziggurat5GUID,0,false);
                    debug_log("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron.");
                }
                SlaugtherSquare_Timer = 0;
            }else SlaugtherSquare_Timer -= diff;
        }
    }
开发者ID:ekzobam,项目名称:HGCore,代码行数:30,代码来源:instance_stratholme.cpp


示例6: CanProgressEvent

    //what other conditions to check?
    bool CanProgressEvent()
    {
        if (!GetPlayerInMap())
            return false;

        return true;
    }
开发者ID:Bootz,项目名称:SF1,代码行数:8,代码来源:instance_dark_portal.cpp


示例7: GetPlayerInMap

void instance_sunken_temple::DoSpawnAtalarionIfCan()
{
    // Return if already summoned
    if (GetSingleCreatureFromStorage(NPC_ATALARION))
    {
        return;
    }

    Player* pPlayer = GetPlayerInMap();
    if (!pPlayer)
    {
        return;
    }

    pPlayer->SummonCreature(NPC_ATALARION, aSunkenTempleLocation[0].m_fX, aSunkenTempleLocation[0].m_fY, aSunkenTempleLocation[0].m_fZ, aSunkenTempleLocation[0].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0);

    // Spawn the idol of Hakkar
    DoRespawnGameObject(GO_IDOL_OF_HAKKAR, 30 * MINUTE);

    // Spawn the big green lights
    for (GuidList::const_iterator itr = m_luiBigLightGUIDs.begin(); itr != m_luiBigLightGUIDs.end(); ++itr)
    {
        DoRespawnGameObject(*itr, 30 * MINUTE);
    }
}
开发者ID:haidusg,项目名称:scripts,代码行数:25,代码来源:instance_sunken_temple.cpp


示例8: Update

void instance_temple_of_ahnqiraj::Update(uint32 uiDiff)
{
    m_dialogueHelper.DialogueUpdate(uiDiff);

    if (GetData(TYPE_CTHUN) == IN_PROGRESS || GetData(TYPE_CTHUN) == DONE)
        return;

    if (m_uiCthunWhisperTimer < uiDiff)
    {
        if (Player* pPlayer = GetPlayerInMap())
        {
            if (Creature* pCthun = GetSingleCreatureFromStorage(NPC_CTHUN))
            {
                // ToDo: also cast the C'thun Whispering charm spell - requires additional research
                switch (urand(0, 7))
                {
                    case 0: DoScriptText(SAY_CTHUN_WHISPER_1, pCthun, pPlayer); break;
                    case 1: DoScriptText(SAY_CTHUN_WHISPER_2, pCthun, pPlayer); break;
                    case 2: DoScriptText(SAY_CTHUN_WHISPER_3, pCthun, pPlayer); break;
                    case 3: DoScriptText(SAY_CTHUN_WHISPER_4, pCthun, pPlayer); break;
                    case 4: DoScriptText(SAY_CTHUN_WHISPER_5, pCthun, pPlayer); break;
                    case 5: DoScriptText(SAY_CTHUN_WHISPER_6, pCthun, pPlayer); break;
                    case 6: DoScriptText(SAY_CTHUN_WHISPER_7, pCthun, pPlayer); break;
                    case 7: DoScriptText(SAY_CTHUN_WHISPER_8, pCthun, pPlayer); break;
                }
            }
        }
        m_uiCthunWhisperTimer = urand(1.5 * MINUTE * IN_MILLISECONDS, 5 * MINUTE * IN_MILLISECONDS);
    }
    else
        m_uiCthunWhisperTimer -= uiDiff;
}
开发者ID:Evildead666,项目名称:scripts,代码行数:32,代码来源:instance_temple_of_ahnqiraj.cpp


示例9: GetPlayerInMap

void instance_scholomance::DoSpawnGandlingIfCan(bool bByPlayerEnter)
{
    // Do not summon, if event finished
    if (m_auiEncounter[TYPE_GANDLING] == DONE)
        return;

    // Summon only once
    if (GetSingleCreatureFromStorage(NPC_DARKMASTER_GANDLING))
        return;

    Player* pPlayer = GetPlayerInMap();
    if (!pPlayer)
        return;

    // Check if all the six bosses are done first
    if (m_auiEncounter[TYPE_MALICIA] == DONE && m_auiEncounter[TYPE_THEOLEN] == DONE && m_auiEncounter[TYPE_POLKELT] == DONE &&
            m_auiEncounter[TYPE_RAVENIAN] == DONE && m_auiEncounter[TYPE_ALEXEI_BAROV] == DONE && m_auiEncounter[TYPE_ILLUCIA_BAROV] == DONE)
    {
        if (Creature* pGandling = pPlayer->SummonCreature(NPC_DARKMASTER_GANDLING, aGandlingSpawnLocs[0].m_fX, aGandlingSpawnLocs[0].m_fY, aGandlingSpawnLocs[0].m_fZ, aGandlingSpawnLocs[0].m_fO, TEMPSPAWN_DEAD_DESPAWN, 0))
        {
            // Switch model to Christmas Gandling if Winter Veil event is active
            if (IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL))
                pGandling->CastSpell(pGandling, SPELL_XMAS_GANDLING, TRIGGERED_NONE);

            if (!bByPlayerEnter)
                DoScriptText(SAY_GANDLING_SPAWN, pGandling);
        }
    }
}
开发者ID:cala,项目名称:mangos-classic,代码行数:29,代码来源:instance_scholomance.cpp


示例10: GetPlayerInMap

void instance_scholomance::DoSpawnGandlingIfCan(bool bByPlayerEnter)
{
    // Do not summon, if event finished
    if (m_auiEncounter[TYPE_GANDLING] == DONE)
        return;

    // Summon only once
    if (GetSingleCreatureFromStorage(NPC_DARKMASTER_GANDLING))
        return;

    Player* pPlayer = GetPlayerInMap();
    if (!pPlayer)
        return;

    // Check if all the six bosses are done first
    if (m_auiEncounter[TYPE_MALICIA] == DONE && m_auiEncounter[TYPE_THEOLEN] == DONE && m_auiEncounter[TYPE_POLKELT] == DONE &&
            m_auiEncounter[TYPE_RAVENIAN] == DONE && m_auiEncounter[TYPE_ALEXEI_BAROV] == DONE && m_auiEncounter[TYPE_ILLUCIA_BAROV] == DONE)
    {
        if (Creature* pGandling = pPlayer->SummonCreature(NPC_DARKMASTER_GANDLING, aGandlingSpawnLocs[0].m_fX, aGandlingSpawnLocs[0].m_fY, aGandlingSpawnLocs[0].m_fZ, aGandlingSpawnLocs[0].m_fO, TEMPSPAWN_DEAD_DESPAWN, 0))
        {
            if (!bByPlayerEnter)
                DoScriptText(SAY_GANDLING_SPAWN, pGandling);
        }
    }
}
开发者ID:krullgor,项目名称:mangos-wotlk,代码行数:25,代码来源:instance_scholomance.cpp


示例11: GetMonsterInMap

CCharacter* CMap::GetCharInMap( unsigned int id )
{
    CMonster* monster = GetMonsterInMap( id );
    if(monster!=NULL)
        return (CCharacter*) monster;
    CPlayer* player = GetPlayerInMap( id );
    if(player!=NULL)
        return (CCharacter*) player;
    return NULL;
}
开发者ID:RavenX8,项目名称:osirose,代码行数:10,代码来源:mapfunctions.cpp


示例12: HandleGameObject

    void HandleGameObject(uint64 guid, uint32 state)
    {
        Player *player = GetPlayerInMap();

        if (!player || !guid)
            return;

        if (GameObject *go = GameObject::GetGameObject(*player,guid))
            go->SetGoState(GOState(state));
    }
开发者ID:Dolmero,项目名称:L4G_Core,代码行数:10,代码来源:instance_blackrock_depths.cpp


示例13: SetData

    void SetData(uint32 type, uint32 data)
    {
        Player* player = GetPlayerInMap();

        if (!player)
        {
            debug_log("BSCR: Instance Steamvault: SetData (Type: %u Data %u) cannot find any player.", type, data);
            return;
        }

        switch (type)
        {
            case TYPE_HYDROMANCER_THESPIA:
                if (data == SPECIAL)
                {
                    if (GameObject* _go = GameObject::GetGameObject(*player,AccessPanelHydro))
                        _go->SetGoState(GO_STATE_ACTIVE);

                    if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)
                    {
                        if (GameObject* _go = GameObject::GetGameObject(*player,MainChambersDoor))
                            _go->SetGoState(GO_STATE_ACTIVE);
                    }
                    debug_log("BSCR: Instance Steamvault: Access panel used.");
                }
                Encounter[0] = data;
                break;
            case TYPE_MEKGINEER_STEAMRIGGER:
                if (data == SPECIAL)
                {
                    if (GameObject* _go = GameObject::GetGameObject(*player,AccessPanelMek))
                        _go->SetGoState(GO_STATE_ACTIVE);

                    if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)
                    {
                     if (GameObject* _go = GameObject::GetGameObject(*player,MainChambersDoor))
                      _go->SetGoState(GO_STATE_ACTIVE);
                    }
                    debug_log("BSCR: Instance Steamvault: Access panel used.");
                }
                Encounter[1] = data;
                break;
            case TYPE_WARLORD_KALITHRESH:
                Encounter[2] = data;
                break;
            case TYPE_DISTILLER:
                Encounter[3] = data;
                break;
        }

        if (data == DONE || data == SPECIAL)
            SaveToDB();
    }
开发者ID:morno,项目名称:blizzlikecore,代码行数:53,代码来源:instance_steam_vault.cpp


示例14: GetPlayerInMap

void instance_ruins_of_ahnqiraj::DoSapwnAndorovIfCan()
{
    if (GetSingleCreatureFromStorage(NPC_GENERAL_ANDOROV))
        return;

    Player* pPlayer = GetPlayerInMap();
    if (!pPlayer)
        return;

    for (uint8 i = 0; i < MAX_HELPERS; ++i)
        pPlayer->SummonCreature(aAndorovSpawnLocs[i].m_uiEntry, aAndorovSpawnLocs[i].m_fX, aAndorovSpawnLocs[i].m_fY, aAndorovSpawnLocs[i].m_fZ, aAndorovSpawnLocs[i].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0);
}
开发者ID:Atari007,项目名称:scripts,代码行数:12,代码来源:instance_ruins_of_ahnqiraj.cpp


示例15: GetPlayerInMap

void instance_ruins_of_ahnqiraj::DoSapwnAndorovIfCan()
{
    if (GetSingleCreatureFromStorage(NPC_GENERAL_ANDOROV))
        return;

    Player* pPlayer = GetPlayerInMap();
    if (!pPlayer)
        return;

    for (const auto& aAndorovSpawnLoc : aAndorovSpawnLocs)
        pPlayer->SummonCreature(aAndorovSpawnLoc.m_uiEntry, aAndorovSpawnLoc.m_fX, aAndorovSpawnLoc.m_fY, aAndorovSpawnLoc.m_fZ, aAndorovSpawnLoc.m_fO, TEMPSPAWN_DEAD_DESPAWN, 0);
}
开发者ID:Ghaster,项目名称:mangos-classic,代码行数:12,代码来源:instance_ruins_of_ahnqiraj.cpp


示例16: HandleGameObject

    void HandleGameObject(uint64 guid, uint32 state)
    {
        Player *player = GetPlayerInMap();

        if (!player || !guid)
        {
            debug_log("SD2: Instance Razorfen Kraul: HandleGameObject fail");
            return;
        }

        if (GameObject *go = GameObject::GetGameObject(*player,guid))
            go->SetGoState(GOState(state));
    }
开发者ID:Dolmero,项目名称:L4G_Core,代码行数:13,代码来源:instance_razorfen_kraul.cpp


示例17: GetInstancePosition

void instance_culling_of_stratholme::DoSpawnArthasIfNeeded()
{
    Creature* pArthas = instance->GetCreature(m_uiArthasGUID);
    if (pArthas && pArthas->isAlive())
        return;

    uint8 uiPosition = GetInstancePosition();
    if (uiPosition && uiPosition <= MAX_ARTHAS_SPAWN_POS)
	{
        if (Player* pPlayer = GetPlayerInMap())
            pPlayer->SummonCreature(NPC_ARTHAS, m_aArthasSpawnLocs[uiPosition-1].m_fX, m_aArthasSpawnLocs[uiPosition-1].m_fY, m_aArthasSpawnLocs[uiPosition-1].m_fZ, m_aArthasSpawnLocs[uiPosition-1].m_fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
	}
}
开发者ID:Dkocir,项目名称:ScriptDev2_2010,代码行数:13,代码来源:instance_culling_of_stratholme.cpp


示例18: HandleGameObject

    void HandleGameObject(uint64 guid, uint32 state)
    {
        Player *player = GetPlayerInMap();

        if (!player || !guid)
        {
            debug_log("TSCR: Shadow Labyrinth: HandleGameObject fail");
            return;
        }

        if (GameObject *go = GameObject::GetGameObject(*player,guid))
            go->SetGoState(state);
    }
开发者ID:Bootz,项目名称:TC-One,代码行数:13,代码来源:instance_shadow_labyrinth.cpp


示例19: DoSpawnAkamaIfCan

void instance_black_temple::DoSpawnAkamaIfCan()
{
    if (GetData(TYPE_ILLIDAN) == DONE || GetData(TYPE_COUNCIL) != DONE)
        return;

    // If already spawned return
    if (GetSingleCreatureFromStorage(NPC_AKAMA, true))
        return;

    // Summon Akama after the council has been defeated
    if (Player* pPlayer = GetPlayerInMap())
        pPlayer->SummonCreature(NPC_AKAMA, 617.754f, 307.768f, 271.735f, 6.197f, TEMPSUMMON_DEAD_DESPAWN, 0);
}
开发者ID:Ankso,项目名称:scriptdev2-tbc,代码行数:13,代码来源:instance_black_temple.cpp


示例20: DoCallNextDwarf

void instance_blackrock_depths::DoCallNextDwarf()
{
    if (Creature* pDwarf = GetSingleCreatureFromStorage(aTombDwarfes[m_uiDwarfRound]))
    {
        if (Player* pPlayer = GetPlayerInMap())
        {
            pDwarf->SetFactionTemporary(FACTION_DWARF_HOSTILE, TEMPFACTION_RESTORE_RESPAWN | TEMPFACTION_RESTORE_REACH_HOME);
            pDwarf->AI()->AttackStart(pPlayer);
        }
    }
    m_uiDwarfFightTimer = 30000;
    ++m_uiDwarfRound;
}
开发者ID:Hammerdrinker,项目名称:scripts,代码行数:13,代码来源:instance_blackrock_depths.cpp



注:本文中的GetPlayerInMap函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetPlayerInfo函数代码示例发布时间:2022-05-30
下一篇:
C++ GetPlayerGUID函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap