[c12530] Looks for passive auras that need to be recast. Like talent spell Feral Swiftness (id: 17002 and ranks), once you go inside a building and then outside again.

Contributor : Ebrithil

(based on commit [12383] - e9f2099)
This commit is contained in:
Maxxie 2013-02-27 20:41:18 +01:00 committed by Antz
parent 2294b41bf3
commit faea73ac9b
3 changed files with 17 additions and 1 deletions

View file

@ -6202,6 +6202,17 @@ void Player::CheckAreaExploreAndOutdoor()
SetRestType(REST_TYPE_NO); SetRestType(REST_TYPE_NO);
} }
} }
// Check if we need to reaply outdoor only passive spells
const PlayerSpellMap& sp_list = GetSpellMap();
for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
{
if (itr->second.state == PLAYERSPELL_REMOVED)
continue;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(itr->first);
if (!spellInfo || !IsNeedCastSpellAtOutdoor(spellInfo) || HasAura(itr->first))
continue;
CastSpell(this, itr->first, true, NULL);
}
} }
else if (sWorld.getConfig(CONFIG_BOOL_VMAP_INDOOR_CHECK) && !isGameMaster()) else if (sWorld.getConfig(CONFIG_BOOL_VMAP_INDOOR_CHECK) && !isGameMaster())
RemoveAurasWithAttribute(SPELL_ATTR_OUTDOORS_ONLY); RemoveAurasWithAttribute(SPELL_ATTR_OUTDOORS_ONLY);

View file

@ -527,6 +527,11 @@ inline bool IsNeedCastSpellAtFormApply(SpellEntry const* spellInfo, ShapeshiftFo
// passive spells with SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT are already active without shapeshift, do no recast! // passive spells with SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT are already active without shapeshift, do no recast!
return (shapeShift->Stances & (1<<(form-1)) && !(spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT)); return (shapeShift->Stances & (1<<(form-1)) && !(spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT));
} }
inline bool IsNeedCastSpellAtOutdoor(SpellEntry const* spellInfo)
{
return (spellInfo->HasAttribute(SPELL_ATTR_OUTDOORS_ONLY) && spellInfo->HasAttribute(SPELL_ATTR_PASSIVE));
}
inline bool NeedsComboPoints(SpellEntry const* spellInfo) inline bool NeedsComboPoints(SpellEntry const* spellInfo)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12529" #define REVISION_NR "12530"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__