本文整理汇总了C++中PlayerPointer::UpdateNearbyGameObjects方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerPointer::UpdateNearbyGameObjects方法的具体用法?C++ PlayerPointer::UpdateNearbyGameObjects怎么用?C++ PlayerPointer::UpdateNearbyGameObjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerPointer
的用法示例。
在下文中一共展示了PlayerPointer::UpdateNearbyGameObjects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToLegionHold
bool ToLegionHold(uint32 i, AuraPointer pAura, bool apply)
{
if ( pAura == NULL || pAura->GetUnitCaster() == NULL || !pAura->GetUnitCaster()->IsPlayer() )
return true;
PlayerPointer pPlayer = TO_PLAYER( pAura->GetUnitCaster() );
CreaturePointer pJovaanCheck = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(-3310.743896f, 2951.929199f, 171.132538f, 21633);
if ( pJovaanCheck != NULL )
return true;
QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 10563 );
if ( pQuest == NULL )
{
pQuest = pPlayer->GetQuestLogForEntry( 10596 );
if ( pQuest == NULL )
return true;
}
if ( apply )
{
pPlayer->SetUInt32Value( UNIT_FIELD_DISPLAYID, 20366 );
pPlayer->Root();
CreaturePointer pJovaan = sEAS.SpawnCreature( pPlayer, 21633, -3310.743896f, 2951.929199f, 171.132538f, 5.054039f, 0 ); // Spawn Jovaan
if ( pJovaan != NULL )
{
pJovaan->SetUInt64Value( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2 );
if ( pJovaan->GetAIInterface() != NULL )
{
pJovaan->GetAIInterface()->SetAllowedToEnterCombat( false );
}
}
GameObjectPointer pGameObject = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 184834);
if ( pGameObject != NULL )
{
pGameObject->Despawn(60000);
pPlayer->UpdateNearbyGameObjects();
}
}
else
{
if ( pQuest->GetMobCount( 2 ) < pQuest->GetQuest()->required_mobcount[2] )
{
pQuest->SetMobCount( 2, pQuest->GetMobCount( 2 ) + 1 );
pQuest->SendUpdateAddKill( 2 );
pQuest->UpdatePlayerFields();
}
pPlayer->SetUInt32Value( UNIT_FIELD_DISPLAYID, pPlayer->GetUInt32Value( UNIT_FIELD_NATIVEDISPLAYID ) );
pPlayer->UnRoot();
}
return true;
}