Jump to content

Valroft

Members
  • Posts

    6
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by Valroft

  1. Part of the reason Blizzard generates loot at creation may be because (unconfirmed) in the event a creature drops a special staff for example, it will sometimes have it equipped as opposed to the normal item creatures of his/her type use. That would be impossible w/o loading at creation.
  2. This should be fairly simple, just set your status to exalted or any other non-hostile reputation and the At War and Invisible Faction flag is controlled by the server, not the client.
  3. Nevermind. I'm an idiot who didn't know MaNGOS did funny things you have .gm on.
  4. Upon a brief scan of the MaNGOS code, and the forums, it seems battlegrounds are completely implemented and functional. This is strange because whenever I start a battleground it seems to start bugged. The gates are unlocked and cna be opened from the start (easy fix but that's for the DB guys anyways), and more importantly, the nodes in the BGs seem to be in multiple states at once, having several banners at their locations. Just wondering if I'm out of my mind or what.
  5. I wasn't aware of it at the time. Apparently it's author is looking for constructive criticism. Wish I had known at the time. Regardless though, this does fix half the problem and I believe it's a bit less hacky.
  6. At the moment, when you cast a scroll on an item to enchant it, it won't work because you are missing the "reagents" of the enchant, even though it shouldn't require them. This patch should fix items such as http://www.wowhead.com/?item=38772 (I'm not completely sure this patch is in the correct format, it's based off of multiple commits I made in a fork) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index a170554..08b8c8e 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19503,7 +19503,7 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons return false; } -bool Player::CanNoReagentCast(SpellEntry const* spellInfo) const +bool Player::CanNoReagentCast(SpellEntry const* spellInfo, Item* pItemCaster) const { // don't take reagents for spells with SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP if (spellInfo->AttributesEx5 & SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP && @@ -19517,6 +19517,10 @@ bool Player::CanNoReagentCast(SpellEntry const* spellInfo) const spellInfo->SpellFamilyFlags2 & noReagentMask_2) return true; + // Check if it's an enchant scroll. These have no required reagents even though their spell does. + if( pItemCaster && pItemCaster->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_ENCHANT_SCROLL) ) + return true; + return false; } diff --git a/src/game/Player.h b/src/game/Player.h index d32f682..2d6a148 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1207,7 +1207,7 @@ class MANGOS_DLL_SPEC Player : public Unit void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_2, 2, count); } bool HasItemCount( uint32 item, uint32 count, bool inBankAlso = false ) const; bool HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item const* ignoreItem = NULL); - bool CanNoReagentCast(SpellEntry const* spellInfo) const; + bool CanNoReagentCast(SpellEntry const* spellInfo, Item* pItemCaster = NULL) const; bool HasItemOrGemWithIdEquipped( uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const; bool HasItemOrGemWithLimitCategoryEquipped( uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const; uint8 CanTakeMoreSimilarItems(Item* pItem) const { return _CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem); } diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 98b08b9..d794d09 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3820,7 +3820,7 @@ void Spell::TakeReagents() return; Player* p_caster = (Player*)m_caster; - if (p_caster->CanNoReagentCast(m_spellInfo)) + if (p_caster->CanNoReagentCast(m_spellInfo, m_CastItem) ) return; for(uint32 x = 0; x < 8; ++x) @@ -5498,8 +5498,7 @@ SpellCastResult Spell::CheckItems() } // check reagents (ignore triggered spells with reagents processed by original spell) and special reagent ignore case. - bool isScrollItemCasting = (m_CastItem && m_CastItem->GetProto()->Flags & ITEM_FLAGS_ENCHANT_SCROLL); - if (!m_IsTriggeredSpell && !p_caster->CanNoReagentCast(m_spellInfo) && !isScrollItemCasting) + if (!m_IsTriggeredSpell && !p_caster->CanNoReagentCast(m_spellInfo, m_CastItem) ) { for(uint32 i = 0; i < 8; ++i) { @@ -5545,7 +5544,7 @@ SpellCastResult Spell::CheckItems() }else totems -= 1; } - if(totems != 0) + if(totems != 0 && !p_caster->CanNoReagentCast(m_spellInfo, m_CastItem) ) return SPELL_FAILED_TOTEMS; //0x7C // Check items for TotemCategory (items presence in inventory) @@ -5563,7 +5562,7 @@ SpellCastResult Spell::CheckItems() else TotemCategory -= 1; } - if(TotemCategory != 0) + if(TotemCategory != 0 && !p_caster->CanNoReagentCast(m_spellInfo, m_CastItem) ) return SPELL_FAILED_TOTEM_CATEGORY; //0x7B // special checks for spell effects
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use