当前位置: 首页>>代码示例>>C++>>正文


C++ Creature::BuildHeartBeatMsg方法代码示例

本文整理汇总了C++中Creature::BuildHeartBeatMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ Creature::BuildHeartBeatMsg方法的具体用法?C++ Creature::BuildHeartBeatMsg怎么用?C++ Creature::BuildHeartBeatMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Creature的用法示例。


在下文中一共展示了Creature::BuildHeartBeatMsg方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: traveller

bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 time_diff)
{
    CreatureTraveller traveller(owner);
    i_destinationHolder.UpdateTraveller(traveller, time_diff);

    if (time_diff > i_travel_timer)
    {
        owner.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);

        // restore orientation of not moving creature at returning to home
        if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE)
        {
            //sLog->outDebug("Entering HomeMovement::GetDestination(z, y, z)");
            owner.SetOrientation(ori);
            WorldPacket packet;
            owner.BuildHeartBeatMsg(&packet);
            owner.SendMessageToSet(&packet, false);
        }

        owner.ClearUnitState(UNIT_STAT_EVADE);
        owner.LoadCreaturesAddon(true);
        owner.AI()->JustReachedHome();
        return false;
    }

    i_travel_timer -= time_diff;

    return true;
}
开发者ID:SingularityCore,项目名称:Singularity,代码行数:29,代码来源:HomeMovementGenerator.cpp

示例2: traveller

bool
HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff)
{
    CreatureTraveller traveller(owner);
    i_destinationHolder.UpdateTraveller(traveller, time_diff);

    if (time_diff > i_travel_timer)
    {
        owner.AddUnitMovementFlag(MOVEFLAG_WALK_MODE);

        // restore orientation of not moving creature at returning to home
        if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE)
        {
            owner.SetOrientation(ori);
            WorldPacket packet;
            owner.BuildHeartBeatMsg(&packet);
            owner.SendMessageToSet(&packet, false);
        }

        owner.AI()->JustReachedHome();
        return false;
    }

    i_travel_timer -= time_diff;

    return true;
}
开发者ID:Amara1231,项目名称:blizzlikecore,代码行数:27,代码来源:HomeMovementGenerator.cpp

示例3: traveller

bool
HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff)
{
    CreatureTraveller traveller( owner);
    if (i_destinationHolder.UpdateTraveller(traveller, time_diff, false))
    {
        if (!IsActive(owner))                               // force stop processing (movement can move out active zone with cleanup movegens list)
            return true;                                    // not expire now, but already lost
    }

    if (time_diff > i_travel_timer)
    {
        owner.AddSplineFlag(SPLINEFLAG_WALKMODE);

        // restore orientation of not moving creature at returning to home
        if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
        {
            if(CreatureData const* data = sObjectMgr.GetCreatureData(owner.GetDBTableGUIDLow()))
            {
                owner.SetOrientation(data->orientation);
                WorldPacket packet;
                owner.BuildHeartBeatMsg(&packet);
                owner.SendMessageToSet(&packet, false);
            }
        }

        owner.LoadCreatureAddon(true);
        owner.AI()->JustReachedHome();
        return false;
    }

    i_travel_timer -= time_diff;

    return true;
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例4: traveller

bool
HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff)
{
    CreatureTraveller traveller( owner);
    i_destinationHolder.UpdateTraveller(traveller, time_diff, false);

    if (time_diff > i_travel_timer)
    {
        owner.AddSplineFlag(SPLINEFLAG_WALKMODE);

        // restore orientation of not moving creature at returning to home
        if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
        {
            if(CreatureData const* data = sObjectMgr.GetCreatureData(owner.GetDBTableGUIDLow()))
            {
                owner.SetOrientation(data->orientation);
                WorldPacket packet;
                owner.BuildHeartBeatMsg(&packet);
                owner.SendMessageToSet(&packet, false);
            }
        }

        owner.AI()->JustReachedHome();
        return false;
    }

    i_travel_timer -= time_diff;

    return true;
}
开发者ID:AztiIluna,项目名称:mangos,代码行数:30,代码来源:HomeMovementGenerator.cpp

