[6828] Added script name indexing for creature, gameobject, item, areatrigger and instance scripts.

* loaded all distinct script names into one vector at server startup
* added custom loaders to convert the script names to indices
* converted all the script lookup functions to use the index instead of the name
This commit is contained in:
Wyk3d 2008-11-16 03:18:26 +02:00
parent 074bd3a08f
commit 766654c85d
16 changed files with 184 additions and 101 deletions

View file

@ -1942,9 +1942,14 @@ uint32 Creature::getLevelForTarget( Unit const* target ) const
return level;
}
char const* Creature::GetScriptName() const
std::string Creature::GetScriptName()
{
return ObjectMgr::GetCreatureTemplate(GetEntry())->ScriptName;
return objmgr.GetScriptName(GetScriptId());
}
uint32 Creature::GetScriptId()
{
return ObjectMgr::GetCreatureTemplate(GetEntry())->ScriptID;
}
VendorItemData const* Creature::GetVendorItems() const