Beispiel #1
0
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;
}
Beispiel #2
0
    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;
            }
        }
    }
    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;
            }
        }
    }
Beispiel #4
0
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;
}