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


C++ MovementInform函数代码示例

本文整理汇总了C++中MovementInform函数的典型用法代码示例。如果您正苦于以下问题:C++ MovementInform函数的具体用法?C++ MovementInform怎么用?C++ MovementInform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: Finalize

void PointMovementGenerator<T>:: Finalize(T &unit)
{
    unit.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);

    if (unit.movespline->Finalized())
        MovementInform(unit);
}
开发者ID:Snoop3r,项目名称:SkyFireEMU,代码行数:7,代码来源:PointMovementGenerator.cpp

示例2: MovementInform

void WaypointMovementGenerator<Creature>::OnArrived(Creature* owner)
{
    if (!owner)
        return;

    if (!i_path || i_path->empty())
        return;

    if (m_isArrivalDone)
        return;

    owner->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
    m_isArrivalDone = true;

    if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
    {
        sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, owner->GetGUID());
        owner->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, owner, NULL);
    }

    // Inform script
    MovementInform(owner);
    owner->UpdateWaypointID(i_currentNode);
    Stop(i_path->at(i_currentNode)->delay);
}
开发者ID:concept45,项目名称:Core,代码行数:25,代码来源:WaypointMovementGenerator.cpp

示例3: Finalize

void PointMovementGenerator<T>:: Finalize(T &unit)
{
    if (unit.hasUnitState(UNIT_STAT_CHARGING))
        unit.clearUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
    if (arrived) // without this crash!
        MovementInform(unit);
}
开发者ID:Blumfield,项目名称:TBCPvP,代码行数:7,代码来源:PointMovementGenerator.cpp

示例4: Stop

void WaypointMovementGenerator<Creature>::OnArrived(Creature* creature)
{
    if (!i_path || i_path->nodes.empty())
        return;

    WaypointNode const &waypoint = i_path->nodes.at(i_currentNode);
    if (waypoint.delay)
    {
        creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
        Stop(waypoint.delay);
    }

    if (waypoint.eventId && urand(0, 99) < waypoint.eventChance)
    {
        TC_LOG_DEBUG("maps.script", "Creature movement start script %u at point %u for %s.", waypoint.eventId, i_currentNode, creature->GetGUID().ToString().c_str());
        creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
        creature->GetMap()->ScriptsStart(sWaypointScripts, waypoint.eventId, creature, nullptr);
    }

    // Inform script
    MovementInform(creature);
    creature->UpdateWaypointID(i_currentNode);

    creature->SetWalk(waypoint.moveType != WAYPOINT_MOVE_TYPE_RUN);
}
开发者ID:090809,项目名称:TrinityCore,代码行数:25,代码来源:WaypointMovementGenerator.cpp

示例5: MovementInform

void EffectMovementGenerator::Finalize(Unit* owner)
{
    if (!owner)
        return;

    MovementInform(owner);
}
开发者ID:Expery,项目名称:Core,代码行数:7,代码来源:PointMovementGenerator.cpp

示例6: TC_LOG_DEBUG

void WaypointMovementGenerator<Creature>::OnArrived(Creature* creature)
{
    if (!i_path || i_path->empty())
        return;
    if (m_isArrivalDone)
        return;

    m_isArrivalDone = true;

    if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
    {
        TC_LOG_DEBUG("maps.script", "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID());
        creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
        creature->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, creature, NULL);
    }

    // Inform script
    MovementInform(creature);
    creature->UpdateWaypointID(i_currentNode);

    if (i_path->at(i_currentNode)->delay)
    {
        creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
        Stop(i_path->at(i_currentNode)->delay);
    }
}
开发者ID:siknd,项目名称:TrinityCore,代码行数:26,代码来源:WaypointMovementGenerator.cpp

示例7: MovementInform

void PointMovementGenerator<T>::Finalize(T& unit)
{
    unit.clearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_ROAMING_MOVE);

    if (i_destinationHolder.HasArrived())
        MovementInform(unit);
}
开发者ID:mynew4,项目名称:MaNGOSZero,代码行数:7,代码来源:PointMovementGenerator.cpp

示例8: defined

void WaypointMovementGenerator<Creature>::OnArrived(Creature* creature)
{
    if (!i_path || i_path->empty())
        return;
    if (m_isArrivalDone)
        return;

    creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
    m_isArrivalDone = true;

    if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
    {
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
        sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID());
#endif
        creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
        creature->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, creature, NULL);
    }

    // Inform script
    MovementInform(creature);
    creature->UpdateWaypointID(i_currentNode);

    if (i_path->at(i_currentNode)->delay)
    {
        creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
        Stop(i_path->at(i_currentNode)->delay);
    }
}
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:29,代码来源:WaypointMovementGenerator.cpp

示例9: traveller

bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
{
    if(!&unit)
        return false;

    if(unit.hasUnitState(UNIT_STAT_CAN_NOT_MOVE))
    {
        unit.clearUnitState(UNIT_STAT_ROAMING_MOVE);
        return true;
    }

    unit.addUnitState(UNIT_STAT_ROAMING_MOVE);

    Traveller<T> traveller(unit);
    if (i_destinationHolder.UpdateTraveller(traveller, diff, false))
    {
        if (!IsActive(unit))                                // force stop processing (movement can move out active zone with cleanup movegens list)
            return true;                                    // not expire now, but already lost
    }

    if(i_destinationHolder.HasArrived())
    {
        unit.clearUnitState(UNIT_STAT_ROAMING_MOVE);
        MovementInform(unit);
        return false;
    }

    return true;
}
开发者ID:Dreinar,项目名称:mangos,代码行数:29,代码来源:PointMovementGenerator.cpp

示例10: BLIZZLIKE_ASSERT

void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
{
    if (!i_path || i_path->empty())
        return;

    m_lastReachedWaypoint = i_currentNode;

    if (m_isArrivalDone)
        return;

    creature.clearUnitState(UNIT_STAT_ROAMING_MOVE);
    m_isArrivalDone = true;

    WaypointPath::const_iterator currPoint = i_path->find(i_currentNode);
    BLIZZLIKE_ASSERT(currPoint != i_path->end());
    WaypointNode const& node = currPoint->second;

    if (node.script_id)
    {
        DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature movement start script %u at point %u for %s.", node.script_id, i_currentNode, creature.GetGuidStr().c_str());
        creature.GetMap()->ScriptsStart(sCreatureMovementScripts, node.script_id, &creature, &creature);
    }

    // We have reached the destination and can process behavior
    if (WaypointBehavior* behavior = node.behavior)
    {
        if (behavior->emote != 0)
            creature.HandleEmote(behavior->emote);

        if (behavior->spell != 0)
            creature.CastSpell(&creature, behavior->spell, false);

        if (behavior->model1 != 0)
            creature.SetDisplayId(behavior->model1);

        if (behavior->textid[0])
        {
            // Not only one text is set
            if (behavior->textid[1])
            {
                // Select one from max 5 texts (0 and 1 already checked)
                int i = 2;
                for (; i < MAX_WAYPOINT_TEXT; ++i)
                {
                    if (!behavior->textid[i])
                        break;
                }

                creature.MonsterSay(behavior->textid[rand() % i], LANG_UNIVERSAL);
            }
            else
                creature.MonsterSay(behavior->textid[0], LANG_UNIVERSAL);
        }
    }

    // Inform script
    MovementInform(creature);
    Stop(node.delay);
}
开发者ID:SakhWoW,项目名称:blizzlikecore,代码行数:59,代码来源:WaypointMovementGenerator.cpp

示例11: MovementInform

void PointMovementGenerator<T>::DoFinalize(T* unit)
{
    if (unit->HasUnitState(UNIT_STATE_CHARGING))
        unit->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);

    if (unit->movespline->Finalized())
        MovementInform(unit);
}
开发者ID:Carbenium,项目名称:TrinityCore,代码行数:8,代码来源:PointMovementGenerator.cpp

示例12: Finalize

void PointMovementGenerator<T>:: Finalize(T& unit)
{
    if (unit.HasUnitState(UNIT_STATE_CHARGING))
        unit.ClearUnitState(UNIT_STATE_CHARGING | UNIT_STATE_JUMPING);

    if (unit.movespline->Finalized())
        MovementInform(unit);
}
开发者ID:Leandros,项目名称:OregonCore,代码行数:8,代码来源:PointMovementGenerator.cpp

示例13: MovementInform

void PointMovementGenerator<T>::DoFinalize(T* owner, bool active, bool movementInform)
{
    MovementGenerator::AddFlag(MOVEMENTGENERATOR_FLAG_FINALIZED);
    if (active)
        owner->ClearUnitState(UNIT_STATE_ROAMING_MOVE);

    if (movementInform && MovementGenerator::HasFlag(MOVEMENTGENERATOR_FLAG_INFORM_ENABLED))
        MovementInform(owner);
}
开发者ID:lasyan3,项目名称:TrinityCore,代码行数:9,代码来源:PointMovementGenerator.cpp

示例14: MovementInform

void PointMovementGenerator<T>::Finalize(T& unit)
{
    unit.clearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_ROAMING_MOVE);
	if (unit.GetTypeId() == TYPEID_UNIT)
		unit.UpdateSpeed(MOVE_RUN, true);

    if (unit.movespline->Finalized())
        MovementInform(unit);
}
开发者ID:ShyoZarak,项目名称:mangos-classic,代码行数:9,代码来源:PointMovementGenerator.cpp

示例15: Reset

    void Reset()
    {
        nextMovementTimer = 0;
        actualAngle = me->GetAngle(CenterPos.GetPositionX(), CenterPos.GetPositionY());
        direction = urand(0, 1);

        if (direction)
            myPositionZ = 435.0f;
        else
            myPositionZ = 440.0f;

        // Enable Movements
        MovementInform(POINT_MOTION_TYPE, POINT_KRIKTHIK_CIRCLE);

        me->setActive(true);
    }
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:16,代码来源:boss_striker_gadok.cpp


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