示例5: InstallAllAccessories

void Vehicle::InstallAllAccessories()
{
    if(!GetMap())
       return;

    CreatureDataAddon const *cainfo = GetCreatureAddon();
    if(!cainfo || !cainfo->passengers)
        return;
    for (CreatureDataAddonPassengers const* cPassanger = cainfo->passengers; cPassanger->seat_idx != -1; ++cPassanger)
    {
        // Continue if seat already taken
        if(GetPassenger(cPassanger->seat_idx))
            continue;

        uint32 guid = 0;
        bool isVehicle = false;
        // Set guid and check whatever it is
        if(cPassanger->guid != 0)
            guid = cPassanger->guid;
        else
        {
            CreatureDataAddon const* passAddon;
            passAddon = ObjectMgr::GetCreatureTemplateAddon(cPassanger->entry);
            if(passAddon && passAddon->vehicle_id != 0)
                isVehicle = true;
            else
                guid = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
        }
        // Create it
        Creature *pPassenger = new Creature;
        if(!isVehicle)
        {
            uint32 entry = cPassanger->entry;
            if(entry == 0)
            {
                CreatureData const* data = sObjectMgr.GetCreatureData(guid);
                if(!data)
                    continue;
                entry = data->id;
            }     
            
            if(!pPassenger->Create(guid, GetMap(), GetPhaseMask(), entry, 0))
                continue;
            pPassenger->LoadFromDB(guid, GetMap());
            pPassenger->Relocate(GetPositionX(), GetPositionY(), GetPositionZ());
            GetMap()->Add(pPassenger);
            pPassenger->AIM_Initialize();
        }
        else
            pPassenger = (Creature*)SummonVehicle(cPassanger->entry, GetPositionX(), GetPositionY(), GetPositionZ(), 0);
        // Enter vehicle...
        pPassenger->EnterVehicle(this, cPassanger->seat_idx, true);
        // ...and send update. Without this, client wont show this new creature/vehicle...
        WorldPacket data;
        pPassenger->BuildHeartBeatMsg(&data);
        pPassenger->SendMessageToSet(&data, false);
    }
}
开发者ID:sc0rpio0o,项目名称:diamondcore,代码行数:58,代码来源:Vehicle.cpp

示例6: traveller

bool
HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff)
{
    CreatureTraveller traveller(owner);
    i_destinationHolder.UpdateTraveller(traveller, time_diff);

    if (time_diff > i_travel_timer)
    { 
	       float x, y, z;
	       owner.GetRespawnCoord(x, y, z);
	       float myx, myy, myz;
	       owner.GetPosition(myx, myy, myz);
	       if (x != myx || y != myy || z != myz)
	       {
	           Position travelto = owner.GetMap()->getNextPositionOnPathToLocation(myx,myy,myz,x,y,z);
	           uint32 travel_time = i_destinationHolder.SetDestination(traveller, travelto.m_positionX, travelto.m_positionY, travelto.m_positionZ);
	           modifyTravelTime(travel_time);
	           return true;
	        }

        owner.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);

        // restore orientation of not moving creature at returning to home
        if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE)
        {
            //sLog.outDebug("Entering HomeMovement::GetDestination(z,y,z)");
            owner.SetOrientation(ori);
            WorldPacket packet;
            owner.BuildHeartBeatMsg(&packet);
            owner.SendMessageToSet(&packet, false);
        }

        owner.clearUnitState(UNIT_STAT_EVADE);
        owner.AI()->JustReachedHome();
        return false;
    }

    i_travel_timer -= time_diff;

    return true;
}
开发者ID:LolJK,项目名称:PhantomCore,代码行数:41,代码来源:HomeMovementGenerator.cpp


注:本文中的Creature::BuildHeartBeatMsg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。