本文整理汇总了C++中CreatureCreatePos::GetPhaseMask方法的典型用法代码示例。如果您正苦于以下问题:C++ CreatureCreatePos::GetPhaseMask方法的具体用法?C++ CreatureCreatePos::GetPhaseMask怎么用?C++ CreatureCreatePos::GetPhaseMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreatureCreatePos
的用法示例。
在下文中一共展示了CreatureCreatePos::GetPhaseMask方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
bool Totem::Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const* cinfo, Unit* owner)
{
SetMap(cPos.GetMap());
SetPhaseMask(cPos.GetPhaseMask(), false);
Team team = owner->GetTypeId() == TYPEID_PLAYER ? ((Player*)owner)->GetTeam() : TEAM_NONE;
if (!CreateFromProto(guidlow, cinfo, team))
return false;
// special model selection case for totems
if (owner->GetTypeId() == TYPEID_PLAYER)
{
if (uint32 modelid_race = sObjectMgr.GetModelForRace(GetNativeDisplayId(), owner->getRaceMask()))
SetDisplayId(modelid_race);
}
cPos.SelectFinalPoint(this);
// totem must be at same Z in case swimming caster and etc.
if (fabs(cPos.m_pos.z - owner->GetPositionZ()) > 5.0f)
cPos.m_pos.z = owner->GetPositionZ();
if (!cPos.Relocate(this))
return false;
// Notify the map's instance data.
// Only works if you create the object in it, not if it is moves to that map.
// Normally non-players do not teleport to other maps.
if (InstanceData* iData = GetMap()->GetInstanceData())
iData->OnCreatureCreate(this);
LoadCreatureAddon(false);
SetCanDodge(false);
SetCanParry(false);
SetCanBlock(false);
return true;
}