本文整理汇总了C++中Summon函数的典型用法代码示例。如果您正苦于以下问题:C++ Summon函数的具体用法?C++ Summon怎么用?C++ Summon使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Summon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiSummonTimer <= diff)
{
Summon();
uiSummonTimer = 15*IN_MILLISECONDS;
} else uiSummonTimer -= diff;
if (uiMindFlayTimer <= diff)
{
DoCast(me->getVictim(), SPELL_MIND_FLAY);
uiMindFlayTimer = 15*IN_MILLISECONDS;
} else uiMindFlayTimer -= diff;
if (uiCurseFatigueTimer <= diff)
{
//WowWiki say "Curse of Fatigue-Kirk'thir will cast Curse of Fatigue on 2-3 targets periodically."
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_CURSE_OF_FATIGUE);
if (Unit* tankTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
DoCast(tankTarget, SPELL_CURSE_OF_FATIGUE);
uiCurseFatigueTimer = 10*IN_MILLISECONDS;
} else uiCurseFatigueTimer -= diff;
if (!me->HasAura(SPELL_FRENZY) && HealthBelowPct(10))
DoCast(me, SPELL_FRENZY, true);
DoMeleeAttackIfReady();
}
示例2: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (SummonTimer <= diff)
{
Summon();
SummonTimer = 15000;
} else SummonTimer -= diff;
if (MindFlayTimer <= diff)
{
DoCast(m_creature->getVictim(), HEROIC(SPELL_MIND_FLAY, H_SPELL_MIND_FLAY));
MindFlayTimer = 15000;
} else MindFlayTimer -= diff;
if (CurseFatigueTimer <= diff)
{
//WowWiki say "Curse of Fatigue-Kirk'thir will cast Curse of Fatigue on 2-3 targets periodically. "
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
Unit *pTarget_1 = SelectUnit(SELECT_TARGET_RANDOM, 1);
DoCast(pTarget, HEROIC(SPELL_CURSE_OF_FATIGUE, H_SPELL_CURSE_OF_FATIGUE));
DoCast(pTarget_1, HEROIC(SPELL_CURSE_OF_FATIGUE, H_SPELL_CURSE_OF_FATIGUE));
CurseFatigueTimer = 10000;
} else CurseFatigueTimer -= diff;
if (!m_creature->HasAura(SPELL_FRENZY) && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10)
m_creature->CastSpell(m_creature,SPELL_FRENZY,true);
DoMeleeAttackIfReady();
}
示例3: EnterCombat
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
Summon();
uiSummonTimer = 15*IN_MILLISECONDS;
if (pInstance)
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS);
}
示例4: EnterCombat
void EnterCombat(Unit* /*who*/)
{
Talk(SAY_AGGRO);
Summon();
uiSummonTimer = 15*IN_MILLISECONDS;
if (instance)
instance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS);
}
示例5: UpdateAI
void UpdateAI(uint32 const diff)
{
if (SummonTimer <= diff)
{
uint8 summon = urand(0,1);
Summon(summon);
SummonTimer = 15000;
} else SummonTimer -= diff;
}
示例6: EnterCombat
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
Summon();
SummonTimer = 15000;
if (pInstance)
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS);
}
示例7: EnterCombat
void EnterCombat(Unit* /*who*/) override
{
Talk(SAY_AGGRO);
_EnterCombat();
Summon();
events.ScheduleEvent(EVENT_SUMMON, 15000);
events.ScheduleEvent(EVENT_MIND_FLAY, 15000);
events.ScheduleEvent(EVENT_CURSE_FATIGUE, 12000);
}
示例8: AIUpdate
void AIUpdate()
{
if((GetHealthPercent() <= 76 && summon == 0)
|| (GetHealthPercent() <= 51 && summon == 2)
|| (GetHealthPercent() <= 25 && summon == 4))
summon += 1;
if(summon == 1 || summon == 3 || summon == 5)
Summon();
if( mRift == true && ( pChaoticRift == NULL || !pChaoticRift->isAlive() ))
{
RemoveAura(47748);
mRift = false;
};
ParentClass::AIUpdate();
};
示例9: UpdateAI
void UpdateAI(const uint32 uiDiff) override
{
if(!m_pInstance) return;
if (m_pInstance->GetData(TYPE_EVENT) == 6)
{
m_pInstance->SetData(TYPE_EVENT, 7);
Summon();
}
if(m_pInstance->GetData(TYPE_MARWYN) == SPECIAL)
{
if(m_uiSummonTimer < uiDiff)
{
++SummonCount;
m_pInstance->SetData(DATA_WAVE_COUNT,SummonCount+5);
if(SummonCount == 1)
DoScriptText(SAY_MARWYN_INTRO, m_creature);
if(SummonCount > 4)
{
m_pInstance->SetData(TYPE_MARWYN, IN_PROGRESS);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetInCombatWithZone();
}
else CallFallSoldier();
m_uiSummonTimer = 60000;
} else m_uiSummonTimer -= uiDiff;
}
if(!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
timedCast(SPELL_OBLITERATE, uiDiff);
timedCast(SPELL_WELL_OF_CORRUPTION, uiDiff);
timedCast(SPELL_SHARED_SUFFERING, uiDiff);
timedCast(SPELL_CORRUPTED_FLESH, uiDiff);
timedCast(SPELL_BERSERK, uiDiff);
DoMeleeAttackIfReady();
}
示例10: WaypointReached
void WaypointReached(uint32 uiPoint)
{
//just in case
if (GetPlayerForEscort())
if (me->GetFaction() != GetPlayerForEscort()->GetFaction())
me->SetFaction(GetPlayerForEscort()->GetFaction());
switch (uiPoint)
{
case 3:
SetEscortPaused(true);
NextStep(2000, false, 3);
break;
case 7:
SetEscortPaused(true);
NextStep(2000, false, 4);
break;
case 9:
NextStep(1000, false, 8);
break;
case 10:
NextStep(25000, false, 10);
break;
case 11:
SetEscortPaused(true);
SetInFace(true);
NextStep(1000, false, 11);
break;
case 12:
NextStep(25000, false, 18);
break;
case 13:
Summon(7);
NextStep(25000, false, 19);
break;
case 14:
SetInFace(false);
DoScriptText(SAY_BLASTMASTER_26, me);
SetEscortPaused(true);
NextStep(5000, false, 20);
break;
}
}
示例11: WaypointReached
void WaypointReached(uint32 waypointId) override
{
//just in case
if (GetPlayerForEscort())
if (me->getFaction() != GetPlayerForEscort()->getFaction())
me->setFaction(GetPlayerForEscort()->getFaction());
switch (waypointId)
{
case 3:
SetEscortPaused(true);
NextStep(2000, false, 3);
break;
case 7:
SetEscortPaused(true);
NextStep(2000, false, 4);
break;
case 9:
NextStep(1000, false, 8);
break;
case 10:
NextStep(25000, false, 10);
break;
case 11:
SetEscortPaused(true);
SetInFace(true);
NextStep(1000, false, 11);
break;
case 12:
NextStep(25000, false, 18);
break;
case 13:
Summon(6);
NextStep(25000, false, 19);
break;
case 14:
SetInFace(false);
Talk(SAY_BLASTMASTER_17);
SetEscortPaused(true);
NextStep(5000, false, 20);
break;
}
}
示例12: SummonWaveP1
void SummonWaveP1()
{
uint8 addIndex = _waveCounter & 1;
uint8 addIndexOther = uint8(addIndex ^ 1);
if (_waveCounter || !sPoolMgr->IsSpawnedObject<Quest>(QUEST_DEPROGRAMMING))
Summon(SummonEntries[addIndex], SummonPositions[addIndex * 3]);
else
Summon(NPC_DARNAVAN, SummonPositions[addIndex * 3]);
Summon(SummonEntries[addIndexOther], SummonPositions[addIndex * 3 + 1]);
Summon(SummonEntries[addIndex], SummonPositions[addIndex * 3 + 2]);
if (Is25ManRaid())
{
Summon(SummonEntries[addIndexOther], SummonPositions[addIndexOther * 3]);
Summon(SummonEntries[addIndex], SummonPositions[addIndexOther * 3 + 1]);
Summon(SummonEntries[addIndexOther], SummonPositions[addIndexOther * 3 + 2]);
Summon(SummonEntries[urand(0, 1)], SummonPositions[6]);
}
++_waveCounter;
}
示例13: UpdateAI
void UpdateAI(const uint32 uiDiff) override
{
if (!m_pInstance)
return;
if (m_pInstance->GetData(TYPE_EVENT) == 5)
{
m_pInstance->SetData(TYPE_EVENT, 6);
Summon();
}
if (m_pInstance->GetData(TYPE_FALRIC) == SPECIAL)
{
if (m_uiSummonTimer < uiDiff)
{
++SummonCount;
m_pInstance->SetData(DATA_WAVE_COUNT,SummonCount);
if(SummonCount > 4)
{
m_pInstance->SetData(TYPE_FALRIC, IN_PROGRESS);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetInCombatWithZone();
}
else CallFallSoldier();
m_uiSummonTimer = 60000;
} else m_uiSummonTimer -= uiDiff;
}
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
timedCast(SPELL_QUIVERING_STRIKE, uiDiff);
timedCast(SPELL_IMPENDING_DESPAIR, uiDiff);
timedCast(SPELL_DEFILING_HORROR, uiDiff);
timedCast(SPELL_BERSERK, uiDiff);
DoMeleeAttackIfReady();
}
示例14: Cmd_Summon_f
void Cmd_Summon_f(edict_t *ent)
{
char * name = gi.args();
edict_t * target;
int i;
for (i = 1; i < (int)(maxclients->value)+1; i++)
{
target = &g_edicts[i];
if (!target->inuse || !target->client || IsSpectator(target))
continue;
if (target == ent)
continue;
// if a specific name requested & doesn't match, skip
if (name[0] && Q_stricmp(name, target->client->pers.netname))
continue;
Summon(ent, target);
return;
}
}
示例15: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SUMMON:
Summon();
events.ScheduleEvent(EVENT_SUMMON, 15000);
break;
case EVENT_MIND_FLAY:
DoCastVictim(SPELL_MIND_FLAY);
events.ScheduleEvent(EVENT_MIND_FLAY, 15000);
break;
case EVENT_CURSE_FATIGUE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_CURSE_OF_FATIGUE);
events.ScheduleEvent(EVENT_CURSE_FATIGUE, 10000);
break;
default:
break;
}
}
if (!me->HasAura(SPELL_FRENZY) && HealthBelowPct(10))
DoCast(me, SPELL_FRENZY, true);
DoMeleeAttackIfReady();
}