Core/Spells:

* Implemented on CheckCast spell script hook
* Added possibility to send SPELL_FAILED_CUSTOM_ERROR and added enum with all possible options for it

Scripts/Spells:
* Added example script for CheckCast hook with SPELL_FAILED_CUSTOM_ERROR (profession research and Book of Glyph Mastery)
This commit is contained in:
Shauren
2011-03-04 21:19:43 +01:00
parent a9582964d3
commit 7120f1eff8
12 changed files with 262 additions and 8 deletions
+16
View File
@@ -191,6 +191,22 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
return 0;
}
bool HasDiscoveredAllSpells(uint32 spellId, Player* player)
{
SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(spellId);
if (tab == SkillDiscoveryStore.end())
return true;
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId);
uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : 0;
for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
if (!player->HasSpell(item_iter->spellId))
return false;
return true;
}
uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
{
uint32 skillvalue = skillId ? player->GetSkillValue(skillId) : 0;
+1
View File
@@ -25,6 +25,7 @@ class Player;
void LoadSkillDiscoveryTable();
uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player);
bool HasDiscoveredAllSpells(uint32 spellId, Player* player);
uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player);
#endif