本文整理汇总了C++中GetPlayerInMap函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPlayerInMap函数的具体用法?C++ GetPlayerInMap怎么用?C++ GetPlayerInMap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetPlayerInMap函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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;
}
}
示例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);
}
示例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;
}
示例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;
}
}
示例6: CanProgressEvent
//what other conditions to check?
bool CanProgressEvent()
{
if (!GetPlayerInMap())
return false;
return true;
}
示例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);
}
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
}
示例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;
}
示例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));
}
示例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();
}
示例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);
}
示例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);
}