*Changes in FindCreature and FindGameObject function
--HG-- branch : trunk
This commit is contained in:
@@ -740,11 +740,11 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
|
|||||||
i_pl->TeleportTo(m_creature->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
i_pl->TeleportTo(m_creature->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit* ScriptedAI::FindCreature(uint32 entry, uint32 range)
|
Unit* ScriptedAI::FindCreature(uint32 entry, uint32 range, uint32 district)
|
||||||
{
|
{
|
||||||
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
|
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
|
||||||
Cell cell(pair);
|
Cell cell(pair);
|
||||||
cell.data.Part.reserved = ALL_DISTRICT;
|
cell.data.Part.reserved = district;
|
||||||
cell.SetNoCreate();
|
cell.SetNoCreate();
|
||||||
|
|
||||||
std::list<Creature*> NPCList;
|
std::list<Creature*> NPCList;
|
||||||
@@ -765,11 +765,11 @@ Unit* ScriptedAI::FindCreature(uint32 entry, uint32 range)
|
|||||||
}else error_log("SD2 ERROR: Entry: %u not found!", entry); return NULL;
|
}else error_log("SD2 ERROR: Entry: %u not found!", entry); return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject* ScriptedAI::FindGameObject(uint32 entry)
|
GameObject* ScriptedAI::FindGameObject(uint32 entry, uint32 district)
|
||||||
{
|
{
|
||||||
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
|
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
|
||||||
Cell cell(pair);
|
Cell cell(pair);
|
||||||
cell.data.Part.reserved = ALL_DISTRICT;
|
cell.data.Part.reserved = district;
|
||||||
cell.SetNoCreate();
|
cell.SetNoCreate();
|
||||||
|
|
||||||
std::list<GameObject*> GOList;
|
std::list<GameObject*> GOList;
|
||||||
|
|||||||
@@ -149,10 +149,10 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
|
|||||||
void DoTeleportAll(float x, float y, float z, float o);
|
void DoTeleportAll(float x, float y, float z, float o);
|
||||||
|
|
||||||
//Get a single creature of given entry
|
//Get a single creature of given entry
|
||||||
Unit* FindCreature(uint32 entry, uint32 range);
|
Unit* FindCreature(uint32 entry, uint32 range, uint32 district = ALL_DISTRICT);
|
||||||
|
|
||||||
//Get a single gameobject of given entry
|
//Get a single gameobject of given entry
|
||||||
GameObject* FindGameObject(uint32 entry);
|
GameObject* FindGameObject(uint32 entry, uint32 district = ALL_DISTRICT);
|
||||||
|
|
||||||
//Returns friendly unit with the most amount of hp missing from max hp
|
//Returns friendly unit with the most amount of hp missing from max hp
|
||||||
Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff = 1);
|
Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff = 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user