本文整理汇总了C++中Despawn函数的典型用法代码示例。如果您正苦于以下问题:C++ Despawn函数的具体用法?C++ Despawn怎么用?C++ Despawn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Despawn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AIUpdate
void AIUpdate()
{
SetAllowMelee(false);
SetCanMove(false);
timmer++;
if (summoningst == true && (timmer == 20 || timmer == 60 || timmer == 100))
{
SpawnCreature(CN_SHADOWSWORD_BERSERKER, 1871, 650, 71, 0, false);
SpawnCreature(CN_SHADOWSWORD_FURY_MAGE, 1871, 650, 71, 0, false);
SpawnCreature(CN_SHADOWSWORD_FURY_MAGE, 1748, 700, 71, 0, false);
SpawnCreature(CN_SHADOWSWORD_BERSERKER, 1748, 700, 71, 0, false);
}
if (timmer == 120)
{
timmer = 0;
summoningst = true;
switch (spawnplace)
{
case 1:
{
SpawnCreature(CN_VOID_SENTINEL, 1800, 652, 71, 0, false);
++spawnplace;
}break;
case 2:
{
SpawnCreature(CN_VOID_SENTINEL, 1798, 605, 71, 0, false);
++spawnplace;
}break;
case 3:
{
SpawnCreature(CN_VOID_SENTINEL, 1826, 650, 71, 0, false);
++spawnplace;
}break;
case 4:
{
SpawnCreature(CN_VOID_SENTINEL, 1783, 625, 71, 0, false);
++spawnplace;
}break;
case 5:
{
SpawnCreature(CN_VOID_SENTINEL, 1816, 595, 71, 0, false);
++spawnplace;
}break;
case 6:
{
SpawnCreature(CN_VOID_SENTINEL, 1844, 641, 71, 0, false);
spawnplace = 1;
}break;
}
}
if (GetHealthPercent() <= 35)
{
SpawnCreature(CN_ENTROPIUS, true);
Despawn(100,0);
}
ParentClass::AIUpdate();
}
示例2: AIUpdate
void AIUpdate()
{
if(Ogre == NULL)
return;
if(GetRange(Ogre) <= 5)
{
Ogre->SetDisplayWeaponIds(28562, 0);
Ogre->GetUnit()->SetEmoteState(92);
Ogre->GetUnit()->SetFaction(35);
Ogre->GetUnit()->SetStandState(STANDSTATE_SIT);
NdGo = GetNearestGameObject(184315);
if(NdGo == NULL)
return;
NdGo->Despawn(0, 0);
Ogre->Despawn(60 * 1000, 3 * 60 * 1000);
if(plr == NULL)
return;
QuestLogEntry* qle = plr->GetQuestLogForEntry(10512);
if(qle != NULL && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
{
qle->SetMobCount(0, qle->GetMobCount(0) + 1);
qle->SendUpdateAddKill(0);
qle->UpdatePlayerFields();
}
Despawn(0, 0);
return;
}
ParentClass::AIUpdate();
}
示例3: AIUpdate
void AIUpdate()
{
if(plr == NULL || plr->isDead() || !plr->HasAura(FROST_TOMB_SPELL))
Despawn( 0, 0 );
ParentClass::AIUpdate();
};
示例4: OnReachWP
void OnReachWP(uint32 iWaypointId, bool bForwards)
{
if (iWaypointId == 1)
{
Despawn(0, 3*60*1000);
}
}
示例5: Reset
void Reset()
{
CheckTeronTimer = 10000;
ShadowBoltTimer = 2000;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
TeronGUID = 0;
TeronGUID = pInstance->GetData64(DATA_TERONGOREFIEND);
Creature* c_Teron = NULL;
if(TeronGUID!= 0)
c_Teron = Creature::GetCreature((*me),TeronGUID);
if(c_Teron)
{
me->setFaction(c_Teron->getFaction());
if(c_Teron->getVictim())
{
me->Attack(c_Teron->getVictim(),false);
DoZoneInCombat();
float x,y,z;
me->GetPosition(x,y,z);
me->GetMotionMaster()->MovePoint(0,x,y,z+HIGH);
}else
{
Despawn();
}
}
}
示例6: UNUSED
void
sstSequence::Update( float timeStep )
{
UNUSED(timeStep); // no using of timeStep in this case; we want to use actual times from sysTimer.
float musicTime = m_mode->GetMusicTime();
m_currentTransform = GetTransformAtTime( musicTime );
const float c_rocketTime = 3.0f;
while ( m_nextBeat < m_beatCount && musicTime + c_rocketTime > m_beat[m_nextBeat] )
{
sstRocket *r = m_mode->GetAvailableRocket();
if ( r )
{
m_rocket[m_nextBeat] = r;
vsTransform2D transformAtImpact = GetTransformAtTime( m_beat[m_nextBeat] );
r->Spawn( transformAtImpact.ApplyTo(m_segment[m_nextBeat].m_position), m_beat[m_nextBeat] - musicTime, this, m_nextBeat );
}
m_nextBeat++;
}
if ( musicTime > m_end )
Despawn();
}
示例7: Despawn
void Summon::OnRemoveInRangeObject(Object* object)
{
if ((owner != NULL) && (object->GetGUID() == owner->GetGUID()))
Despawn(1, 0);
Creature::OnRemoveInRangeObject(object);
}
示例8: AIUpdate
void AIUpdate()
{
if( Ogre == NULL )
return;
if( GetRange( Ogre ) <= 5 )
{
Ogre->SetDisplayWeaponIds( 28562, 0);
Ogre->GetUnit()->SetUInt32Value( UNIT_NPC_EMOTESTATE, 92 );
Ogre->GetUnit()->SetUInt32Value( UNIT_FIELD_FACTIONTEMPLATE, 35 );
Ogre->GetUnit()->SetStandState( STANDSTATE_SIT );
Ogre->GetUnit()->_setFaction();
GameObject *GO = GetNearestGameObject(184315);
if( GO )
GO->Despawn(0);
Ogre->Despawn(60*1000, 3*60*1000);
QuestLogEntry * qle = NULL;
if( plr )
qle = plr->GetQuestLogForEntry( 10512 );
if( qle!=NULL && qle->GetMobCount( 0 ) < qle->GetQuest()->required_mobcount[0] )
{
qle->SetMobCount( 0, qle->GetMobCount( 0 )+1);
qle->SendUpdateAddKill( 0 );
qle->UpdatePlayerFields();
}
Despawn(0, 0);
}
ParentClass::AIUpdate();
}
示例9: OnDied
void OnDied( Unit* pKiller )
{
ParentClass::OnDied( pKiller );
if( !mForceDied )
ApplyAura( FELFIRE_FISSION );
Despawn( 10000, 0 );
};
示例10: RandomEmote
void MoonScriptCreatureAI::OnDied(Unit *pKiller)
{
RandomEmote(mOnDiedEmotes);
CancelAllSpells();
CancelAllTimers();
RemoveAllAuras();
if( mDespawnWhenInactive ) Despawn(DEFAULT_DESPAWN_TIMER);
}
示例11: OnDied
void OnDied(Unit* pKilled)
{
if (plr != NULL && plr->HasAura(FROST_TOMB_SPELL))
plr->RemoveAura(FROST_TOMB_SPELL);
ParentClass::OnDied(pKilled);
Despawn(1);
};
示例12: CoreHoundAI
CoreHoundAI(Creature* pCreature) : MoonScriptCreatureAI(pCreature)
{
if(IsMagmadarDead[_unit->GetInstanceID()] == true)
{
Despawn(0, 0);
return;
}
AddSpell(COREHOUND_SERRATEDBITE, Target_RandomPlayer, 10, 0, 0, 0, 10);
}
示例13: UpdateAI
void UpdateAI(const uint32 diff)
{
if(CheckTeronTimer < diff)
{
Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID));
if(Teron && Teron->isInCombat())
{
DoZoneInCombat();
Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID));
if((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
Despawn();
float newX, newY, newZ;
m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(), 3.0, newX, newY, newZ);
newZ = (newZ < 200.0) ? (newZ + 1.0) : newZ;
m_creature->GetMotionMaster()->MovePoint(1, newX, newY, newZ);
m_creature->SetSpeed(MOVE_RUN, 0.1);
}
else
Despawn();
CheckTeronTimer = 5000;
}
else
CheckTeronTimer -= diff;
if(ShadowBoltTimer < diff)
{
Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID));
if(!Teron)
return;
if(Unit *target = ((ScriptedAI*)Teron->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0, 200, true))
DoCast(target, SPELL_SHADOWBOLT);
ShadowBoltTimer = 1500+rand()%1000;
}
else
ShadowBoltTimer -= diff;
return;
}
示例14: CancelAllSpells
void MoonScriptCreatureAI::OnCombatStop(Unit *pTarget)
{
CancelAllSpells();
CancelAllTimers();
RemoveAllAuras();
SetCanMove(true);
SetBehavior(Behavior_Default);
if( mDespawnWhenInactive )
Despawn(DEFAULT_DESPAWN_TIMER);
}
示例15: CancelAllSpells
void ArcScriptCreatureAI::OnCombatStop(Unit* pTarget)
{
CancelAllSpells();
CancelAllTimers();
RemoveAllAuras();
SetBehavior(Behavior_Default);
_unit->GetAIInterface()->SetAIState(STATE_IDLE);
RemoveAIUpdateEvent();
if( mDespawnWhenInactive ) Despawn(DEFAULT_DESPAWN_TIMER);
}