void ConfusedMovementGenerator<Player>::Finalize(Player &unit)
{
    unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
    unit.ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE);
    unit.StopMoving();
    //   unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
}
void FleeingMovementGenerator<Player>::Finalize(Player &owner)
{
    owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
 //   owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
    owner.ClearUnitState(UNIT_STATE_FLEEING | UNIT_STATE_FLEEING_MOVE);
    owner.StopMoving();
}
Пример #3
0
void FlightPathMovementGenerator::Finalize(Player & player)
{
    // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
    player.clearUnitState(UNIT_STAT_IN_FLIGHT);

    float x, y, z;
    i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z);
    player.Anti__SetLastTeleTime(time(NULL));
    player.SetPosition(x, y, z, player.GetOrientation());

    player.Unmount();
    player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);

    if(player.m_taxi.empty())
    {
        player.getHostileRefManager().setOnlineOfflineState(true);
        if(player.pvpInfo.inHostileArea)
            player.CastSpell(&player, 2479, true);

        // update z position to ground and orientation for landing point
        // this prevent cheating with landing  point at lags
        // when client side flight end early in comparison server side
        player.StopMoving();
    }
}
void FollowMovementGenerator<Player>::Initialize(Player &owner)
{
    owner.StopMoving();

    owner.addUnitState(UNIT_STAT_FOLLOW);
    _updateSpeed(owner);
    _setTargetLocation(owner);
}
Пример #5
0
void FlightPathMovementGenerator::_Finalize(Player & player)
{
    if(player.m_taxi.empty())
    {
        // update z position to ground and orientation for landing point
        // this prevent cheating with landing  point at lags
        // when client side flight end early in comparison server side
        player.StopMoving();
    }
}
Пример #6
0
void FlightPathMovementGenerator::Finalize(Player & player)
{
    // Random handlers when path is finished - best would be to add FlightPathMovementGenerator::Finalize to sub-script class (Feanor)
    switch( i_pathId )
    {
        case 632:
        {
            if( player.GetQuestStatus(10525) == QUEST_STATUS_INCOMPLETE )
                player.CompleteQuest(10525);

            player.SetDisplayId(player.GetNativeDisplayId());
            break;    
        }
        case 811:
        {
            if( player.GetQuestStatus(12028) == QUEST_STATUS_INCOMPLETE )
                player.CompleteQuest(12028);

            player.SetDisplayId(player.GetNativeDisplayId());
            break;
        }
    }

    // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
    player.clearUnitState(UNIT_STAT_IN_FLIGHT);

    float x, y, z;
    i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z);
    player.SetPosition(x, y, z, player.GetOrientation());

    // Quest path (teleport player back to start)
    if( i_pathId == 632 )
        player.TeleportTo( player.GetMapId(), i_path.GetNodes(0)->x, i_path.GetNodes(0)->y, i_path.GetNodes(0)->z, player.GetOrientation() );

    player.Unmount();
    player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);

    if(player.m_taxi.empty())
    {
        player.getHostileRefManager().setOnlineOfflineState(true);
        if(player.pvpInfo.inHostileArea)
            player.CastSpell(&player, 2479, true);

        // update z position to ground and orientation for landing point
        // this prevent cheating with landing  point at lags
        // when client side flight end early in comparison server side
        player.StopMoving();
    }
}
Пример #7
0
void FlightPathMovementGenerator::DoFinalize(Player& player)
{
    // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
    player.ClearUnitState(UNIT_STATE_IN_FLIGHT);

    player.Dismount();
    player.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);

    if (player.m_taxi.empty())
    {
        player.getHostileRefManager().setOnlineOfflineState(true);
        // update z position to ground and orientation for landing point
        // this prevent cheating with landing  point at lags
        // when client side flight end early in comparison server side
        player.StopMoving();
    }
}
Пример #8
0
void FlightPathMovementGenerator::Finalize(Player & player)
{
    float x, y, z;
    i_destinationHolder.GetLocationNow(player.GetMapId(), x, y, z);
    player.SetPosition(x, y, z, player.GetOrientation());

    player.clearUnitState(UNIT_STAT_IN_FLIGHT);
    player.Unmount();
    player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);

    if(player.m_taxi.empty())
    {
        player.getHostilRefManager().setOnlineOfflineState(true);
        if(player.pvpInfo.inHostileArea)
            player.CastSpell(&player, 2479, true);

        player.SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
        player.StopMoving();
    }
}
void FlightPathMovementGenerator::Finalize(Player & player)
{
    // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
    player.clearUnitState(UNIT_FLAG_DISABLE_MOVE | UNIT_STAT_IN_FLIGHT);

    float x, y, z;
    i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z);
    player.SetPosition(x, y, z, player.GetOrientation());

    player.Unmount();

    if (player.m_taxi.empty())
    {
        player.getHostileRefManager().setOnlineOfflineState(true);
        if (player.pvpInfo.inHostileArea)
            player.CastSpell(&player, 2479, true);

        player.SetUnitMovementFlags(MOVEFLAG_WALK_MODE);
        player.StopMoving();
    }
}
void FleeingMovementGenerator<Player>::Finalize(Player& owner)
{
    owner.clearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_FLEEING_MOVE);
    owner.StopMoving();
}
void ChaseMovementGenerator<Player>::Initialize(Player &owner)
{
    owner.StopMoving();
    owner.addUnitState(UNIT_STAT_CHASE);
    _setTargetLocation(owner);
}
void ConfusedMovementGenerator<Player>::Finalize(Player& unit)
{
    unit.clearUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_CONFUSED_MOVE);
    unit.StopMoving();
}