*Add base scripting interfce for spells - thanks to Brian for help in making it compile with GCC.

*Add hook for handling spell effects in new scripting system.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-07-24 22:41:42 +02:00
parent 687cd83bdd
commit 2352fc7cdf
30 changed files with 1253 additions and 14 deletions

View File

@@ -544,3 +544,25 @@ InstanceData* ScriptMgr::CreateInstanceData(Map *map)
return tmpscript->GetInstanceData(map);
}
void ScriptMgr::CreateSpellScripts(uint32 spell_id, std::list<SpellScript *> & script_vector)
{
SpellScriptsBounds bounds = objmgr.GetSpellScriptsBounds(spell_id);
for (SpellScriptsMap::iterator itr = bounds.first; itr != bounds.second; ++itr)
{
Script *tmpscript = m_scripts[itr->second];
if (!tmpscript || !tmpscript->GetSpellScript) continue;
script_vector.push_back(tmpscript->GetSpellScript());
}
}
void ScriptMgr::CreateSpellScripts(uint32 spell_id, std::vector<std::pair<SpellScript *, SpellScriptsMap::iterator> > & script_vector)
{
SpellScriptsBounds bounds = objmgr.GetSpellScriptsBounds(spell_id);
script_vector.reserve(std::distance(bounds.first, bounds.second));
for (SpellScriptsMap::iterator itr = bounds.first; itr != bounds.second; ++itr)
{
Script *tmpscript = m_scripts[itr->second];
if (!tmpscript || !tmpscript->GetSpellScript) continue;
script_vector.push_back(std::make_pair(tmpscript->GetSpellScript(), itr));
}
}