mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-26 15:33:34 +00:00
Replace all auto with auto*
For components
This commit is contained in:
parent
62aa863997
commit
e2dfa1809d
@ -427,7 +427,7 @@ void Character::SetPlayerFlag(const int32_t flagId, const bool value) {
|
|||||||
auto* player = EntityManager::Instance()->GetEntity(m_ObjectID);
|
auto* player = EntityManager::Instance()->GetEntity(m_ObjectID);
|
||||||
|
|
||||||
if (player != nullptr) {
|
if (player != nullptr) {
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent != nullptr) {
|
if (missionComponent != nullptr) {
|
||||||
missionComponent->Progress(eMissionTaskType::PLAYER_FLAG, flagId);
|
missionComponent->Progress(eMissionTaskType::PLAYER_FLAG, flagId);
|
||||||
@ -538,7 +538,7 @@ void Character::OnZoneLoad() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto missionComponent = m_OurEntity->GetComponent<MissionComponent>();
|
auto* missionComponent = m_OurEntity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent != nullptr) {
|
if (missionComponent != nullptr) {
|
||||||
// Fix the monument race flag
|
// Fix the monument race flag
|
||||||
@ -563,7 +563,7 @@ void Character::OnZoneLoad() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventoryComponent = m_OurEntity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = m_OurEntity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) {
|
if (inventoryComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -690,7 +690,7 @@ void Entity::OnCollisionPhantom(const LWOOBJID otherEntity) {
|
|||||||
const auto& poi = GetVar<std::u16string>(u"POI");
|
const auto& poi = GetVar<std::u16string>(u"POI");
|
||||||
|
|
||||||
if (!poi.empty()) {
|
if (!poi.empty()) {
|
||||||
auto missionComponent = other->GetComponent<MissionComponent>();
|
auto* missionComponent = other->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent != nullptr) {
|
if (missionComponent != nullptr) {
|
||||||
missionComponent->Progress(eMissionTaskType::EXPLORE, 0, 0, GeneralUtils::UTF16ToWTF8(poi));
|
missionComponent->Progress(eMissionTaskType::EXPLORE, 0, 0, GeneralUtils::UTF16ToWTF8(poi));
|
||||||
@ -936,7 +936,7 @@ void Entity::Kill(Entity* murderer) {
|
|||||||
|
|
||||||
// Track a player smashing something else
|
// Track a player smashing something else
|
||||||
if (murderer != nullptr) {
|
if (murderer != nullptr) {
|
||||||
auto murdererCharacterComponent = murderer->GetComponent<CharacterComponent>();
|
auto* murdererCharacterComponent = murderer->GetComponent<CharacterComponent>();
|
||||||
if (murdererCharacterComponent != nullptr) {
|
if (murdererCharacterComponent != nullptr) {
|
||||||
murdererCharacterComponent->UpdatePlayerStatistic(SmashablesSmashed);
|
murdererCharacterComponent->UpdatePlayerStatistic(SmashablesSmashed);
|
||||||
}
|
}
|
||||||
|
@ -483,7 +483,7 @@ void EntityManager::UpdateGhosting(Player* player) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent == nullptr) {
|
if (missionComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -599,7 +599,7 @@ void EntityManager::ScheduleForKill(Entity* entity) {
|
|||||||
if (!entity)
|
if (!entity)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto switchComp = entity->GetComponent<SwitchComponent>();
|
auto* switchComp = entity->GetComponent<SwitchComponent>();
|
||||||
if (switchComp) {
|
if (switchComp) {
|
||||||
entity->TriggerEvent(eTriggerEventType::DEACTIVATED, entity);
|
entity->TriggerEvent(eTriggerEventType::DEACTIVATED, entity);
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ void Player::SendToZone(LWOMAPID zoneId, LWOCLONEID cloneId) {
|
|||||||
const auto sysAddr = entity->GetSystemAddress();
|
const auto sysAddr = entity->GetSystemAddress();
|
||||||
|
|
||||||
auto* character = entity->GetCharacter();
|
auto* character = entity->GetCharacter();
|
||||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||||
|
|
||||||
if (character != nullptr && characterComponent != nullptr) {
|
if (character != nullptr && characterComponent != nullptr) {
|
||||||
character->SetZoneID(zoneID);
|
character->SetZoneID(zoneID);
|
||||||
|
@ -114,10 +114,10 @@ void Trade::Complete() {
|
|||||||
|
|
||||||
if (entityA == nullptr || entityB == nullptr) return;
|
if (entityA == nullptr || entityB == nullptr) return;
|
||||||
|
|
||||||
auto inventoryA = entityA->GetComponent<InventoryComponent>();
|
auto* inventoryA = entityA->GetComponent<InventoryComponent>();
|
||||||
auto inventoryB = entityB->GetComponent<InventoryComponent>();
|
auto* inventoryB = entityB->GetComponent<InventoryComponent>();
|
||||||
auto missionsA = entityA->GetComponent<MissionComponent>();
|
auto* missionsA = entityA->GetComponent<MissionComponent>();
|
||||||
auto missionsB = entityB->GetComponent<MissionComponent>();
|
auto* missionsB = entityB->GetComponent<MissionComponent>();
|
||||||
auto* characterA = entityA->GetCharacter();
|
auto* characterA = entityA->GetCharacter();
|
||||||
auto* characterB = entityB->GetCharacter();
|
auto* characterB = entityB->GetCharacter();
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ void Trade::SendUpdateToOther(LWOOBJID participant) {
|
|||||||
|
|
||||||
std::vector<TradeItem> items{};
|
std::vector<TradeItem> items{};
|
||||||
|
|
||||||
auto inventoryComponent = self->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = self->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) return;
|
if (inventoryComponent == nullptr) return;
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ void UserManager::RequestCharacterList(const SystemAddress& sysAddr) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto skillComponent = chars[i]->GetEntity()->GetComponent<SkillComponent>();
|
auto* skillComponent = chars[i]->GetEntity()->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent != nullptr) {
|
if (skillComponent != nullptr) {
|
||||||
skillComponent->Reset();
|
skillComponent->Reset();
|
||||||
|
@ -9,7 +9,7 @@ void ApplyBuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitS
|
|||||||
|
|
||||||
if (entity == nullptr) return;
|
if (entity == nullptr) return;
|
||||||
|
|
||||||
auto buffComponent = entity->GetComponent<BuffComponent>();
|
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
||||||
|
|
||||||
if (buffComponent == nullptr) return;
|
if (buffComponent == nullptr) return;
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ void ApplyBuffBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext b
|
|||||||
|
|
||||||
if (entity == nullptr) return;
|
if (entity == nullptr) return;
|
||||||
|
|
||||||
auto buffComponent = entity->GetComponent<BuffComponent>();
|
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
||||||
|
|
||||||
if (buffComponent == nullptr) return;
|
if (buffComponent == nullptr) return;
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ void AreaOfEffectBehavior::Calculate(BehaviorContext* context, RakNet::BitStream
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent == nullptr) {
|
if (destroyableComponent == nullptr) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -11,7 +11,7 @@ void BasicAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bi
|
|||||||
if (context->unmanaged) {
|
if (context->unmanaged) {
|
||||||
auto* entity = EntityManager::Instance()->GetEntity(branch.target);
|
auto* entity = EntityManager::Instance()->GetEntity(branch.target);
|
||||||
|
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
if (destroyableComponent != nullptr) {
|
if (destroyableComponent != nullptr) {
|
||||||
PlayFx(u"onhit", entity->GetObjectID());
|
PlayFx(u"onhit", entity->GetObjectID());
|
||||||
destroyableComponent->Damage(this->m_MaxDamage, context->originator, context->skillID);
|
destroyableComponent->Damage(this->m_MaxDamage, context->originator, context->skillID);
|
||||||
@ -44,7 +44,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = targetEntity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = targetEntity->GetComponent<DestroyableComponent>();
|
||||||
if (!destroyableComponent) {
|
if (!destroyableComponent) {
|
||||||
Game::logger->Log("BasicAttackBehavior", "No destroyable found on the obj/lot %llu/%i", branch.target, targetEntity->GetLOT());
|
Game::logger->Log("BasicAttackBehavior", "No destroyable found on the obj/lot %llu/%i", branch.target, targetEntity->GetLOT());
|
||||||
return;
|
return;
|
||||||
@ -161,7 +161,7 @@ void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = targetEntity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = targetEntity->GetComponent<DestroyableComponent>();
|
||||||
if (!destroyableComponent || !destroyableComponent->GetOwningEntity()) {
|
if (!destroyableComponent || !destroyableComponent->GetOwningEntity()) {
|
||||||
Game::logger->Log("BasicAttackBehavior", "No destroyable component on %llu", branch.target);
|
Game::logger->Log("BasicAttackBehavior", "No destroyable component on %llu", branch.target);
|
||||||
return;
|
return;
|
||||||
|
@ -328,7 +328,7 @@ void Behavior::PlayFx(std::u16string type, const LWOOBJID target, const LWOOBJID
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto renderComponent = targetEntity->GetComponent<RenderComponent>();
|
auto* renderComponent = targetEntity->GetComponent<RenderComponent>();
|
||||||
|
|
||||||
const auto typeString = GeneralUtils::UTF16ToWTF8(type);
|
const auto typeString = GeneralUtils::UTF16ToWTF8(type);
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ uint32_t BehaviorContext::GetUniqueSkillId() const {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto component = entity->GetComponent<SkillComponent>();
|
auto* component = entity->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (component == nullptr) {
|
if (component == nullptr) {
|
||||||
Game::logger->Log("BehaviorContext", "No skill component attached to (%llu)!", this->originator);;
|
Game::logger->Log("BehaviorContext", "No skill component attached to (%llu)!", this->originator);;
|
||||||
@ -331,7 +331,7 @@ std::vector<LWOOBJID> BehaviorContext::GetValidTargets(int32_t ignoreFaction, in
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ignoreFaction || includeFaction || (!entity->HasComponent(eReplicaComponentType::PHANTOM_PHYSICS) && targets.empty())) {
|
if (ignoreFaction || includeFaction || (!entity->HasComponent(eReplicaComponentType::PHANTOM_PHYSICS) && targets.empty())) {
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
if (!destroyableComponent) {
|
if (!destroyableComponent) {
|
||||||
return targets;
|
return targets;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ void BlockBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStrea
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent == nullptr) {
|
if (destroyableComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -48,7 +48,7 @@ void BlockBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branc
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
destroyableComponent->SetAttacksToBlock(this->m_numAttacksCanBlock);
|
destroyableComponent->SetAttacksToBlock(this->m_numAttacksCanBlock);
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ void BuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto component = entity->GetComponent<DestroyableComponent>();
|
auto* component = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (component == nullptr) {
|
if (component == nullptr) {
|
||||||
Game::logger->Log("BuffBehavior", "Invalid target, no destroyable component (%llu)!", target);
|
Game::logger->Log("BuffBehavior", "Invalid target, no destroyable component (%llu)!", target);
|
||||||
@ -52,7 +52,7 @@ void BuffBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto component = entity->GetComponent<DestroyableComponent>();
|
auto* component = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (component == nullptr) {
|
if (component == nullptr) {
|
||||||
Game::logger->Log("BuffBehavior", "Invalid target, no destroyable component (%llu)!", target);
|
Game::logger->Log("BuffBehavior", "Invalid target, no destroyable component (%llu)!", target);
|
||||||
|
@ -19,13 +19,13 @@ void CarBoostBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitSt
|
|||||||
|
|
||||||
Game::logger->Log("Car boost", "Activating car boost!");
|
Game::logger->Log("Car boost", "Activating car boost!");
|
||||||
|
|
||||||
auto possessableComponent = entity->GetComponent<PossessableComponent>();
|
auto* possessableComponent = entity->GetComponent<PossessableComponent>();
|
||||||
if (possessableComponent != nullptr) {
|
if (possessableComponent != nullptr) {
|
||||||
|
|
||||||
auto* possessor = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
auto* possessor = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
||||||
if (possessor != nullptr) {
|
if (possessor != nullptr) {
|
||||||
|
|
||||||
auto characterComponent = possessor->GetComponent<CharacterComponent>();
|
auto* characterComponent = possessor->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
Game::logger->Log("Car boost", "Tracking car boost!");
|
Game::logger->Log("Car boost", "Tracking car boost!");
|
||||||
characterComponent->UpdatePlayerStatistic(RacingCarBoostsActivated);
|
characterComponent->UpdatePlayerStatistic(RacingCarBoostsActivated);
|
||||||
|
@ -16,7 +16,7 @@ void DamageAbsorptionBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyable = target->GetComponent<DestroyableComponent>();
|
auto* destroyable = target->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) {
|
if (destroyable == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -42,7 +42,7 @@ void DamageAbsorptionBehavior::Timer(BehaviorContext* context, BehaviorBranchCon
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyable = target->GetComponent<DestroyableComponent>();
|
auto* destroyable = target->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) {
|
if (destroyable == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -16,7 +16,7 @@ void DamageReductionBehavior::Handle(BehaviorContext* context, RakNet::BitStream
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyable = target->GetComponent<DestroyableComponent>();
|
auto* destroyable = target->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) {
|
if (destroyable == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -40,7 +40,7 @@ void DamageReductionBehavior::Timer(BehaviorContext* context, BehaviorBranchCont
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyable = target->GetComponent<DestroyableComponent>();
|
auto* destroyable = target->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) {
|
if (destroyable == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -14,7 +14,7 @@ void DarkInspirationBehavior::Handle(BehaviorContext* context, RakNet::BitStream
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = target->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = target->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent == nullptr) {
|
if (destroyableComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -34,7 +34,7 @@ void DarkInspirationBehavior::Calculate(BehaviorContext* context, RakNet::BitStr
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = target->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = target->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent == nullptr) {
|
if (destroyableComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -11,7 +11,7 @@ void FallSpeedBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitS
|
|||||||
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
|
|
||||||
auto controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
controllablePhysicsComponent->SetGravityScale(m_PercentSlowed);
|
controllablePhysicsComponent->SetGravityScale(m_PercentSlowed);
|
||||||
EntityManager::Instance()->SerializeEntity(target);
|
EntityManager::Instance()->SerializeEntity(target);
|
||||||
@ -39,7 +39,7 @@ void FallSpeedBehavior::End(BehaviorContext* context, BehaviorBranchContext bran
|
|||||||
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
|
|
||||||
auto controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
controllablePhysicsComponent->SetGravityScale(1);
|
controllablePhysicsComponent->SetGravityScale(1);
|
||||||
EntityManager::Instance()->SerializeEntity(target);
|
EntityManager::Instance()->SerializeEntity(target);
|
||||||
|
@ -44,7 +44,7 @@ void ForceMovementBehavior::Calculate(BehaviorContext* context, RakNet::BitStrea
|
|||||||
|
|
||||||
auto* casterEntity = EntityManager::Instance()->GetEntity(context->caster);
|
auto* casterEntity = EntityManager::Instance()->GetEntity(context->caster);
|
||||||
if (casterEntity != nullptr) {
|
if (casterEntity != nullptr) {
|
||||||
auto controllablePhysicsComponent = casterEntity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = casterEntity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (controllablePhysicsComponent != nullptr) {
|
if (controllablePhysicsComponent != nullptr) {
|
||||||
|
|
||||||
if (m_Forward == 1) {
|
if (m_Forward == 1) {
|
||||||
@ -74,7 +74,7 @@ void ForceMovementBehavior::Load() {
|
|||||||
void ForceMovementBehavior::SyncCalculation(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
|
void ForceMovementBehavior::SyncCalculation(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
|
||||||
auto* casterEntity = EntityManager::Instance()->GetEntity(context->caster);
|
auto* casterEntity = EntityManager::Instance()->GetEntity(context->caster);
|
||||||
if (casterEntity != nullptr) {
|
if (casterEntity != nullptr) {
|
||||||
auto controllablePhysicsComponent = casterEntity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = casterEntity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (controllablePhysicsComponent != nullptr) {
|
if (controllablePhysicsComponent != nullptr) {
|
||||||
|
|
||||||
controllablePhysicsComponent->SetPosition(controllablePhysicsComponent->GetPosition() + controllablePhysicsComponent->GetVelocity() * m_Duration);
|
controllablePhysicsComponent->SetPosition(controllablePhysicsComponent->GetPosition() + controllablePhysicsComponent->GetVelocity() * m_Duration);
|
||||||
|
@ -16,7 +16,7 @@ void HealBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_strea
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyable = entity->GetComponent<DestroyableComponent>();
|
auto* destroyable = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) {
|
if (destroyable == nullptr) {
|
||||||
Game::logger->Log("HealBehavior", "Failed to find destroyable component for %(llu)!", branch.target);
|
Game::logger->Log("HealBehavior", "Failed to find destroyable component for %(llu)!", branch.target);
|
||||||
|
@ -13,7 +13,7 @@ void ImaginationBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bi
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyable = entity->GetComponent<DestroyableComponent>();
|
auto* destroyable = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) {
|
if (destroyable == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -17,7 +17,7 @@ void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitSt
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = target->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = target->GetComponent<DestroyableComponent>();
|
||||||
if (destroyableComponent) {
|
if (destroyableComponent) {
|
||||||
destroyableComponent->SetStatusImmunity(
|
destroyableComponent->SetStatusImmunity(
|
||||||
eStateChangeType::PUSH,
|
eStateChangeType::PUSH,
|
||||||
@ -33,7 +33,7 @@ void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitSt
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (controllablePhysicsComponent) {
|
if (controllablePhysicsComponent) {
|
||||||
controllablePhysicsComponent->SetStunImmunity(
|
controllablePhysicsComponent->SetStunImmunity(
|
||||||
eStateChangeType::PUSH,
|
eStateChangeType::PUSH,
|
||||||
@ -63,7 +63,7 @@ void ImmunityBehavior::Timer(BehaviorContext* context, BehaviorBranchContext bra
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = target->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = target->GetComponent<DestroyableComponent>();
|
||||||
if (destroyableComponent) {
|
if (destroyableComponent) {
|
||||||
destroyableComponent->SetStatusImmunity(
|
destroyableComponent->SetStatusImmunity(
|
||||||
eStateChangeType::POP,
|
eStateChangeType::POP,
|
||||||
@ -79,7 +79,7 @@ void ImmunityBehavior::Timer(BehaviorContext* context, BehaviorBranchContext bra
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (controllablePhysicsComponent) {
|
if (controllablePhysicsComponent) {
|
||||||
controllablePhysicsComponent->SetStunImmunity(
|
controllablePhysicsComponent->SetStunImmunity(
|
||||||
eStateChangeType::POP,
|
eStateChangeType::POP,
|
||||||
|
@ -46,7 +46,7 @@ void InterruptBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitS
|
|||||||
|
|
||||||
if (target == nullptr) return;
|
if (target == nullptr) return;
|
||||||
|
|
||||||
auto skillComponent = target->GetComponent<SkillComponent>();
|
auto* skillComponent = target->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent == nullptr) return;
|
if (skillComponent == nullptr) return;
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ void InterruptBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* b
|
|||||||
|
|
||||||
if (target == nullptr) return;
|
if (target == nullptr) return;
|
||||||
|
|
||||||
auto skillComponent = target->GetComponent<SkillComponent>();
|
auto* skillComponent = target->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent == nullptr) return;
|
if (skillComponent == nullptr) return;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ void KnockbackBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* b
|
|||||||
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
||||||
|
|
||||||
if (target != nullptr) {
|
if (target != nullptr) {
|
||||||
auto destroyableComponent = target->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = target->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent != nullptr) {
|
if (destroyableComponent != nullptr) {
|
||||||
blocked = destroyableComponent->IsKnockbackImmune();
|
blocked = destroyableComponent->IsKnockbackImmune();
|
||||||
|
@ -4,7 +4,7 @@ void LootBuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitSt
|
|||||||
auto target = EntityManager::Instance()->GetEntity(context->caster);
|
auto target = EntityManager::Instance()->GetEntity(context->caster);
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
|
|
||||||
auto controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
|
|
||||||
controllablePhysicsComponent->AddPickupRadiusScale(m_Scale);
|
controllablePhysicsComponent->AddPickupRadiusScale(m_Scale);
|
||||||
@ -22,7 +22,7 @@ void LootBuffBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext br
|
|||||||
auto target = EntityManager::Instance()->GetEntity(context->caster);
|
auto target = EntityManager::Instance()->GetEntity(context->caster);
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
|
|
||||||
auto controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
|
|
||||||
controllablePhysicsComponent->RemovePickupRadiusScale(m_Scale);
|
controllablePhysicsComponent->RemovePickupRadiusScale(m_Scale);
|
||||||
|
@ -24,7 +24,7 @@ void OverTimeBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitSt
|
|||||||
|
|
||||||
if (entity == nullptr) return;
|
if (entity == nullptr) return;
|
||||||
|
|
||||||
auto skillComponent = entity->GetComponent<SkillComponent>();
|
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent == nullptr) return;
|
if (skillComponent == nullptr) return;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto skillComponent = entity->GetComponent<SkillComponent>();
|
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent == nullptr) {
|
if (skillComponent == nullptr) {
|
||||||
Game::logger->Log("ProjectileAttackBehavior", "Failed to find skill component for (%llu)!", -context->originator);
|
Game::logger->Log("ProjectileAttackBehavior", "Failed to find skill component for (%llu)!", -context->originator);
|
||||||
@ -69,7 +69,7 @@ void ProjectileAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitSt
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto skillComponent = entity->GetComponent<SkillComponent>();
|
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent == nullptr) {
|
if (skillComponent == nullptr) {
|
||||||
Game::logger->Log("ProjectileAttackBehavior", "Failed to find skill component for (%llu)!", context->originator);
|
Game::logger->Log("ProjectileAttackBehavior", "Failed to find skill component for (%llu)!", context->originator);
|
||||||
|
@ -14,7 +14,7 @@ void PullToPointBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bi
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto movement = target->GetComponent<MovementAIComponent>();
|
auto* movement = target->GetComponent<MovementAIComponent>();
|
||||||
|
|
||||||
if (movement == nullptr) {
|
if (movement == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -9,7 +9,7 @@ void RemoveBuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit
|
|||||||
auto* entity = EntityManager::Instance()->GetEntity(context->caster);
|
auto* entity = EntityManager::Instance()->GetEntity(context->caster);
|
||||||
if (!entity) return;
|
if (!entity) return;
|
||||||
|
|
||||||
auto buffComponent = entity->GetComponent<BuffComponent>();
|
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
||||||
if (!buffComponent) return;
|
if (!buffComponent) return;
|
||||||
|
|
||||||
buffComponent->RemoveBuff(m_BuffId, false, m_RemoveImmunity);
|
buffComponent->RemoveBuff(m_BuffId, false, m_RemoveImmunity);
|
||||||
|
@ -16,7 +16,7 @@ void RepairBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_str
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyable = entity->GetComponent<DestroyableComponent>();
|
auto* destroyable = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) {
|
if (destroyable == nullptr) {
|
||||||
Game::logger->Log("RepairBehavior", "Failed to find destroyable component for %(llu)!", branch.target);
|
Game::logger->Log("RepairBehavior", "Failed to find destroyable component for %(llu)!", branch.target);
|
||||||
|
@ -53,7 +53,7 @@ void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStrea
|
|||||||
entity->SetOwnerOverride(context->originator);
|
entity->SetOwnerOverride(context->originator);
|
||||||
|
|
||||||
// Unset the flag to reposition the player, this makes it harder to glitch out of the map
|
// Unset the flag to reposition the player, this makes it harder to glitch out of the map
|
||||||
auto rebuildComponent = entity->GetComponent<RebuildComponent>();
|
auto* rebuildComponent = entity->GetComponent<RebuildComponent>();
|
||||||
|
|
||||||
if (rebuildComponent != nullptr) {
|
if (rebuildComponent != nullptr) {
|
||||||
rebuildComponent->SetRepositionPlayer(false);
|
rebuildComponent->SetRepositionPlayer(false);
|
||||||
@ -87,7 +87,7 @@ void SpawnBehavior::Timer(BehaviorContext* context, const BehaviorBranchContext
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyable = entity->GetComponent<DestroyableComponent>();
|
auto* destroyable = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (!destroyable) {
|
if (!destroyable) {
|
||||||
entity->Smash(context->originator);
|
entity->Smash(context->originator);
|
||||||
|
@ -12,7 +12,7 @@ void SpeedBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStrea
|
|||||||
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
|
|
||||||
auto controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
|
|
||||||
controllablePhysicsComponent->AddSpeedboost(m_RunSpeed);
|
controllablePhysicsComponent->AddSpeedboost(m_RunSpeed);
|
||||||
@ -41,7 +41,7 @@ void SpeedBehavior::End(BehaviorContext* context, BehaviorBranchContext branch,
|
|||||||
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
|
|
||||||
auto controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
|
|
||||||
controllablePhysicsComponent->RemoveSpeedboost(m_RunSpeed);
|
controllablePhysicsComponent->RemoveSpeedboost(m_RunSpeed);
|
||||||
|
@ -33,7 +33,7 @@ void StunBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream
|
|||||||
* If our target is an enemy we can go ahead and stun it.
|
* If our target is an enemy we can go ahead and stun it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
auto combatAiComponent = target->GetComponent<BaseCombatAIComponent>();
|
auto* combatAiComponent = target->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
if (combatAiComponent == nullptr) {
|
if (combatAiComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -56,7 +56,7 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStr
|
|||||||
* See if we can stun ourselves
|
* See if we can stun ourselves
|
||||||
*/
|
*/
|
||||||
|
|
||||||
auto combatAiComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAiComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
if (combatAiComponent == nullptr) {
|
if (combatAiComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -72,7 +72,7 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStr
|
|||||||
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
||||||
|
|
||||||
if (target != nullptr) {
|
if (target != nullptr) {
|
||||||
auto destroyableComponent = target->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = target->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent != nullptr) {
|
if (destroyableComponent != nullptr) {
|
||||||
blocked = destroyableComponent->IsKnockbackImmune();
|
blocked = destroyableComponent->IsKnockbackImmune();
|
||||||
@ -91,7 +91,7 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStr
|
|||||||
* If our target is an enemy we can go ahead and stun it.
|
* If our target is an enemy we can go ahead and stun it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
auto combatAiComponent = target->GetComponent<BaseCombatAIComponent>();
|
auto* combatAiComponent = target->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
if (combatAiComponent == nullptr) {
|
if (combatAiComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -22,7 +22,7 @@ void SwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStre
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent == nullptr) {
|
if (destroyableComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -46,7 +46,7 @@ void SwitchBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitS
|
|||||||
state = entity != nullptr;
|
state = entity != nullptr;
|
||||||
|
|
||||||
if (state && m_targetHasBuff != 0) {
|
if (state && m_targetHasBuff != 0) {
|
||||||
auto buffComponent = entity->GetComponent<BuffComponent>();
|
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
||||||
|
|
||||||
if (buffComponent != nullptr && !buffComponent->HasBuff(m_targetHasBuff)) {
|
if (buffComponent != nullptr && !buffComponent->HasBuff(m_targetHasBuff)) {
|
||||||
state = false;
|
state = false;
|
||||||
|
@ -82,7 +82,7 @@ void TacArcBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitS
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
const auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if ((this->m_usePickedTarget || context->clientInitalized) && branch.target > 0) {
|
if ((this->m_usePickedTarget || context->clientInitalized) && branch.target > 0) {
|
||||||
const auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
const auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
||||||
@ -101,7 +101,7 @@ void TacArcBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitS
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto combatAi = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAi = self->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
const auto casterPosition = self->GetPosition();
|
const auto casterPosition = self->GetPosition();
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ void TauntBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStrea
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto combatComponent = target->GetComponent<BaseCombatAIComponent>();
|
auto* combatComponent = target->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
if (combatComponent != nullptr) {
|
if (combatComponent != nullptr) {
|
||||||
combatComponent->Taunt(context->originator, m_threatToAdd);
|
combatComponent->Taunt(context->originator, m_threatToAdd);
|
||||||
@ -31,7 +31,7 @@ void TauntBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitSt
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto combatComponent = target->GetComponent<BaseCombatAIComponent>();
|
auto* combatComponent = target->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
if (combatComponent != nullptr) {
|
if (combatComponent != nullptr) {
|
||||||
combatComponent->Taunt(context->originator, m_threatToAdd);
|
combatComponent->Taunt(context->originator, m_threatToAdd);
|
||||||
|
@ -8,7 +8,7 @@ void VentureVisionBehavior::Handle(BehaviorContext* context, RakNet::BitStream*
|
|||||||
const auto targetEntity = EntityManager::Instance()->GetEntity(branch.target);
|
const auto targetEntity = EntityManager::Instance()->GetEntity(branch.target);
|
||||||
|
|
||||||
if (targetEntity) {
|
if (targetEntity) {
|
||||||
auto characterComponent = targetEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = targetEntity->GetComponent<CharacterComponent>();
|
||||||
|
|
||||||
if (characterComponent) {
|
if (characterComponent) {
|
||||||
if (m_show_collectibles) characterComponent->AddVentureVisionEffect(m_ShowCollectibles);
|
if (m_show_collectibles) characterComponent->AddVentureVisionEffect(m_ShowCollectibles);
|
||||||
@ -24,7 +24,7 @@ void VentureVisionBehavior::UnCast(BehaviorContext* context, BehaviorBranchConte
|
|||||||
const auto targetEntity = EntityManager::Instance()->GetEntity(branch.target);
|
const auto targetEntity = EntityManager::Instance()->GetEntity(branch.target);
|
||||||
|
|
||||||
if (targetEntity) {
|
if (targetEntity) {
|
||||||
auto characterComponent = targetEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = targetEntity->GetComponent<CharacterComponent>();
|
||||||
|
|
||||||
if (characterComponent) {
|
if (characterComponent) {
|
||||||
if (m_show_collectibles) characterComponent->RemoveVentureVisionEffect(m_ShowCollectibles);
|
if (m_show_collectibles) characterComponent->RemoveVentureVisionEffect(m_ShowCollectibles);
|
||||||
|
@ -244,7 +244,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
|||||||
bool hadRemainingDowntime = m_SkillTime > 0.0f;
|
bool hadRemainingDowntime = m_SkillTime > 0.0f;
|
||||||
if (m_SkillTime > 0.0f) m_SkillTime -= deltaTime;
|
if (m_SkillTime > 0.0f) m_SkillTime -= deltaTime;
|
||||||
|
|
||||||
auto rebuild = m_OwningEntity->GetComponent<RebuildComponent>();
|
auto* rebuild = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||||
|
|
||||||
if (rebuild != nullptr) {
|
if (rebuild != nullptr) {
|
||||||
const auto state = rebuild->GetState();
|
const auto state = rebuild->GetState();
|
||||||
@ -254,7 +254,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto skillComponent = m_OwningEntity->GetComponent<SkillComponent>();
|
auto* skillComponent = m_OwningEntity->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent == nullptr) {
|
if (skillComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -288,7 +288,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m_TetherEffectActive && m_OutOfCombat && (m_OutOfCombatTime -= deltaTime) <= 0) {
|
if (!m_TetherEffectActive && m_OutOfCombat && (m_OutOfCombatTime -= deltaTime) <= 0) {
|
||||||
auto destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent != nullptr && destroyableComponent->HasFaction(4)) {
|
if (destroyableComponent != nullptr && destroyableComponent->HasFaction(4)) {
|
||||||
auto serilizationRequired = false;
|
auto serilizationRequired = false;
|
||||||
@ -548,13 +548,13 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyable = entity->GetComponent<DestroyableComponent>();
|
auto* destroyable = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) {
|
if (destroyable == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto referenceDestroyable = m_OwningEntity->GetComponent<DestroyableComponent>();
|
auto* referenceDestroyable = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (referenceDestroyable == nullptr) {
|
if (referenceDestroyable == nullptr) {
|
||||||
Game::logger->Log("BaseCombatAIComponent", "Invalid reference destroyable component on (%llu)!", m_OwningEntity->GetObjectID());
|
Game::logger->Log("BaseCombatAIComponent", "Invalid reference destroyable component on (%llu)!", m_OwningEntity->GetObjectID());
|
||||||
@ -562,7 +562,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto quickbuild = entity->GetComponent<RebuildComponent>();
|
auto* quickbuild = entity->GetComponent<RebuildComponent>();
|
||||||
|
|
||||||
if (quickbuild != nullptr) {
|
if (quickbuild != nullptr) {
|
||||||
const auto state = quickbuild->GetState();
|
const auto state = quickbuild->GetState();
|
||||||
|
@ -71,7 +71,7 @@ void BouncerComponent::LookupPetSwitch() {
|
|||||||
const auto& entities = EntityManager::Instance()->GetEntitiesInGroup(group);
|
const auto& entities = EntityManager::Instance()->GetEntitiesInGroup(group);
|
||||||
|
|
||||||
for (auto* entity : entities) {
|
for (auto* entity : entities) {
|
||||||
auto switchComponent = entity->GetComponent<SwitchComponent>();
|
auto* switchComponent = entity->GetComponent<SwitchComponent>();
|
||||||
|
|
||||||
if (switchComponent != nullptr) {
|
if (switchComponent != nullptr) {
|
||||||
switchComponent->SetPetBouncer(this);
|
switchComponent->SetPetBouncer(this);
|
||||||
|
@ -149,7 +149,7 @@ void BuffComponent::ApplyBuffEffect(int32_t id) {
|
|||||||
if (parameter.name == "max_health") {
|
if (parameter.name == "max_health") {
|
||||||
const auto maxHealth = parameter.value;
|
const auto maxHealth = parameter.value;
|
||||||
|
|
||||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) return;
|
if (destroyable == nullptr) return;
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ void BuffComponent::ApplyBuffEffect(int32_t id) {
|
|||||||
} else if (parameter.name == "max_armor") {
|
} else if (parameter.name == "max_armor") {
|
||||||
const auto maxArmor = parameter.value;
|
const auto maxArmor = parameter.value;
|
||||||
|
|
||||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) return;
|
if (destroyable == nullptr) return;
|
||||||
|
|
||||||
@ -165,13 +165,13 @@ void BuffComponent::ApplyBuffEffect(int32_t id) {
|
|||||||
} else if (parameter.name == "max_imagination") {
|
} else if (parameter.name == "max_imagination") {
|
||||||
const auto maxImagination = parameter.value;
|
const auto maxImagination = parameter.value;
|
||||||
|
|
||||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) return;
|
if (destroyable == nullptr) return;
|
||||||
|
|
||||||
destroyable->SetMaxImagination(destroyable->GetMaxImagination() + maxImagination);
|
destroyable->SetMaxImagination(destroyable->GetMaxImagination() + maxImagination);
|
||||||
} else if (parameter.name == "speed") {
|
} else if (parameter.name == "speed") {
|
||||||
auto controllablePhysicsComponent = this->GetOwningEntity()->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = this->GetOwningEntity()->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
const auto speed = parameter.value;
|
const auto speed = parameter.value;
|
||||||
controllablePhysicsComponent->AddSpeedboost(speed);
|
controllablePhysicsComponent->AddSpeedboost(speed);
|
||||||
@ -185,7 +185,7 @@ void BuffComponent::RemoveBuffEffect(int32_t id) {
|
|||||||
if (parameter.name == "max_health") {
|
if (parameter.name == "max_health") {
|
||||||
const auto maxHealth = parameter.value;
|
const auto maxHealth = parameter.value;
|
||||||
|
|
||||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) return;
|
if (destroyable == nullptr) return;
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ void BuffComponent::RemoveBuffEffect(int32_t id) {
|
|||||||
} else if (parameter.name == "max_armor") {
|
} else if (parameter.name == "max_armor") {
|
||||||
const auto maxArmor = parameter.value;
|
const auto maxArmor = parameter.value;
|
||||||
|
|
||||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) return;
|
if (destroyable == nullptr) return;
|
||||||
|
|
||||||
@ -201,13 +201,13 @@ void BuffComponent::RemoveBuffEffect(int32_t id) {
|
|||||||
} else if (parameter.name == "max_imagination") {
|
} else if (parameter.name == "max_imagination") {
|
||||||
const auto maxImagination = parameter.value;
|
const auto maxImagination = parameter.value;
|
||||||
|
|
||||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable == nullptr) return;
|
if (destroyable == nullptr) return;
|
||||||
|
|
||||||
destroyable->SetMaxImagination(destroyable->GetMaxImagination() - maxImagination);
|
destroyable->SetMaxImagination(destroyable->GetMaxImagination() - maxImagination);
|
||||||
} else if (parameter.name == "speed") {
|
} else if (parameter.name == "speed") {
|
||||||
auto controllablePhysicsComponent = this->GetOwningEntity()->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = this->GetOwningEntity()->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
const auto speed = parameter.value;
|
const auto speed = parameter.value;
|
||||||
controllablePhysicsComponent->RemoveSpeedboost(speed);
|
controllablePhysicsComponent->RemoveSpeedboost(speed);
|
||||||
|
@ -27,7 +27,7 @@ void BuildBorderComponent::OnUse(Entity* originator) {
|
|||||||
Game::logger->Log("BuildBorderComponent", "Using PropertyPlaque");
|
Game::logger->Log("BuildBorderComponent", "Using PropertyPlaque");
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventoryComponent = originator->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = originator->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) {
|
if (inventoryComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -63,7 +63,7 @@ void BuildBorderComponent::OnUse(Entity* originator) {
|
|||||||
GameMessages::SendStartArrangingWithItem(originator, originator->GetSystemAddress(), true, buildArea, originator->GetPosition());
|
GameMessages::SendStartArrangingWithItem(originator, originator->GetSystemAddress(), true, buildArea, originator->GetPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inv = m_OwningEntity->GetComponent<InventoryComponent>();
|
auto* inv = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
inv->PushEquippedItems(); // technically this is supposed to happen automatically... but it doesnt? so just keep this here
|
inv->PushEquippedItems(); // technically this is supposed to happen automatically... but it doesnt? so just keep this here
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ void CharacterComponent::SetLastRocketConfig(std::u16string config) {
|
|||||||
Item* CharacterComponent::GetRocket(Entity* player) {
|
Item* CharacterComponent::GetRocket(Entity* player) {
|
||||||
Item* rocket = nullptr;
|
Item* rocket = nullptr;
|
||||||
|
|
||||||
auto inventoryComponent = player->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (!inventoryComponent) return rocket;
|
if (!inventoryComponent) return rocket;
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ void ControllablePhysicsComponent::RemoveSpeedboost(float value) {
|
|||||||
// Recalculate speedboost since we removed one
|
// Recalculate speedboost since we removed one
|
||||||
m_SpeedBoost = 0.0f;
|
m_SpeedBoost = 0.0f;
|
||||||
if (m_ActiveSpeedBoosts.empty()) { // no active speed boosts left, so return to base speed
|
if (m_ActiveSpeedBoosts.empty()) { // no active speed boosts left, so return to base speed
|
||||||
auto levelProgressionComponent = m_OwningEntity->GetComponent<LevelProgressionComponent>();
|
auto* levelProgressionComponent = m_OwningEntity->GetComponent<LevelProgressionComponent>();
|
||||||
if (levelProgressionComponent) m_SpeedBoost = levelProgressionComponent->GetSpeedBase();
|
if (levelProgressionComponent) m_SpeedBoost = levelProgressionComponent->GetSpeedBase();
|
||||||
} else { // Used the last applied speedboost
|
} else { // Used the last applied speedboost
|
||||||
m_SpeedBoost = m_ActiveSpeedBoosts.back();
|
m_SpeedBoost = m_ActiveSpeedBoosts.back();
|
||||||
|
@ -185,7 +185,7 @@ void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto buffComponent = m_OwningEntity->GetComponent<BuffComponent>();
|
auto* buffComponent = m_OwningEntity->GetComponent<BuffComponent>();
|
||||||
|
|
||||||
if (buffComponent != nullptr) {
|
if (buffComponent != nullptr) {
|
||||||
buffComponent->LoadFromXml(doc);
|
buffComponent->LoadFromXml(doc);
|
||||||
@ -207,7 +207,7 @@ void DestroyableComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto buffComponent = m_OwningEntity->GetComponent<BuffComponent>();
|
auto* buffComponent = m_OwningEntity->GetComponent<BuffComponent>();
|
||||||
|
|
||||||
if (buffComponent != nullptr) {
|
if (buffComponent != nullptr) {
|
||||||
buffComponent->UpdateXml(doc);
|
buffComponent->UpdateXml(doc);
|
||||||
@ -224,7 +224,7 @@ void DestroyableComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
|||||||
void DestroyableComponent::SetHealth(int32_t value) {
|
void DestroyableComponent::SetHealth(int32_t value) {
|
||||||
m_DirtyHealth = true;
|
m_DirtyHealth = true;
|
||||||
|
|
||||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->TrackHealthDelta(value - m_iHealth);
|
characterComponent->TrackHealthDelta(value - m_iHealth);
|
||||||
}
|
}
|
||||||
@ -262,14 +262,14 @@ void DestroyableComponent::SetArmor(int32_t value) {
|
|||||||
// If Destroyable Component already has zero armor do not trigger the passive ability again.
|
// If Destroyable Component already has zero armor do not trigger the passive ability again.
|
||||||
bool hadArmor = m_iArmor > 0;
|
bool hadArmor = m_iArmor > 0;
|
||||||
|
|
||||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->TrackArmorDelta(value - m_iArmor);
|
characterComponent->TrackArmorDelta(value - m_iArmor);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_iArmor = value;
|
m_iArmor = value;
|
||||||
|
|
||||||
auto inventroyComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
auto* inventroyComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||||
if (m_iArmor == 0 && inventroyComponent != nullptr && hadArmor) {
|
if (m_iArmor == 0 && inventroyComponent != nullptr && hadArmor) {
|
||||||
inventroyComponent->TriggerPassiveAbility(PassiveAbilityTrigger::SentinelArmor);
|
inventroyComponent->TriggerPassiveAbility(PassiveAbilityTrigger::SentinelArmor);
|
||||||
}
|
}
|
||||||
@ -300,14 +300,14 @@ void DestroyableComponent::SetMaxArmor(float value, bool playAnim) {
|
|||||||
void DestroyableComponent::SetImagination(int32_t value) {
|
void DestroyableComponent::SetImagination(int32_t value) {
|
||||||
m_DirtyHealth = true;
|
m_DirtyHealth = true;
|
||||||
|
|
||||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->TrackImaginationDelta(value - m_iImagination);
|
characterComponent->TrackImaginationDelta(value - m_iImagination);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_iImagination = value;
|
m_iImagination = value;
|
||||||
|
|
||||||
auto inventroyComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
auto* inventroyComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||||
if (m_iImagination == 0 && inventroyComponent != nullptr) {
|
if (m_iImagination == 0 && inventroyComponent != nullptr) {
|
||||||
inventroyComponent->TriggerPassiveAbility(PassiveAbilityTrigger::AssemblyImagination);
|
inventroyComponent->TriggerPassiveAbility(PassiveAbilityTrigger::AssemblyImagination);
|
||||||
}
|
}
|
||||||
@ -407,7 +407,7 @@ void DestroyableComponent::AddFaction(const int32_t factionID, const bool ignore
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool DestroyableComponent::IsEnemy(const Entity* other) const {
|
bool DestroyableComponent::IsEnemy(const Entity* other) const {
|
||||||
const auto otherDestroyableComponent = other->GetComponent<DestroyableComponent>();
|
const auto* otherDestroyableComponent = other->GetComponent<DestroyableComponent>();
|
||||||
if (otherDestroyableComponent != nullptr) {
|
if (otherDestroyableComponent != nullptr) {
|
||||||
for (const auto enemyFaction : m_EnemyFactionIDs) {
|
for (const auto enemyFaction : m_EnemyFactionIDs) {
|
||||||
for (const auto otherFaction : otherDestroyableComponent->GetFactionIDs()) {
|
for (const auto otherFaction : otherDestroyableComponent->GetFactionIDs()) {
|
||||||
@ -421,7 +421,7 @@ bool DestroyableComponent::IsEnemy(const Entity* other) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool DestroyableComponent::IsFriend(const Entity* other) const {
|
bool DestroyableComponent::IsFriend(const Entity* other) const {
|
||||||
const auto otherDestroyableComponent = other->GetComponent<DestroyableComponent>();
|
const auto* otherDestroyableComponent = other->GetComponent<DestroyableComponent>();
|
||||||
if (otherDestroyableComponent != nullptr) {
|
if (otherDestroyableComponent != nullptr) {
|
||||||
for (const auto enemyFaction : m_EnemyFactionIDs) {
|
for (const auto enemyFaction : m_EnemyFactionIDs) {
|
||||||
for (const auto otherFaction : otherDestroyableComponent->GetFactionIDs()) {
|
for (const auto otherFaction : otherDestroyableComponent->GetFactionIDs()) {
|
||||||
@ -455,8 +455,8 @@ bool DestroyableComponent::IsImmune() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool DestroyableComponent::IsKnockbackImmune() const {
|
bool DestroyableComponent::IsKnockbackImmune() const {
|
||||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||||
auto inventoryComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (characterComponent != nullptr && inventoryComponent != nullptr && characterComponent->GetCurrentActivity() == eGameActivity::QUICKBUILDING) {
|
if (characterComponent != nullptr && inventoryComponent != nullptr && characterComponent->GetCurrentActivity() == eGameActivity::QUICKBUILDING) {
|
||||||
const auto hasPassive = inventoryComponent->HasAnyPassive({
|
const auto hasPassive = inventoryComponent->HasAnyPassive({
|
||||||
@ -493,13 +493,13 @@ bool DestroyableComponent::CheckValidity(const LWOOBJID target, const bool ignor
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto targetDestroyable = targetEntity->GetComponent<DestroyableComponent>();
|
auto* targetDestroyable = targetEntity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (targetDestroyable == nullptr) {
|
if (targetDestroyable == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto targetQuickbuild = targetEntity->GetComponent<RebuildComponent>();
|
auto* targetQuickbuild = targetEntity->GetComponent<RebuildComponent>();
|
||||||
|
|
||||||
if (targetQuickbuild != nullptr) {
|
if (targetQuickbuild != nullptr) {
|
||||||
const auto state = targetQuickbuild->GetState();
|
const auto state = targetQuickbuild->GetState();
|
||||||
@ -616,13 +616,13 @@ void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, uint32
|
|||||||
SetIsShielded(absorb > 0);
|
SetIsShielded(absorb > 0);
|
||||||
|
|
||||||
// Dismount on the possessable hit
|
// Dismount on the possessable hit
|
||||||
auto possessable = m_OwningEntity->GetComponent<PossessableComponent>();
|
auto* possessable = m_OwningEntity->GetComponent<PossessableComponent>();
|
||||||
if (possessable && possessable->GetDepossessOnHit()) {
|
if (possessable && possessable->GetDepossessOnHit()) {
|
||||||
possessable->Dismount();
|
possessable->Dismount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dismount on the possessor hit
|
// Dismount on the possessor hit
|
||||||
auto possessor = m_OwningEntity->GetComponent<PossessorComponent>();
|
auto* possessor = m_OwningEntity->GetComponent<PossessorComponent>();
|
||||||
if (possessor) {
|
if (possessor) {
|
||||||
auto possessableId = possessor->GetPossessable();
|
auto possessableId = possessor->GetPossessable();
|
||||||
if (possessableId != LWOOBJID_EMPTY) {
|
if (possessableId != LWOOBJID_EMPTY) {
|
||||||
@ -651,7 +651,7 @@ void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, uint32
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (health != 0) {
|
if (health != 0) {
|
||||||
auto combatComponent = m_OwningEntity->GetComponent<BaseCombatAIComponent>();
|
auto* combatComponent = m_OwningEntity->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
if (combatComponent != nullptr) {
|
if (combatComponent != nullptr) {
|
||||||
combatComponent->Taunt(source, sourceDamage * 10); // * 10 is arbatrary
|
combatComponent->Taunt(source, sourceDamage * 10); // * 10 is arbatrary
|
||||||
@ -710,13 +710,13 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
|
|||||||
|
|
||||||
const auto isEnemy = m_OwningEntity->GetComponent<BaseCombatAIComponent>() != nullptr;
|
const auto isEnemy = m_OwningEntity->GetComponent<BaseCombatAIComponent>() != nullptr;
|
||||||
|
|
||||||
auto inventoryComponent = owner->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = owner->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent != nullptr && isEnemy) {
|
if (inventoryComponent != nullptr && isEnemy) {
|
||||||
inventoryComponent->TriggerPassiveAbility(PassiveAbilityTrigger::EnemySmashed, m_OwningEntity);
|
inventoryComponent->TriggerPassiveAbility(PassiveAbilityTrigger::EnemySmashed, m_OwningEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto missions = owner->GetComponent<MissionComponent>();
|
auto* missions = owner->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missions != nullptr) {
|
if (missions != nullptr) {
|
||||||
if (team != nullptr) {
|
if (team != nullptr) {
|
||||||
@ -725,7 +725,7 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
|
|||||||
|
|
||||||
if (member == nullptr) continue;
|
if (member == nullptr) continue;
|
||||||
|
|
||||||
auto memberMissions = member->GetComponent<MissionComponent>();
|
auto* memberMissions = member->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (memberMissions == nullptr) continue;
|
if (memberMissions == nullptr) continue;
|
||||||
|
|
||||||
@ -750,7 +750,7 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
|
|||||||
|
|
||||||
if (team != nullptr && m_OwningEntity->GetComponent<BaseCombatAIComponent>() != nullptr) {
|
if (team != nullptr && m_OwningEntity->GetComponent<BaseCombatAIComponent>() != nullptr) {
|
||||||
LWOOBJID specificOwner = LWOOBJID_EMPTY;
|
LWOOBJID specificOwner = LWOOBJID_EMPTY;
|
||||||
auto scriptedActivityComponent = m_OwningEntity->GetComponent<ScriptedActivityComponent>();
|
auto* scriptedActivityComponent = m_OwningEntity->GetComponent<ScriptedActivityComponent>();
|
||||||
uint32_t teamSize = team->members.size();
|
uint32_t teamSize = team->members.size();
|
||||||
uint32_t lootMatrixId = GetLootMatrixID();
|
uint32_t lootMatrixId = GetLootMatrixID();
|
||||||
|
|
||||||
@ -877,11 +877,11 @@ void DestroyableComponent::FixStats() {
|
|||||||
if (entity == nullptr) return;
|
if (entity == nullptr) return;
|
||||||
|
|
||||||
// Reset skill component and buff component
|
// Reset skill component and buff component
|
||||||
auto skillComponent = entity->GetComponent<SkillComponent>();
|
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||||
auto buffComponent = entity->GetComponent<BuffComponent>();
|
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
||||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
// If any of the components are nullptr, return
|
// If any of the components are nullptr, return
|
||||||
if (skillComponent == nullptr || buffComponent == nullptr || missionComponent == nullptr || inventoryComponent == nullptr || destroyableComponent == nullptr) {
|
if (skillComponent == nullptr || buffComponent == nullptr || missionComponent == nullptr || inventoryComponent == nullptr || destroyableComponent == nullptr) {
|
||||||
@ -976,7 +976,7 @@ void DestroyableComponent::DoHardcoreModeDrops(const LWOOBJID source){
|
|||||||
//check if this is a player:
|
//check if this is a player:
|
||||||
if (m_OwningEntity->IsPlayer()) {
|
if (m_OwningEntity->IsPlayer()) {
|
||||||
//remove hardcore_lose_uscore_on_death_percent from the player's uscore:
|
//remove hardcore_lose_uscore_on_death_percent from the player's uscore:
|
||||||
auto character = m_OwningEntity->GetComponent<CharacterComponent>();
|
auto* character = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||||
auto uscore = character->GetUScore();
|
auto uscore = character->GetUScore();
|
||||||
|
|
||||||
auto uscoreToLose = uscore * (EntityManager::Instance()->GetHardcoreLoseUscoreOnDeathPercent() / 100);
|
auto uscoreToLose = uscore * (EntityManager::Instance()->GetHardcoreLoseUscoreOnDeathPercent() / 100);
|
||||||
@ -986,7 +986,7 @@ void DestroyableComponent::DoHardcoreModeDrops(const LWOOBJID source){
|
|||||||
|
|
||||||
if (EntityManager::Instance()->GetHardcoreDropinventoryOnDeath()) {
|
if (EntityManager::Instance()->GetHardcoreDropinventoryOnDeath()) {
|
||||||
//drop all items from inventory:
|
//drop all items from inventory:
|
||||||
auto inventory = m_OwningEntity->GetComponent<InventoryComponent>();
|
auto* inventory = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||||
if (inventory) {
|
if (inventory) {
|
||||||
//get the items inventory:
|
//get the items inventory:
|
||||||
auto items = inventory->GetInventory(eInventoryType::ITEMS);
|
auto items = inventory->GetInventory(eInventoryType::ITEMS);
|
||||||
@ -1029,7 +1029,7 @@ void DestroyableComponent::DoHardcoreModeDrops(const LWOOBJID source){
|
|||||||
//award the player some u-score:
|
//award the player some u-score:
|
||||||
auto* player = EntityManager::Instance()->GetEntity(source);
|
auto* player = EntityManager::Instance()->GetEntity(source);
|
||||||
if (player && player->IsPlayer()) {
|
if (player && player->IsPlayer()) {
|
||||||
auto playerStats = player->GetComponent<CharacterComponent>();
|
auto* playerStats = player->GetComponent<CharacterComponent>();
|
||||||
if (playerStats) {
|
if (playerStats) {
|
||||||
//get the maximum health from this enemy:
|
//get the maximum health from this enemy:
|
||||||
auto maxHealth = GetMaxHealth();
|
auto maxHealth = GetMaxHealth();
|
||||||
|
@ -189,7 +189,7 @@ void InventoryComponent::AddItem(
|
|||||||
inventoryType = Inventory::FindInventoryTypeForLot(lot);
|
inventoryType = Inventory::FindInventoryTypeForLot(lot);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto missions = m_OwningEntity->GetComponent<MissionComponent>();
|
auto* missions = m_OwningEntity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
auto* inventory = GetInventory(inventoryType);
|
auto* inventory = GetInventory(inventoryType);
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ void InventoryComponent::MoveItemToInventory(Item* item, const eInventoryType in
|
|||||||
item->SetCount(item->GetCount() - delta, false, false);
|
item->SetCount(item->GetCount() - delta, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto missionComponent = m_OwningEntity->GetComponent<MissionComponent>();
|
auto* missionComponent = m_OwningEntity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent != nullptr) {
|
if (missionComponent != nullptr) {
|
||||||
if (IsTransferInventory(inventory)) {
|
if (IsTransferInventory(inventory)) {
|
||||||
@ -833,7 +833,7 @@ void InventoryComponent::EquipItem(Item* item, const bool skipChecks) {
|
|||||||
for (auto* lauchPad : rocketLauchPads) {
|
for (auto* lauchPad : rocketLauchPads) {
|
||||||
if (Vector3::DistanceSquared(lauchPad->GetPosition(), position) > 13 * 13) continue;
|
if (Vector3::DistanceSquared(lauchPad->GetPosition(), position) > 13 * 13) continue;
|
||||||
|
|
||||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||||
|
|
||||||
if (characterComponent != nullptr) characterComponent->SetLastRocketItemID(item->GetId());
|
if (characterComponent != nullptr) characterComponent->SetLastRocketItemID(item->GetId());
|
||||||
|
|
||||||
@ -950,10 +950,10 @@ void InventoryComponent::UnequipScripts(Item* unequippedItem) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InventoryComponent::HandlePossession(Item* item) {
|
void InventoryComponent::HandlePossession(Item* item) {
|
||||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||||
if (!characterComponent) return;
|
if (!characterComponent) return;
|
||||||
|
|
||||||
auto possessorComponent = m_OwningEntity->GetComponent<PossessorComponent>();
|
auto* possessorComponent = m_OwningEntity->GetComponent<PossessorComponent>();
|
||||||
if (!possessorComponent) return;
|
if (!possessorComponent) return;
|
||||||
|
|
||||||
// Don't do anything if we are busy dismounting
|
// Don't do anything if we are busy dismounting
|
||||||
@ -986,7 +986,7 @@ void InventoryComponent::HandlePossession(Item* item) {
|
|||||||
auto* mount = EntityManager::Instance()->CreateEntity(info, nullptr, m_OwningEntity);
|
auto* mount = EntityManager::Instance()->CreateEntity(info, nullptr, m_OwningEntity);
|
||||||
|
|
||||||
// Check to see if the mount is a vehicle, if so, flip it
|
// Check to see if the mount is a vehicle, if so, flip it
|
||||||
auto havokVehiclePhysicsComponent = mount->GetComponent<HavokVehiclePhysicsComponent>();
|
auto* havokVehiclePhysicsComponent = mount->GetComponent<HavokVehiclePhysicsComponent>();
|
||||||
if (havokVehiclePhysicsComponent) {
|
if (havokVehiclePhysicsComponent) {
|
||||||
auto angles = startRotation.GetEulerAngles();
|
auto angles = startRotation.GetEulerAngles();
|
||||||
// Make it right side up
|
// Make it right side up
|
||||||
@ -1000,14 +1000,14 @@ void InventoryComponent::HandlePossession(Item* item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup the destroyable stats
|
// Setup the destroyable stats
|
||||||
auto destroyableComponent = mount->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = mount->GetComponent<DestroyableComponent>();
|
||||||
if (destroyableComponent) {
|
if (destroyableComponent) {
|
||||||
destroyableComponent->SetIsSmashable(false);
|
destroyableComponent->SetIsSmashable(false);
|
||||||
destroyableComponent->SetIsImmune(true);
|
destroyableComponent->SetIsImmune(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mount it
|
// Mount it
|
||||||
auto possessableComponent = mount->GetComponent<PossessableComponent>();
|
auto* possessableComponent = mount->GetComponent<PossessableComponent>();
|
||||||
if (possessableComponent) {
|
if (possessableComponent) {
|
||||||
possessableComponent->SetIsItemSpawned(true);
|
possessableComponent->SetIsItemSpawned(true);
|
||||||
possessableComponent->SetPossessor(m_OwningEntity->GetObjectID());
|
possessableComponent->SetPossessor(m_OwningEntity->GetObjectID());
|
||||||
@ -1076,7 +1076,7 @@ void InventoryComponent::PopEquippedItems() {
|
|||||||
|
|
||||||
m_Pushed.clear();
|
m_Pushed.clear();
|
||||||
|
|
||||||
auto destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
// Reset stats to full
|
// Reset stats to full
|
||||||
if (destroyableComponent) {
|
if (destroyableComponent) {
|
||||||
@ -1246,7 +1246,7 @@ void InventoryComponent::SpawnPet(Item* item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// First check if we can summon the pet. You need 1 imagination to do so.
|
// First check if we can summon the pet. You need 1 imagination to do so.
|
||||||
auto destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (Game::config->GetValue("pets_take_imagination") == "1" && destroyableComponent && destroyableComponent->GetImagination() <= 0) {
|
if (Game::config->GetValue("pets_take_imagination") == "1" && destroyableComponent && destroyableComponent->GetImagination() <= 0) {
|
||||||
GameMessages::SendUseItemRequirementsResponse(m_OwningEntity->GetObjectID(), m_OwningEntity->GetSystemAddress(), eUseItemResponse::NoImaginationForPet);
|
GameMessages::SendUseItemRequirementsResponse(m_OwningEntity->GetObjectID(), m_OwningEntity->GetSystemAddress(), eUseItemResponse::NoImaginationForPet);
|
||||||
@ -1261,7 +1261,7 @@ void InventoryComponent::SpawnPet(Item* item) {
|
|||||||
|
|
||||||
auto* pet = EntityManager::Instance()->CreateEntity(info);
|
auto* pet = EntityManager::Instance()->CreateEntity(info);
|
||||||
|
|
||||||
auto petComponent = pet->GetComponent<PetComponent>();
|
auto* petComponent = pet->GetComponent<PetComponent>();
|
||||||
|
|
||||||
if (petComponent != nullptr) {
|
if (petComponent != nullptr) {
|
||||||
petComponent->Activate(item);
|
petComponent->Activate(item);
|
||||||
@ -1339,7 +1339,7 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
|
|||||||
return entry.objectTemplate == static_cast<unsigned int>(item->GetLot());
|
return entry.objectTemplate == static_cast<unsigned int>(item->GetLot());
|
||||||
});
|
});
|
||||||
|
|
||||||
auto missions = m_OwningEntity->GetComponent<MissionComponent>();
|
auto* missions = m_OwningEntity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
for (const auto& result : results) {
|
for (const auto& result : results) {
|
||||||
if (result.castOnType == 1) {
|
if (result.castOnType == 1) {
|
||||||
|
@ -49,8 +49,8 @@ void LevelProgressionComponent::HandleLevelUp() {
|
|||||||
const auto& rewards = rewardsTable->GetByLevelID(m_Level);
|
const auto& rewards = rewardsTable->GetByLevelID(m_Level);
|
||||||
bool rewardingItem = rewards.size() > 0;
|
bool rewardingItem = rewards.size() > 0;
|
||||||
|
|
||||||
auto inventoryComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||||
|
|
||||||
if (!inventoryComponent || !controllablePhysicsComponent) return;
|
if (!inventoryComponent || !controllablePhysicsComponent) return;
|
||||||
// Tell the client we beginning to send level rewards.
|
// Tell the client we beginning to send level rewards.
|
||||||
@ -84,6 +84,6 @@ void LevelProgressionComponent::HandleLevelUp() {
|
|||||||
|
|
||||||
void LevelProgressionComponent::SetRetroactiveBaseSpeed(){
|
void LevelProgressionComponent::SetRetroactiveBaseSpeed(){
|
||||||
if (m_Level >= 20) m_SpeedBase = 525.0f;
|
if (m_Level >= 20) m_SpeedBase = 525.0f;
|
||||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (controllablePhysicsComponent) controllablePhysicsComponent->SetSpeedMultiplier(m_SpeedBase / 500.0f);
|
if (controllablePhysicsComponent) controllablePhysicsComponent->SetSpeedMultiplier(m_SpeedBase / 500.0f);
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ void MissionOfferComponent::OnUse(Entity* originator) {
|
|||||||
|
|
||||||
void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifiedMissionId) {
|
void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifiedMissionId) {
|
||||||
// First, get the entity's MissionComponent. If there is not one, then we cannot offer missions to this entity.
|
// First, get the entity's MissionComponent. If there is not one, then we cannot offer missions to this entity.
|
||||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (!missionComponent) {
|
if (!missionComponent) {
|
||||||
Game::logger->Log("MissionOfferComponent", "Unable to get mission component for Entity %llu", entity->GetObjectID());
|
Game::logger->Log("MissionOfferComponent", "Unable to get mission component for Entity %llu", entity->GetObjectID());
|
||||||
|
@ -322,7 +322,7 @@ foundComponent:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MovementAIComponent::SetPosition(const NiPoint3& value) {
|
void MovementAIComponent::SetPosition(const NiPoint3& value) {
|
||||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||||
|
|
||||||
if (controllablePhysicsComponent != nullptr) {
|
if (controllablePhysicsComponent != nullptr) {
|
||||||
controllablePhysicsComponent->SetPosition(value);
|
controllablePhysicsComponent->SetPosition(value);
|
||||||
@ -330,7 +330,7 @@ void MovementAIComponent::SetPosition(const NiPoint3& value) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
auto* simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||||
|
|
||||||
if (simplePhysicsComponent != nullptr) {
|
if (simplePhysicsComponent != nullptr) {
|
||||||
simplePhysicsComponent->SetPosition(value);
|
simplePhysicsComponent->SetPosition(value);
|
||||||
@ -342,7 +342,7 @@ void MovementAIComponent::SetRotation(const NiQuaternion& value) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||||
|
|
||||||
if (controllablePhysicsComponent != nullptr) {
|
if (controllablePhysicsComponent != nullptr) {
|
||||||
controllablePhysicsComponent->SetRotation(value);
|
controllablePhysicsComponent->SetRotation(value);
|
||||||
@ -350,7 +350,7 @@ void MovementAIComponent::SetRotation(const NiQuaternion& value) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
auto* simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||||
|
|
||||||
if (simplePhysicsComponent != nullptr) {
|
if (simplePhysicsComponent != nullptr) {
|
||||||
simplePhysicsComponent->SetRotation(value);
|
simplePhysicsComponent->SetRotation(value);
|
||||||
@ -358,7 +358,7 @@ void MovementAIComponent::SetRotation(const NiQuaternion& value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MovementAIComponent::SetVelocity(const NiPoint3& value) {
|
void MovementAIComponent::SetVelocity(const NiPoint3& value) {
|
||||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||||
|
|
||||||
if (controllablePhysicsComponent != nullptr) {
|
if (controllablePhysicsComponent != nullptr) {
|
||||||
controllablePhysicsComponent->SetVelocity(value);
|
controllablePhysicsComponent->SetVelocity(value);
|
||||||
@ -366,7 +366,7 @@ void MovementAIComponent::SetVelocity(const NiPoint3& value) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
auto* simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||||
|
|
||||||
if (simplePhysicsComponent != nullptr) {
|
if (simplePhysicsComponent != nullptr) {
|
||||||
simplePhysicsComponent->SetVelocity(value);
|
simplePhysicsComponent->SetVelocity(value);
|
||||||
|
@ -17,7 +17,7 @@ MultiZoneEntranceComponent::MultiZoneEntranceComponent(Entity* parent) : Compone
|
|||||||
MultiZoneEntranceComponent::~MultiZoneEntranceComponent() {}
|
MultiZoneEntranceComponent::~MultiZoneEntranceComponent() {}
|
||||||
|
|
||||||
void MultiZoneEntranceComponent::OnUse(Entity* originator) {
|
void MultiZoneEntranceComponent::OnUse(Entity* originator) {
|
||||||
auto rocket = originator->GetComponent<CharacterComponent>()->RocketEquip(originator);
|
auto* rocket = originator->GetComponent<CharacterComponent>()->RocketEquip(originator);
|
||||||
if (!rocket) return;
|
if (!rocket) return;
|
||||||
|
|
||||||
// the LUP world menu is just the property menu, the client knows how to handle it
|
// the LUP world menu is just the property menu, the client knows how to handle it
|
||||||
@ -25,7 +25,7 @@ void MultiZoneEntranceComponent::OnUse(Entity* originator) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MultiZoneEntranceComponent::OnSelectWorld(Entity* originator, uint32_t index) {
|
void MultiZoneEntranceComponent::OnSelectWorld(Entity* originator, uint32_t index) {
|
||||||
auto rocketLaunchpadControlComponent = m_OwningEntity->GetComponent<RocketLaunchpadControlComponent>();
|
auto* rocketLaunchpadControlComponent = m_OwningEntity->GetComponent<RocketLaunchpadControlComponent>();
|
||||||
if (!rocketLaunchpadControlComponent) return;
|
if (!rocketLaunchpadControlComponent) return;
|
||||||
|
|
||||||
rocketLaunchpadControlComponent->Launch(originator, m_LUPWorlds[index], 0);
|
rocketLaunchpadControlComponent->Launch(originator, m_LUPWorlds[index], 0);
|
||||||
|
@ -163,7 +163,7 @@ void PetComponent::OnUse(Entity* originator) {
|
|||||||
m_Tamer = LWOOBJID_EMPTY;
|
m_Tamer = LWOOBJID_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventoryComponent = originator->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = originator->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) {
|
if (inventoryComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -173,7 +173,7 @@ void PetComponent::OnUse(Entity* originator) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto movementAIComponent = m_OwningEntity->GetComponent<MovementAIComponent>();
|
auto* movementAIComponent = m_OwningEntity->GetComponent<MovementAIComponent>();
|
||||||
|
|
||||||
if (movementAIComponent != nullptr) {
|
if (movementAIComponent != nullptr) {
|
||||||
movementAIComponent->Stop();
|
movementAIComponent->Stop();
|
||||||
@ -224,7 +224,7 @@ void PetComponent::OnUse(Entity* originator) {
|
|||||||
imaginationCost = cached->second.imaginationCost;
|
imaginationCost = cached->second.imaginationCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = originator->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = originator->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent == nullptr) {
|
if (destroyableComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -487,7 +487,7 @@ void PetComponent::TryBuild(uint32_t numBricks, bool clientFailed) {
|
|||||||
|
|
||||||
if (cached == buildCache.end()) return;
|
if (cached == buildCache.end()) return;
|
||||||
|
|
||||||
auto destroyableComponent = tamer->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = tamer->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent == nullptr) return;
|
if (destroyableComponent == nullptr) return;
|
||||||
|
|
||||||
@ -548,7 +548,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
|
|||||||
|
|
||||||
GameMessages::SendPetResponse(m_Tamer, m_OwningEntity->GetObjectID(), 0, 10, 0, tamer->GetSystemAddress());
|
GameMessages::SendPetResponse(m_Tamer, m_OwningEntity->GetObjectID(), 0, 10, 0, tamer->GetSystemAddress());
|
||||||
|
|
||||||
auto inventoryComponent = tamer->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = tamer->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) {
|
if (inventoryComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -606,7 +606,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
|
|||||||
tamer->GetCharacter()->SetPlayerFlag(petFlags.at(m_OwningEntity->GetLOT()), true);
|
tamer->GetCharacter()->SetPlayerFlag(petFlags.at(m_OwningEntity->GetLOT()), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto missionComponent = tamer->GetComponent<MissionComponent>();
|
auto* missionComponent = tamer->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent != nullptr) {
|
if (missionComponent != nullptr) {
|
||||||
missionComponent->Progress(eMissionTaskType::PET_TAMING, m_OwningEntity->GetLOT());
|
missionComponent->Progress(eMissionTaskType::PET_TAMING, m_OwningEntity->GetLOT());
|
||||||
@ -614,7 +614,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
|
|||||||
|
|
||||||
SetStatus(1);
|
SetStatus(1);
|
||||||
|
|
||||||
auto characterComponent = tamer->GetComponent<CharacterComponent>();
|
auto* characterComponent = tamer->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->UpdatePlayerStatistic(PetsTamed);
|
characterComponent->UpdatePlayerStatistic(PetsTamed);
|
||||||
}
|
}
|
||||||
@ -648,7 +648,7 @@ void PetComponent::RequestSetPetName(std::u16string name) {
|
|||||||
|
|
||||||
Game::logger->Log("PetComponent", "Got set pet name (%s)", GeneralUtils::UTF16ToWTF8(name).c_str());
|
Game::logger->Log("PetComponent", "Got set pet name (%s)", GeneralUtils::UTF16ToWTF8(name).c_str());
|
||||||
|
|
||||||
auto inventoryComponent = tamer->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = tamer->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) {
|
if (inventoryComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -913,7 +913,7 @@ void PetComponent::AddDrainImaginationTimer(Item* item, bool fromTaming) {
|
|||||||
auto playerEntity = playerInventoryComponent->GetOwningEntity();
|
auto playerEntity = playerInventoryComponent->GetOwningEntity();
|
||||||
if (!playerEntity) return;
|
if (!playerEntity) return;
|
||||||
|
|
||||||
auto playerDestroyableComponent = playerEntity->GetComponent<DestroyableComponent>();
|
auto* playerDestroyableComponent = playerEntity->GetComponent<DestroyableComponent>();
|
||||||
if (!playerDestroyableComponent) return;
|
if (!playerDestroyableComponent) return;
|
||||||
|
|
||||||
// Drain by 1 when you summon pet or when this method is called, but not when we have just tamed this pet.
|
// Drain by 1 when you summon pet or when this method is called, but not when we have just tamed this pet.
|
||||||
@ -962,7 +962,7 @@ void PetComponent::Deactivate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PetComponent::Release() {
|
void PetComponent::Release() {
|
||||||
auto inventoryComponent = GetOwner()->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = GetOwner()->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) {
|
if (inventoryComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -48,7 +48,7 @@ void PossessableComponent::Dismount() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PossessableComponent::OnUse(Entity* originator) {
|
void PossessableComponent::OnUse(Entity* originator) {
|
||||||
auto possessor = originator->GetComponent<PossessorComponent>();
|
auto* possessor = originator->GetComponent<PossessorComponent>();
|
||||||
if (possessor) {
|
if (possessor) {
|
||||||
possessor->Mount(m_OwningEntity);
|
possessor->Mount(m_OwningEntity);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ PossessorComponent::~PossessorComponent() {
|
|||||||
if (m_Possessable != LWOOBJID_EMPTY) {
|
if (m_Possessable != LWOOBJID_EMPTY) {
|
||||||
auto* mount = EntityManager::Instance()->GetEntity(m_Possessable);
|
auto* mount = EntityManager::Instance()->GetEntity(m_Possessable);
|
||||||
if (mount) {
|
if (mount) {
|
||||||
auto possessable = mount->GetComponent<PossessableComponent>();
|
auto* possessable = mount->GetComponent<PossessableComponent>();
|
||||||
if (possessable) {
|
if (possessable) {
|
||||||
if (possessable->GetIsItemSpawned()) {
|
if (possessable->GetIsItemSpawned()) {
|
||||||
GameMessages::SendMarkInventoryItemAsActive(m_OwningEntity->GetObjectID(), false, eUnequippableActiveType::MOUNT, GetMountItemID(), m_OwningEntity->GetSystemAddress());
|
GameMessages::SendMarkInventoryItemAsActive(m_OwningEntity->GetObjectID(), false, eUnequippableActiveType::MOUNT, GetMountItemID(), m_OwningEntity->GetSystemAddress());
|
||||||
@ -43,14 +43,14 @@ void PossessorComponent::Mount(Entity* mount) {
|
|||||||
if (GetIsDismounting() || !mount) return;
|
if (GetIsDismounting() || !mount) return;
|
||||||
|
|
||||||
GameMessages::SendSetMountInventoryID(m_OwningEntity, mount->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);
|
GameMessages::SendSetMountInventoryID(m_OwningEntity, mount->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
auto possessableComponent = mount->GetComponent<PossessableComponent>();
|
auto* possessableComponent = mount->GetComponent<PossessableComponent>();
|
||||||
if (possessableComponent) {
|
if (possessableComponent) {
|
||||||
possessableComponent->SetPossessor(m_OwningEntity->GetObjectID());
|
possessableComponent->SetPossessor(m_OwningEntity->GetObjectID());
|
||||||
SetPossessable(mount->GetObjectID());
|
SetPossessable(mount->GetObjectID());
|
||||||
SetPossessableType(possessableComponent->GetPossessionType());
|
SetPossessableType(possessableComponent->GetPossessionType());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent) characterComponent->SetIsRacing(true);
|
if (characterComponent) characterComponent->SetIsRacing(true);
|
||||||
|
|
||||||
// GM's to send
|
// GM's to send
|
||||||
@ -68,7 +68,7 @@ void PossessorComponent::Dismount(Entity* mount, bool forceDismount) {
|
|||||||
SetIsDismounting(true);
|
SetIsDismounting(true);
|
||||||
|
|
||||||
if (mount) {
|
if (mount) {
|
||||||
auto possessableComponent = mount->GetComponent<PossessableComponent>();
|
auto* possessableComponent = mount->GetComponent<PossessableComponent>();
|
||||||
if (possessableComponent) {
|
if (possessableComponent) {
|
||||||
possessableComponent->SetPossessor(LWOOBJID_EMPTY);
|
possessableComponent->SetPossessor(LWOOBJID_EMPTY);
|
||||||
if (forceDismount) possessableComponent->ForceDepossess();
|
if (forceDismount) possessableComponent->ForceDepossess();
|
||||||
@ -76,7 +76,7 @@ void PossessorComponent::Dismount(Entity* mount, bool forceDismount) {
|
|||||||
EntityManager::Instance()->SerializeEntity(m_OwningEntity);
|
EntityManager::Instance()->SerializeEntity(m_OwningEntity);
|
||||||
EntityManager::Instance()->SerializeEntity(mount);
|
EntityManager::Instance()->SerializeEntity(mount);
|
||||||
|
|
||||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent) characterComponent->SetIsRacing(false);
|
if (characterComponent) characterComponent->SetIsRacing(false);
|
||||||
}
|
}
|
||||||
// Make sure we don't have wacky controls
|
// Make sure we don't have wacky controls
|
||||||
|
@ -26,10 +26,10 @@ PropertyEntranceComponent::PropertyEntranceComponent(uint32_t componentID, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PropertyEntranceComponent::OnUse(Entity* entity) {
|
void PropertyEntranceComponent::OnUse(Entity* entity) {
|
||||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||||
if (!characterComponent) return;
|
if (!characterComponent) return;
|
||||||
|
|
||||||
auto rocket = entity->GetComponent<CharacterComponent>()->RocketEquip(entity);
|
auto* rocket = entity->GetComponent<CharacterComponent>()->RocketEquip(entity);
|
||||||
if (!rocket) return;
|
if (!rocket) return;
|
||||||
|
|
||||||
GameMessages::SendPropertyEntranceBegin(m_OwningEntity->GetObjectID(), entity->GetSystemAddress());
|
GameMessages::SendPropertyEntranceBegin(m_OwningEntity->GetObjectID(), entity->GetSystemAddress());
|
||||||
@ -63,7 +63,7 @@ void PropertyEntranceComponent::OnEnterProperty(Entity* entity, uint32_t index,
|
|||||||
cloneId = query[index].CloneId;
|
cloneId = query[index].CloneId;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto launcher = m_OwningEntity->GetComponent<RocketLaunchpadControlComponent>();
|
auto* launcher = m_OwningEntity->GetComponent<RocketLaunchpadControlComponent>();
|
||||||
|
|
||||||
if (launcher == nullptr) {
|
if (launcher == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -263,7 +263,7 @@ void PropertyManagementComponent::OnStartBuilding() {
|
|||||||
SetPrivacyOption(PropertyPrivacyOption::Private); // Cant visit player which is building
|
SetPrivacyOption(PropertyPrivacyOption::Private); // Cant visit player which is building
|
||||||
|
|
||||||
if (!entrance.empty()) {
|
if (!entrance.empty()) {
|
||||||
auto rocketPad = entrance[0]->GetComponent<RocketLaunchpadControlComponent>();
|
auto* rocketPad = entrance[0]->GetComponent<RocketLaunchpadControlComponent>();
|
||||||
|
|
||||||
if (rocketPad != nullptr) {
|
if (rocketPad != nullptr) {
|
||||||
zoneId = rocketPad->GetDefaultZone();
|
zoneId = rocketPad->GetDefaultZone();
|
||||||
@ -275,7 +275,7 @@ void PropertyManagementComponent::OnStartBuilding() {
|
|||||||
|
|
||||||
player->SendToZone(zoneId);
|
player->SendToZone(zoneId);
|
||||||
}
|
}
|
||||||
auto inventoryComponent = ownerEntity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = ownerEntity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
// Push equipped items
|
// Push equipped items
|
||||||
if (inventoryComponent) inventoryComponent->PushEquippedItems();
|
if (inventoryComponent) inventoryComponent->PushEquippedItems();
|
||||||
@ -302,7 +302,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) {
|
if (inventoryComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -404,7 +404,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
|
|||||||
EntityManager::Instance()->GetZoneControlEntity()->OnZonePropertyModelPlaced(entity);
|
EntityManager::Instance()->GetZoneControlEntity()->OnZonePropertyModelPlaced(entity);
|
||||||
});
|
});
|
||||||
// Progress place model missions
|
// Progress place model missions
|
||||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
if (missionComponent != nullptr) missionComponent->Progress(eMissionTaskType::PLACE_MODEL, 0);
|
if (missionComponent != nullptr) missionComponent->Progress(eMissionTaskType::PLACE_MODEL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,7 +417,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) {
|
if (inventoryComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -86,7 +86,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventoryComponent = player->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) {
|
if (inventoryComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -140,7 +140,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
|||||||
// Make the vehicle a child of the racing controller.
|
// Make the vehicle a child of the racing controller.
|
||||||
m_OwningEntity->AddChild(carEntity);
|
m_OwningEntity->AddChild(carEntity);
|
||||||
|
|
||||||
auto destroyableComponent = carEntity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = carEntity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
// Setup the vehicle stats.
|
// Setup the vehicle stats.
|
||||||
if (destroyableComponent != nullptr) {
|
if (destroyableComponent != nullptr) {
|
||||||
@ -149,14 +149,14 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup the vehicle as being possessed by the player.
|
// Setup the vehicle as being possessed by the player.
|
||||||
auto possessableComponent = carEntity->GetComponent<PossessableComponent>();
|
auto* possessableComponent = carEntity->GetComponent<PossessableComponent>();
|
||||||
|
|
||||||
if (possessableComponent != nullptr) {
|
if (possessableComponent != nullptr) {
|
||||||
possessableComponent->SetPossessor(player->GetObjectID());
|
possessableComponent->SetPossessor(player->GetObjectID());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the vehicle's assemblyPartLOTs for display.
|
// Load the vehicle's assemblyPartLOTs for display.
|
||||||
auto moduleAssemblyComponent = carEntity->GetComponent<ModuleAssemblyComponent>();
|
auto* moduleAssemblyComponent = carEntity->GetComponent<ModuleAssemblyComponent>();
|
||||||
|
|
||||||
if (moduleAssemblyComponent) {
|
if (moduleAssemblyComponent) {
|
||||||
moduleAssemblyComponent->SetSubKey(item->GetSubKey());
|
moduleAssemblyComponent->SetSubKey(item->GetSubKey());
|
||||||
@ -171,7 +171,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup the player as possessing the vehicle.
|
// Setup the player as possessing the vehicle.
|
||||||
auto possessorComponent = player->GetComponent<PossessorComponent>();
|
auto* possessorComponent = player->GetComponent<PossessorComponent>();
|
||||||
|
|
||||||
if (possessorComponent != nullptr) {
|
if (possessorComponent != nullptr) {
|
||||||
possessorComponent->SetPossessable(carEntity->GetObjectID());
|
possessorComponent->SetPossessable(carEntity->GetObjectID());
|
||||||
@ -179,7 +179,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the player's current activity as racing.
|
// Set the player's current activity as racing.
|
||||||
auto characterComponent = player->GetComponent<CharacterComponent>();
|
auto* characterComponent = player->GetComponent<CharacterComponent>();
|
||||||
|
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->SetIsRacing(true);
|
characterComponent->SetIsRacing(true);
|
||||||
@ -289,7 +289,7 @@ void RacingControlComponent::OnRequestDie(Entity* player) {
|
|||||||
GameMessages::SendDie(vehicle, vehicle->GetObjectID(), LWOOBJID_EMPTY, true,
|
GameMessages::SendDie(vehicle, vehicle->GetObjectID(), LWOOBJID_EMPTY, true,
|
||||||
eKillType::VIOLENT, u"", 0, 0, 90.0f, false, true, 0);
|
eKillType::VIOLENT, u"", 0, 0, 90.0f, false, true, 0);
|
||||||
|
|
||||||
auto destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||||
uint32_t respawnImagination = 0;
|
uint32_t respawnImagination = 0;
|
||||||
// Reset imagination to half its current value, rounded up to the nearest value divisible by 10, as it was done in live.
|
// Reset imagination to half its current value, rounded up to the nearest value divisible by 10, as it was done in live.
|
||||||
// Do not actually change the value yet. Do that on respawn.
|
// Do not actually change the value yet. Do that on respawn.
|
||||||
@ -314,13 +314,13 @@ void RacingControlComponent::OnRequestDie(Entity* player) {
|
|||||||
UNASSIGNED_SYSTEM_ADDRESS);
|
UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
|
|
||||||
GameMessages::SendResurrect(vehicle);
|
GameMessages::SendResurrect(vehicle);
|
||||||
auto destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||||
// Reset imagination to half its current value, rounded up to the nearest value divisible by 10, as it was done in live.
|
// Reset imagination to half its current value, rounded up to the nearest value divisible by 10, as it was done in live.
|
||||||
if (destroyableComponent) destroyableComponent->SetImagination(respawnImagination);
|
if (destroyableComponent) destroyableComponent->SetImagination(respawnImagination);
|
||||||
EntityManager::Instance()->SerializeEntity(vehicle);
|
EntityManager::Instance()->SerializeEntity(vehicle);
|
||||||
});
|
});
|
||||||
|
|
||||||
auto characterComponent = player->GetComponent<CharacterComponent>();
|
auto* characterComponent = player->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->UpdatePlayerStatistic(RacingTimesWrecked);
|
characterComponent->UpdatePlayerStatistic(RacingTimesWrecked);
|
||||||
}
|
}
|
||||||
@ -382,7 +382,7 @@ void RacingControlComponent::HandleMessageBoxResponse(Entity* player, int32_t bu
|
|||||||
m_OwningEntity->GetObjectID(), 2, 0, LWOOBJID_EMPTY, u"",
|
m_OwningEntity->GetObjectID(), 2, 0, LWOOBJID_EMPTY, u"",
|
||||||
player->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);
|
player->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
|
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent == nullptr) return;
|
if (missionComponent == nullptr) return;
|
||||||
|
|
||||||
@ -635,7 +635,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
|||||||
vehicle->SetPosition(player.respawnPosition);
|
vehicle->SetPosition(player.respawnPosition);
|
||||||
vehicle->SetRotation(player.respawnRotation);
|
vehicle->SetRotation(player.respawnRotation);
|
||||||
|
|
||||||
auto destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent != nullptr) {
|
if (destroyableComponent != nullptr) {
|
||||||
destroyableComponent->SetImagination(0);
|
destroyableComponent->SetImagination(0);
|
||||||
@ -812,7 +812,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
|||||||
"Best lap time (%llu)", lapTime);
|
"Best lap time (%llu)", lapTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto missionComponent = playerEntity->GetComponent<MissionComponent>();
|
auto* missionComponent = playerEntity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent != nullptr) {
|
if (missionComponent != nullptr) {
|
||||||
|
|
||||||
@ -835,7 +835,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
|||||||
// Entire race time
|
// Entire race time
|
||||||
missionComponent->Progress(eMissionTaskType::RACING, (raceTime) * 1000, (LWOOBJID)eRacingTaskParam::TOTAL_TRACK_TIME);
|
missionComponent->Progress(eMissionTaskType::RACING, (raceTime) * 1000, (LWOOBJID)eRacingTaskParam::TOTAL_TRACK_TIME);
|
||||||
|
|
||||||
auto characterComponent = playerEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = playerEntity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->TrackRaceCompleted(m_Finished == 1);
|
characterComponent->TrackRaceCompleted(m_Finished == 1);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ RailActivatorComponent::RailActivatorComponent(Entity* parent, int32_t component
|
|||||||
RailActivatorComponent::~RailActivatorComponent() = default;
|
RailActivatorComponent::~RailActivatorComponent() = default;
|
||||||
|
|
||||||
void RailActivatorComponent::OnUse(Entity* originator) {
|
void RailActivatorComponent::OnUse(Entity* originator) {
|
||||||
auto rebuildComponent = m_OwningEntity->GetComponent<RebuildComponent>();
|
auto* rebuildComponent = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() != eRebuildState::COMPLETED)
|
if (rebuildComponent != nullptr && rebuildComponent->GetState() != eRebuildState::COMPLETED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ void RailActivatorComponent::OnCancelRailMovement(Entity* originator) {
|
|||||||
true, true, true, true, true, true, true
|
true, true, true, true, true, true, true
|
||||||
);
|
);
|
||||||
|
|
||||||
auto rebuildComponent = m_OwningEntity->GetComponent<RebuildComponent>();
|
auto* rebuildComponent = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||||
|
|
||||||
if (rebuildComponent != nullptr) {
|
if (rebuildComponent != nullptr) {
|
||||||
// Set back reset time
|
// Set back reset time
|
||||||
|
@ -194,7 +194,7 @@ void RebuildComponent::Update(float deltaTime) {
|
|||||||
if (m_TimeBeforeDrain <= 0.0f) {
|
if (m_TimeBeforeDrain <= 0.0f) {
|
||||||
m_TimeBeforeDrain = m_CompleteTime / static_cast<float>(m_TakeImagination);
|
m_TimeBeforeDrain = m_CompleteTime / static_cast<float>(m_TakeImagination);
|
||||||
|
|
||||||
auto destComp = builder->GetComponent<DestroyableComponent>();
|
auto* destComp = builder->GetComponent<DestroyableComponent>();
|
||||||
if (!destComp) break;
|
if (!destComp) break;
|
||||||
|
|
||||||
int newImagination = destComp->GetImagination();
|
int newImagination = destComp->GetImagination();
|
||||||
@ -400,7 +400,7 @@ void RebuildComponent::StartRebuild(Entity* user) {
|
|||||||
if (m_State == eRebuildState::OPEN || m_State == eRebuildState::COMPLETED || m_State == eRebuildState::INCOMPLETE) {
|
if (m_State == eRebuildState::OPEN || m_State == eRebuildState::COMPLETED || m_State == eRebuildState::INCOMPLETE) {
|
||||||
m_Builder = user->GetObjectID();
|
m_Builder = user->GetObjectID();
|
||||||
|
|
||||||
auto character = user->GetComponent<CharacterComponent>();
|
auto* character = user->GetComponent<CharacterComponent>();
|
||||||
character->SetCurrentActivity(eGameActivity::QUICKBUILDING);
|
character->SetCurrentActivity(eGameActivity::QUICKBUILDING);
|
||||||
|
|
||||||
EntityManager::Instance()->SerializeEntity(user);
|
EntityManager::Instance()->SerializeEntity(user);
|
||||||
@ -412,7 +412,7 @@ void RebuildComponent::StartRebuild(Entity* user) {
|
|||||||
m_StateDirty = true;
|
m_StateDirty = true;
|
||||||
EntityManager::Instance()->SerializeEntity(m_OwningEntity);
|
EntityManager::Instance()->SerializeEntity(m_OwningEntity);
|
||||||
|
|
||||||
auto movingPlatform = m_OwningEntity->GetComponent<MovingPlatformComponent>();
|
auto* movingPlatform = m_OwningEntity->GetComponent<MovingPlatformComponent>();
|
||||||
if (movingPlatform != nullptr) {
|
if (movingPlatform != nullptr) {
|
||||||
movingPlatform->OnRebuildInitilized();
|
movingPlatform->OnRebuildInitilized();
|
||||||
}
|
}
|
||||||
@ -434,7 +434,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto characterComponent = user->GetComponent<CharacterComponent>();
|
auto* characterComponent = user->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
||||||
characterComponent->TrackRebuildComplete();
|
characterComponent->TrackRebuildComplete();
|
||||||
@ -478,12 +478,12 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
|||||||
for (const auto memberId : team->members) { // progress missions for all team members
|
for (const auto memberId : team->members) { // progress missions for all team members
|
||||||
auto* member = EntityManager::Instance()->GetEntity(memberId);
|
auto* member = EntityManager::Instance()->GetEntity(memberId);
|
||||||
if (member) {
|
if (member) {
|
||||||
auto missionComponent = member->GetComponent<MissionComponent>();
|
auto* missionComponent = member->GetComponent<MissionComponent>();
|
||||||
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else{
|
} else{
|
||||||
auto missionComponent = builder->GetComponent<MissionComponent>();
|
auto* missionComponent = builder->GetComponent<MissionComponent>();
|
||||||
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
||||||
}
|
}
|
||||||
LootGenerator::Instance().DropActivityLoot(builder, m_OwningEntity, m_ActivityId, 1);
|
LootGenerator::Instance().DropActivityLoot(builder, m_OwningEntity, m_ActivityId, 1);
|
||||||
@ -503,7 +503,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
|||||||
|
|
||||||
m_OwningEntity->TriggerEvent(eTriggerEventType::REBUILD_COMPLETE, user);
|
m_OwningEntity->TriggerEvent(eTriggerEventType::REBUILD_COMPLETE, user);
|
||||||
|
|
||||||
auto movingPlatform = m_OwningEntity->GetComponent<MovingPlatformComponent>();
|
auto* movingPlatform = m_OwningEntity->GetComponent<MovingPlatformComponent>();
|
||||||
if (movingPlatform != nullptr) {
|
if (movingPlatform != nullptr) {
|
||||||
movingPlatform->OnCompleteRebuild();
|
movingPlatform->OnCompleteRebuild();
|
||||||
}
|
}
|
||||||
@ -588,7 +588,7 @@ void RebuildComponent::CancelRebuild(Entity* entity, eQuickBuildFailReason failR
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent) {
|
if (characterComponent) {
|
||||||
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
||||||
EntityManager::Instance()->SerializeEntity(entity);
|
EntityManager::Instance()->SerializeEntity(entity);
|
||||||
|
@ -214,7 +214,7 @@ float RenderComponent::GetAnimationTime(Entity* self, const std::string& animati
|
|||||||
float RenderComponent::DoAnimation(Entity* self, const std::string& animation, bool sendAnimation, float priority, float scale) {
|
float RenderComponent::DoAnimation(Entity* self, const std::string& animation, bool sendAnimation, float priority, float scale) {
|
||||||
float returnlength = 0.0f;
|
float returnlength = 0.0f;
|
||||||
if (!self) return returnlength;
|
if (!self) return returnlength;
|
||||||
auto renderComponent = self->GetComponent<RenderComponent>();
|
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||||
if (!renderComponent) return returnlength;
|
if (!renderComponent) return returnlength;
|
||||||
|
|
||||||
auto* animationsTable = CDClientManager::Instance().GetTable<CDAnimationsTable>();
|
auto* animationsTable = CDClientManager::Instance().GetTable<CDAnimationsTable>();
|
||||||
|
@ -50,7 +50,7 @@ void RocketLaunchpadControlComponent::Launch(Entity* originator, LWOMAPID mapId,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This also gets triggered by a proximity monitor + item equip, I will set that up when havok is ready
|
// This also gets triggered by a proximity monitor + item equip, I will set that up when havok is ready
|
||||||
auto characterComponent = originator->GetComponent<CharacterComponent>();
|
auto* characterComponent = originator->GetComponent<CharacterComponent>();
|
||||||
auto* character = originator->GetCharacter();
|
auto* character = originator->GetCharacter();
|
||||||
|
|
||||||
if (!characterComponent || !character) return;
|
if (!characterComponent || !character) return;
|
||||||
@ -89,18 +89,18 @@ void RocketLaunchpadControlComponent::OnUse(Entity* originator) {
|
|||||||
// instead we let their OnUse handlers do their things
|
// instead we let their OnUse handlers do their things
|
||||||
// which components of an Object have their OnUse called when using them
|
// which components of an Object have their OnUse called when using them
|
||||||
// so we don't need to call it here
|
// so we don't need to call it here
|
||||||
auto propertyEntrance = m_OwningEntity->GetComponent<PropertyEntranceComponent>();
|
auto* propertyEntrance = m_OwningEntity->GetComponent<PropertyEntranceComponent>();
|
||||||
if (propertyEntrance) {
|
if (propertyEntrance) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto multiZoneEntranceComponent = m_OwningEntity->GetComponent<MultiZoneEntranceComponent>();
|
auto* multiZoneEntranceComponent = m_OwningEntity->GetComponent<MultiZoneEntranceComponent>();
|
||||||
if (multiZoneEntranceComponent) {
|
if (multiZoneEntranceComponent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// No rocket no launch
|
// No rocket no launch
|
||||||
auto rocket = originator->GetComponent<CharacterComponent>()->RocketEquip(originator);
|
auto* rocket = originator->GetComponent<CharacterComponent>()->RocketEquip(originator);
|
||||||
if (!rocket) {
|
if (!rocket) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ ScriptedActivityComponent::ScriptedActivityComponent(Entity* parent, int activit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent) {
|
if (destroyableComponent) {
|
||||||
// check for LMIs and set the loot LMIs
|
// check for LMIs and set the loot LMIs
|
||||||
@ -305,7 +305,7 @@ bool ScriptedActivityComponent::IsValidActivity(Entity* player) {
|
|||||||
// Makes it so that scripted activities with an unimplemented map cannot be joined
|
// Makes it so that scripted activities with an unimplemented map cannot be joined
|
||||||
/*if (player->GetGMLevel() < eGameMasterLevel::DEVELOPER && (m_ActivityInfo.instanceMapID == 1302 || m_ActivityInfo.instanceMapID == 1301)) {
|
/*if (player->GetGMLevel() < eGameMasterLevel::DEVELOPER && (m_ActivityInfo.instanceMapID == 1302 || m_ActivityInfo.instanceMapID == 1301)) {
|
||||||
if (m_OwningEntity->GetLOT() == 4860) {
|
if (m_OwningEntity->GetLOT() == 4860) {
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
missionComponent->CompleteMission(229);
|
missionComponent->CompleteMission(229);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,7 +354,7 @@ bool ScriptedActivityComponent::TakeCost(Entity* player) const {
|
|||||||
if (m_ActivityInfo.optionalCostLOT <= 0 || m_ActivityInfo.optionalCostCount <= 0)
|
if (m_ActivityInfo.optionalCostLOT <= 0 || m_ActivityInfo.optionalCostCount <= 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
auto inventoryComponent = player->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||||
if (inventoryComponent == nullptr)
|
if (inventoryComponent == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -555,7 +555,7 @@ void ActivityInstance::StartZone() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ActivityInstance::RewardParticipant(Entity* participant) {
|
void ActivityInstance::RewardParticipant(Entity* participant) {
|
||||||
auto missionComponent = participant->GetComponent<MissionComponent>();
|
auto* missionComponent = participant->GetComponent<MissionComponent>();
|
||||||
if (missionComponent) {
|
if (missionComponent) {
|
||||||
missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityInfo.ActivityID);
|
missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityInfo.ActivityID);
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ void SkillComponent::Reset() {
|
|||||||
|
|
||||||
void SkillComponent::Interrupt() {
|
void SkillComponent::Interrupt() {
|
||||||
// TODO: need to check immunities on the destroyable component, but they aren't implemented
|
// TODO: need to check immunities on the destroyable component, but they aren't implemented
|
||||||
auto combat = m_OwningEntity->GetComponent<BaseCombatAIComponent>();
|
auto* combat = m_OwningEntity->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combat != nullptr && combat->GetStunImmune()) return;
|
if (combat != nullptr && combat->GetStunImmune()) return;
|
||||||
|
|
||||||
for (const auto& behavior : this->m_managedBehaviors) {
|
for (const auto& behavior : this->m_managedBehaviors) {
|
||||||
|
@ -196,7 +196,7 @@ void TriggerComponent::HandleDestroyObject(Entity* targetEntity, std::string arg
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string args){
|
void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string args){
|
||||||
auto triggerComponent = targetEntity->GetComponent<TriggerComponent>();
|
auto* triggerComponent = targetEntity->GetComponent<TriggerComponent>();
|
||||||
if (!triggerComponent) {
|
if (!triggerComponent) {
|
||||||
Game::logger->LogDebug("TriggerComponent::HandleToggleTrigger", "Trigger component not found!");
|
Game::logger->LogDebug("TriggerComponent::HandleToggleTrigger", "Trigger component not found!");
|
||||||
return;
|
return;
|
||||||
@ -205,7 +205,7 @@ void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string arg
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleResetRebuild(Entity* targetEntity, std::string args){
|
void TriggerComponent::HandleResetRebuild(Entity* targetEntity, std::string args){
|
||||||
auto rebuildComponent = targetEntity->GetComponent<RebuildComponent>();
|
auto* rebuildComponent = targetEntity->GetComponent<RebuildComponent>();
|
||||||
if (!rebuildComponent) {
|
if (!rebuildComponent) {
|
||||||
Game::logger->LogDebug("TriggerComponent::HandleResetRebuild", "Rebuild component not found!");
|
Game::logger->LogDebug("TriggerComponent::HandleResetRebuild", "Rebuild component not found!");
|
||||||
return;
|
return;
|
||||||
@ -237,7 +237,7 @@ void TriggerComponent::HandleRotateObject(Entity* targetEntity, std::vector<std:
|
|||||||
void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::string> argArray){
|
void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::string> argArray){
|
||||||
if (argArray.size() < 3) return;
|
if (argArray.size() < 3) return;
|
||||||
|
|
||||||
auto phantomPhysicsComponent = m_OwningEntity->GetComponent<PhantomPhysicsComponent>();
|
auto* phantomPhysicsComponent = m_OwningEntity->GetComponent<PhantomPhysicsComponent>();
|
||||||
if (!phantomPhysicsComponent) {
|
if (!phantomPhysicsComponent) {
|
||||||
Game::logger->LogDebug("TriggerComponent::HandlePushObject", "Phantom Physics component not found!");
|
Game::logger->LogDebug("TriggerComponent::HandlePushObject", "Phantom Physics component not found!");
|
||||||
return;
|
return;
|
||||||
@ -254,7 +254,7 @@ void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::s
|
|||||||
|
|
||||||
|
|
||||||
void TriggerComponent::HandleRepelObject(Entity* targetEntity, std::string args){
|
void TriggerComponent::HandleRepelObject(Entity* targetEntity, std::string args){
|
||||||
auto phantomPhysicsComponent = m_OwningEntity->GetComponent<PhantomPhysicsComponent>();
|
auto* phantomPhysicsComponent = m_OwningEntity->GetComponent<PhantomPhysicsComponent>();
|
||||||
if (!phantomPhysicsComponent) {
|
if (!phantomPhysicsComponent) {
|
||||||
Game::logger->LogDebug("TriggerComponent::HandleRepelObject", "Phantom Physics component not found!");
|
Game::logger->LogDebug("TriggerComponent::HandleRepelObject", "Phantom Physics component not found!");
|
||||||
return;
|
return;
|
||||||
@ -334,7 +334,7 @@ void TriggerComponent::HandleUpdateMission(Entity* targetEntity, std::vector<std
|
|||||||
// If others need to be implemented for modding
|
// If others need to be implemented for modding
|
||||||
// then we need a good way to convert this from a string to that enum
|
// then we need a good way to convert this from a string to that enum
|
||||||
if (argArray.at(0) != "exploretask") return;
|
if (argArray.at(0) != "exploretask") return;
|
||||||
auto missionComponent = targetEntity->GetComponent<MissionComponent>();
|
auto* missionComponent = targetEntity->GetComponent<MissionComponent>();
|
||||||
if (!missionComponent){
|
if (!missionComponent){
|
||||||
Game::logger->LogDebug("TriggerComponent::HandleUpdateMission", "Mission component not found!");
|
Game::logger->LogDebug("TriggerComponent::HandleUpdateMission", "Mission component not found!");
|
||||||
return;
|
return;
|
||||||
@ -353,7 +353,7 @@ void TriggerComponent::HandlePlayEffect(Entity* targetEntity, std::vector<std::s
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
|
void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
|
||||||
auto skillComponent = targetEntity->GetComponent<SkillComponent>();
|
auto* skillComponent = targetEntity->GetComponent<SkillComponent>();
|
||||||
if (!skillComponent) {
|
if (!skillComponent) {
|
||||||
Game::logger->LogDebug("TriggerComponent::HandleCastSkill", "Skill component not found!");
|
Game::logger->LogDebug("TriggerComponent::HandleCastSkill", "Skill component not found!");
|
||||||
return;
|
return;
|
||||||
@ -364,7 +364,7 @@ void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::vector<std::string> argArray) {
|
void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::vector<std::string> argArray) {
|
||||||
auto phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
auto* phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
||||||
if (!phantomPhysicsComponent) {
|
if (!phantomPhysicsComponent) {
|
||||||
Game::logger->LogDebug("TriggerComponent::HandleSetPhysicsVolumeEffect", "Phantom Physics component not found!");
|
Game::logger->LogDebug("TriggerComponent::HandleSetPhysicsVolumeEffect", "Phantom Physics component not found!");
|
||||||
return;
|
return;
|
||||||
@ -399,7 +399,7 @@ void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::v
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleSetPhysicsVolumeStatus(Entity* targetEntity, std::string args) {
|
void TriggerComponent::HandleSetPhysicsVolumeStatus(Entity* targetEntity, std::string args) {
|
||||||
auto phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
auto* phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
||||||
if (!phantomPhysicsComponent) {
|
if (!phantomPhysicsComponent) {
|
||||||
Game::logger->LogDebug("TriggerComponent::HandleSetPhysicsVolumeEffect", "Phantom Physics component not found!");
|
Game::logger->LogDebug("TriggerComponent::HandleSetPhysicsVolumeEffect", "Phantom Physics component not found!");
|
||||||
return;
|
return;
|
||||||
|
@ -110,7 +110,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
|
|||||||
player->ConstructLimboEntities();
|
player->ConstructLimboEntities();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
if (inv) {
|
if (inv) {
|
||||||
auto items = inv->GetEquippedItems();
|
auto items = inv->GetEquippedItems();
|
||||||
for (auto pair : items) {
|
for (auto pair : items) {
|
||||||
@ -120,13 +120,13 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyable = entity->GetComponent<DestroyableComponent>();
|
auto* destroyable = entity->GetComponent<DestroyableComponent>();
|
||||||
destroyable->SetImagination(destroyable->GetImagination());
|
destroyable->SetImagination(destroyable->GetImagination());
|
||||||
EntityManager::Instance()->SerializeEntity(entity);
|
EntityManager::Instance()->SerializeEntity(entity);
|
||||||
|
|
||||||
std::vector<Entity*> racingControllers = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL);
|
std::vector<Entity*> racingControllers = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL);
|
||||||
for (Entity* racingController : racingControllers) {
|
for (Entity* racingController : racingControllers) {
|
||||||
auto racingComponent = racingController->GetComponent<RacingControlComponent>();
|
auto* racingComponent = racingController->GetComponent<RacingControlComponent>();
|
||||||
if (racingComponent != nullptr) {
|
if (racingComponent != nullptr) {
|
||||||
racingComponent->OnPlayerLoaded(entity);
|
racingComponent->OnPlayerLoaded(entity);
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
|
|||||||
|
|
||||||
message.Deserialize(inStream);
|
message.Deserialize(inStream);
|
||||||
|
|
||||||
auto skill_component = entity->GetComponent<SkillComponent>();
|
auto* skill_component = entity->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skill_component != nullptr) {
|
if (skill_component != nullptr) {
|
||||||
auto* bs = new RakNet::BitStream((unsigned char*)message.sBitStream.c_str(), message.sBitStream.size(), false);
|
auto* bs = new RakNet::BitStream((unsigned char*)message.sBitStream.c_str(), message.sBitStream.size(), false);
|
||||||
@ -275,7 +275,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
|
|||||||
|
|
||||||
if (startSkill.skillID == 1561 || startSkill.skillID == 1562 || startSkill.skillID == 1541) return;
|
if (startSkill.skillID == 1561 || startSkill.skillID == 1562 || startSkill.skillID == 1541) return;
|
||||||
|
|
||||||
auto comp = entity->GetComponent<MissionComponent>();
|
auto* comp = entity->GetComponent<MissionComponent>();
|
||||||
if (comp) {
|
if (comp) {
|
||||||
comp->Progress(eMissionTaskType::USE_SKILL, startSkill.skillID);
|
comp->Progress(eMissionTaskType::USE_SKILL, startSkill.skillID);
|
||||||
}
|
}
|
||||||
@ -288,12 +288,12 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
|
|||||||
if (behaviorId > 0) {
|
if (behaviorId > 0) {
|
||||||
RakNet::BitStream* bs = new RakNet::BitStream((unsigned char*)startSkill.sBitStream.c_str(), startSkill.sBitStream.size(), false);
|
RakNet::BitStream* bs = new RakNet::BitStream((unsigned char*)startSkill.sBitStream.c_str(), startSkill.sBitStream.size(), false);
|
||||||
|
|
||||||
auto skillComponent = entity->GetComponent<SkillComponent>();
|
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
success = skillComponent->CastPlayerSkill(behaviorId, startSkill.uiSkillHandle, bs, startSkill.optionalTargetID, startSkill.skillID);
|
success = skillComponent->CastPlayerSkill(behaviorId, startSkill.uiSkillHandle, bs, startSkill.optionalTargetID, startSkill.skillID);
|
||||||
|
|
||||||
if (success && entity->GetCharacter()) {
|
if (success && entity->GetCharacter()) {
|
||||||
auto destComp = entity->GetComponent<DestroyableComponent>();
|
auto* destComp = entity->GetComponent<DestroyableComponent>();
|
||||||
destComp->SetImagination(destComp->GetImagination() - skillTable->GetSkillByID(startSkill.skillID).imaginationcost);
|
destComp->SetImagination(destComp->GetImagination() - skillTable->GetSkillByID(startSkill.skillID).imaginationcost);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
|
|||||||
if (usr != nullptr) {
|
if (usr != nullptr) {
|
||||||
RakNet::BitStream* bs = new RakNet::BitStream((unsigned char*)sync.sBitStream.c_str(), sync.sBitStream.size(), false);
|
RakNet::BitStream* bs = new RakNet::BitStream((unsigned char*)sync.sBitStream.c_str(), sync.sBitStream.size(), false);
|
||||||
|
|
||||||
auto skillComponent = entity->GetComponent<SkillComponent>();
|
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
skillComponent->SyncPlayerSkill(sync.uiSkillHandle, sync.uiBehaviorHandle, bs);
|
skillComponent->SyncPlayerSkill(sync.uiSkillHandle, sync.uiBehaviorHandle, bs);
|
||||||
|
|
||||||
|
@ -934,10 +934,10 @@ void GameMessages::SendResurrect(Entity* entity) {
|
|||||||
// and just make sure the client has time to be ready.
|
// and just make sure the client has time to be ready.
|
||||||
constexpr float respawnTime = 3.66700005531311f + 0.5f;
|
constexpr float respawnTime = 3.66700005531311f + 0.5f;
|
||||||
entity->AddCallbackTimer(respawnTime, [=]() {
|
entity->AddCallbackTimer(respawnTime, [=]() {
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent != nullptr && entity->GetLOT() == 1) {
|
if (destroyableComponent != nullptr && entity->GetLOT() == 1) {
|
||||||
auto levelComponent = entity->GetComponent<LevelProgressionComponent>();
|
auto* levelComponent = entity->GetComponent<LevelProgressionComponent>();
|
||||||
if (levelComponent) {
|
if (levelComponent) {
|
||||||
int32_t healthToRestore = levelComponent->GetLevel() >= 45 ? 8 : 4;
|
int32_t healthToRestore = levelComponent->GetLevel() >= 45 ? 8 : 4;
|
||||||
if (healthToRestore > destroyableComponent->GetMaxHealth()) healthToRestore = destroyableComponent->GetMaxHealth();
|
if (healthToRestore > destroyableComponent->GetMaxHealth()) healthToRestore = destroyableComponent->GetMaxHealth();
|
||||||
@ -951,7 +951,7 @@ void GameMessages::SendResurrect(Entity* entity) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
auto cont = entity->GetComponent<ControllablePhysicsComponent>();
|
auto* cont = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (cont && entity->GetLOT() == 1) {
|
if (cont && entity->GetLOT() == 1) {
|
||||||
cont->SetPosition(entity->GetRespawnPosition());
|
cont->SetPosition(entity->GetRespawnPosition());
|
||||||
cont->SetRotation(entity->GetRespawnRotation());
|
cont->SetRotation(entity->GetRespawnRotation());
|
||||||
@ -1148,7 +1148,7 @@ void GameMessages::SendPlayerReachedRespawnCheckpoint(Entity* entity, const NiPo
|
|||||||
bitStream.Write(position.y);
|
bitStream.Write(position.y);
|
||||||
bitStream.Write(position.z);
|
bitStream.Write(position.z);
|
||||||
|
|
||||||
auto con = entity->GetComponent<ControllablePhysicsComponent>();
|
auto* con = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (con) {
|
if (con) {
|
||||||
auto rot = con->GetRotation();
|
auto rot = con->GetRotation();
|
||||||
bitStream.Write(rot.x);
|
bitStream.Write(rot.x);
|
||||||
@ -1283,7 +1283,7 @@ void GameMessages::SendVendorStatusUpdate(Entity* entity, const SystemAddress& s
|
|||||||
CBITSTREAM;
|
CBITSTREAM;
|
||||||
CMSGHEADER;
|
CMSGHEADER;
|
||||||
|
|
||||||
auto vendor = entity->GetComponent<VendorComponent>();
|
auto* vendor = entity->GetComponent<VendorComponent>();
|
||||||
if (!vendor) return;
|
if (!vendor) return;
|
||||||
|
|
||||||
std::map<LOT, int> vendorItems = vendor->GetInventory();
|
std::map<LOT, int> vendorItems = vendor->GetInventory();
|
||||||
@ -1405,7 +1405,7 @@ void GameMessages::SendMoveInventoryBatch(Entity* entity, uint32_t stackCount, i
|
|||||||
CBITSTREAM;
|
CBITSTREAM;
|
||||||
CMSGHEADER;
|
CMSGHEADER;
|
||||||
|
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
Item* itemStack = inv->FindItemById(iObjID);
|
Item* itemStack = inv->FindItemById(iObjID);
|
||||||
@ -2181,7 +2181,7 @@ void GameMessages::HandleUnUseModel(RakNet::BitStream* inStream, Entity* entity,
|
|||||||
LWOOBJID objIdToAddToInventory{};
|
LWOOBJID objIdToAddToInventory{};
|
||||||
inStream->Read(unknown);
|
inStream->Read(unknown);
|
||||||
inStream->Read(objIdToAddToInventory);
|
inStream->Read(objIdToAddToInventory);
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
if (inventoryComponent) {
|
if (inventoryComponent) {
|
||||||
auto* inventory = inventoryComponent->GetInventory(eInventoryType::MODELS_IN_BBB);
|
auto* inventory = inventoryComponent->GetInventory(eInventoryType::MODELS_IN_BBB);
|
||||||
auto* item = inventory->FindItemById(objIdToAddToInventory);
|
auto* item = inventory->FindItemById(objIdToAddToInventory);
|
||||||
@ -2243,7 +2243,7 @@ void GameMessages::HandleQueryPropertyData(RakNet::BitStream* inStream, Entity*
|
|||||||
entity = entites[0];
|
entity = entites[0];
|
||||||
*/
|
*/
|
||||||
|
|
||||||
auto propertyVendorComponent = entity->GetComponent<PropertyVendorComponent>();
|
auto* propertyVendorComponent = entity->GetComponent<PropertyVendorComponent>();
|
||||||
|
|
||||||
if (propertyVendorComponent != nullptr) {
|
if (propertyVendorComponent != nullptr) {
|
||||||
propertyVendorComponent->OnQueryPropertyData(entity, sysAddr);
|
propertyVendorComponent->OnQueryPropertyData(entity, sysAddr);
|
||||||
@ -2255,7 +2255,7 @@ void GameMessages::HandleQueryPropertyData(RakNet::BitStream* inStream, Entity*
|
|||||||
entity = entites[0];
|
entity = entites[0];
|
||||||
*/
|
*/
|
||||||
|
|
||||||
auto propertyManagerComponent = entity->GetComponent<PropertyManagementComponent>();
|
auto* propertyManagerComponent = entity->GetComponent<PropertyManagementComponent>();
|
||||||
|
|
||||||
if (propertyManagerComponent != nullptr) {
|
if (propertyManagerComponent != nullptr) {
|
||||||
propertyManagerComponent->OnQueryPropertyData(entity, sysAddr);
|
propertyManagerComponent->OnQueryPropertyData(entity, sysAddr);
|
||||||
@ -2421,7 +2421,7 @@ void GameMessages::HandleBBBLoadItemRequest(RakNet::BitStream* inStream, Entity*
|
|||||||
|
|
||||||
Game::logger->Log("BBB", "Load item request for: %lld", previousItemID);
|
Game::logger->Log("BBB", "Load item request for: %lld", previousItemID);
|
||||||
LWOOBJID newId = previousItemID;
|
LWOOBJID newId = previousItemID;
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
if (inventoryComponent) {
|
if (inventoryComponent) {
|
||||||
auto* inventory = inventoryComponent->GetInventory(eInventoryType::MODELS);
|
auto* inventory = inventoryComponent->GetInventory(eInventoryType::MODELS);
|
||||||
auto* itemToMove = inventory->FindItemById(previousItemID);
|
auto* itemToMove = inventory->FindItemById(previousItemID);
|
||||||
@ -2775,7 +2775,7 @@ void GameMessages::HandlePropertyEntranceSync(RakNet::BitStream* inStream, Entit
|
|||||||
|
|
||||||
auto* player = Player::GetPlayer(sysAddr);
|
auto* player = Player::GetPlayer(sysAddr);
|
||||||
|
|
||||||
auto entranceComponent = entity->GetComponent<PropertyEntranceComponent>();
|
auto* entranceComponent = entity->GetComponent<PropertyEntranceComponent>();
|
||||||
|
|
||||||
if (entranceComponent == nullptr) return;
|
if (entranceComponent == nullptr) return;
|
||||||
|
|
||||||
@ -2802,13 +2802,13 @@ void GameMessages::HandleEnterProperty(RakNet::BitStream* inStream, Entity* enti
|
|||||||
|
|
||||||
auto* player = Player::GetPlayer(sysAddr);
|
auto* player = Player::GetPlayer(sysAddr);
|
||||||
|
|
||||||
auto entranceComponent = entity->GetComponent<PropertyEntranceComponent>();
|
auto* entranceComponent = entity->GetComponent<PropertyEntranceComponent>();
|
||||||
if (entranceComponent != nullptr) {
|
if (entranceComponent != nullptr) {
|
||||||
entranceComponent->OnEnterProperty(player, index, returnToZone, sysAddr);
|
entranceComponent->OnEnterProperty(player, index, returnToZone, sysAddr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto multiZoneEntranceComponent = entity->GetComponent<MultiZoneEntranceComponent>();
|
auto* multiZoneEntranceComponent = entity->GetComponent<MultiZoneEntranceComponent>();
|
||||||
if (multiZoneEntranceComponent != nullptr) {
|
if (multiZoneEntranceComponent != nullptr) {
|
||||||
multiZoneEntranceComponent->OnSelectWorld(player, index);
|
multiZoneEntranceComponent->OnSelectWorld(player, index);
|
||||||
}
|
}
|
||||||
@ -2819,7 +2819,7 @@ void GameMessages::HandleSetConsumableItem(RakNet::BitStream* inStream, Entity*
|
|||||||
|
|
||||||
inStream->Read(lot);
|
inStream->Read(lot);
|
||||||
|
|
||||||
auto inventory = entity->GetComponent<InventoryComponent>();
|
auto* inventory = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventory == nullptr) return;
|
if (inventory == nullptr) return;
|
||||||
|
|
||||||
@ -3817,7 +3817,7 @@ void GameMessages::HandleCommandPet(RakNet::BitStream* inStream, Entity* entity,
|
|||||||
inStream->Read(iTypeID);
|
inStream->Read(iTypeID);
|
||||||
overrideObey = inStream->ReadBit();
|
overrideObey = inStream->ReadBit();
|
||||||
|
|
||||||
auto petComponent = entity->GetComponent<PetComponent>();
|
auto* petComponent = entity->GetComponent<PetComponent>();
|
||||||
|
|
||||||
if (petComponent == nullptr) {
|
if (petComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -3883,13 +3883,13 @@ void GameMessages::HandleMessageBoxResponse(RakNet::BitStream* inStream, Entity*
|
|||||||
|
|
||||||
entity->OnMessageBoxResponse(userEntity, iButton, identifier, userData);
|
entity->OnMessageBoxResponse(userEntity, iButton, identifier, userData);
|
||||||
|
|
||||||
auto scriptedActivityComponent = entity->GetComponent<ScriptedActivityComponent>();
|
auto* scriptedActivityComponent = entity->GetComponent<ScriptedActivityComponent>();
|
||||||
|
|
||||||
if (scriptedActivityComponent != nullptr) {
|
if (scriptedActivityComponent != nullptr) {
|
||||||
scriptedActivityComponent->HandleMessageBoxResponse(userEntity, GeneralUtils::UTF16ToWTF8(identifier));
|
scriptedActivityComponent->HandleMessageBoxResponse(userEntity, GeneralUtils::UTF16ToWTF8(identifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto racingControlComponent = entity->GetComponent<RacingControlComponent>();
|
auto* racingControlComponent = entity->GetComponent<RacingControlComponent>();
|
||||||
|
|
||||||
if (racingControlComponent != nullptr) {
|
if (racingControlComponent != nullptr) {
|
||||||
racingControlComponent->HandleMessageBoxResponse(userEntity, iButton, GeneralUtils::UTF16ToWTF8(identifier));
|
racingControlComponent->HandleMessageBoxResponse(userEntity, iButton, GeneralUtils::UTF16ToWTF8(identifier));
|
||||||
@ -4055,7 +4055,7 @@ void GameMessages::HandleDismountComplete(RakNet::BitStream* inStream, Entity* e
|
|||||||
|
|
||||||
// If we aren't possessing somethings, the don't do anything
|
// If we aren't possessing somethings, the don't do anything
|
||||||
if (objectId != LWOOBJID_EMPTY) {
|
if (objectId != LWOOBJID_EMPTY) {
|
||||||
auto possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||||
auto* mount = EntityManager::Instance()->GetEntity(objectId);
|
auto* mount = EntityManager::Instance()->GetEntity(objectId);
|
||||||
// make sure we have the things we need and they aren't null
|
// make sure we have the things we need and they aren't null
|
||||||
if (possessorComponent && mount) {
|
if (possessorComponent && mount) {
|
||||||
@ -4065,7 +4065,7 @@ void GameMessages::HandleDismountComplete(RakNet::BitStream* inStream, Entity* e
|
|||||||
possessorComponent->SetPossessableType(ePossessionType::NO_POSSESSION);
|
possessorComponent->SetPossessableType(ePossessionType::NO_POSSESSION);
|
||||||
|
|
||||||
// character related things
|
// character related things
|
||||||
auto character = entity->GetComponent<CharacterComponent>();
|
auto* character = entity->GetComponent<CharacterComponent>();
|
||||||
if (character) {
|
if (character) {
|
||||||
// If we had an active item turn it off
|
// If we had an active item turn it off
|
||||||
if (possessorComponent->GetMountItemID() != LWOOBJID_EMPTY) GameMessages::SendMarkInventoryItemAsActive(entity->GetObjectID(), false, eUnequippableActiveType::MOUNT, possessorComponent->GetMountItemID(), entity->GetSystemAddress());
|
if (possessorComponent->GetMountItemID() != LWOOBJID_EMPTY) GameMessages::SendMarkInventoryItemAsActive(entity->GetObjectID(), false, eUnequippableActiveType::MOUNT, possessorComponent->GetMountItemID(), entity->GetSystemAddress());
|
||||||
@ -4073,11 +4073,11 @@ void GameMessages::HandleDismountComplete(RakNet::BitStream* inStream, Entity* e
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set that the controllabel phsyics comp is teleporting
|
// Set that the controllabel phsyics comp is teleporting
|
||||||
auto controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (controllablePhysicsComponent) controllablePhysicsComponent->SetIsTeleporting(true);
|
if (controllablePhysicsComponent) controllablePhysicsComponent->SetIsTeleporting(true);
|
||||||
|
|
||||||
// Call dismoint on the possessable comp to let it handle killing the possessable
|
// Call dismoint on the possessable comp to let it handle killing the possessable
|
||||||
auto possessableComponent = mount->GetComponent<PossessableComponent>();
|
auto* possessableComponent = mount->GetComponent<PossessableComponent>();
|
||||||
if (possessableComponent) possessableComponent->Dismount();
|
if (possessableComponent) possessableComponent->Dismount();
|
||||||
|
|
||||||
// Update the entity that was possessing
|
// Update the entity that was possessing
|
||||||
@ -4101,7 +4101,7 @@ void GameMessages::HandleAcknowledgePossession(RakNet::BitStream* inStream, Enti
|
|||||||
//Racing
|
//Racing
|
||||||
|
|
||||||
void GameMessages::HandleModuleAssemblyQueryData(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
void GameMessages::HandleModuleAssemblyQueryData(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||||
auto moduleAssemblyComponent = entity->GetComponent<ModuleAssemblyComponent>();
|
auto* moduleAssemblyComponent = entity->GetComponent<ModuleAssemblyComponent>();
|
||||||
|
|
||||||
Game::logger->Log("HandleModuleAssemblyQueryData", "Got Query from %i", entity->GetLOT());
|
Game::logger->Log("HandleModuleAssemblyQueryData", "Got Query from %i", entity->GetLOT());
|
||||||
|
|
||||||
@ -4137,7 +4137,7 @@ void GameMessages::HandleRacingClientReady(RakNet::BitStream* inStream, Entity*
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto racingControlComponent = dZoneManager::Instance()->GetZoneControlObject()->GetComponent<RacingControlComponent>();
|
auto* racingControlComponent = dZoneManager::Instance()->GetZoneControlObject()->GetComponent<RacingControlComponent>();
|
||||||
|
|
||||||
if (racingControlComponent == nullptr) {
|
if (racingControlComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -4187,12 +4187,12 @@ void GameMessages::HandleRequestDie(RakNet::BitStream* inStream, Entity* entity,
|
|||||||
|
|
||||||
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
|
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
|
||||||
|
|
||||||
auto racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
||||||
|
|
||||||
Game::logger->Log("HandleRequestDie", "Got die request: %i", entity->GetLOT());
|
Game::logger->Log("HandleRequestDie", "Got die request: %i", entity->GetLOT());
|
||||||
|
|
||||||
if (racingControlComponent != nullptr) {
|
if (racingControlComponent != nullptr) {
|
||||||
auto possessableComponent = entity->GetComponent<PossessableComponent>();
|
auto* possessableComponent = entity->GetComponent<PossessableComponent>();
|
||||||
|
|
||||||
if (possessableComponent != nullptr) {
|
if (possessableComponent != nullptr) {
|
||||||
entity = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
entity = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
||||||
@ -4230,7 +4230,7 @@ void GameMessages::HandleRacingPlayerInfoResetFinished(RakNet::BitStream* inStre
|
|||||||
|
|
||||||
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
|
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
|
||||||
|
|
||||||
auto racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
||||||
|
|
||||||
Game::logger->Log("HandleRacingPlayerInfoResetFinished", "Got finished: %i", entity->GetLOT());
|
Game::logger->Log("HandleRacingPlayerInfoResetFinished", "Got finished: %i", entity->GetLOT());
|
||||||
|
|
||||||
@ -4292,7 +4292,7 @@ void GameMessages::HandleVehicleNotifyHitImaginationServer(RakNet::BitStream* in
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto possessableComponent = entity->GetComponent<PossessableComponent>();
|
auto* possessableComponent = entity->GetComponent<PossessableComponent>();
|
||||||
|
|
||||||
if (possessableComponent != nullptr) {
|
if (possessableComponent != nullptr) {
|
||||||
entity = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
entity = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
||||||
@ -4302,7 +4302,7 @@ void GameMessages::HandleVehicleNotifyHitImaginationServer(RakNet::BitStream* in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->UpdatePlayerStatistic(RacingImaginationPowerUpsCollected);
|
characterComponent->UpdatePlayerStatistic(RacingImaginationPowerUpsCollected);
|
||||||
}
|
}
|
||||||
@ -4629,7 +4629,7 @@ void GameMessages::HandleRequestMoveItemBetweenInventoryTypes(RakNet::BitStream*
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent != nullptr) {
|
if (inventoryComponent != nullptr) {
|
||||||
if (itemID != LWOOBJID_EMPTY) {
|
if (itemID != LWOOBJID_EMPTY) {
|
||||||
@ -4722,7 +4722,7 @@ void GameMessages::HandleBuyFromVendor(RakNet::BitStream* inStream, Entity* enti
|
|||||||
Entity* player = EntityManager::Instance()->GetEntity(user->GetLoggedInChar());
|
Entity* player = EntityManager::Instance()->GetEntity(user->GetLoggedInChar());
|
||||||
if (!player) return;
|
if (!player) return;
|
||||||
|
|
||||||
auto propertyVendorComponent = entity->GetComponent<PropertyVendorComponent>();
|
auto* propertyVendorComponent = entity->GetComponent<PropertyVendorComponent>();
|
||||||
|
|
||||||
if (propertyVendorComponent != nullptr) {
|
if (propertyVendorComponent != nullptr) {
|
||||||
propertyVendorComponent->OnBuyFromVendor(player, bConfirmed, item, count);
|
propertyVendorComponent->OnBuyFromVendor(player, bConfirmed, item, count);
|
||||||
@ -4732,10 +4732,10 @@ void GameMessages::HandleBuyFromVendor(RakNet::BitStream* inStream, Entity* enti
|
|||||||
|
|
||||||
const auto isCommendationVendor = entity->GetLOT() == 13806;
|
const auto isCommendationVendor = entity->GetLOT() == 13806;
|
||||||
|
|
||||||
auto vend = entity->GetComponent<VendorComponent>();
|
auto* vend = entity->GetComponent<VendorComponent>();
|
||||||
if (!vend && !isCommendationVendor) return;
|
if (!vend && !isCommendationVendor) return;
|
||||||
|
|
||||||
auto inv = player->GetComponent<InventoryComponent>();
|
auto* inv = player->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
if (!isCommendationVendor && !vend->SellsItem(item)) {
|
if (!isCommendationVendor && !vend->SellsItem(item)) {
|
||||||
@ -4763,7 +4763,7 @@ void GameMessages::HandleBuyFromVendor(RakNet::BitStream* inStream, Entity* enti
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent == nullptr) {
|
if (missionComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -4826,10 +4826,10 @@ void GameMessages::HandleSellToVendor(RakNet::BitStream* inStream, Entity* entit
|
|||||||
if (!player) return;
|
if (!player) return;
|
||||||
Character* character = player->GetCharacter();
|
Character* character = player->GetCharacter();
|
||||||
if (!character) return;
|
if (!character) return;
|
||||||
auto inv = player->GetComponent<InventoryComponent>();
|
auto* inv = player->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
auto vend = entity->GetComponent<VendorComponent>();
|
auto* vend = entity->GetComponent<VendorComponent>();
|
||||||
if (!vend) return;
|
if (!vend) return;
|
||||||
|
|
||||||
Item* item = inv->FindItemById(iObjID);
|
Item* item = inv->FindItemById(iObjID);
|
||||||
@ -4876,10 +4876,10 @@ void GameMessages::HandleBuybackFromVendor(RakNet::BitStream* inStream, Entity*
|
|||||||
if (!player) return;
|
if (!player) return;
|
||||||
Character* character = player->GetCharacter();
|
Character* character = player->GetCharacter();
|
||||||
if (!character) return;
|
if (!character) return;
|
||||||
auto inv = player->GetComponent<InventoryComponent>();
|
auto* inv = player->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
auto vend = entity->GetComponent<VendorComponent>();
|
auto* vend = entity->GetComponent<VendorComponent>();
|
||||||
if (!vend) return;
|
if (!vend) return;
|
||||||
|
|
||||||
Item* item = inv->FindItemById(iObjID);
|
Item* item = inv->FindItemById(iObjID);
|
||||||
@ -4973,7 +4973,7 @@ void GameMessages::HandleFireEventServerSide(RakNet::BitStream* inStream, Entity
|
|||||||
LWOCLONEID cloneId = 0;
|
LWOCLONEID cloneId = 0;
|
||||||
LWOMAPID mapId = 0;
|
LWOMAPID mapId = 0;
|
||||||
|
|
||||||
auto rocketPad = entity->GetComponent<RocketLaunchpadControlComponent>();
|
auto* rocketPad = entity->GetComponent<RocketLaunchpadControlComponent>();
|
||||||
|
|
||||||
if (rocketPad == nullptr) return;
|
if (rocketPad == nullptr) return;
|
||||||
|
|
||||||
@ -5030,7 +5030,7 @@ void GameMessages::HandleRebuildCancel(RakNet::BitStream* inStream, Entity* enti
|
|||||||
inStream->Read(bEarlyRelease);
|
inStream->Read(bEarlyRelease);
|
||||||
inStream->Read(userID);
|
inStream->Read(userID);
|
||||||
|
|
||||||
auto rebComp = entity->GetComponent<RebuildComponent>();
|
auto* rebComp = entity->GetComponent<RebuildComponent>();
|
||||||
if (!rebComp) return;
|
if (!rebComp) return;
|
||||||
|
|
||||||
rebComp->CancelRebuild(EntityManager::Instance()->GetEntity(userID), eQuickBuildFailReason::CANCELED_EARLY);
|
rebComp->CancelRebuild(EntityManager::Instance()->GetEntity(userID), eQuickBuildFailReason::CANCELED_EARLY);
|
||||||
@ -5063,7 +5063,7 @@ void GameMessages::HandleRequestUse(RakNet::BitStream* inStream, Entity* entity,
|
|||||||
|
|
||||||
if (bIsMultiInteractUse) {
|
if (bIsMultiInteractUse) {
|
||||||
if (multiInteractType == 0) {
|
if (multiInteractType == 0) {
|
||||||
auto missionOfferComponent = interactedObject->GetComponent<MissionOfferComponent>();
|
auto* missionOfferComponent = interactedObject->GetComponent<MissionOfferComponent>();
|
||||||
|
|
||||||
if (missionOfferComponent != nullptr) {
|
if (missionOfferComponent != nullptr) {
|
||||||
missionOfferComponent->OfferMissions(entity, multiInteractID);
|
missionOfferComponent->OfferMissions(entity, multiInteractID);
|
||||||
@ -5076,7 +5076,7 @@ void GameMessages::HandleRequestUse(RakNet::BitStream* inStream, Entity* entity,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Perform use task if possible:
|
//Perform use task if possible:
|
||||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent == nullptr) return;
|
if (missionComponent == nullptr) return;
|
||||||
|
|
||||||
@ -5098,7 +5098,7 @@ void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity)
|
|||||||
if (emoteID == 0) return;
|
if (emoteID == 0) return;
|
||||||
std::string sAnimationName = "deaded"; //Default name in case we fail to get the emote
|
std::string sAnimationName = "deaded"; //Default name in case we fail to get the emote
|
||||||
|
|
||||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
if (!missionComponent) return;
|
if (!missionComponent) return;
|
||||||
|
|
||||||
if (targetID != LWOOBJID_EMPTY) {
|
if (targetID != LWOOBJID_EMPTY) {
|
||||||
@ -5142,7 +5142,7 @@ void GameMessages::HandleModularBuildConvertModel(RakNet::BitStream* inStream, E
|
|||||||
if (!user) return;
|
if (!user) return;
|
||||||
Entity* character = EntityManager::Instance()->GetEntity(user->GetLoggedInChar());
|
Entity* character = EntityManager::Instance()->GetEntity(user->GetLoggedInChar());
|
||||||
if (!character) return;
|
if (!character) return;
|
||||||
auto inv = character->GetComponent<InventoryComponent>();
|
auto* inv = character->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
auto* item = inv->FindItemById(modelID);
|
auto* item = inv->FindItemById(modelID);
|
||||||
@ -5185,7 +5185,7 @@ void GameMessages::HandleRespondToMission(RakNet::BitStream* inStream, Entity* e
|
|||||||
inStream->Read(isDefaultReward);
|
inStream->Read(isDefaultReward);
|
||||||
if (isDefaultReward) inStream->Read(reward);
|
if (isDefaultReward) inStream->Read(reward);
|
||||||
|
|
||||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
if (!missionComponent) {
|
if (!missionComponent) {
|
||||||
Game::logger->Log("GameMessages", "Unable to get mission component for entity %llu to handle RespondToMission", playerID);
|
Game::logger->Log("GameMessages", "Unable to get mission component for entity %llu to handle RespondToMission", playerID);
|
||||||
return;
|
return;
|
||||||
@ -5228,7 +5228,7 @@ void GameMessages::HandleMissionDialogOK(RakNet::BitStream* inStream, Entity* en
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the player's mission component
|
// Get the player's mission component
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
if (!missionComponent) {
|
if (!missionComponent) {
|
||||||
Game::logger->Log("GameMessages", "Unable to get mission component for entity %llu to handle MissionDialogueOK", player->GetObjectID());
|
Game::logger->Log("GameMessages", "Unable to get mission component for entity %llu to handle MissionDialogueOK", player->GetObjectID());
|
||||||
return;
|
return;
|
||||||
@ -5252,7 +5252,7 @@ void GameMessages::HandleRequestLinkedMission(RakNet::BitStream* inStream, Entit
|
|||||||
|
|
||||||
auto* player = EntityManager::Instance()->GetEntity(playerId);
|
auto* player = EntityManager::Instance()->GetEntity(playerId);
|
||||||
|
|
||||||
auto missionOfferComponent = entity->GetComponent<MissionOfferComponent>();
|
auto* missionOfferComponent = entity->GetComponent<MissionOfferComponent>();
|
||||||
|
|
||||||
if (missionOfferComponent != nullptr) {
|
if (missionOfferComponent != nullptr) {
|
||||||
missionOfferComponent->OfferMissions(player, 0);
|
missionOfferComponent->OfferMissions(player, 0);
|
||||||
@ -5266,16 +5266,16 @@ void GameMessages::HandleHasBeenCollected(RakNet::BitStream* inStream, Entity* e
|
|||||||
Entity* player = EntityManager::Instance()->GetEntity(playerID);
|
Entity* player = EntityManager::Instance()->GetEntity(playerID);
|
||||||
if (!player || !entity || entity->GetCollectibleID() == 0) return;
|
if (!player || !entity || entity->GetCollectibleID() == 0) return;
|
||||||
|
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
if (missionComponent) {
|
if (missionComponent) {
|
||||||
missionComponent->Progress(eMissionTaskType::COLLECTION, entity->GetLOT(), entity->GetObjectID());
|
missionComponent->Progress(eMissionTaskType::COLLECTION, entity->GetLOT(), entity->GetObjectID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::HandleNotifyServerLevelProcessingComplete(RakNet::BitStream* inStream, Entity* entity) {
|
void GameMessages::HandleNotifyServerLevelProcessingComplete(RakNet::BitStream* inStream, Entity* entity) {
|
||||||
auto levelComp = entity->GetComponent<LevelProgressionComponent>();
|
auto* levelComp = entity->GetComponent<LevelProgressionComponent>();
|
||||||
if (!levelComp) return;
|
if (!levelComp) return;
|
||||||
auto character = entity->GetComponent<CharacterComponent>();
|
auto* character = entity->GetComponent<CharacterComponent>();
|
||||||
if (!character) return;
|
if (!character) return;
|
||||||
|
|
||||||
//Update our character's level in memory:
|
//Update our character's level in memory:
|
||||||
@ -5283,7 +5283,7 @@ void GameMessages::HandleNotifyServerLevelProcessingComplete(RakNet::BitStream*
|
|||||||
|
|
||||||
levelComp->HandleLevelUp();
|
levelComp->HandleLevelUp();
|
||||||
|
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent != nullptr) {
|
if (inventoryComponent != nullptr) {
|
||||||
auto* inventory = inventoryComponent->GetInventory(ITEMS);
|
auto* inventory = inventoryComponent->GetInventory(ITEMS);
|
||||||
@ -5369,7 +5369,7 @@ void GameMessages::HandleEquipItem(RakNet::BitStream* inStream, Entity* entity)
|
|||||||
inStream->Read(immediate); //twice?
|
inStream->Read(immediate); //twice?
|
||||||
inStream->Read(objectID);
|
inStream->Read(objectID);
|
||||||
|
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
Item* item = inv->FindItemById(objectID);
|
Item* item = inv->FindItemById(objectID);
|
||||||
@ -5388,7 +5388,7 @@ void GameMessages::HandleUnequipItem(RakNet::BitStream* inStream, Entity* entity
|
|||||||
inStream->Read(immediate);
|
inStream->Read(immediate);
|
||||||
inStream->Read(objectID);
|
inStream->Read(objectID);
|
||||||
|
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
auto* item = inv->FindItemById(objectID);
|
auto* item = inv->FindItemById(objectID);
|
||||||
@ -5463,7 +5463,7 @@ void GameMessages::HandleRemoveItemFromInventory(RakNet::BitStream* inStream, En
|
|||||||
inStream->Read(iTradeIDIsDefault);
|
inStream->Read(iTradeIDIsDefault);
|
||||||
if (iTradeIDIsDefault) inStream->Read(iTradeID);
|
if (iTradeIDIsDefault) inStream->Read(iTradeID);
|
||||||
|
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
auto* item = inv->FindItemById(iObjID);
|
auto* item = inv->FindItemById(iObjID);
|
||||||
@ -5484,7 +5484,7 @@ void GameMessages::HandleRemoveItemFromInventory(RakNet::BitStream* inStream, En
|
|||||||
item->SetCount(item->GetCount() - iStackCount, true);
|
item->SetCount(item->GetCount() - iStackCount, true);
|
||||||
EntityManager::Instance()->SerializeEntity(entity);
|
EntityManager::Instance()->SerializeEntity(entity);
|
||||||
|
|
||||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent != nullptr) {
|
if (missionComponent != nullptr) {
|
||||||
missionComponent->Progress(eMissionTaskType::GATHER, item->GetLot(), LWOOBJID_EMPTY, "", -iStackCount);
|
missionComponent->Progress(eMissionTaskType::GATHER, item->GetLot(), LWOOBJID_EMPTY, "", -iStackCount);
|
||||||
@ -5506,7 +5506,7 @@ void GameMessages::HandleMoveItemInInventory(RakNet::BitStream* inStream, Entity
|
|||||||
inStream->Read(responseCode);
|
inStream->Read(responseCode);
|
||||||
inStream->Read(slot);
|
inStream->Read(slot);
|
||||||
|
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
auto* item = inv->FindItemById(iObjID);
|
auto* item = inv->FindItemById(iObjID);
|
||||||
@ -5538,7 +5538,7 @@ void GameMessages::HandleMoveItemBetweenInventoryTypes(RakNet::BitStream* inStre
|
|||||||
inStream->Read(templateIDIsDefault);
|
inStream->Read(templateIDIsDefault);
|
||||||
if (templateIDIsDefault) inStream->Read(templateID);
|
if (templateIDIsDefault) inStream->Read(templateID);
|
||||||
|
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
auto* item = inv->FindItemById(objectID);
|
auto* item = inv->FindItemById(objectID);
|
||||||
@ -5583,7 +5583,7 @@ void GameMessages::HandleModularBuildFinish(RakNet::BitStream* inStream, Entity*
|
|||||||
if (!user) return;
|
if (!user) return;
|
||||||
Entity* character = EntityManager::Instance()->GetEntity(user->GetLoggedInChar());
|
Entity* character = EntityManager::Instance()->GetEntity(user->GetLoggedInChar());
|
||||||
if (!character) return;
|
if (!character) return;
|
||||||
auto inv = character->GetComponent<InventoryComponent>();
|
auto* inv = character->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
Game::logger->Log("GameMessages", "Build finished");
|
Game::logger->Log("GameMessages", "Build finished");
|
||||||
@ -5638,7 +5638,7 @@ void GameMessages::HandleModularBuildFinish(RakNet::BitStream* inStream, Entity*
|
|||||||
inv->AddItem(8092, 1, eLootSourceType::QUICKBUILD, eInventoryType::MODELS, config);
|
inv->AddItem(8092, 1, eLootSourceType::QUICKBUILD, eInventoryType::MODELS, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto missionComponent = character->GetComponent<MissionComponent>();
|
auto* missionComponent = character->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (entity->GetLOT() != 9980 || Game::server->GetZoneID() != 1200) {
|
if (entity->GetLOT() != 9980 || Game::server->GetZoneID() != 1200) {
|
||||||
if (missionComponent != nullptr) {
|
if (missionComponent != nullptr) {
|
||||||
@ -5648,7 +5648,7 @@ void GameMessages::HandleModularBuildFinish(RakNet::BitStream* inStream, Entity*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto script = entity->GetComponent<ScriptComponent>();
|
auto* script = entity->GetComponent<ScriptComponent>();
|
||||||
|
|
||||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(entity)) {
|
for (CppScripts::Script* script : CppScripts::GetEntityScripts(entity)) {
|
||||||
script->OnModularBuildExit(entity, character, count >= 3, modList);
|
script->OnModularBuildExit(entity, character, count >= 3, modList);
|
||||||
@ -5671,7 +5671,7 @@ void GameMessages::HandleDoneArrangingWithItem(RakNet::BitStream* inStream, Enti
|
|||||||
if (!user) return;
|
if (!user) return;
|
||||||
Entity* character = EntityManager::Instance()->GetEntity(user->GetLoggedInChar());
|
Entity* character = EntityManager::Instance()->GetEntity(user->GetLoggedInChar());
|
||||||
if (!character) return;
|
if (!character) return;
|
||||||
auto inv = character->GetComponent<InventoryComponent>();
|
auto* inv = character->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -5789,7 +5789,7 @@ void GameMessages::HandleModularBuildMoveAndEquip(RakNet::BitStream* inStream, E
|
|||||||
|
|
||||||
inStream->Read(templateID);
|
inStream->Read(templateID);
|
||||||
|
|
||||||
auto inv = character->GetComponent<InventoryComponent>();
|
auto* inv = character->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
auto* item = inv->FindItemByLot(templateID, TEMP_MODELS);
|
auto* item = inv->FindItemByLot(templateID, TEMP_MODELS);
|
||||||
@ -5841,13 +5841,13 @@ void GameMessages::HandleResurrect(RakNet::BitStream* inStream, Entity* entity)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::HandlePushEquippedItemsState(RakNet::BitStream* inStream, Entity* entity) {
|
void GameMessages::HandlePushEquippedItemsState(RakNet::BitStream* inStream, Entity* entity) {
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
inv->PushEquippedItems();
|
inv->PushEquippedItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::HandlePopEquippedItemsState(RakNet::BitStream* inStream, Entity* entity) {
|
void GameMessages::HandlePopEquippedItemsState(RakNet::BitStream* inStream, Entity* entity) {
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
inv->PopEquippedItems();
|
inv->PopEquippedItems();
|
||||||
EntityManager::Instance()->SerializeEntity(entity); // so it updates on client side
|
EntityManager::Instance()->SerializeEntity(entity); // so it updates on client side
|
||||||
@ -5859,7 +5859,7 @@ void GameMessages::HandleClientItemConsumed(RakNet::BitStream* inStream, Entity*
|
|||||||
|
|
||||||
inStream->Read(itemConsumed);
|
inStream->Read(itemConsumed);
|
||||||
|
|
||||||
auto inventory = entity->GetComponent<InventoryComponent>();
|
auto* inventory = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventory == nullptr) {
|
if (inventory == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -5873,7 +5873,7 @@ void GameMessages::HandleClientItemConsumed(RakNet::BitStream* inStream, Entity*
|
|||||||
|
|
||||||
item->Consume();
|
item->Consume();
|
||||||
|
|
||||||
auto missions = entity->GetComponent<MissionComponent>();
|
auto* missions = entity->GetComponent<MissionComponent>();
|
||||||
if (missions != nullptr) {
|
if (missions != nullptr) {
|
||||||
missions->Progress(eMissionTaskType::USE_ITEM, itemLot);
|
missions->Progress(eMissionTaskType::USE_ITEM, itemLot);
|
||||||
}
|
}
|
||||||
@ -5885,7 +5885,7 @@ void GameMessages::HandleUseNonEquipmentItem(RakNet::BitStream* inStream, Entity
|
|||||||
|
|
||||||
inStream->Read(itemConsumed);
|
inStream->Read(itemConsumed);
|
||||||
|
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
@ -5920,7 +5920,7 @@ void GameMessages::HandleMatchRequest(RakNet::BitStream* inStream, Entity* entit
|
|||||||
if (type == 0) { // join
|
if (type == 0) { // join
|
||||||
if (value != 0) {
|
if (value != 0) {
|
||||||
for (Entity* scriptedAct : scriptedActs) {
|
for (Entity* scriptedAct : scriptedActs) {
|
||||||
auto comp = scriptedAct->GetComponent<ScriptedActivityComponent>();
|
auto* comp = scriptedAct->GetComponent<ScriptedActivityComponent>();
|
||||||
if (!comp) continue;
|
if (!comp) continue;
|
||||||
if (comp->GetActivityID() == value) {
|
if (comp->GetActivityID() == value) {
|
||||||
comp->PlayerJoin(entity);
|
comp->PlayerJoin(entity);
|
||||||
@ -5931,7 +5931,7 @@ void GameMessages::HandleMatchRequest(RakNet::BitStream* inStream, Entity* entit
|
|||||||
}
|
}
|
||||||
} else if (type == 1) { // ready/unready
|
} else if (type == 1) { // ready/unready
|
||||||
for (Entity* scriptedAct : scriptedActs) {
|
for (Entity* scriptedAct : scriptedActs) {
|
||||||
auto comp = scriptedAct->GetComponent<ScriptedActivityComponent>();
|
auto* comp = scriptedAct->GetComponent<ScriptedActivityComponent>();
|
||||||
if (!comp) continue;
|
if (!comp) continue;
|
||||||
if (comp->PlayerIsInQueue(entity)) {
|
if (comp->PlayerIsInQueue(entity)) {
|
||||||
comp->PlayerReady(entity, value);
|
comp->PlayerReady(entity, value);
|
||||||
@ -6051,7 +6051,7 @@ void
|
|||||||
GameMessages::HandleClientRailMovementReady(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
GameMessages::HandleClientRailMovementReady(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||||
const auto possibleRails = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::RAIL_ACTIVATOR);
|
const auto possibleRails = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::RAIL_ACTIVATOR);
|
||||||
for (const auto* possibleRail : possibleRails) {
|
for (const auto* possibleRail : possibleRails) {
|
||||||
const auto rail = possibleRail->GetComponent<RailActivatorComponent>();
|
const auto* rail = possibleRail->GetComponent<RailActivatorComponent>();
|
||||||
if (rail != nullptr) {
|
if (rail != nullptr) {
|
||||||
rail->OnRailMovementReady(entity);
|
rail->OnRailMovementReady(entity);
|
||||||
}
|
}
|
||||||
@ -6063,7 +6063,7 @@ void GameMessages::HandleCancelRailMovement(RakNet::BitStream* inStream, Entity*
|
|||||||
|
|
||||||
const auto possibleRails = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::RAIL_ACTIVATOR);
|
const auto possibleRails = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::RAIL_ACTIVATOR);
|
||||||
for (const auto* possibleRail : possibleRails) {
|
for (const auto* possibleRail : possibleRails) {
|
||||||
auto rail = possibleRail->GetComponent<RailActivatorComponent>();
|
auto* rail = possibleRail->GetComponent<RailActivatorComponent>();
|
||||||
if (rail != nullptr) {
|
if (rail != nullptr) {
|
||||||
rail->OnCancelRailMovement(entity);
|
rail->OnCancelRailMovement(entity);
|
||||||
}
|
}
|
||||||
@ -6112,7 +6112,7 @@ void GameMessages::HandleModifyPlayerZoneStatistic(RakNet::BitStream* inStream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Notify the character component that something's changed
|
// Notify the character component that something's changed
|
||||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->HandleZoneStatisticsUpdate(zone, statisticsName, value);
|
characterComponent->HandleZoneStatisticsUpdate(zone, statisticsName, value);
|
||||||
}
|
}
|
||||||
@ -6129,14 +6129,14 @@ void GameMessages::HandleUpdatePlayerStatistic(RakNet::BitStream* inStream, Enti
|
|||||||
updateValue = 1;
|
updateValue = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->UpdatePlayerStatistic((StatisticID)updateID, (uint64_t)std::max(updateValue, int64_t(0)));
|
characterComponent->UpdatePlayerStatistic((StatisticID)updateID, (uint64_t)std::max(updateValue, int64_t(0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::HandleDeactivateBubbleBuff(RakNet::BitStream* inStream, Entity* entity) {
|
void GameMessages::HandleDeactivateBubbleBuff(RakNet::BitStream* inStream, Entity* entity) {
|
||||||
auto controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (controllablePhysicsComponent) controllablePhysicsComponent->DeactivateBubbleBuff();
|
if (controllablePhysicsComponent) controllablePhysicsComponent->DeactivateBubbleBuff();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6149,7 +6149,7 @@ void GameMessages::HandleActivateBubbleBuff(RakNet::BitStream* inStream, Entity*
|
|||||||
if (type == u"skunk") bubbleType = eBubbleType::SKUNK;
|
if (type == u"skunk") bubbleType = eBubbleType::SKUNK;
|
||||||
else if (type == u"energy") bubbleType = eBubbleType::ENERGY;
|
else if (type == u"energy") bubbleType = eBubbleType::ENERGY;
|
||||||
|
|
||||||
auto controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (controllablePhysicsComponent) controllablePhysicsComponent->ActivateBubbleBuff(bubbleType, specialAnimations);
|
if (controllablePhysicsComponent) controllablePhysicsComponent->ActivateBubbleBuff(bubbleType, specialAnimations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,8 +125,8 @@ void ItemSet::OnEquip(const LOT lot) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto skillComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<SkillComponent>();
|
auto* skillComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<SkillComponent>();
|
||||||
auto missionComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<MissionComponent>();
|
auto* missionComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
for (const auto skill : skillSet) {
|
for (const auto skill : skillSet) {
|
||||||
auto* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>();
|
auto* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>();
|
||||||
@ -158,7 +158,7 @@ void ItemSet::OnUnEquip(const LOT lot) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& skillComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<SkillComponent>();
|
const auto* skillComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
for (const auto skill : skillSet) {
|
for (const auto skill : skillSet) {
|
||||||
auto* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>();
|
auto* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>();
|
||||||
|
@ -37,8 +37,8 @@ void ItemSetPassiveAbility::Activate(Entity* target) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = m_Parent->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = m_Parent->GetComponent<DestroyableComponent>();
|
||||||
auto skillComponent = m_Parent->GetComponent<SkillComponent>();
|
auto* skillComponent = m_Parent->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (destroyableComponent == nullptr || skillComponent == nullptr) {
|
if (destroyableComponent == nullptr || skillComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -196,8 +196,8 @@ std::vector<ItemSetPassiveAbility> ItemSetPassiveAbility::FindAbilities(uint32_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ItemSetPassiveAbility::OnEnemySmshed(Entity* target) {
|
void ItemSetPassiveAbility::OnEnemySmshed(Entity* target) {
|
||||||
auto destroyableComponent = m_Parent->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = m_Parent->GetComponent<DestroyableComponent>();
|
||||||
auto skillComponent = m_Parent->GetComponent<SkillComponent>();
|
auto* skillComponent = m_Parent->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (destroyableComponent == nullptr || skillComponent == nullptr) {
|
if (destroyableComponent == nullptr || skillComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -319,12 +319,12 @@ void Mission::Complete(const bool yieldRewards) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->TrackMissionCompletion(!info->isMission);
|
characterComponent->TrackMissionCompletion(!info->isMission);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
missionComponent->Progress(eMissionTaskType::META, info->id);
|
missionComponent->Progress(eMissionTaskType::META, info->id);
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ void Mission::CheckCompletion() {
|
|||||||
void Mission::Catchup() {
|
void Mission::Catchup() {
|
||||||
auto* entity = GetAssociate();
|
auto* entity = GetAssociate();
|
||||||
|
|
||||||
auto inventory = entity->GetComponent<InventoryComponent>();
|
auto* inventory = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
for (auto* task : m_Tasks) {
|
for (auto* task : m_Tasks) {
|
||||||
const auto type = task->GetType();
|
const auto type = task->GetType();
|
||||||
@ -414,11 +414,11 @@ void Mission::YieldRewards() {
|
|||||||
|
|
||||||
auto* character = GetUser()->GetLastUsedChar();
|
auto* character = GetUser()->GetLastUsedChar();
|
||||||
|
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
auto levelComponent = entity->GetComponent<LevelProgressionComponent>();
|
auto* levelComponent = entity->GetComponent<LevelProgressionComponent>();
|
||||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
// Remove mission items
|
// Remove mission items
|
||||||
for (auto* task : m_Tasks) {
|
for (auto* task : m_Tasks) {
|
||||||
@ -532,7 +532,7 @@ void Mission::YieldRewards() {
|
|||||||
|
|
||||||
if (info->reward_reputation > 0) {
|
if (info->reward_reputation > 0) {
|
||||||
missionComponent->Progress(eMissionTaskType::EARN_REPUTATION, 0, 0L, "", info->reward_reputation);
|
missionComponent->Progress(eMissionTaskType::EARN_REPUTATION, 0, 0L, "", info->reward_reputation);
|
||||||
auto character = entity->GetComponent<CharacterComponent>();
|
auto* character = entity->GetComponent<CharacterComponent>();
|
||||||
if (character) {
|
if (character) {
|
||||||
character->SetReputation(character->GetReputation() + info->reward_reputation);
|
character->SetReputation(character->GetReputation() + info->reward_reputation);
|
||||||
GameMessages::SendUpdateReputation(entity->GetObjectID(), character->GetReputation(), entity->GetSystemAddress());
|
GameMessages::SendUpdateReputation(entity->GetObjectID(), character->GetReputation(), entity->GetSystemAddress());
|
||||||
|
@ -194,7 +194,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventoryComponent = mission->GetAssociate()->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = mission->GetAssociate()->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent != nullptr) {
|
if (inventoryComponent != nullptr) {
|
||||||
int32_t itemCount = inventoryComponent->GetLotCountNonTransfer(value);
|
int32_t itemCount = inventoryComponent->GetLotCountNonTransfer(value);
|
||||||
@ -308,7 +308,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
|
|||||||
|
|
||||||
int32_t gameID = minigameManager->GetLOT();
|
int32_t gameID = minigameManager->GetLOT();
|
||||||
|
|
||||||
auto sac = minigameManager->GetComponent<ScriptedActivityComponent>();
|
auto* sac = minigameManager->GetComponent<ScriptedActivityComponent>();
|
||||||
if (sac != nullptr) {
|
if (sac != nullptr) {
|
||||||
gameID = sac->GetActivityID();
|
gameID = sac->GetActivityID();
|
||||||
}
|
}
|
||||||
@ -368,7 +368,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
|
|||||||
|
|
||||||
if (entity == nullptr) break;
|
if (entity == nullptr) break;
|
||||||
|
|
||||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionComponent == nullptr) break;
|
if (missionComponent == nullptr) break;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ void ControlBehaviors::RequestUpdatedID(int32_t behaviorID, ModelBehaviorCompone
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ControlBehaviors::SendBehaviorListToClient(Entity* modelEntity, const SystemAddress& sysAddr, Entity* modelOwner) {
|
void ControlBehaviors::SendBehaviorListToClient(Entity* modelEntity, const SystemAddress& sysAddr, Entity* modelOwner) {
|
||||||
auto modelComponent = modelEntity->GetComponent<ModelBehaviorComponent>();
|
auto* modelComponent = modelEntity->GetComponent<ModelBehaviorComponent>();
|
||||||
|
|
||||||
if (!modelComponent) return;
|
if (!modelComponent) return;
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ void ControlBehaviors::MoveToInventory(ModelBehaviorComponent* modelComponent, c
|
|||||||
|
|
||||||
void ControlBehaviors::ProcessCommand(Entity* modelEntity, const SystemAddress& sysAddr, AMFArrayValue* arguments, std::string command, Entity* modelOwner) {
|
void ControlBehaviors::ProcessCommand(Entity* modelEntity, const SystemAddress& sysAddr, AMFArrayValue* arguments, std::string command, Entity* modelOwner) {
|
||||||
if (!isInitialized || !modelEntity || !modelOwner || !arguments) return;
|
if (!isInitialized || !modelEntity || !modelOwner || !arguments) return;
|
||||||
auto modelComponent = modelEntity->GetComponent<ModelBehaviorComponent>();
|
auto* modelComponent = modelEntity->GetComponent<ModelBehaviorComponent>();
|
||||||
|
|
||||||
if (!modelComponent) return;
|
if (!modelComponent) return;
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ LootGenerator::LootGenerator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::unordered_map<LOT, int32_t> LootGenerator::RollLootMatrix(Entity* player, uint32_t matrixIndex) {
|
std::unordered_map<LOT, int32_t> LootGenerator::RollLootMatrix(Entity* player, uint32_t matrixIndex) {
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
std::unordered_map<LOT, int32_t> drops;
|
std::unordered_map<LOT, int32_t> drops;
|
||||||
|
|
||||||
@ -283,7 +283,7 @@ void LootGenerator::GiveLoot(Entity* player, uint32_t matrixIndex, eLootSourceTy
|
|||||||
void LootGenerator::GiveLoot(Entity* player, std::unordered_map<LOT, int32_t>& result, eLootSourceType lootSourceType) {
|
void LootGenerator::GiveLoot(Entity* player, std::unordered_map<LOT, int32_t>& result, eLootSourceType lootSourceType) {
|
||||||
player = player->GetOwner(); // if the owner is overwritten, we collect that here
|
player = player->GetOwner(); // if the owner is overwritten, we collect that here
|
||||||
|
|
||||||
auto inventoryComponent = player->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (!inventoryComponent)
|
if (!inventoryComponent)
|
||||||
return;
|
return;
|
||||||
@ -330,7 +330,7 @@ void LootGenerator::GiveActivityLoot(Entity* player, Entity* source, uint32_t ac
|
|||||||
void LootGenerator::DropLoot(Entity* player, Entity* killedObject, uint32_t matrixIndex, uint32_t minCoins, uint32_t maxCoins) {
|
void LootGenerator::DropLoot(Entity* player, Entity* killedObject, uint32_t matrixIndex, uint32_t minCoins, uint32_t maxCoins) {
|
||||||
player = player->GetOwner(); // if the owner is overwritten, we collect that here
|
player = player->GetOwner(); // if the owner is overwritten, we collect that here
|
||||||
|
|
||||||
auto inventoryComponent = player->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (!inventoryComponent)
|
if (!inventoryComponent)
|
||||||
return;
|
return;
|
||||||
@ -343,7 +343,7 @@ void LootGenerator::DropLoot(Entity* player, Entity* killedObject, uint32_t matr
|
|||||||
void LootGenerator::DropLoot(Entity* player, Entity* killedObject, std::unordered_map<LOT, int32_t>& result, uint32_t minCoins, uint32_t maxCoins) {
|
void LootGenerator::DropLoot(Entity* player, Entity* killedObject, std::unordered_map<LOT, int32_t>& result, uint32_t minCoins, uint32_t maxCoins) {
|
||||||
player = player->GetOwner(); // if the owner is overwritten, we collect that here
|
player = player->GetOwner(); // if the owner is overwritten, we collect that here
|
||||||
|
|
||||||
auto inventoryComponent = player->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (!inventoryComponent)
|
if (!inventoryComponent)
|
||||||
return;
|
return;
|
||||||
|
@ -197,7 +197,7 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd
|
|||||||
//Inventory::InventoryType itemType;
|
//Inventory::InventoryType itemType;
|
||||||
int mailCost = dZoneManager::Instance()->GetWorldConfig()->mailBaseFee;
|
int mailCost = dZoneManager::Instance()->GetWorldConfig()->mailBaseFee;
|
||||||
int stackSize = 0;
|
int stackSize = 0;
|
||||||
auto inv = entity->GetComponent<InventoryComponent>();
|
auto* inv = entity->GetComponent<InventoryComponent>();
|
||||||
Item* item = nullptr;
|
Item* item = nullptr;
|
||||||
|
|
||||||
if (itemID > 0 && attachmentCount > 0 && inv) {
|
if (itemID > 0 && attachmentCount > 0 && inv) {
|
||||||
@ -267,7 +267,7 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd
|
|||||||
Game::logger->Log("Mail", "Trying to remove item with ID/count/LOT: %i %i %i", itemID, attachmentCount, itemLOT);
|
Game::logger->Log("Mail", "Trying to remove item with ID/count/LOT: %i %i %i", itemID, attachmentCount, itemLOT);
|
||||||
inv->RemoveItem(itemLOT, attachmentCount, INVALID, true);
|
inv->RemoveItem(itemLOT, attachmentCount, INVALID, true);
|
||||||
|
|
||||||
auto missionCompoent = entity->GetComponent<MissionComponent>();
|
auto* missionCompoent = entity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (missionCompoent != nullptr) {
|
if (missionCompoent != nullptr) {
|
||||||
missionCompoent->Progress(eMissionTaskType::GATHER, itemLOT, LWOOBJID_EMPTY, "", -attachmentCount);
|
missionCompoent->Progress(eMissionTaskType::GATHER, itemLOT, LWOOBJID_EMPTY, "", -attachmentCount);
|
||||||
@ -356,7 +356,7 @@ void Mail::HandleAttachmentCollect(RakNet::BitStream* packet, const SystemAddres
|
|||||||
attachmentCount = res->getInt(2);
|
attachmentCount = res->getInt(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inv = player->GetComponent<InventoryComponent>();
|
auto* inv = player->GetComponent<InventoryComponent>();
|
||||||
if (!inv) return;
|
if (!inv) return;
|
||||||
|
|
||||||
inv->AddItem(attachmentLOT, attachmentCount, eLootSourceType::MAIL);
|
inv->AddItem(attachmentLOT, attachmentCount, eLootSourceType::MAIL);
|
||||||
|
@ -115,10 +115,10 @@ bool Precondition::Check(Entity* player, bool evaluateCosts) const {
|
|||||||
|
|
||||||
|
|
||||||
bool Precondition::CheckValue(Entity* player, const uint32_t value, bool evaluateCosts) const {
|
bool Precondition::CheckValue(Entity* player, const uint32_t value, bool evaluateCosts) const {
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
auto inventoryComponent = player->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||||
auto destroyableComponent = player->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = player->GetComponent<DestroyableComponent>();
|
||||||
auto levelComponent = player->GetComponent<LevelProgressionComponent>();
|
auto* levelComponent = player->GetComponent<LevelProgressionComponent>();
|
||||||
auto* character = player->GetCharacter();
|
auto* character = player->GetCharacter();
|
||||||
|
|
||||||
Mission* mission;
|
Mission* mission;
|
||||||
|
@ -176,7 +176,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
if (chatCommand == "pvp") {
|
if (chatCommand == "pvp") {
|
||||||
auto character = entity->GetComponent<CharacterComponent>();
|
auto* character = entity->GetComponent<CharacterComponent>();
|
||||||
|
|
||||||
if (character == nullptr) {
|
if (character == nullptr) {
|
||||||
Game::logger->Log("SlashCommandHandler", "Failed to find character component!");
|
Game::logger->Log("SlashCommandHandler", "Failed to find character component!");
|
||||||
@ -227,9 +227,9 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
|
|
||||||
if (chatCommand == "fix-stats") {
|
if (chatCommand == "fix-stats") {
|
||||||
// Reset skill component and buff component
|
// Reset skill component and buff component
|
||||||
auto skillComponent = entity->GetComponent<SkillComponent>();
|
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||||
auto buffComponent = entity->GetComponent<BuffComponent>();
|
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
// If any of the components are nullptr, return
|
// If any of the components are nullptr, return
|
||||||
if (skillComponent == nullptr || buffComponent == nullptr || destroyableComponent == nullptr) {
|
if (skillComponent == nullptr || buffComponent == nullptr || destroyableComponent == nullptr) {
|
||||||
@ -336,7 +336,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "resurrect") {
|
if (chatCommand == "resurrect") {
|
||||||
auto scriptedActivityComponent = dZoneManager::Instance()->GetZoneControlObject()->GetComponent<ScriptedActivityComponent>();
|
auto* scriptedActivityComponent = dZoneManager::Instance()->GetZoneControlObject()->GetComponent<ScriptedActivityComponent>();
|
||||||
|
|
||||||
if (scriptedActivityComponent) { // check if user is in activity world and if so, they can't resurrect
|
if (scriptedActivityComponent) { // check if user is in activity world and if so, they can't resurrect
|
||||||
ChatPackets::SendSystemMessage(sysAddr, u"You cannot resurrect in an activity world.");
|
ChatPackets::SendSystemMessage(sysAddr, u"You cannot resurrect in an activity world.");
|
||||||
@ -373,7 +373,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
EntityManager::Instance()->DestructEntity(entity, sysAddr);
|
EntityManager::Instance()->DestructEntity(entity, sysAddr);
|
||||||
auto charComp = entity->GetComponent<CharacterComponent>();
|
auto* charComp = entity->GetComponent<CharacterComponent>();
|
||||||
std::string lowerName = args[0];
|
std::string lowerName = args[0];
|
||||||
if (lowerName.empty()) return;
|
if (lowerName.empty()) return;
|
||||||
std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), ::tolower);
|
std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), ::tolower);
|
||||||
@ -413,7 +413,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
if ((chatCommand == "playanimation" || chatCommand == "playanim") && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if ((chatCommand == "playanimation" || chatCommand == "playanim") && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
std::u16string anim = GeneralUtils::ASCIIToUTF16(args[0], args[0].size());
|
std::u16string anim = GeneralUtils::ASCIIToUTF16(args[0], args[0].size());
|
||||||
RenderComponent::PlayAnimation(entity, anim);
|
RenderComponent::PlayAnimation(entity, anim);
|
||||||
auto possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||||
if (possessorComponent) {
|
if (possessorComponent) {
|
||||||
auto* possessedComponent = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* possessedComponent = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
||||||
if (possessedComponent) RenderComponent::PlayAnimation(possessedComponent, anim);
|
if (possessedComponent) RenderComponent::PlayAnimation(possessedComponent, anim);
|
||||||
@ -468,19 +468,19 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
|
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
controllablePhysicsComponent->SetSpeedMultiplier(boost);
|
controllablePhysicsComponent->SetSpeedMultiplier(boost);
|
||||||
|
|
||||||
// speedboost possesables
|
// speedboost possesables
|
||||||
auto possessor = entity->GetComponent<PossessorComponent>();
|
auto* possessor = entity->GetComponent<PossessorComponent>();
|
||||||
if (possessor) {
|
if (possessor) {
|
||||||
auto possessedID = possessor->GetPossessable();
|
auto possessedID = possessor->GetPossessable();
|
||||||
if (possessedID != LWOOBJID_EMPTY) {
|
if (possessedID != LWOOBJID_EMPTY) {
|
||||||
auto possessable = EntityManager::Instance()->GetEntity(possessedID);
|
auto possessable = EntityManager::Instance()->GetEntity(possessedID);
|
||||||
if (possessable) {
|
if (possessable) {
|
||||||
auto possessControllablePhysicsComponent = possessable->GetComponent<ControllablePhysicsComponent>();
|
auto* possessControllablePhysicsComponent = possessable->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (possessControllablePhysicsComponent) {
|
if (possessControllablePhysicsComponent) {
|
||||||
possessControllablePhysicsComponent->SetSpeedMultiplier(boost);
|
possessControllablePhysicsComponent->SetSpeedMultiplier(boost);
|
||||||
}
|
}
|
||||||
@ -579,7 +579,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
GeneralUtils::to_u16string(size));
|
GeneralUtils::to_u16string(size));
|
||||||
} else ChatPackets::SendSystemMessage(sysAddr, u"Setting inventory ITEMS to size " + GeneralUtils::to_u16string(size));
|
} else ChatPackets::SendSystemMessage(sysAddr, u"Setting inventory ITEMS to size " + GeneralUtils::to_u16string(size));
|
||||||
|
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
if (inventoryComponent) {
|
if (inventoryComponent) {
|
||||||
auto* inventory = inventoryComponent->GetInventory(selectedInventory);
|
auto* inventory = inventoryComponent->GetInventory(selectedInventory);
|
||||||
|
|
||||||
@ -629,7 +629,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto comp = entity->GetComponent<MissionComponent>();
|
auto* comp = entity->GetComponent<MissionComponent>();
|
||||||
if (comp) comp->AcceptMission(missionID, true);
|
if (comp) comp->AcceptMission(missionID, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -644,7 +644,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto comp = entity->GetComponent<MissionComponent>();
|
auto* comp = entity->GetComponent<MissionComponent>();
|
||||||
if (comp) comp->CompleteMission(missionID, true);
|
if (comp) comp->CompleteMission(missionID, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -694,7 +694,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto comp = entity->GetComponent<MissionComponent>();
|
auto* comp = entity->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
if (comp == nullptr) {
|
if (comp == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -771,7 +771,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "getnavmeshheight" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if (chatCommand == "getnavmeshheight" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto control = entity->GetComponent<ControllablePhysicsComponent>();
|
auto* control = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!control) return;
|
if (!control) return;
|
||||||
|
|
||||||
float y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(control->GetPosition());
|
float y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(control->GetPosition());
|
||||||
@ -788,7 +788,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventory = entity->GetComponent<InventoryComponent>();
|
auto* inventory = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
inventory->AddItem(itemLOT, 1, eLootSourceType::MODERATION);
|
inventory->AddItem(itemLOT, 1, eLootSourceType::MODERATION);
|
||||||
} else if (args.size() == 2) {
|
} else if (args.size() == 2) {
|
||||||
@ -806,7 +806,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventory = entity->GetComponent<InventoryComponent>();
|
auto* inventory = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
inventory->AddItem(itemLOT, count, eLootSourceType::MODERATION);
|
inventory->AddItem(itemLOT, count, eLootSourceType::MODERATION);
|
||||||
} else {
|
} else {
|
||||||
@ -935,12 +935,12 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
auto possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||||
if (possessorComponent) {
|
if (possessorComponent) {
|
||||||
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
||||||
|
|
||||||
if (possassableEntity != nullptr) {
|
if (possassableEntity != nullptr) {
|
||||||
auto havokVehiclePhysicsComponent = possassableEntity->GetComponent<HavokVehiclePhysicsComponent>();
|
auto* havokVehiclePhysicsComponent = possassableEntity->GetComponent<HavokVehiclePhysicsComponent>();
|
||||||
if (havokVehiclePhysicsComponent) {
|
if (havokVehiclePhysicsComponent) {
|
||||||
havokVehiclePhysicsComponent->SetPosition(pos);
|
havokVehiclePhysicsComponent->SetPosition(pos);
|
||||||
EntityManager::Instance()->SerializeEntity(possassableEntity);
|
EntityManager::Instance()->SerializeEntity(possassableEntity);
|
||||||
@ -962,7 +962,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "dismount" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if (chatCommand == "dismount" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||||
if (possessorComponent) {
|
if (possessorComponent) {
|
||||||
auto possessableId = possessorComponent->GetPossessable();
|
auto possessableId = possessorComponent->GetPossessable();
|
||||||
if (possessableId != LWOOBJID_EMPTY) {
|
if (possessableId != LWOOBJID_EMPTY) {
|
||||||
@ -1171,7 +1171,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
if (chatCommand == "buffme" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if (chatCommand == "buffme" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto dest = entity->GetComponent<DestroyableComponent>();
|
auto* dest = entity->GetComponent<DestroyableComponent>();
|
||||||
if (dest) {
|
if (dest) {
|
||||||
dest->SetHealth(999);
|
dest->SetHealth(999);
|
||||||
dest->SetMaxHealth(999.0f);
|
dest->SetMaxHealth(999.0f);
|
||||||
@ -1195,7 +1195,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "buffmed" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if (chatCommand == "buffmed" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto dest = entity->GetComponent<DestroyableComponent>();
|
auto* dest = entity->GetComponent<DestroyableComponent>();
|
||||||
if (dest) {
|
if (dest) {
|
||||||
dest->SetHealth(9);
|
dest->SetHealth(9);
|
||||||
dest->SetMaxHealth(9.0f);
|
dest->SetMaxHealth(9.0f);
|
||||||
@ -1209,7 +1209,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
|
|
||||||
if (chatCommand == "refillstats" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if (chatCommand == "refillstats" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
|
|
||||||
auto dest = entity->GetComponent<DestroyableComponent>();
|
auto* dest = entity->GetComponent<DestroyableComponent>();
|
||||||
if (dest) {
|
if (dest) {
|
||||||
dest->SetHealth((int)dest->GetMaxHealth());
|
dest->SetHealth((int)dest->GetMaxHealth());
|
||||||
dest->SetArmor((int)dest->GetMaxArmor());
|
dest->SetArmor((int)dest->GetMaxArmor());
|
||||||
@ -1242,7 +1242,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "spawn" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
if (chatCommand == "spawn" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||||
auto comp = entity->GetComponent<ControllablePhysicsComponent>();
|
auto* comp = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!comp) return;
|
if (!comp) return;
|
||||||
|
|
||||||
uint32_t lot;
|
uint32_t lot;
|
||||||
@ -1267,7 +1267,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto havokVehiclePhysicsComponent = newEntity->GetComponent<HavokVehiclePhysicsComponent>();
|
auto* havokVehiclePhysicsComponent = newEntity->GetComponent<HavokVehiclePhysicsComponent>();
|
||||||
if (havokVehiclePhysicsComponent) {
|
if (havokVehiclePhysicsComponent) {
|
||||||
auto newRot = newEntity->GetRotation();
|
auto newRot = newEntity->GetRotation();
|
||||||
auto angles = newRot.GetEulerAngles();
|
auto angles = newRot.GetEulerAngles();
|
||||||
@ -1283,7 +1283,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "spawngroup" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 3) {
|
if (chatCommand == "spawngroup" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 3) {
|
||||||
auto controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
|
|
||||||
LOT lot{};
|
LOT lot{};
|
||||||
@ -1341,7 +1341,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto character = entity->GetComponent<CharacterComponent>();
|
auto* character = entity->GetComponent<CharacterComponent>();
|
||||||
if (character) character->SetUScore(character->GetUScore() + uscore);
|
if (character) character->SetUScore(character->GetUScore() + uscore);
|
||||||
// MODERATION should work but it doesn't. Relog to see uscore changes
|
// MODERATION should work but it doesn't. Relog to see uscore changes
|
||||||
|
|
||||||
@ -1385,9 +1385,9 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
// query to set our uscore to the correct value for this level
|
// query to set our uscore to the correct value for this level
|
||||||
|
|
||||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||||
if (!characterComponent) return;
|
if (!characterComponent) return;
|
||||||
auto levelComponent = entity->GetComponent<LevelProgressionComponent>();
|
auto* levelComponent = entity->GetComponent<LevelProgressionComponent>();
|
||||||
auto query = CDClientDatabase::CreatePreppedStmt("SELECT requiredUScore from LevelProgressionLookup WHERE id = ?;");
|
auto query = CDClientDatabase::CreatePreppedStmt("SELECT requiredUScore from LevelProgressionLookup WHERE id = ?;");
|
||||||
query.bind(1, (int)requestedLevel);
|
query.bind(1, (int)requestedLevel);
|
||||||
auto result = query.execQuery();
|
auto result = query.execQuery();
|
||||||
@ -1486,7 +1486,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "gmimmune" && args.size() >= 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if (chatCommand == "gmimmune" && args.size() >= 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
int32_t state = false;
|
int32_t state = false;
|
||||||
|
|
||||||
@ -1503,7 +1503,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "buff" && args.size() >= 2 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if (chatCommand == "buff" && args.size() >= 2 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto buffComponent = entity->GetComponent<BuffComponent>();
|
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
||||||
|
|
||||||
int32_t id = 0;
|
int32_t id = 0;
|
||||||
int32_t duration = 0;
|
int32_t duration = 0;
|
||||||
@ -1615,7 +1615,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((chatCommand == "boost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if ((chatCommand == "boost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||||
|
|
||||||
if (possessorComponent == nullptr) {
|
if (possessorComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -1647,7 +1647,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((chatCommand == "unboost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if ((chatCommand == "unboost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||||
|
|
||||||
if (possessorComponent == nullptr) return;
|
if (possessorComponent == nullptr) return;
|
||||||
auto* vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
||||||
@ -1674,7 +1674,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
//Go tell physics to spawn all the vertices:
|
//Go tell physics to spawn all the vertices:
|
||||||
auto entities = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::PHANTOM_PHYSICS);
|
auto entities = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::PHANTOM_PHYSICS);
|
||||||
for (auto en : entities) {
|
for (auto en : entities) {
|
||||||
auto phys = en->GetComponent<PhantomPhysicsComponent>();
|
auto* phys = en->GetComponent<PhantomPhysicsComponent>();
|
||||||
if (phys)
|
if (phys)
|
||||||
phys->SpawnVertices();
|
phys->SpawnVertices();
|
||||||
}
|
}
|
||||||
@ -1683,7 +1683,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
if (chatCommand == "reportproxphys" && entity->GetGMLevel() >= eGameMasterLevel::JUNIOR_DEVELOPER) {
|
if (chatCommand == "reportproxphys" && entity->GetGMLevel() >= eGameMasterLevel::JUNIOR_DEVELOPER) {
|
||||||
auto entities = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::PROXIMITY_MONITOR);
|
auto entities = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::PROXIMITY_MONITOR);
|
||||||
for (auto en : entities) {
|
for (auto en : entities) {
|
||||||
auto phys = en->GetComponent<ProximityMonitorComponent>();
|
auto* phys = en->GetComponent<ProximityMonitorComponent>();
|
||||||
if (phys) {
|
if (phys) {
|
||||||
for (auto prox : phys->GetProximitiesData()) {
|
for (auto prox : phys->GetProximitiesData()) {
|
||||||
if (!prox.second) continue;
|
if (!prox.second) continue;
|
||||||
@ -1717,7 +1717,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
if (!GeneralUtils::TryParse(args[0], baseItem)) return;
|
if (!GeneralUtils::TryParse(args[0], baseItem)) return;
|
||||||
if (!GeneralUtils::TryParse(args[1], reforgedItem)) return;
|
if (!GeneralUtils::TryParse(args[1], reforgedItem)) return;
|
||||||
|
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) return;
|
if (inventoryComponent == nullptr) return;
|
||||||
|
|
||||||
@ -1779,7 +1779,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
dpWorld::Instance().Reload();
|
dpWorld::Instance().Reload();
|
||||||
auto entities = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::SCRIPTED_ACTIVITY);
|
auto entities = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::SCRIPTED_ACTIVITY);
|
||||||
for (auto entity : entities) {
|
for (auto entity : entities) {
|
||||||
auto scriptedActivityComponent = entity->GetComponent<ScriptedActivityComponent>();
|
auto* scriptedActivityComponent = entity->GetComponent<ScriptedActivityComponent>();
|
||||||
if (!scriptedActivityComponent) continue;
|
if (!scriptedActivityComponent) continue;
|
||||||
|
|
||||||
scriptedActivityComponent->ReloadConfig();
|
scriptedActivityComponent->ReloadConfig();
|
||||||
@ -1842,7 +1842,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
if (!inventoryComponent) return;
|
if (!inventoryComponent) return;
|
||||||
|
|
||||||
auto* inventoryToDelete = inventoryComponent->GetInventory(inventoryType);
|
auto* inventoryToDelete = inventoryComponent->GetInventory(inventoryType);
|
||||||
@ -1930,7 +1930,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
|
|
||||||
if (args.size() >= 2) {
|
if (args.size() >= 2) {
|
||||||
if (args[1] == "-m" && args.size() >= 3) {
|
if (args[1] == "-m" && args.size() >= 3) {
|
||||||
auto movingPlatformComponent = closest->GetComponent<MovingPlatformComponent>();
|
auto* movingPlatformComponent = closest->GetComponent<MovingPlatformComponent>();
|
||||||
|
|
||||||
int32_t value = 0;
|
int32_t value = 0;
|
||||||
|
|
||||||
@ -1964,7 +1964,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
GeneralUtils::ASCIIToUTF16("< " + std::to_string(postion.x) + ", " + std::to_string(postion.y) + ", " + std::to_string(postion.z) + " >")
|
GeneralUtils::ASCIIToUTF16("< " + std::to_string(postion.x) + ", " + std::to_string(postion.y) + ", " + std::to_string(postion.z) + " >")
|
||||||
);
|
);
|
||||||
} else if (args[1] == "-f") {
|
} else if (args[1] == "-f") {
|
||||||
auto destuctable = closest->GetComponent<DestroyableComponent>();
|
auto* destuctable = closest->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destuctable == nullptr) {
|
if (destuctable == nullptr) {
|
||||||
ChatPackets::SendSystemMessage(sysAddr, u"No destroyable component on this entity!");
|
ChatPackets::SendSystemMessage(sysAddr, u"No destroyable component on this entity!");
|
||||||
@ -1993,7 +1993,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
destuctable->AddFaction(faction, true);
|
destuctable->AddFaction(faction, true);
|
||||||
}
|
}
|
||||||
} else if (args[1] == "-t") {
|
} else if (args[1] == "-t") {
|
||||||
auto phantomPhysicsComponent = closest->GetComponent<PhantomPhysicsComponent>();
|
auto* phantomPhysicsComponent = closest->GetComponent<PhantomPhysicsComponent>();
|
||||||
|
|
||||||
if (phantomPhysicsComponent != nullptr) {
|
if (phantomPhysicsComponent != nullptr) {
|
||||||
ChatPackets::SendSystemMessage(sysAddr, u"Type: " + (GeneralUtils::to_u16string(static_cast<uint32_t>(phantomPhysicsComponent->GetEffectType()))));
|
ChatPackets::SendSystemMessage(sysAddr, u"Type: " + (GeneralUtils::to_u16string(static_cast<uint32_t>(phantomPhysicsComponent->GetEffectType()))));
|
||||||
@ -2003,7 +2003,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
ChatPackets::SendSystemMessage(sysAddr, u"Active: " + (GeneralUtils::to_u16string(phantomPhysicsComponent->GetPhysicsEffectActive())));
|
ChatPackets::SendSystemMessage(sysAddr, u"Active: " + (GeneralUtils::to_u16string(phantomPhysicsComponent->GetPhysicsEffectActive())));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto triggerComponent = closest->GetComponent<TriggerComponent>();
|
auto* triggerComponent = closest->GetComponent<TriggerComponent>();
|
||||||
if (triggerComponent) {
|
if (triggerComponent) {
|
||||||
auto trigger = triggerComponent->GetTrigger();
|
auto trigger = triggerComponent->GetTrigger();
|
||||||
if (trigger) {
|
if (trigger) {
|
||||||
|
@ -117,7 +117,7 @@ void VanityUtilities::SpawnVanity() {
|
|||||||
|
|
||||||
npcEntity->SetVar<std::vector<std::string>>(u"chats", npc.m_Phrases);
|
npcEntity->SetVar<std::vector<std::string>>(u"chats", npc.m_Phrases);
|
||||||
|
|
||||||
auto scriptComponent = npcEntity->GetComponent<ScriptComponent>();
|
auto* scriptComponent = npcEntity->GetComponent<ScriptComponent>();
|
||||||
|
|
||||||
if (scriptComponent != nullptr) {
|
if (scriptComponent != nullptr) {
|
||||||
scriptComponent->SetScript(npc.m_Script);
|
scriptComponent->SetScript(npc.m_Script);
|
||||||
@ -161,13 +161,13 @@ Entity* VanityUtilities::SpawnNPC(LOT lot, const std::string& name, const NiPoin
|
|||||||
auto* entity = EntityManager::Instance()->CreateEntity(info);
|
auto* entity = EntityManager::Instance()->CreateEntity(info);
|
||||||
entity->SetVar(u"npcName", name);
|
entity->SetVar(u"npcName", name);
|
||||||
|
|
||||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent != nullptr) {
|
if (inventoryComponent != nullptr) {
|
||||||
inventoryComponent->SetNPCItems(inventory);
|
inventoryComponent->SetNPCItems(inventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent != nullptr) {
|
if (destroyableComponent != nullptr) {
|
||||||
destroyableComponent->SetIsGMImmune(true);
|
destroyableComponent->SetIsGMImmune(true);
|
||||||
@ -519,7 +519,7 @@ void VanityUtilities::SetupNPCTalk(Entity* npc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VanityUtilities::NPCTalk(Entity* npc) {
|
void VanityUtilities::NPCTalk(Entity* npc) {
|
||||||
auto proximityMonitorComponent = npc->GetComponent<ProximityMonitorComponent>();
|
auto* proximityMonitorComponent = npc->GetComponent<ProximityMonitorComponent>();
|
||||||
|
|
||||||
if (!proximityMonitorComponent->GetProximityObjects("talk").empty()) {
|
if (!proximityMonitorComponent->GetProximityObjects("talk").empty()) {
|
||||||
const auto& chats = npc->GetVar<std::vector<std::string>>(u"chats");
|
const auto& chats = npc->GetVar<std::vector<std::string>>(u"chats");
|
||||||
|
@ -85,7 +85,7 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
|
|||||||
Entity* entity = EntityManager::Instance()->GetEntity(user->GetLastUsedChar()->GetObjectID());
|
Entity* entity = EntityManager::Instance()->GetEntity(user->GetLastUsedChar()->GetObjectID());
|
||||||
if (!entity) return;
|
if (!entity) return;
|
||||||
|
|
||||||
auto comp = entity->GetComponent<ControllablePhysicsComponent>();
|
auto* comp = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!comp) return;
|
if (!comp) return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -100,7 +100,7 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
auto possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||||
|
|
||||||
NiPoint3 position;
|
NiPoint3 position;
|
||||||
inStream.Read(position.x);
|
inStream.Read(position.x);
|
||||||
@ -142,13 +142,13 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
|
|||||||
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
||||||
|
|
||||||
if (possassableEntity != nullptr) {
|
if (possassableEntity != nullptr) {
|
||||||
auto possessableComponent = possassableEntity->GetComponent<PossessableComponent>();
|
auto* possessableComponent = possassableEntity->GetComponent<PossessableComponent>();
|
||||||
if (possessableComponent) {
|
if (possessableComponent) {
|
||||||
// While possessing something, only update char if we are attached to the thing we are possessing
|
// While possessing something, only update char if we are attached to the thing we are possessing
|
||||||
if (possessableComponent->GetPossessionType() != ePossessionType::ATTACHED_VISIBLE) updateChar = false;
|
if (possessableComponent->GetPossessionType() != ePossessionType::ATTACHED_VISIBLE) updateChar = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto havokVehiclePhysicsComponent = possassableEntity->GetComponent<HavokVehiclePhysicsComponent>();
|
auto* havokVehiclePhysicsComponent = possassableEntity->GetComponent<HavokVehiclePhysicsComponent>();
|
||||||
if (havokVehiclePhysicsComponent != nullptr) {
|
if (havokVehiclePhysicsComponent != nullptr) {
|
||||||
// This is flipped for whatever reason
|
// This is flipped for whatever reason
|
||||||
rotation = NiQuaternion(rotation.z, rotation.y, rotation.x, rotation.w);
|
rotation = NiQuaternion(rotation.z, rotation.y, rotation.x, rotation.w);
|
||||||
@ -163,7 +163,7 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
|
|||||||
havokVehiclePhysicsComponent->SetDirtyAngularVelocity(angVelocityFlag);
|
havokVehiclePhysicsComponent->SetDirtyAngularVelocity(angVelocityFlag);
|
||||||
} else {
|
} else {
|
||||||
// Need to get the mount's controllable physics
|
// Need to get the mount's controllable physics
|
||||||
auto controllablePhysicsComponent = possassableEntity->GetComponent<ControllablePhysicsComponent>();
|
auto* controllablePhysicsComponent = possassableEntity->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controllablePhysicsComponent) return;
|
if (!controllablePhysicsComponent) return;
|
||||||
controllablePhysicsComponent->SetPosition(position);
|
controllablePhysicsComponent->SetPosition(position);
|
||||||
controllablePhysicsComponent->SetRotation(rotation);
|
controllablePhysicsComponent->SetRotation(rotation);
|
||||||
@ -186,7 +186,7 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
|
|||||||
|
|
||||||
|
|
||||||
// Handle statistics
|
// Handle statistics
|
||||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->TrackPositionUpdate(position);
|
characterComponent->TrackPositionUpdate(position);
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ void WorldPackets::SendCreateCharacter(const SystemAddress& sysAddr, Entity* ent
|
|||||||
RakNet::BitStream data;
|
RakNet::BitStream data;
|
||||||
data.Write<uint32_t>(7); //LDF key count
|
data.Write<uint32_t>(7); //LDF key count
|
||||||
|
|
||||||
auto character = entity->GetComponent<CharacterComponent>();
|
auto* character = entity->GetComponent<CharacterComponent>();
|
||||||
if (!character) {
|
if (!character) {
|
||||||
Game::logger->Log("WorldPackets", "Entity is not a character?? what??");
|
Game::logger->Log("WorldPackets", "Entity is not a character?? what??");
|
||||||
return;
|
return;
|
||||||
|
@ -29,9 +29,9 @@ void BossSpiderQueenEnemyServer::OnStartup(Entity* self) {
|
|||||||
//self:SetStatusImmunity{ StateChangeType = "PUSH", bImmuneToPullToPoint = true, bImmuneToKnockback = true, bImmuneToInterrupt = true }
|
//self:SetStatusImmunity{ StateChangeType = "PUSH", bImmuneToPullToPoint = true, bImmuneToKnockback = true, bImmuneToInterrupt = true }
|
||||||
|
|
||||||
//Get our components:
|
//Get our components:
|
||||||
auto destroyable = self->GetComponent<DestroyableComponent>();
|
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
||||||
auto controllable = self->GetComponent<ControllablePhysicsComponent>();
|
auto* controllable = self->GetComponent<ControllablePhysicsComponent>();
|
||||||
auto combat = self->GetComponent<BaseCombatAIComponent>();
|
auto* combat = self->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
if (!destroyable || !controllable) return;
|
if (!destroyable || !controllable) return;
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ void BossSpiderQueenEnemyServer::OnStartup(Entity* self) {
|
|||||||
|
|
||||||
void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
|
void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
|
||||||
if (dZoneManager::Instance()->GetZoneID().GetMapID() == instanceZoneID) {
|
if (dZoneManager::Instance()->GetZoneID().GetMapID() == instanceZoneID) {
|
||||||
auto missionComponent = killer->GetComponent<MissionComponent>();
|
auto* missionComponent = killer->GetComponent<MissionComponent>();
|
||||||
if (missionComponent == nullptr)
|
if (missionComponent == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
|
|||||||
|
|
||||||
EntityManager::Instance()->SerializeEntity(self);
|
EntityManager::Instance()->SerializeEntity(self);
|
||||||
|
|
||||||
auto baseCombatAi = self->GetComponent<BaseCombatAIComponent>();
|
auto* baseCombatAi = self->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
baseCombatAi->SetDisabled(true);
|
baseCombatAi->SetDisabled(true);
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
|
|||||||
//Cancel all remaining timers for say idle anims:
|
//Cancel all remaining timers for say idle anims:
|
||||||
self->CancelAllTimers();
|
self->CancelAllTimers();
|
||||||
|
|
||||||
auto baseCombatAi = self->GetComponent<BaseCombatAIComponent>();
|
auto* baseCombatAi = self->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
baseCombatAi->SetDisabled(false);
|
baseCombatAi->SetDisabled(false);
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ void BossSpiderQueenEnemyServer::RainOfFireManager(Entity* self) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto skillComponent = entity->GetComponent<SkillComponent>();
|
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent == nullptr) {
|
if (skillComponent == nullptr) {
|
||||||
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find impact skill component!");
|
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find impact skill component!");
|
||||||
@ -347,7 +347,7 @@ void BossSpiderQueenEnemyServer::RapidFireShooterManager(Entity* self) {
|
|||||||
|
|
||||||
const auto target = attackTargetTable[0];
|
const auto target = attackTargetTable[0];
|
||||||
|
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
skillComponent->CalculateBehavior(1394, 32612, target, true);
|
skillComponent->CalculateBehavior(1394, 32612, target, true);
|
||||||
|
|
||||||
@ -381,7 +381,7 @@ void BossSpiderQueenEnemyServer::RunRapidFireShooter(Entity* self) {
|
|||||||
|
|
||||||
attackTargetTable.push_back(attackFocus);
|
attackTargetTable.push_back(attackFocus);
|
||||||
|
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
skillComponent->CalculateBehavior(1480, 36652, attackFocus, true);
|
skillComponent->CalculateBehavior(1480, 36652, attackFocus, true);
|
||||||
|
|
||||||
@ -493,14 +493,14 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
|
|||||||
auto landingTarget = self->GetI64(u"LandingTarget");
|
auto landingTarget = self->GetI64(u"LandingTarget");
|
||||||
auto landingEntity = EntityManager::Instance()->GetEntity(landingTarget);
|
auto landingEntity = EntityManager::Instance()->GetEntity(landingTarget);
|
||||||
|
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent != nullptr) {
|
if (skillComponent != nullptr) {
|
||||||
skillComponent->CalculateBehavior(bossLandingSkill, 37739, LWOOBJID_EMPTY);
|
skillComponent->CalculateBehavior(bossLandingSkill, 37739, LWOOBJID_EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (landingEntity) {
|
if (landingEntity) {
|
||||||
auto landingSkill = landingEntity->GetComponent<SkillComponent>();
|
auto* landingSkill = landingEntity->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (landingSkill != nullptr) {
|
if (landingSkill != nullptr) {
|
||||||
landingSkill->CalculateBehavior(bossLandingSkill, 37739, LWOOBJID_EMPTY, true);
|
landingSkill->CalculateBehavior(bossLandingSkill, 37739, LWOOBJID_EMPTY, true);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
void AmDarklingDragon::OnStartup(Entity* self) {
|
void AmDarklingDragon::OnStartup(Entity* self) {
|
||||||
self->SetVar<int32_t>(u"weakspot", 0);
|
self->SetVar<int32_t>(u"weakspot", 0);
|
||||||
|
|
||||||
auto baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
if (baseCombatAIComponent != nullptr) {
|
if (baseCombatAIComponent != nullptr) {
|
||||||
baseCombatAIComponent->SetStunImmune(true);
|
baseCombatAIComponent->SetStunImmune(true);
|
||||||
@ -46,7 +46,7 @@ void AmDarklingDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent != nullptr) {
|
if (destroyableComponent != nullptr) {
|
||||||
if (destroyableComponent->GetArmor() > 0) return;
|
if (destroyableComponent->GetArmor() > 0) return;
|
||||||
@ -56,8 +56,8 @@ void AmDarklingDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
|
|||||||
if (weakpoint == 0) {
|
if (weakpoint == 0) {
|
||||||
self->AddTimer("ReviveTimer", 12);
|
self->AddTimer("ReviveTimer", 12);
|
||||||
|
|
||||||
auto baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (baseCombatAIComponent != nullptr) {
|
if (baseCombatAIComponent != nullptr) {
|
||||||
baseCombatAIComponent->SetDisabled(true);
|
baseCombatAIComponent->SetDisabled(true);
|
||||||
@ -127,8 +127,8 @@ void AmDarklingDragon::OnTimerDone(Entity* self, std::string timerName) {
|
|||||||
RenderComponent::PlayAnimation(self, u"stunend", 2.0f);
|
RenderComponent::PlayAnimation(self, u"stunend", 2.0f);
|
||||||
self->AddTimer("backToAttack", 1);
|
self->AddTimer("backToAttack", 1);
|
||||||
} else if (timerName == "backToAttack") {
|
} else if (timerName == "backToAttack") {
|
||||||
auto baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
if (baseCombatAIComponent != nullptr) {
|
if (baseCombatAIComponent != nullptr) {
|
||||||
baseCombatAIComponent->SetDisabled(false);
|
baseCombatAIComponent->SetDisabled(false);
|
||||||
baseCombatAIComponent->SetStunned(false);
|
baseCombatAIComponent->SetStunned(false);
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
#include "SkillComponent.h"
|
#include "SkillComponent.h"
|
||||||
|
|
||||||
void AmSkeletonEngineer::OnHit(Entity* self, Entity* attacker) {
|
void AmSkeletonEngineer::OnHit(Entity* self, Entity* attacker) {
|
||||||
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (destroyableComponent == nullptr || skillComponent == nullptr) {
|
if (destroyableComponent == nullptr || skillComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
void FvMaelstromDragon::OnStartup(Entity* self) {
|
void FvMaelstromDragon::OnStartup(Entity* self) {
|
||||||
self->SetVar<int32_t>(u"weakspot", 0);
|
self->SetVar<int32_t>(u"weakspot", 0);
|
||||||
|
|
||||||
auto baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
|
|
||||||
if (baseCombatAIComponent != nullptr) {
|
if (baseCombatAIComponent != nullptr) {
|
||||||
baseCombatAIComponent->SetStunImmune(true);
|
baseCombatAIComponent->SetStunImmune(true);
|
||||||
@ -59,7 +59,7 @@ void FvMaelstromDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyableComponent != nullptr) {
|
if (destroyableComponent != nullptr) {
|
||||||
if (destroyableComponent->GetArmor() > 0) return;
|
if (destroyableComponent->GetArmor() > 0) return;
|
||||||
@ -71,8 +71,8 @@ void FvMaelstromDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_
|
|||||||
|
|
||||||
self->AddTimer("ReviveTimer", 12);
|
self->AddTimer("ReviveTimer", 12);
|
||||||
|
|
||||||
auto baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (baseCombatAIComponent != nullptr) {
|
if (baseCombatAIComponent != nullptr) {
|
||||||
baseCombatAIComponent->SetDisabled(true);
|
baseCombatAIComponent->SetDisabled(true);
|
||||||
@ -143,8 +143,8 @@ void FvMaelstromDragon::OnTimerDone(Entity* self, std::string timerName) {
|
|||||||
RenderComponent::PlayAnimation(self, u"stunend", 2.0f);
|
RenderComponent::PlayAnimation(self, u"stunend", 2.0f);
|
||||||
self->AddTimer("backToAttack", 1.0f);
|
self->AddTimer("backToAttack", 1.0f);
|
||||||
} else if (timerName == "backToAttack") {
|
} else if (timerName == "backToAttack") {
|
||||||
auto baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (baseCombatAIComponent != nullptr) {
|
if (baseCombatAIComponent != nullptr) {
|
||||||
baseCombatAIComponent->SetDisabled(false);
|
baseCombatAIComponent->SetDisabled(false);
|
||||||
|
@ -31,11 +31,11 @@ void BaseEnemyApe::OnSkillCast(Entity* self, uint32_t skillID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BaseEnemyApe::OnHit(Entity* self, Entity* attacker) {
|
void BaseEnemyApe::OnHit(Entity* self, Entity* attacker) {
|
||||||
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||||
if (destroyableComponent != nullptr && destroyableComponent->GetArmor() < 1 && !self->GetBoolean(u"knockedOut")) {
|
if (destroyableComponent != nullptr && destroyableComponent->GetArmor() < 1 && !self->GetBoolean(u"knockedOut")) {
|
||||||
StunApe(self, true);
|
StunApe(self, true);
|
||||||
self->CancelTimer("spawnQBTime");
|
self->CancelTimer("spawnQBTime");
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
if (skillComponent) {
|
if (skillComponent) {
|
||||||
skillComponent->Reset();
|
skillComponent->Reset();
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ void BaseEnemyApe::OnTimerDone(Entity* self, std::string timerName) {
|
|||||||
|
|
||||||
// Revives the ape, giving it back some armor
|
// Revives the ape, giving it back some armor
|
||||||
const auto timesStunned = self->GetVar<uint32_t>(u"timesStunned");
|
const auto timesStunned = self->GetVar<uint32_t>(u"timesStunned");
|
||||||
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||||
if (destroyableComponent != nullptr) {
|
if (destroyableComponent != nullptr) {
|
||||||
destroyableComponent->SetArmor(destroyableComponent->GetMaxArmor() / timesStunned);
|
destroyableComponent->SetArmor(destroyableComponent->GetMaxArmor() / timesStunned);
|
||||||
}
|
}
|
||||||
@ -104,7 +104,7 @@ void BaseEnemyApe::OnTimerDone(Entity* self, std::string timerName) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
if (skillComponent != nullptr) {
|
if (skillComponent != nullptr) {
|
||||||
skillComponent->CalculateBehavior(1273, 29446, self->GetObjectID(), true, false, player->GetObjectID());
|
skillComponent->CalculateBehavior(1273, 29446, self->GetObjectID(), true, false, player->GetObjectID());
|
||||||
}
|
}
|
||||||
@ -123,12 +123,12 @@ void BaseEnemyApe::OnFireEventServerSide(Entity* self, Entity* sender, std::stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BaseEnemyApe::StunApe(Entity* self, bool stunState) {
|
void BaseEnemyApe::StunApe(Entity* self, bool stunState) {
|
||||||
auto combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combatAIComponent != nullptr) {
|
if (combatAIComponent != nullptr) {
|
||||||
combatAIComponent->SetDisabled(stunState);
|
combatAIComponent->SetDisabled(stunState);
|
||||||
combatAIComponent->SetStunned(stunState);
|
combatAIComponent->SetStunned(stunState);
|
||||||
|
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
if (skillComponent != nullptr) {
|
if (skillComponent != nullptr) {
|
||||||
skillComponent->Interrupt();
|
skillComponent->Interrupt();
|
||||||
}
|
}
|
||||||
|
@ -9,14 +9,14 @@
|
|||||||
#include "eReplicaComponentType.h"
|
#include "eReplicaComponentType.h"
|
||||||
|
|
||||||
void BaseEnemyMech::OnStartup(Entity* self) {
|
void BaseEnemyMech::OnStartup(Entity* self) {
|
||||||
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||||
if (destroyableComponent != nullptr) {
|
if (destroyableComponent != nullptr) {
|
||||||
destroyableComponent->SetFaction(4);
|
destroyableComponent->SetFaction(4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseEnemyMech::OnDie(Entity* self, Entity* killer) {
|
void BaseEnemyMech::OnDie(Entity* self, Entity* killer) {
|
||||||
auto controlPhys = self->GetComponent<ControllablePhysicsComponent>();
|
auto* controlPhys = self->GetComponent<ControllablePhysicsComponent>();
|
||||||
if (!controlPhys) return;
|
if (!controlPhys) return;
|
||||||
|
|
||||||
NiPoint3 newLoc = { controlPhys->GetPosition().x, dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(controlPhys->GetPosition()), controlPhys->GetPosition().z };
|
NiPoint3 newLoc = { controlPhys->GetPosition().x, dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(controlPhys->GetPosition()), controlPhys->GetPosition().z };
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "SkillComponent.h"
|
#include "SkillComponent.h"
|
||||||
|
|
||||||
void EnemyNjBuff::OnStartup(Entity* self) {
|
void EnemyNjBuff::OnStartup(Entity* self) {
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent == nullptr) {
|
if (skillComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -15,7 +15,7 @@ void TreasureChestDragonServer::OnUse(Entity* self, Entity* user) {
|
|||||||
|
|
||||||
self->SetVar<bool>(u"bUsed", true);
|
self->SetVar<bool>(u"bUsed", true);
|
||||||
|
|
||||||
auto scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
auto* scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
||||||
|
|
||||||
if (scriptedActivityComponent == nullptr) {
|
if (scriptedActivityComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
void AgSurvivalMech::OnStartup(Entity* self) {
|
void AgSurvivalMech::OnStartup(Entity* self) {
|
||||||
BaseWavesGenericEnemy::OnStartup(self);
|
BaseWavesGenericEnemy::OnStartup(self);
|
||||||
|
|
||||||
auto destroyable = self->GetComponent<DestroyableComponent>();
|
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
||||||
if (destroyable != nullptr) {
|
if (destroyable != nullptr) {
|
||||||
destroyable->SetFaction(4);
|
destroyable->SetFaction(4);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
void AgSurvivalSpiderling::OnStartup(Entity* self) {
|
void AgSurvivalSpiderling::OnStartup(Entity* self) {
|
||||||
BaseWavesGenericEnemy::OnStartup(self);
|
BaseWavesGenericEnemy::OnStartup(self);
|
||||||
|
|
||||||
auto combatAI = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAI = self->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combatAI != nullptr) {
|
if (combatAI != nullptr) {
|
||||||
combatAI->SetStunImmune(true);
|
combatAI->SetStunImmune(true);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ void WaveBossApe::OnStartup(Entity* self) {
|
|||||||
self->SetVar<float_t>(u"AnchorDamageDelayTime", 0.5f);
|
self->SetVar<float_t>(u"AnchorDamageDelayTime", 0.5f);
|
||||||
self->SetVar<float_t>(u"spawnQBTime", 5.0f);
|
self->SetVar<float_t>(u"spawnQBTime", 5.0f);
|
||||||
|
|
||||||
auto combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combatAIComponent != nullptr) {
|
if (combatAIComponent != nullptr) {
|
||||||
combatAIComponent->SetDisabled(true);
|
combatAIComponent->SetDisabled(true);
|
||||||
combatAIComponent->SetStunImmune(true);
|
combatAIComponent->SetStunImmune(true);
|
||||||
@ -30,7 +30,7 @@ void WaveBossApe::OnDie(Entity* self, Entity* killer) {
|
|||||||
void WaveBossApe::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
void WaveBossApe::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
||||||
int32_t param3) {
|
int32_t param3) {
|
||||||
if (args == "startAI") {
|
if (args == "startAI") {
|
||||||
auto combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combatAIComponent != nullptr) {
|
if (combatAIComponent != nullptr) {
|
||||||
combatAIComponent->SetDisabled(false);
|
combatAIComponent->SetDisabled(false);
|
||||||
combatAIComponent->SetStunImmune(false);
|
combatAIComponent->SetStunImmune(false);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
void WaveBossHammerling::OnStartup(Entity* self) {
|
void WaveBossHammerling::OnStartup(Entity* self) {
|
||||||
BaseWavesGenericEnemy::OnStartup(self);
|
BaseWavesGenericEnemy::OnStartup(self);
|
||||||
|
|
||||||
auto combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combatAIComponent != nullptr) {
|
if (combatAIComponent != nullptr) {
|
||||||
combatAIComponent->SetDisabled(true);
|
combatAIComponent->SetDisabled(true);
|
||||||
combatAIComponent->SetStunImmune(true);
|
combatAIComponent->SetStunImmune(true);
|
||||||
@ -17,7 +17,7 @@ void WaveBossHammerling::OnStartup(Entity* self) {
|
|||||||
void WaveBossHammerling::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
|
void WaveBossHammerling::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
|
||||||
int32_t param2, int32_t param3) {
|
int32_t param2, int32_t param3) {
|
||||||
if (args == "startAI") {
|
if (args == "startAI") {
|
||||||
auto combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combatAIComponent != nullptr) {
|
if (combatAIComponent != nullptr) {
|
||||||
combatAIComponent->SetDisabled(false);
|
combatAIComponent->SetDisabled(false);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
void WaveBossHorsemen::OnStartup(Entity* self) {
|
void WaveBossHorsemen::OnStartup(Entity* self) {
|
||||||
BaseWavesGenericEnemy::OnStartup(self);
|
BaseWavesGenericEnemy::OnStartup(self);
|
||||||
|
|
||||||
auto combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combatAIComponent != nullptr) {
|
if (combatAIComponent != nullptr) {
|
||||||
combatAIComponent->SetDisabled(true);
|
combatAIComponent->SetDisabled(true);
|
||||||
combatAIComponent->SetStunImmune(true);
|
combatAIComponent->SetStunImmune(true);
|
||||||
@ -18,7 +18,7 @@ void
|
|||||||
WaveBossHorsemen::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
WaveBossHorsemen::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
||||||
int32_t param3) {
|
int32_t param3) {
|
||||||
if (args == "startAI") {
|
if (args == "startAI") {
|
||||||
auto combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combatAIComponent != nullptr) {
|
if (combatAIComponent != nullptr) {
|
||||||
combatAIComponent->SetDisabled(false);
|
combatAIComponent->SetDisabled(false);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
void WaveBossSpiderling::OnStartup(Entity* self) {
|
void WaveBossSpiderling::OnStartup(Entity* self) {
|
||||||
BaseWavesGenericEnemy::OnStartup(self);
|
BaseWavesGenericEnemy::OnStartup(self);
|
||||||
|
|
||||||
auto combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combatAIComponent != nullptr) {
|
if (combatAIComponent != nullptr) {
|
||||||
combatAIComponent->SetDisabled(true);
|
combatAIComponent->SetDisabled(true);
|
||||||
combatAIComponent->SetStunImmune(true);
|
combatAIComponent->SetStunImmune(true);
|
||||||
@ -17,7 +17,7 @@ void WaveBossSpiderling::OnStartup(Entity* self) {
|
|||||||
void WaveBossSpiderling::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
|
void WaveBossSpiderling::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
|
||||||
int32_t param2, int32_t param3) {
|
int32_t param2, int32_t param3) {
|
||||||
if (args == "startAI") {
|
if (args == "startAI") {
|
||||||
auto combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
|
||||||
if (combatAIComponent != nullptr) {
|
if (combatAIComponent != nullptr) {
|
||||||
combatAIComponent->SetDisabled(false);
|
combatAIComponent->SetDisabled(false);
|
||||||
combatAIComponent->SetStunImmune(false);
|
combatAIComponent->SetStunImmune(false);
|
||||||
|
@ -35,13 +35,13 @@ BootyDigServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string
|
|||||||
// Make sure players only dig up one booty per instance
|
// Make sure players only dig up one booty per instance
|
||||||
player->SetVar<bool>(u"bootyDug", true);
|
player->SetVar<bool>(u"bootyDug", true);
|
||||||
|
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
if (missionComponent != nullptr) {
|
if (missionComponent != nullptr) {
|
||||||
auto* mission = missionComponent->GetMission(1881);
|
auto* mission = missionComponent->GetMission(1881);
|
||||||
if (mission != nullptr && (mission->GetMissionState() == eMissionState::ACTIVE || mission->GetMissionState() == eMissionState::COMPLETE_ACTIVE)) {
|
if (mission != nullptr && (mission->GetMissionState() == eMissionState::ACTIVE || mission->GetMissionState() == eMissionState::COMPLETE_ACTIVE)) {
|
||||||
mission->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
|
mission->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
|
||||||
|
|
||||||
auto renderComponent = self->GetComponent<RenderComponent>();
|
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||||
if (renderComponent != nullptr)
|
if (renderComponent != nullptr)
|
||||||
renderComponent->PlayEffect(7730, u"cast", "bootyshine");
|
renderComponent->PlayEffect(7730, u"cast", "bootyshine");
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ void MaestromExtracticatorServer::OnFireEventServerSide(Entity* self, Entity* se
|
|||||||
Entity* player = EntityManager::Instance()->GetEntity(self->GetSpawnerID());
|
Entity* player = EntityManager::Instance()->GetEntity(self->GetSpawnerID());
|
||||||
if (!player) return;
|
if (!player) return;
|
||||||
|
|
||||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
if (missionComponent == nullptr) return;
|
if (missionComponent == nullptr) return;
|
||||||
|
|
||||||
missionComponent->Progress(eMissionTaskType::SMASH, 14718);
|
missionComponent->Progress(eMissionTaskType::SMASH, 14718);
|
||||||
|
@ -8,7 +8,7 @@ void AgBugsprayer::OnRebuildComplete(Entity* self, Entity* target) {
|
|||||||
|
|
||||||
void AgBugsprayer::OnTimerDone(Entity* self, std::string timerName) {
|
void AgBugsprayer::OnTimerDone(Entity* self, std::string timerName) {
|
||||||
if (timerName == "castSkill") {
|
if (timerName == "castSkill") {
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
|
|
||||||
if (skillComponent == nullptr) return;
|
if (skillComponent == nullptr) return;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ void AgCagedBricksServer::OnUse(Entity* self, Entity* user) {
|
|||||||
character->SetPlayerFlag(ePlayerFlag::CAGED_SPIDER, true);
|
character->SetPlayerFlag(ePlayerFlag::CAGED_SPIDER, true);
|
||||||
|
|
||||||
//Remove the maelstrom cube:
|
//Remove the maelstrom cube:
|
||||||
auto inv = user->GetComponent<InventoryComponent>();
|
auto* inv = user->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inv) {
|
if (inv) {
|
||||||
inv->RemoveItem(14553, 1);
|
inv->RemoveItem(14553, 1);
|
||||||
|
@ -8,7 +8,7 @@ void AgLaserSensorServer::OnStartup(Entity* self) {
|
|||||||
self->SetBoolean(u"active", true);
|
self->SetBoolean(u"active", true);
|
||||||
auto repelForce = self->GetVarAs<float>(u"repelForce");
|
auto repelForce = self->GetVarAs<float>(u"repelForce");
|
||||||
if (!repelForce) repelForce = m_RepelForce;
|
if (!repelForce) repelForce = m_RepelForce;
|
||||||
auto phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
|
auto* phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
|
||||||
if (!phantomPhysicsComponent) return;
|
if (!phantomPhysicsComponent) return;
|
||||||
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
||||||
phantomPhysicsComponent->SetEffectType(ePhysicsEffectType::REPULSE);
|
phantomPhysicsComponent->SetEffectType(ePhysicsEffectType::REPULSE);
|
||||||
@ -22,7 +22,7 @@ void AgLaserSensorServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
|||||||
if (!active) return;
|
if (!active) return;
|
||||||
auto skillCastID = self->GetVarAs<float>(u"skillCastID");
|
auto skillCastID = self->GetVarAs<float>(u"skillCastID");
|
||||||
if (skillCastID == 0) skillCastID = m_SkillCastID;
|
if (skillCastID == 0) skillCastID = m_SkillCastID;
|
||||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||||
if (!skillComponent) return;
|
if (!skillComponent) return;
|
||||||
skillComponent->CastSkill(m_SkillCastID, target->GetObjectID());
|
skillComponent->CastSkill(m_SkillCastID, target->GetObjectID());
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ void NpcAgCourseStarter::OnStartup(Entity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NpcAgCourseStarter::OnUse(Entity* self, Entity* user) {
|
void NpcAgCourseStarter::OnUse(Entity* self, Entity* user) {
|
||||||
auto scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
auto* scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
||||||
|
|
||||||
if (scriptedActivityComponent == nullptr) {
|
if (scriptedActivityComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -27,7 +27,7 @@ void NpcAgCourseStarter::OnUse(Entity* self, Entity* user) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NpcAgCourseStarter::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) {
|
void NpcAgCourseStarter::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) {
|
||||||
auto scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
auto* scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
||||||
|
|
||||||
if (scriptedActivityComponent == nullptr) {
|
if (scriptedActivityComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -70,7 +70,7 @@ void NpcAgCourseStarter::OnMessageBoxResponse(Entity* self, Entity* sender, int3
|
|||||||
|
|
||||||
void NpcAgCourseStarter::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
void NpcAgCourseStarter::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
||||||
int32_t param3) {
|
int32_t param3) {
|
||||||
auto scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
auto* scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
||||||
if (scriptedActivityComponent == nullptr)
|
if (scriptedActivityComponent == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ void NpcAgCourseStarter::OnFireEventServerSide(Entity* self, Entity* sender, std
|
|||||||
|
|
||||||
data->values[2] = *(float*)&finish;
|
data->values[2] = *(float*)&finish;
|
||||||
|
|
||||||
auto missionComponent = sender->GetComponent<MissionComponent>();
|
auto* missionComponent = sender->GetComponent<MissionComponent>();
|
||||||
if (missionComponent != nullptr) {
|
if (missionComponent != nullptr) {
|
||||||
missionComponent->ForceProgressTaskType(1884, 1, 1, false);
|
missionComponent->ForceProgressTaskType(1884, 1, 1, false);
|
||||||
missionComponent->Progress(eMissionTaskType::PERFORM_ACTIVITY, -finish, self->GetObjectID(),
|
missionComponent->Progress(eMissionTaskType::PERFORM_ACTIVITY, -finish, self->GetObjectID(),
|
||||||
|
@ -7,7 +7,7 @@ void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto inventoryComponent = target->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = target->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
if (inventoryComponent == nullptr) {
|
if (inventoryComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -12,7 +12,7 @@ void NpcNjAssistantServer::OnMissionDialogueOK(Entity* self, Entity* target, int
|
|||||||
if (missionState == eMissionState::COMPLETE || missionState == eMissionState::READY_TO_COMPLETE) {
|
if (missionState == eMissionState::COMPLETE || missionState == eMissionState::READY_TO_COMPLETE) {
|
||||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"switch", 0, 0, LWOOBJID_EMPTY, "", target->GetSystemAddress());
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"switch", 0, 0, LWOOBJID_EMPTY, "", target->GetSystemAddress());
|
||||||
|
|
||||||
auto inv = target->GetComponent<InventoryComponent>();
|
auto* inv = target->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
// If we are ready to complete our missions, we take the kit from you:
|
// If we are ready to complete our missions, we take the kit from you:
|
||||||
if (inv && missionState == eMissionState::READY_TO_COMPLETE) {
|
if (inv && missionState == eMissionState::READY_TO_COMPLETE) {
|
||||||
@ -23,7 +23,7 @@ void NpcNjAssistantServer::OnMissionDialogueOK(Entity* self, Entity* target, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (missionState == eMissionState::AVAILABLE) {
|
} else if (missionState == eMissionState::AVAILABLE) {
|
||||||
auto missionComponent = target->GetComponent<MissionComponent>();
|
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||||
missionComponent->CompleteMission(mailAchievement, true);
|
missionComponent->CompleteMission(mailAchievement, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "InventoryComponent.h"
|
#include "InventoryComponent.h"
|
||||||
|
|
||||||
void NpcPirateServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
void NpcPirateServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
||||||
auto inventory = target->GetComponent<InventoryComponent>();
|
auto* inventory = target->GetComponent<InventoryComponent>();
|
||||||
if (inventory != nullptr && missionID == 1881) {
|
if (inventory != nullptr && missionID == 1881) {
|
||||||
auto* luckyShovel = inventory->FindItemByLot(14591);
|
auto* luckyShovel = inventory->FindItemByLot(14591);
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio
|
|||||||
if (missionID != 1849 && missionID != 1883)
|
if (missionID != 1849 && missionID != 1883)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto inventory = target->GetComponent<InventoryComponent>();
|
auto* inventory = target->GetComponent<InventoryComponent>();
|
||||||
if (inventory == nullptr)
|
if (inventory == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user