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


C++ VehicleSeat函数代码示例

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


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

示例1: me

Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleInfo(vehInfo), m_usableSeatNum(0), m_bonusHP(0)
{
    for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i)
    {
        if (uint32 seatId = m_vehicleInfo->m_seatID[i])
            if (VehicleSeatEntry const *veSeat = sVehicleSeatStore.LookupEntry(seatId))
            {
                m_Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));
                if (veSeat->IsUsable())
                    ++m_usableSeatNum;
            }
    }

    // HACKY WAY, We must found a more generic way to handle this
    // Set inmunities since db ones are rewritten with player's ones
    switch (GetVehicleInfo()->m_ID)
    {
        case 160:
            me->SetControlled(true, UNIT_STAT_ROOT);
            me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
            me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true);
        case 158:
            me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL, true);
            me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_FEAR, true);
            me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_PERIODIC_HEAL, true);
            me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_STUN, true);
            me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_ROOT, true);
            me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_DECREASE_SPEED, true);
            me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
            me->ApplySpellImmune(0, IMMUNITY_ID, 49560, true); // Death Grip jump effect
            break;
        default:
            break;
    }
}
开发者ID:Bootz,项目名称:S6.RO.WoW,代码行数:35,代码来源:Vehicle.cpp

示例2: me

Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleInfo(vehInfo), m_usableSeatNum(0)
{
    for (uint32 i = 0; i < 8; ++i)
    {
        if (uint32 seatId = m_vehicleInfo->m_seatID[i])
            if (VehicleSeatEntry const *veSeat = sVehicleSeatStore.LookupEntry(seatId))
            {
                m_Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));
                if (veSeat->IsUsable())
                    ++m_usableSeatNum;
            }
    }

       switch (vehInfo->m_ID)
    {
        case 160:
                       me->SetControlled(true, UNIT_STAT_ROOT);
        case 158:
                       me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                       me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL, true);
                       me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_FEAR, true);
                       me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_PERIODIC_HEAL, true);
                       me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_STUN, true);
                       me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_ROOT, true);
                       me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
                       me->ApplySpellImmune(0, IMMUNITY_ID, 49560, true); // Death Grip jump effect
            break;
        default:
            break;
    }
    assert(!m_Seats.empty());
}
开发者ID:LolJK,项目名称:PhantomCore,代码行数:32,代码来源:Vehicle.cpp

示例3: m_pBase

VehicleKit::VehicleKit(Unit* base) : m_pBase(base), m_uiNumFreeSeats(0)
{
    for (uint32 i = 0; i < MAX_VEHICLE_SEAT; ++i)
    {
        uint32 seatId = GetBase()->GetVehicleInfo()->GetEntry()->m_seatID[i];

        if (!seatId)
            continue;

        if(base)
        {
            if(GetBase()->GetVehicleInfo()->GetEntry()->m_flags & VEHICLE_FLAG_NO_STRAFE)
                GetBase()->m_movementInfo.AddMovementFlag2(MOVEFLAG2_PREVENT_STRAFE);

            if(GetBase()->GetVehicleInfo()->GetEntry()->m_flags & VEHICLE_FLAG_NO_JUMPING)
                GetBase()->m_movementInfo.AddMovementFlag2(MOVEFLAG2_PREVENT_JUMPING);
        }

        if (VehicleSeatEntry const *seatInfo = sVehicleSeatStore.LookupEntry(seatId))
        {
            m_Seats.insert(std::make_pair(i, VehicleSeat(seatInfo)));

            if (seatInfo->IsUsable())
                ++m_uiNumFreeSeats;
        }
    }
}
开发者ID:Dekadencee,项目名称:StrawberryCore,代码行数:27,代码来源:Vehicle.cpp

示例4: RemoveAllPassengers

void Vehicle::SetVehicleId(uint32 id)
{
    if(m_vehicleInfo && id == m_vehicleInfo->m_ID)
        return;

    VehicleEntry const *ve = sVehicleStore.LookupEntry(id);
    if(!ve)
        return;

    m_vehicleInfo = ve;

    RemoveAllPassengers();
    m_Seats.clear();
    m_usableSeatNum = 0;

    for(uint32 i = 0; i < 8; ++i)
    {
        if(uint32 seatId = m_vehicleInfo->m_seatID[i])
            if(VehicleSeatEntry const *veSeat = sVehicleSeatStore.LookupEntry(seatId))
            {
                m_Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));
                if(veSeat->IsUsable())
                    ++m_usableSeatNum;
            }                    
    }

    assert(!m_Seats.empty());
    if(m_usableSeatNum)
        SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
}
开发者ID:MilchBuby,项目名称:riboncore,代码行数:30,代码来源:Vehicle.cpp

