本文整理汇总了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;
}
}
示例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());
}
示例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;
}
}
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
}
}
示例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();
}
示例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();
}
示例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)));
}
}