本文整理汇总了C++中CreaturePointer::isAlive方法的典型用法代码示例。如果您正苦于以下问题:C++ CreaturePointer::isAlive方法的具体用法?C++ CreaturePointer::isAlive怎么用?C++ CreaturePointer::isAlive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreaturePointer
的用法示例。
在下文中一共展示了CreaturePointer::isAlive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShatteringStomp
bool ShatteringStomp(uint32 i, SpellPointer pSpell)
{
if( !pSpell->u_caster )
return false;
UnitPointer _unit = pSpell->u_caster;
CreaturePointer golem = NULLCREATURE;
for(unordered_set<ObjectPointer>::iterator itr = _unit->GetInRangeSetBegin(); itr != _unit->GetInRangeSetEnd(); ++itr)
{
if( (*itr) && (*itr)->IsCreature() )
{
golem = TO_CREATURE((*itr));
if( golem->isAlive() && golem->creature_info && golem->creature_info->Id == MOLTEN_GOLEM_ENTRY )
{
uint32 spellid = pSpell->m_spellInfo->Id == 59529 ? 59527 : 52429;
CreaturePointer Golem = TO_CREATURE( (*itr) );
Golem->CastSpell( Golem, spellid, true );
for( uint8 i=0; i<7; i++ )
Golem->SchoolImmunityList[i] = 0;
_unit->DealDamage( Golem, Golem->GetHealth(),0,0,0);
}
}
}
return true;
}
示例2: OnLoad
void OnLoad()
{
if(!_unit)
return
_unit->Despawn(60*1000, 0);
CreaturePointer cialo = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 5307);
if(!cialo)
return;
if(!cialo->isAlive())
cialo->Despawn(1, 6*60*1000);
}
示例3: OnActivate
void OnActivate(PlayerPointer pPlayer)
{
if(!pPlayer)
return;
QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(1150);
if(qle == NULL)
return;
CreaturePointer grenka = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 4490);
if(grenka)
{
if(!grenka->isAlive())
grenka->Despawn( 5000, 120000 );
else
return;
}
CreaturePointer grenkaspawn = sEAS.SpawnCreature(pPlayer, 4490, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 0);
if ( grenkaspawn != NULL )
grenkaspawn->Despawn(6*60*1000, 0);
}