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


C++ Item::GetEnchantment方法代码示例

本文整理汇总了C++中Item::GetEnchantment方法的典型用法代码示例。如果您正苦于以下问题:C++ Item::GetEnchantment方法的具体用法?C++ Item::GetEnchantment怎么用?C++ Item::GetEnchantment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Item的用法示例。


在下文中一共展示了Item::GetEnchantment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Shiv

bool Shiv(uint8_t /*effectIndex*/, Spell* pSpell)
{
    Unit* pTarget = pSpell->GetUnitTarget();
    if (!pSpell->p_caster || !pTarget) return true;

    pSpell->p_caster->castSpell(pTarget->getGuid(), 5940, true);

    Item* it = pSpell->p_caster->getItemInterface()->GetInventoryItem(EQUIPMENT_SLOT_OFFHAND);
    if (!it)
        return true;

    EnchantmentInstance* ench = it->GetEnchantment(TEMP_ENCHANTMENT_SLOT);
    if (ench)
    {
        DBC::Structures::SpellItemEnchantmentEntry const* Entry = ench->Enchantment;
        for (uint8 c = 0; c < 3; c++)
        {
            if (Entry->type[c] && Entry->spell[c])
            {
                SpellInfo const* sp = sSpellMgr.getSpellInfo(Entry->spell[c]);
                if (!sp) return true;

                if (sp->custom_c_is_flags & SPELL_FLAG_IS_POISON)
                {
                    pSpell->p_caster->castSpell(pTarget->getGuid(), Entry->spell[c], true);
                }
            }
        }
    }
    return true;
}
开发者ID:AscEmu,项目名称:AscEmu,代码行数:31,代码来源:RogueSpells.cpp

示例2: Init

    void Init(Object* obj)
    {
        if(obj == NULL)
        {
            mDeleted = true;
            //initializing anyway all fields.
            mItemGUID = 0;
            damage = 0;
            return;
        }

        mItemGUID = obj->GetGUID();
        damage = 0;
        uint32 wp_speed;
        Item* item = TO_ITEM(obj);
        EnchantmentInstance* enchant = item->GetEnchantment(TEMP_ENCHANTMENT_SLOT);
        if(enchant != NULL)
        {
            SpellEntry* sp = dbcSpell.LookupEntryForced(enchant->Enchantment->spell[0]);
            if(sp != NULL && sp->NameHash == SPELL_HASH_FLAMETONGUE_WEAPON__PASSIVE_)
            {
                wp_speed = item->GetProto()->Delay;
                damage = (sp->EffectBasePoints[0] + 1) * wp_speed / 100000;
            }
        }
    }
开发者ID:Selenah,项目名称:ArcEmu,代码行数:26,代码来源:SpellProc_Shaman.cpp

示例3: Init

    void Init(Object* obj)
    {
        if (obj == NULL)
        {
            mDeleted = true;
            //initializing anyway all fields.
            mItemGUID = 0;
            damage = 0;
            return;
        }

        mItemGUID = obj->GetGUID();
        damage = 0;
        uint32 wp_speed;
        Item* item = static_cast< Item* >(obj);
        EnchantmentInstance* enchant = item->GetEnchantment(TEMP_ENCHANTMENT_SLOT);
        if (enchant != nullptr)
        {
            SpellInfo* sp = sSpellCustomizations.GetSpellInfo(enchant->Enchantment->spell[0]);
            if (sp != nullptr && sp->custom_NameHash == SPELL_HASH_FLAMETONGUE_WEAPON__PASSIVE_)
            {
                wp_speed = item->GetItemProperties()->Delay;
                damage = (sp->EffectBasePoints[0] + 1) * wp_speed / 100000;
            }
        }
    }
开发者ID:master312,项目名称:AscEmu,代码行数:26,代码来源:SpellProc_ClassScripts.cpp

示例4: Shiv

bool Shiv(uint32 i, Spell* pSpell)
{
    Unit* pTarget = pSpell->GetUnitTarget();
    if(!pSpell->p_caster || !pTarget) return true;

    pSpell->p_caster->CastSpell(pTarget->GetGUID(), 5940, true);

    Item* it = pSpell->p_caster->GetItemInterface()->GetInventoryItem(EQUIPMENT_SLOT_OFFHAND);
    if(!it) return true;

    EnchantmentInstance* ench = it->GetEnchantment(TEMP_ENCHANTMENT_SLOT);
    if(ench)
    {
        EnchantEntry* Entry = ench->Enchantment;
        for(uint32 c = 0; c < 3; c++)
        {
            if(Entry->type[c] && Entry->spell[c])
            {
                SpellEntry* sp = dbcSpell.LookupEntry(Entry->spell[c]);
                if(!sp) return true;

                if(sp->c_is_flags & SPELL_FLAG_IS_POISON)
                {
                    pSpell->p_caster->CastSpell(pTarget->GetGUID(), Entry->spell[c], true);
                }
            }
        }
    }
    return true;
}
开发者ID:Nupper,项目名称:AscEmu,代码行数:30,代码来源:RogueSpells.cpp


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