本文整理汇总了C++中UnSummon函数的典型用法代码示例。如果您正苦于以下问题:C++ UnSummon函数的具体用法?C++ UnSummon怎么用?C++ UnSummon使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UnSummon函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetOwner
void Totem::Update(uint32 update_diff, uint32 time )
{
Unit *owner = GetOwner();
if (!owner || !owner->isAlive() || !isAlive())
{
UnSummon(); // remove self
return;
}
if (m_duration <= update_diff)
{
UnSummon(); // remove self
return;
}
else
m_duration -= update_diff;
// Grounding totem + polymorph = unsummon
if(GetCreatureInfo()->Entry == 5925 && HasAuraType(SPELL_AURA_MOD_CONFUSE))
{
UnSummon(); // remove self
return;
}
Creature::Update( update_diff, time );
}
示例2: UnSummon
void Totem::Update(uint32 time) {
if (!m_owner->isAlive() || !isAlive()) {
UnSummon(); // remove self
return;
}
if (m_duration <= time) {
UnSummon(); // remove self
return;
} else
m_duration -= time;
Creature::Update(time);
}
示例3: UnSummon
void Puppet::Update(uint32 time)
{
Minion::Update(time);
//check if caster is channelling?
if (IsInWorld() && !isAlive())
UnSummon();
}
示例4: GetOwner
void Totem::Update(uint32 update_diff, uint32 time )
{
Unit *owner = GetOwner();
if (!owner || !owner->isAlive() || !isAlive())
{
UnSummon(); // remove self
return;
}
if (m_duration <= update_diff)
{
UnSummon(); // remove self
return;
}
else
m_duration -= update_diff;
Creature::Update( update_diff, time );
}
示例5: UnSummon
void Puppet::Update(uint32 time) {
Minion::Update(time);
//check if caster is channelling?
if (IsInWorld()) {
if (!isAlive()) {
UnSummon();
// TODO: why long distance .die does not remove it
}
}
}
示例6: GetOwner
void Totem::Update( uint32 time )
{
Unit *owner = GetOwner();
if (!owner || !owner->isAlive() || !this->isAlive())
{
UnSummon(); // remove self
return;
}
if (m_duration <= time)
{
UnSummon(); // remove self
return;
}
else
m_duration -= time;
Creature::Update( time );
}
示例7: UnSummon
void TempSummon::Update(uint32 diff)
{
Creature::Update(diff);
if (m_deathState == DEAD)
{
UnSummon();
return;
}
switch (m_type)
{
case TEMPSUMMON_MANUAL_DESPAWN:
break;
case TEMPSUMMON_TIMED_DESPAWN:
{
if (m_timer <= diff)
{
UnSummon();
return;
}
m_timer -= diff;
break;
}
case TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT:
{
if (!IsInCombat())
{
if (m_timer <= diff)
{
UnSummon();
return;
}
m_timer -= diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
break;
}
case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
{
if (m_deathState == CORPSE)
{
if (m_timer <= diff)
{
UnSummon();
return;
}
m_timer -= diff;
}
break;
}
case TEMPSUMMON_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (m_deathState == CORPSE || m_deathState == DEAD)
{
UnSummon();
return;
}
break;
}
case TEMPSUMMON_DEAD_DESPAWN:
{
if (m_deathState == DEAD)
{
UnSummon();
return;
}
break;
}
case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (m_deathState == CORPSE || m_deathState == DEAD)
{
UnSummon();
return;
}
if (!IsInCombat())
{
if (m_timer <= diff)
{
UnSummon();
return;
}
else
m_timer -= diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
break;
}
case TEMPSUMMON_TIMED_OR_DEAD_DESPAWN:
//.........这里部分代码省略.........
示例8: switch
void TemporarySummon::Update( uint32 update_diff, uint32 diff )
{
switch(m_type)
{
case TEMPSUMMON_MANUAL_DESPAWN:
break;
case TEMPSUMMON_TIMED_DESPAWN:
{
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
break;
}
case TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT:
{
if (!isInCombat())
{
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
break;
}
case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
{
if (IsCorpse())
{
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
}
break;
}
case TEMPSUMMON_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (isDead())
{
UnSummon();
return;
}
break;
}
case TEMPSUMMON_DEAD_DESPAWN:
{
if (IsDespawned())
{
UnSummon();
return;
}
break;
}
case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (isDead())
{
UnSummon();
return;
}
if (m_timer <= update_diff)
{
UnSummon();
return;
}
else
m_timer -= update_diff;
break;
}
case TEMPSUMMON_TIMED_OR_DEAD_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (IsDespawned())
{
UnSummon();
return;
}
if (m_timer <= update_diff)
{
UnSummon();
//.........这里部分代码省略.........
示例9: switch
void TemporarySummon::Update(uint32 update_diff, uint32 diff)
{
switch (m_type)
{
case TEMPSUMMON_MANUAL_DESPAWN:
break;
case TEMPSUMMON_TIMED_DESPAWN:
{
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
break;
}
case TEMPSUMMON_TIMED_OOC_DESPAWN:
{
if (!IsInCombat())
{
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
break;
}
case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
{
if (IsCorpse())
{
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
}
if (IsDespawned())
{
UnSummon();
return;
}
break;
}
case TEMPSUMMON_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (IsDead())
{
UnSummon();
return;
}
break;
}
case TEMPSUMMON_DEAD_DESPAWN:
{
if (IsDespawned())
{
UnSummon();
return;
}
break;
}
case TEMPSUMMON_TIMED_OOC_OR_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (IsDead())
{
UnSummon();
return;
}
if (!IsInCombat())
{
if (m_timer <= update_diff)
{
UnSummon();
return;
}
else
m_timer -= update_diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
break;
}
case TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
//.........这里部分代码省略.........
示例10: switch
void TemporarySpawn::Update(uint32 update_diff, uint32 diff)
{
switch (m_type)
{
case TEMPSPAWN_MANUAL_DESPAWN:
break;
case TEMPSPAWN_TIMED_DESPAWN:
{
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
break;
}
case TEMPSPAWN_TIMED_OOC_DESPAWN:
{
if (isAlive())
{
if (!isInCombat())
{
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
}
else if (IsDespawned())
{
UnSummon();
return;
}
break;
}
case TEMPSPAWN_CORPSE_TIMED_DESPAWN:
{
if (IsCorpse())
{
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
}
if (IsDespawned())
{
UnSummon();
return;
}
break;
}
case TEMPSPAWN_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (isDead())
{
UnSummon();
return;
}
break;
}
case TEMPSPAWN_DEAD_DESPAWN:
{
if (IsDespawned())
{
UnSummon();
return;
}
break;
}
case TEMPSPAWN_TIMED_OOC_OR_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (isDead())
{
UnSummon();
return;
}
if (!isInCombat())
{
if (m_timer <= update_diff)
{
UnSummon();
//.........这里部分代码省略.........
示例11: UnSummon
void TempSummon::Update(uint32 diff)
{
Creature::Update(diff);
if (m_deathState == DEAD)
{
UnSummon();
return;
}
switch (m_type)
{
case TEMPSUMMON_MANUAL_DESPAWN:
break;
case TEMPSUMMON_TIMED_DESPAWN:
{
if (m_timer <= diff)
{
if (IsAIEnabled)
AI()->JustDespawned();
UnSummon();
return;
}
m_timer -= diff;
break;
}
case TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT:
{
if (!isInCombat())
{
if (m_timer <= diff)
{
UnSummon();
return;
}
m_timer -= diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
break;
}
case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
{
if (m_deathState == CORPSE)
{
if (m_timer <= diff)
{
UnSummon();
return;
}
m_timer -= diff;
}
break;
}
case TEMPSUMMON_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (m_deathState == CORPSE || m_deathState == DEAD)
{
UnSummon();
return;
}
break;
}
case TEMPSUMMON_DEAD_DESPAWN:
{
if (m_deathState == DEAD)
{
UnSummon();
return;
}
break;
}
case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (m_deathState == CORPSE || m_deathState == DEAD)
{
UnSummon();
return;
}
if (!isInCombat())
{
if (m_timer <= diff)
{
UnSummon();
return;
}
else
m_timer -= diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
//.........这里部分代码省略.........
示例12: switch
//.........这里部分代码省略.........
// if m_deathState is DEAD, CORPSE was skipped
ua = isDead() ? TSUA_UNSUMMON : TSUA_CHECK_TIMER;
break;
}
case TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN:
{
if (IsDespawned())
ua = TSUA_UNSUMMON;
else
ua = (!isInCombat() && isAlive()) ? TSUA_CHECK_TIMER : TSUA_RESET_TIMER;
break;
}
case TEMPSUMMON_TIMED_OOC_OR_CORPSE_DESPAWN:
{
if (isDead())
ua = TSUA_UNSUMMON;
else
ua = isInCombat() ? TSUA_RESET_TIMER : TSUA_CHECK_TIMER;
break;
}
case TEMPSUMMON_LOST_OWNER_DESPAWN:
case TEMPSUMMON_DEAD_OR_LOST_OWNER_DESPAWN:
{
if (m_type == TEMPSUMMON_DEAD_OR_LOST_OWNER_DESPAWN && IsDespawned())
ua = TSUA_UNSUMMON;
else if (!GetSummoner())
{
m_type = TEMPSUMMON_TIMED_DESPAWN;
m_lifetime = DEFAULT_DESPAWN_DELAY;
ua = TSUA_RESET_TIMER;
}
break;
}
case TEMPSUMMON_TIMED_OR_DEAD_OR_LOST_OWNER_DESPAWN:
{
ua = (IsDespawned() || !GetSummoner()) ? TSUA_UNSUMMON : TSUA_CHECK_TIMER;
break;
}
case TEMPSUMMON_TIMED_OR_DEAD_OR_LOST_UNIQUENESS_DESPAWN:
{
ua = IsDespawned() ? TSUA_UNSUMMON : TSUpdateActions(TSUA_CHECK_UNIQUENESS | TSUA_CHECK_TIMER);
break;
}
case TEMPSUMMON_DEAD_OR_LOST_UNIQUENESS_DESPAWN:
{
ua = IsDespawned() ? TSUA_UNSUMMON : TSUA_CHECK_UNIQUENESS;
break;
}
default:
ua = TSUA_UNSUMMON;
sLog.outError("Temporary summoned %s have unknown type %u of", GetGuidStr().c_str(), m_type);
break;
}
if (ua & TSUA_RESET_TIMER)
{
if (m_timer != m_lifetime)
m_timer = m_lifetime;
}
else if (ua & TSUA_CHECK_TIMER)
{
if (m_timer <= update_diff)
ua = TSUA_UNSUMMON;
else
m_timer -= update_diff;
}
if (ua & TSUA_CHECK_UNIQUENESS)
{
std::list<Creature*> tlist;
MaNGOS::AllIdenticalObjectsInRangeCheck check(this, GetMap()->GetVisibilityDistance());
MaNGOS::CreatureListSearcher<MaNGOS::AllIdenticalObjectsInRangeCheck> searcher(tlist, check);
Cell::VisitGridObjects(this, searcher, GetMap()->GetVisibilityDistance(), true);
for (std::list<Creature*>::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
{
Creature* pCre = *itr;
if (!pCre || !pCre->isAlive() || !pCre->IsTemporarySummon())
continue;
if (((TemporarySummon*)pCre)->GetTempSummonType() == GetTempSummonType() &&
((TemporarySummon*)pCre)->GetSummonerGuid() == GetSummonerGuid())
{
ua = TSUA_UNSUMMON;
break;
}
}
}
if (ua & TSUA_UNSUMMON)
{
UnSummon();
return;
}
if (!m_isActive)
return;
Creature::Update(update_diff, diff);
}