本文整理汇总了C++中CreaturePointer::setAttackTimer方法的典型用法代码示例。如果您正苦于以下问题:C++ CreaturePointer::setAttackTimer方法的具体用法?C++ CreaturePointer::setAttackTimer怎么用?C++ CreaturePointer::setAttackTimer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreaturePointer
的用法示例。
在下文中一共展示了CreaturePointer::setAttackTimer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GossipHello
void GossipHello( ObjectPointer pObject, PlayerPointer pPlayer, bool AutoSend )
{
if ( pObject == NULL || pObject->GetTypeId() != TYPEID_ITEM || pPlayer == NULL )
return;
QuestLogEntry* QuestEntry = pPlayer->GetQuestLogForEntry( 9452 );
if ( QuestEntry == NULL )
return;
#ifndef BLIZZLIKE
//if ( QuestEntry->GetMobCount( 0 ) >= QuestEntry->GetQuest()->required_mobcount[ 0 ] )
// return;
#endif
if ( pPlayer->GetMapMgr() == NULLMAPMGR )
return;
// Meh, double object looking - we should find a way to remove this
GameObjectPointer School = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 181616 );
if ( School == NULLGOB || pPlayer->CalcDistance( School ) > 5.0f )
return;
#ifdef BLIZZLIKE
sEventMgr.AddEvent( School, &GameObject::Despawn, static_cast< uint32 >( 20000 ), EVENT_GAMEOBJECT_ITEM_SPAWN, 1000, 1, 0 );
#else
School->Despawn( 20000 );
#endif
pPlayer->CastSpell( pPlayer, dbcSpell.LookupEntry( TO_ITEM( pObject )->GetProto()->Spells[ 0 ].Id ), false );
uint32 Chance = RandomUInt( 10 );
if ( Chance <= 3 )
{
CreaturePointer NewCreature = sEAS.SpawnCreature( pPlayer, 17102, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 180000 );
if ( NewCreature != NULLCREATURE )
{
NewCreature->GetAIInterface()->StopMovement( 500 );
NewCreature->setAttackTimer( 1000, false );
NewCreature->m_noRespawn = true;
};
return;
};
sEAS.AddItem( 23614, pPlayer );
QuestEntry->SendUpdateAddKill( 1 );
QuestEntry->UpdatePlayerFields();
pPlayer->Gossip_Complete();
};