Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
- index 0c9413d..e5ee935 100755
- --- a/src/server/game/Entities/Player/Player.cpp
- +++ b/src/server/game/Entities/Player/Player.cpp
- @@ -8509,6 +8509,18 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
- void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex)
- {
- ItemTemplate const* proto = item->GetTemplate();
- +
- + bool instant = false;
- + if ((proto->Class == ITEM_CLASS_GLYPH) ||
- + (proto->Class == ITEM_CLASS_CONSUMABLE && (
- + proto->SubClass == ITEM_SUBCLASS_ITEM_ENHANCEMENT ||
- + proto->SubClass == ITEM_SUBCLASS_CONSUMABLE_OTHER)) ||
- + (proto->Class == ITEM_CLASS_TRADE_GOODS && (
- + proto->SubClass == ITEM_SUBCLASS_ARMOR_ENCHANTMENT ||
- + proto->SubClass == ITEM_SUBCLASS_WEAPON_ENCHANTMENT ||
- + proto->SubClass == ITEM_SUBCLASS_ENCHANTING)))
- + instant = true;
- +
- // special learning case
- if (proto->Spells[0].SpellId == 483 || proto->Spells[0].SpellId == 55884)
- {
- @@ -8527,7 +8539,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
- spell->m_CastItem = item;
- spell->m_cast_count = cast_count; //set count of casts
- spell->SetSpellValue(SPELLVALUE_BASE_POINT0, learning_spell_id);
- - spell->prepare(&targets);
- + spell->prepare(&targets, NULL, instant);
- return;
- }
- @@ -8558,7 +8570,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
- spell->m_CastItem = item;
- spell->m_cast_count = cast_count; // set count of casts
- spell->m_glyphIndex = glyphIndex; // glyph index
- - spell->prepare(&targets);
- + spell->prepare(&targets, NULL, instant);
- ++count;
- }
- diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
- index 7f6af3e..b580113 100755
- --- a/src/server/game/Spells/Spell.cpp
- +++ b/src/server/game/Spells/Spell.cpp
- @@ -2903,7 +2903,7 @@ bool Spell::UpdateChanneledTargetList()
- return channelTargetEffectMask == 0;
- }
- -void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura)
- +void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura, const bool instant)
- {
- if (m_CastItem)
- m_castItemGUID = m_CastItem->GetGUID();
- @@ -2998,6 +2998,8 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
- m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
- + if (instant) m_casttime = 0;
- +
- // don't allow channeled spells / spells with cast time to be casted while moving
- // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in)
- if ((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT)
- diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
- index 0d9380d..baf75a7 100755
- --- a/src/server/game/Spells/Spell.h
- +++ b/src/server/game/Spells/Spell.h
- @@ -369,7 +369,7 @@ class Spell
- void SearchAreaTargets(std::list<WorldObject*>& targets, float range, Position const* position, Unit* referer, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList);
- void SearchChainTargets(std::list<WorldObject*>& targets, uint32 chainTargets, WorldObject* target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, ConditionList* condList, bool isChainHeal);
- - void prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura = NULL);
- + void prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura = NULL, const bool instant = false);
- void cancel();
- void update(uint32 difftime);
- void cast(bool skipCheck = false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement