本文整理汇总了C++中CreatureGroup::GetLeaderGuid方法的典型用法代码示例。如果您正苦于以下问题:C++ CreatureGroup::GetLeaderGuid方法的具体用法?C++ CreatureGroup::GetLeaderGuid怎么用?C++ CreatureGroup::GetLeaderGuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreatureGroup
的用法示例。
在下文中一共展示了CreatureGroup::GetLeaderGuid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWaveFromCreature
uint8 GetWaveFromCreature(Creature* creature)
{
CreatureGroup* group = creature->GetCreatureGroup();
if (!group)
{
//sLog.nostalrius("no group");
return 0;
}
//sLog.nostalrius("group leader : %u",group->GetLeaderGuid().GetEntry());
switch (group->GetLeaderGuid().GetEntry())
{
case NPC_CAPTAIN_QEEZ:
return 1;
case NPC_CAPTAIN_TUUBID:
return 2;
case NPC_CAPTAIN_DRENN:
return 3;
case NPC_CAPTAIN_XURREM:
return 4;
case NPC_MAJOR_YEGGETH:
return 5;
case NPC_MAJOR_PAKKON:
return 6;
case NPC_COLONEL_ZERRAN:
return 7;
default:
return 0;
}
}
示例2: Load
void CreatureGroupsManager::Load()
{
uint32 oldMSTime = WorldTimer::getMSTime();
// Memory leak, but we cannot delete the loaded groups, since pointer may be present at loaded creatures
_groups.clear();
QueryResult* result = WorldDatabase.Query("SELECT leaderGUID, memberGUID, dist, angle, flags FROM creature_groups ORDER BY leaderGUID");
if (!result)
{
sLog.outErrorDb(">> Loaded 0 creature groups. DB table `creature_groups` is empty!");
sLog.outString();
return;
}
uint32 count = 0;
Field *fields;
CreatureGroup *currentGroup = NULL;
do
{
fields = result->Fetch();
//Load group member data
ObjectGuid leaderGuid = ConvertDBGuid(fields[0].GetUInt32());
ObjectGuid memberGuid = ConvertDBGuid(fields[1].GetUInt32());
if (leaderGuid.IsEmpty())
sLog.outErrorDb("CREATURE GROUPS: Bad leader guid %u", fields[0].GetUInt32());
else if (memberGuid.IsEmpty())
sLog.outErrorDb("CREATURE GROUPS: Bad member guid %u", fields[1].GetUInt32());
else
{
if (!currentGroup || leaderGuid != currentGroup->GetLeaderGuid())
{
currentGroup = new CreatureGroup(leaderGuid);
RegisterNewGroup(currentGroup);
}
currentGroup->AddMember(memberGuid, fields[2].GetFloat(), fields[3].GetFloat(), fields[4].GetUInt8());
++count;
}
}
while (result->NextRow());
delete result;
sLog.outString(">> Loaded %u creature groups in %u ms", count, WorldTimer::getMSTime() - oldMSTime);
sLog.outString();
}