本文整理汇总了C++中GetExplTargetUnit函数的典型用法代码示例。如果您正苦于以下问题:C++ GetExplTargetUnit函数的具体用法?C++ GetExplTargetUnit怎么用?C++ GetExplTargetUnit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetExplTargetUnit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckCast
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
if (caster->GetTypeId() != TYPEID_PLAYER)
return SPELL_FAILED_DONT_REPORT;
if (!GetExplTargetUnit())
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
if (Creature* target = GetExplTargetUnit()->ToCreature())
{
if (target->getLevel() > caster->getLevel())
return SPELL_FAILED_HIGHLEVEL;
// use SMSG_PET_TAME_FAILURE?
if (!target->GetCreatureTemplate()->IsTameable(caster->ToPlayer()->CanTameExoticPets()))
return SPELL_FAILED_BAD_TARGETS;
if (caster->GetPetGUID())
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
if (caster->GetCharmGUID())
return SPELL_FAILED_ALREADY_HAVE_CHARM;
}
else
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
return SPELL_CAST_OK;
}
示例2: HandleScript
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
if (Unit* target = GetExplTargetUnit())
if (caster->HasAura(SPELL_SHAMAN_PATH_OF_FLAMES_TALENT))
caster->CastSpell(target, SPELL_SHAMAN_PATH_OF_FLAMES_SPREAD, true);
}
示例3: CheckCast
SpellCastResult CheckCast()
{
if (GetCaster() == GetExplTargetUnit())
return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}
示例4: FilterTargets
void FilterTargets(std::list<WorldObject*>& targets)
{
if (!GetCaster()->ToPlayer()->GetGroup())
{
targets.clear();
targets.push_back(GetCaster());
}
else
{
targets.remove(GetExplTargetUnit());
std::list<Unit*> tempTargets;
for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith((*itr)->ToUnit()))
tempTargets.push_back((*itr)->ToUnit());
if (tempTargets.empty())
{
targets.clear();
FinishCast(SPELL_FAILED_DONT_REPORT);
return;
}
Unit* target = Trinity::Containers::SelectRandomContainerElement(tempTargets);
targets.clear();
targets.push_back(target);
}
}
示例5: HandleBeforeCast
void HandleBeforeCast()
{
Unit* caster = GetCaster();
Unit* target = GetExplTargetUnit();
if(caster && target)
{
int32 basepoints0 = 0;
if(AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_WARRIOR, 243, EFFECT_0))
{
basepoints0 = CalculatePct(caster->CalculateDamage(BASE_ATTACK, true, true), aurEff->GetAmount());
// Check for IconId duplicate
if(aurEff->GetBase() && aurEff->GetBase()->GetId() != 84919)
{
// * 6 because I need the total remaind periodic amount
basepoints0 += (target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, SPELL_AURA_PERIODIC_DAMAGE) * 6);
}
}
// Per tick damage
if(basepoints0)
{
deepWoundsAmount = basepoints0 / 6;
}
}
}
示例6: FilterTargets
void FilterTargets(std::list<Unit*>& unitList)
{
if (!GetCaster()->ToPlayer()->GetGroup())
{
unitList.clear();
unitList.push_back(GetCaster());
}
else
{
unitList.remove(GetExplTargetUnit());
std::list<Unit*> tempTargets;
for (std::list<Unit*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
if ((*itr)->GetTypeId() == TYPE_ID_PLAYER && GetCaster()->IsInRaidWith(*itr))
tempTargets.push_back(*itr);
if (tempTargets.empty())
{
unitList.clear();
FinishCast(SPELL_FAILED_DONT_REPORT);
return;
}
Unit* target = Quantum::DataPackets::SelectRandomContainerElement(tempTargets);
unitList.clear();
unitList.push_back(target);
}
}
示例7: HandleDummy
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetExplTargetUnit())
if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3))
// Make sure nobody else is channeling the same target
if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER))
GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, true, GetCastItem());
}
示例8: FilterTargets
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove(GetExplTargetUnit());
Trinity::Containers::RandomResize(targets, [this](WorldObject* target)
{
return target->GetTypeId() == TYPEID_UNIT && !target->ToUnit()->HasAura(SPELL_SHAMAN_FLAME_SHOCK_MAELSTROM, GetCaster()->GetGUID());
}, 1);
}
示例9: CheckCast
SpellCastResult CheckCast()
{
Player* caster = GetCaster()->ToPlayer();
if (Unit* target = GetExplTargetUnit())
if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target))
return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}
示例10: CheckCast
SpellCastResult CheckCast()
{
if (Unit* target = GetExplTargetUnit())
if (target->GetEntry() == NPC_LUCKY_WILHELM)
return SPELL_CAST_OK;
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_TARGET_WILHELM);
return SPELL_FAILED_CUSTOM_ERROR;
}
示例11: CheckCast
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
Unit* target = GetExplTargetUnit();
if (!target || (!caster->HasAura(SPELL_PRIEST_ABSOLUTION) && caster != target && target->IsFriendlyTo(caster)))
return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}
示例12: CheckCast
SpellCastResult CheckCast()
{
if (Battlefield* wg = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
if (Player* target = GetExplTargetUnit()->ToPlayer())
// check if we are in Wintergrasp at all, SotA uses same teleport spells
if ((target->GetZoneId() == 4197 && target->GetTeamId() != wg->GetDefenderTeam()) || target->HasAura(SPELL_WINTERGRASP_TELEPORT_TRIGGER))
return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}
示例13: CheckCast
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
if (Unit* target = GetExplTargetUnit())
if (caster == target)
if (target->HasAura(SPELL_PALADIN_FORBEARANCE) || target->HasAura(SPELL_PALADIN_IMMUNE_SHIELD_MARKER))
return SPELL_FAILED_TARGET_AURASTATE;
return SPELL_CAST_OK;
}
示例14: CheckTarget
SpellCastResult CheckTarget()
{
if (IsVampire(GetExplTargetUnit()))
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES);
return SPELL_FAILED_CUSTOM_ERROR;
}
return SPELL_CAST_OK;
}
示例15: CheckRequirement
SpellCastResult CheckRequirement()
{
if (!GetCaster()->HasAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue()))
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // This is actually correct
if (!GetExplTargetUnit())
return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}