mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 21:20:01 -04:00
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Entities/Player/Player.cpp src/server/game/Handlers/MailHandler.cpp
This commit is contained in:
@@ -2463,6 +2463,24 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
||||
return summon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Summons group of creatures.
|
||||
*
|
||||
* @param group Id of group to summon.
|
||||
* @param list List to store pointers to summoned creatures.
|
||||
*/
|
||||
|
||||
void Map::SummonCreatureGroup(uint8 group, std::list<TempSummon*>& list)
|
||||
{
|
||||
std::vector<TempSummonData> const* data = sObjectMgr->GetSummonGroup(GetId(), SUMMONER_TYPE_MAP, group);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
for (std::vector<TempSummonData>::const_iterator itr = data->begin(); itr != data->end(); ++itr)
|
||||
if (TempSummon* summon = SummonCreature(itr->entry, itr->pos, NULL, itr->time))
|
||||
list.push_back(summon);
|
||||
}
|
||||
|
||||
void WorldObject::SetZoneScript()
|
||||
{
|
||||
if (Map* map = FindMap())
|
||||
@@ -2542,6 +2560,25 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
|
||||
return summon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Summons group of creatures. Should be called only by instances of Creature and GameObject classes.
|
||||
*
|
||||
* @param group Id of group to summon.
|
||||
* @param list List to store pointers to summoned creatures.
|
||||
*/
|
||||
void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>& list)
|
||||
{
|
||||
ASSERT((GetTypeId() == TYPEID_GAMEOBJECT || GetTypeId() == TYPEID_UNIT) && "Only GOs and creatures can summon npc groups!");
|
||||
|
||||
std::vector<TempSummonData> const* data = sObjectMgr->GetSummonGroup(GetEntry(), GetTypeId() == TYPEID_GAMEOBJECT ? SUMMONER_TYPE_GAMEOBJECT : SUMMONER_TYPE_CREATURE, group);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
for (std::vector<TempSummonData>::const_iterator itr = data->begin(); itr != data->end(); ++itr)
|
||||
if (TempSummon* summon = SummonCreature(itr->entry, itr->pos, itr->type, itr->time))
|
||||
list.push_back(summon);
|
||||
}
|
||||
|
||||
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const
|
||||
{
|
||||
Creature* creature = NULL;
|
||||
|
||||
Reference in New Issue
Block a user