示例5: UsableSeatNum

Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) :
UsableSeatNum(0), _me(unit), _vehicleInfo(vehInfo), _creatureEntry(creatureEntry), _status(STATUS_NONE)
{
    for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i)
    {
        if (uint32 seatId = _vehicleInfo->m_seatID[i])
            if (VehicleSeatEntry const* veSeat = sVehicleSeatStore.LookupEntry(seatId))
            {
                Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));
                if (veSeat->CanEnterOrExit())
                    ++UsableSeatNum;
            }
    }

    // Vehicle Immunities
    switch (GetVehicleInfo()->m_ID)
    {
        case 160:
        case 116:
            _me->SetControlled(true, UNIT_STATE_ROOT);
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true);
        case 117:
        case 324:
        case 158:
        case 79:
        case 106:
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL_PCT, true);
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_DISPEL, true);
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_FEAR, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_PERIODIC_HEAL, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_STUN, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_ROOT, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_DECREASE_SPEED, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
            _me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
            _me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_SHIELD, true);
            _me->ApplySpellImmune(0, IMMUNITY_ID, 13810, true); // Frost Trap
            _me->ApplySpellImmune(0, IMMUNITY_ID, 55741, true); // Desecration Rank 1
            _me->ApplySpellImmune(0, IMMUNITY_ID, 68766, true); // Desecration Rank 2
            break;
        default:
            break;
    }

    // Set or remove correct flags based on available seats. Will overwrite db data (if wrong).
    if (UsableSeatNum)
        _me->SetFlag(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));
    else
        _me->RemoveFlag(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));

    InitMovementInfoForBase();
}
开发者ID:bromacia,项目名称:TrinityCore-3.3.5a,代码行数:55,代码来源:Vehicle.cpp

示例6: _me

Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) : _me(unit), _vehicleInfo(vehInfo), _usableSeatNum(0), _creatureEntry(creatureEntry)
{
    for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i)
    {
        if (uint32 seatId = _vehicleInfo->m_seatID[i])
            if (VehicleSeatEntry const* veSeat = sVehicleSeatStore.LookupEntry(seatId))
            {
                Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));
                if (veSeat->CanEnterOrExit())
                    ++_usableSeatNum;
            }
    }

    // HACKY WAY, We must found a more generic way to handle this
    // Set inmunities since db ones are rewritten with player's ones
    switch (GetVehicleInfo()->m_ID)
    {
        case 160:
        case 116:
        case 452:
        case 453:
        case 510:
            _me->SetControlled(true, UNIT_STATE_ROOT);
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true);
       case 117:
       case 324:
       case 158:
       case 79:
       case 106:
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL_PCT, true);
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_DISPEL, true);
            _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_FEAR, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_PERIODIC_HEAL, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_STUN, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_ROOT, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_DECREASE_SPEED, true);
            _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
            _me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
            _me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_SHIELD, true);
            _me->ApplySpellImmune(0, IMMUNITY_ID, 13810, true); // Frost Trap
            _me->ApplySpellImmune(0, IMMUNITY_ID, 55741, true); // Desecration Rank 1
            _me->ApplySpellImmune(0, IMMUNITY_ID, 68766, true); // Desecration Rank 2
            break;
        default:
            break;
    }

    InitMovementInfoForBase();
}
开发者ID:bahajan95,项目名称:flame-core,代码行数:52,代码来源:Vehicle.cpp

示例7: _me

Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) : _me(unit), _vehicleInfo(vehInfo), _usableSeatNum(0), _creatureEntry(creatureEntry)
{
    for(uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i)
    {
        if(uint32 seatId = _vehicleInfo->m_seatID[i])
            if(VehicleSeatEntry const* veSeat = sVehicleSeatStore.LookupEntry(seatId))
            {
                Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));
                if(veSeat->CanEnterOrExit())
                    ++_usableSeatNum;
            }
    }

    InitMovementInfoForBase();
}
开发者ID:FreedomEmu,项目名称:FreedomEmu,代码行数:15,代码来源:Vehicle.cpp

示例8: m_vehicleInfo

VehicleKit::VehicleKit( Unit* base, VehicleEntry const* vehicleInfo ) : m_vehicleInfo(vehicleInfo), m_pBase(base), m_uiNumFreeSeats(0)
{
    for(uint32 i = 0; i < MAX_SEAT; ++i)
    {
        uint32 seatId = m_vehicleInfo->m_seatID[i];

        if(!seatId)
            continue;

        if(VehicleSeatEntry const *veSeat = sVehicleSeatStore.LookupEntry(seatId))
        {
            m_Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));

            if (veSeat->IsUsable())
                ++m_uiNumFreeSeats;
        }
    }
}
开发者ID:eviljared,项目名称:diamondcore,代码行数:18,代码来源:Vehicle.cpp

示例9: TransportBase

VehicleKit::VehicleKit(Unit* base, VehicleEntry const* entry) 
    :  TransportBase(base), m_vehicleEntry(entry), m_uiNumFreeSeats(0), m_isInitialized(false)
{
    for (uint32 i = 0; i < MAX_VEHICLE_SEAT; ++i)
    {
        uint32 seatId = GetEntry()->m_seatID[i];

        if (!seatId)
            continue;


        if (VehicleSeatEntry const *seatInfo = sVehicleSeatStore.LookupEntry(seatId))
        {
            m_Seats.insert(std::make_pair(i, VehicleSeat(seatInfo)));

            if (seatInfo->IsUsable())
                ++m_uiNumFreeSeats;
        }
    }

    if (base)
    {
        if (GetEntry()->m_flags & VEHICLE_FLAG_NO_STRAFE)
            GetBase()->m_movementInfo.AddMovementFlag2(MOVEFLAG2_NO_STRAFE);

        if (GetEntry()->m_flags & VEHICLE_FLAG_NO_JUMPING)
            GetBase()->m_movementInfo.AddMovementFlag2(MOVEFLAG2_NO_JUMPING);

        if (GetEntry()->m_flags & VEHICLE_FLAG_FULLSPEEDTURNING)
            GetBase()->m_movementInfo.AddMovementFlag2(MOVEFLAG2_FULLSPEEDTURNING);

        if (GetEntry()->m_flags & VEHICLE_FLAG_ALLOW_PITCHING)
            GetBase()->m_movementInfo.AddMovementFlag2(MOVEFLAG2_ALLOW_PITCHING);

        if (GetEntry()->m_flags & VEHICLE_FLAG_FULLSPEEDPITCHING)
        {
            GetBase()->m_movementInfo.AddMovementFlag2(MOVEFLAG2_ALLOW_PITCHING);
            GetBase()->m_movementInfo.AddMovementFlag2(MOVEFLAG2_FULLSPEEDPITCHING);
        }

    }
    SetDestination();
}
开发者ID:mynew3,项目名称:mangos,代码行数:43,代码来源:Vehicle.cpp

示例10: UsableSeatNum

Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) :
UsableSeatNum(0), _me(unit), _vehicleInfo(vehInfo), _creatureEntry(creatureEntry), _status(STATUS_NONE)
{
    for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i)
    {
        if (uint32 seatId = _vehicleInfo->m_seatID[i])
            if (VehicleSeatEntry const* veSeat = sVehicleSeatStore.LookupEntry(seatId))
            {
                Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));
                if (veSeat->CanEnterOrExit())
                    ++UsableSeatNum;
            }
    }

    // Set or remove correct flags based on available seats. Will overwrite db data (if wrong).
    if (UsableSeatNum)
        _me->SetFlag(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));
    else
        _me->RemoveFlag(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));

    InitMovementInfoForBase();
}
开发者ID:MICHAL53Q,项目名称:TrinityCore,代码行数:22,代码来源:Vehicle.cpp

示例11: RemoveAllPassengers

void Vehicle::SetVehicleId(uint32 id)
{
    if(_vehicleInfo && id == _vehicleInfo->m_ID)
        return;

    VehicleEntry const *ve = sVehicleStore.LookupEntry(id);

    if(!ve)
        return;

    _vehicleInfo = ve;

    RemoveAllPassengers();
    Seats.clear();

    for(uint32 i = 0; i < 8; ++i)
    {
        uint32 seatId = _vehicleInfo->m_seatID[i];
        if(seatId)
            if(VehicleSeatEntry const *veSeat = sVehicleSeatStore.LookupEntry(seatId))
                Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));
    }
}
开发者ID:Cryostorm,项目名称:WowSource434,代码行数:23,代码来源:Vehicle.cpp


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