本文整理汇总了C++中SetCustomCastResultMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ SetCustomCastResultMessage函数的具体用法?C++ SetCustomCastResultMessage怎么用?C++ SetCustomCastResultMessage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetCustomCastResultMessage函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckCast
SpellCastResult CheckCast()
{
if (Unit* caster = GetCaster())
{
if (caster->HasUnitState(UNIT_STATE_ROOT))
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_DO_WHILE_ROOTED);
return SPELL_FAILED_CUSTOM_ERROR;
}
}
if (Unit* caster = GetCaster())
{
Position const* pos = GetExplTargetDest();
MotionMaster* motionMaster = caster->GetMotionMaster();
float x, y, z;
caster->GetContactPoint(caster, x, y, z, CONTACT_DISTANCE);
float dist = ((pos->GetPositionZ()) - z);
if(dist > 5.0f || dist < -5.0f)
return SPELL_FAILED_NOPATH;
}
return SPELL_CAST_OK;
}
示例2: CheckCast
SpellCastResult CheckCast()
{
if (Unit* caster = GetCaster())
{
if (caster->HasUnitState(UNIT_STATE_ROOT))
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_DO_WHILE_ROOTED);
return SPELL_FAILED_CUSTOM_ERROR;
}
}
if (Unit* caster = GetCaster())
{
Position const* pos = GetExplTargetDest();
float x, y, z;
caster->GetContactPoint(caster, x, y, z, CONTACT_DISTANCE);
float dist = ((pos->GetPositionZ()) - z);
float delta = 7.5f;
if(caster->ToPlayer()->IsFalling())
delta = 40.0f;
if(dist > delta)
return SPELL_FAILED_NOPATH;
}
return SPELL_CAST_OK;
}
示例3: 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;
}
示例4: CheckTarget
SpellCastResult CheckTarget()
{
if (IsVampire(GetExplTargetUnit()))
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES);
return SPELL_FAILED_CUSTOM_ERROR;
}
return SPELL_CAST_OK;
}
示例5: CheckClass
SpellCastResult CheckClass()
{
if (GetCaster()->getClass() != CLASS_DEATH_KNIGHT)
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_BE_DEATH_KNIGHT);
return SPELL_FAILED_CUSTOM_ERROR;
}
return SPELL_CAST_OK;
}
示例6: CheckFireTotem
SpellCastResult CheckFireTotem()
{
// fire totem
if (!GetCaster()->m_SummonSlot[1])
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM);
return SPELL_FAILED_CUSTOM_ERROR;
}
return SPELL_CAST_OK;
}
示例7: CheckRequirement
SpellCastResult CheckRequirement()
{
if(GetCaster()->GetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID) == 46106 ||
GetCaster()->GetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID) == 46069 ||
GetCaster()->GetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID) == 46070)
{
GetCaster()->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
return SPELL_CAST_OK;
} else {
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED);
return SPELL_FAILED_CUSTOM_ERROR;
}
}
示例8: CheckCast
SpellCastResult CheckCast()
{
Unit* pet = GetCaster()->GetGuardianPet();
if (!pet)
pet = GetCaster()->GetCharm();
if (!pet)
return SPELL_FAILED_NO_PET;
if (!pet->IsAlive())
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_PET_IS_DEAD);
return SPELL_FAILED_CUSTOM_ERROR;
}
if (!GetCaster()->IsWithinLOSInMap(pet))
return SPELL_FAILED_LINE_OF_SIGHT;
return SPELL_CAST_OK;
}