当前位置: 首页>>代码示例>>C++>>正文


C++ SetCustomCastResultMessage函数代码示例

本文整理汇总了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;
            }
开发者ID:Faydz,项目名称:TrinityCore,代码行数:25,代码来源:spell_warrior.cpp

示例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;
            }
开发者ID:AtVirus,项目名称:Forgotten-Lands-Source,代码行数:26,代码来源:spell_warrior.cpp

示例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;
        }
开发者ID:090809,项目名称:TrinityCore,代码行数:9,代码来源:zone_sholazar_basin.cpp

示例4: CheckTarget

            SpellCastResult CheckTarget()
            {
                if (IsVampire(GetExplTargetUnit()))
                {
                    SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES);
                    return SPELL_FAILED_CUSTOM_ERROR;
                }

                return SPELL_CAST_OK;
            }
开发者ID:Darkelmo,项目名称:bliz,代码行数:10,代码来源:boss_blood_queen_lana_thel.cpp

示例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;
            }
开发者ID:bahajan95,项目名称:flame-core,代码行数:10,代码来源:spell_dk.cpp

示例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;
            }
开发者ID:BlackWolfsDen,项目名称:Justicar-WoW,代码行数:11,代码来源:spell_shaman.cpp

示例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;
     }
 }
开发者ID:Cailiaock,项目名称:5.4.7-Wow-source,代码行数:13,代码来源:boss_grand_champions.cpp

示例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;
            }
开发者ID:DSlayerMan,项目名称:Sunwell,代码行数:20,代码来源:spell_hunter.cpp


注:本文中的SetCustomCastResultMessage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。