本文整理汇总了C++中MoonScriptCreatureAI::SetDespawnWhenInactive方法的典型用法代码示例。如果您正苦于以下问题:C++ MoonScriptCreatureAI::SetDespawnWhenInactive方法的具体用法?C++ MoonScriptCreatureAI::SetDespawnWhenInactive怎么用?C++ MoonScriptCreatureAI::SetDespawnWhenInactive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoonScriptCreatureAI
的用法示例。
在下文中一共展示了MoonScriptCreatureAI::SetDespawnWhenInactive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AIUpdate
void AIUpdate()
{
if (GetHealthPercent() <= 75 && GetPhase() == 1)
{
_unit->SendScriptTextChatMessage(7723); // Lapdogs, all of you!
SetPhase(2);
}
else if (GetHealthPercent() <= 50 && GetPhase() == 2)
{
_unit->SendScriptTextChatMessage(7725); // Fools! Our cause is righteous!
for (int x = 0; x < 2; x++)
{
MoonScriptCreatureAI* Guard = SpawnCreature(636);
if (Guard != NULL)
{
Guard->SetDespawnWhenInactive(true);
Guard->GetUnit()->m_noRespawn = true;
}
}
SetPhase(3);
}
else if (GetHealthPercent() <= 25 && GetPhase() == 3)
{
_unit->SendScriptTextChatMessage(7727); // The Brotherhood shall prevail!
SetPhase(4);
}
ParentClass::AIUpdate();
}
示例2: AIUpdate
/*
At <= 50% He will spawn 2 Defias Blackguards
ToDo: Make them despawn WHEN he dies, also make them unlootable
*/
void AIUpdate()
{
if(GetHealthPercent() <= 75 && GetPhase() == 1)
{
Emote("Lap dogs, all of you.", Text_Yell, 5782);
SetPhase(2);
}
else if(GetHealthPercent() <= 50 && GetPhase() == 2)
{
Emote("Fools! Our cause is righteous.", Text_Yell, 5783);
// Defias Blackguard x 2
MoonScriptCreatureAI* Guard = NULL;
for(int x=0; x<2; x++)
{
Guard = SpawnCreature(636);
if(Guard == NULL)
continue;
Guard->SetDespawnWhenInactive(true);
Guard->GetUnit()->m_noRespawn = true;
Guard = NULL;
}
SetPhase(3);
}
else if(GetHealthPercent() <= 25 && GetPhase() == 3)
{
Emote("The brotherhood shall remain.", Text_Yell, 5784);
SetPhase(4);
}
ParentClass::AIUpdate();
}
示例3: AIUpdate
void AIUpdate()
{
ParentClass::AIUpdate();
if( IsTimerFinished( mSummonTime ) )
{
MoonScriptCreatureAI *Eagle = NULL;
// Spawn 3 Soaring Eagles
for(int x=0; x<3; x++)
{
Eagle = SpawnCreature(CN_SOARING_EAGLE, ( _unit->GetPositionX() + RandomFloat( 12 ) - 10 ), ( _unit->GetPositionY()+ RandomFloat( 12 ) - 15 ),
_unit->GetPositionZ(), _unit->GetOrientation(), true);
if(Eagle)
{
Eagle->AggroNearestUnit();
Eagle->SetDespawnWhenInactive(true);
}
}
Eagle = NULL;
Emote("Feed, me bruddahs!", Text_Yell, 12019);
// Restart the timer
ResetTimer( mSummonTime, 120000);
}
}