本文整理汇总了C++中CAST_SUM函数的典型用法代码示例。如果您正苦于以下问题:C++ CAST_SUM函数的具体用法?C++ CAST_SUM怎么用?C++ CAST_SUM使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CAST_SUM函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JustDied
void JustDied(Unit* /*killer*/)
{
if (CAST_SUM(me))
if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (pSummoner->AI())
pSummoner->AI()->DoAction(ACTION_FLESH_TENTACLE_KILLED);
}
示例2: UpdateAI
void UpdateAI(const uint32 diff)
{
events.Update(diff);
if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA)
{
std::list<Creature*> tigers;
GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f);
if (!tigers.empty())
{
for (std::list<Creature*>::iterator itr = tigers.begin(); itr != tigers.end(); ++itr)
{
if (Unit* summoner = CAST_SUM(*itr)->GetSummoner())
if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER)
&& !summoner->isInCombat())
{
me->AddAura(SPELL_NO_SUMMON_AURA, summoner);
me->AddAura(SPELL_DETECT_INVIS, summoner);
summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true);
Talk(SAY_MATRIARCH_AGGRO, summoner->GetGUID());
}
}
}
events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000);
}
}
示例3: SetDataSummoner
void SetDataSummoner() {
if (!me->isSummon())
return;
if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
CAST_CRE(pSummon)->AI()->SetData(2, 1);
}
示例4: JustDied
void JustDied(Unit* /*pKiller*/) {
if (!me->isSummon())
return;
if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
CAST_CRE(pSummon)->AI()->SetData(2, 2);
}
示例5: EnterEvadeMode
void EnterEvadeMode()
{
if (m_creature->isSummon())
if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
pAI->RemoveSummons();
}
示例6: MoveToSummoner
void MoveToSummoner()
{
if (me->isSummon())
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
if (pSummoner)
me->GetMotionMaster()->MovePoint(0,pSummoner->GetPositionX(),pSummoner->GetPositionY(),pSummoner->GetPositionZ());
}
示例7: JustDied
void JustDied(Unit * /*killer*/)
{
if (me->isSummon())
{
if (Unit *owner = CAST_SUM(me)->GetSummoner())
CombatAI::JustDied(owner);
}
}
示例8: UpdateAI
void UpdateAI(const uint32 /*diff*/)
{
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
WrapTargetGUID = pSummoner->GetGUID();
Unit* temp = Unit::GetUnit((*me), WrapTargetGUID);
if ((temp && temp->isAlive() && !temp->HasAura(SPELL_SNAKE_WRAP_STUN)) || !temp)
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
示例9: JustDied
void JustDied(Unit* pKiller)
{
if (m_creature->isSummon())
if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
pAI->bEventInProgress = false;
if (pKiller->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(pKiller)->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_MAGNATAUR, CAST_PLR(pKiller));
}
示例10: JustDied
void JustDied(Unit* pKiller)
{
if (me->isSummon())
{
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
{
if (pSummoner && pSummoner->isAlive())
CAST_CRE(pSummoner)->AI()->SetData(1, 0);
}
}
}
示例11: InitScriptData
void InitScriptData() {
Player* pPlayer = NULL;
if (me->isSummon())
if (Unit* summoner = CAST_SUM(me)->GetSummoner())
if (summoner->GetTypeId() == TYPEID_PLAYER)
pPlayer = CAST_PLR(summoner);
if (!pPlayer)
return;
me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
Start(false, false, pPlayer->GetGUID());
}
示例12: EnterEvadeMode
void EnterEvadeMode()
{
me->DisappearAndDie();
if (me->isSummon())
{
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
{
if (pSummoner && pSummoner->isAlive())
CAST_CRE(pSummoner)->DisappearAndDie();
}
}
}
示例13: EnterCombat
void EnterCombat(Unit* pWho)
{
DoScriptText(SAY_MARZON_2, me);
if (me->isSummon())
{
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
{
if (pSummoner && pSummoner->isAlive() && !pSummoner->isInCombat())
CAST_CRE(pSummoner)->AI()->AttackStart(pWho);
}
}
}
示例14: UpdateAI
void UpdateAI(const uint32 diff)
{
if (FlyBackTimer <= diff)
{
Player *plr = NULL;
if (me->isSummon())
if (Unit *summoner = CAST_SUM(me)->GetSummoner())
if (summoner->GetTypeId() == TYPEID_PLAYER)
plr = CAST_PLR(summoner);
if (!plr)
phase = 3;
switch(phase)
{
case 0:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
FlyBackTimer = 500;
break;
case 1:
plr->GetClosePoint(x, y, z, me->GetObjectSize());
z += 2.5; x -= 2; y -= 1.5;
me->GetMotionMaster()->MovePoint(0, x, y, z);
me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
me->SetVisible(true);
FlyBackTimer = 4500;
break;
case 2:
if (!plr->isRessurectRequested())
{
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
DoCast(plr, SPELL_REVIVE, true);
me->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
}
FlyBackTimer = 5000;
break;
case 3:
me->SetVisible(false);
FlyBackTimer = 3000;
break;
case 4:
me->DisappearAndDie();
break;
default:
//Nothing To DO
break;
}
++phase;
} else FlyBackTimer-=diff;
}
示例15: KilledUnit
void KilledUnit(Unit* victim)
{
if (victim->GetTypeId() != TYPEID_UNIT)
return;
if (Unit* vehSummoner = CAST_SUM(victim)->GetSummoner())
{
vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER);
vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER);
}
me->ForcedDespawn();
}