mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-19 05:48:09 +00:00
fix: powerup drops and hardcore loot drops (#1914)
tested the following are now functional ag buff station tiki torch ve rocket part boxes ns statue property behavior extra items from full inventory hardcore drops (items and coins)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "Loot.h"
|
||||
|
||||
void GfTikiTorch::OnStartup(Entity* self) {
|
||||
LightTorch(self);
|
||||
@@ -22,7 +23,14 @@ void GfTikiTorch::OnUse(Entity* self, Entity* killer) {
|
||||
self->SetI64(u"userID", killer->GetObjectID());
|
||||
|
||||
for (int i = 0; i < m_numspawn; i++) {
|
||||
GameMessages::SendDropClientLoot(killer, self->GetObjectID(), 935, 0, self->GetPosition());
|
||||
GameMessages::DropClientLoot lootMsg{};
|
||||
lootMsg.target = killer->GetObjectID();
|
||||
lootMsg.ownerID = killer->GetObjectID();
|
||||
lootMsg.sourceID = self->GetObjectID();
|
||||
lootMsg.item = 935;
|
||||
lootMsg.count = 1;
|
||||
lootMsg.spawnPos = self->GetPosition();
|
||||
Loot::DropItem(*killer, lootMsg);
|
||||
}
|
||||
|
||||
self->AddTimer("InteractionCooldown", 4);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "TeamManager.h"
|
||||
#include "Loot.h"
|
||||
|
||||
void AgSurvivalBuffStation::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
@@ -55,7 +56,14 @@ void AgSurvivalBuffStation::OnTimerDone(Entity* self, std::string timerName) {
|
||||
for (auto memberID : team) {
|
||||
auto member = Game::entityManager->GetEntity(memberID);
|
||||
if (member != nullptr && !member->GetIsDead()) {
|
||||
GameMessages::SendDropClientLoot(member, self->GetObjectID(), powerupToDrop, 0, self->GetPosition());
|
||||
GameMessages::DropClientLoot lootMsg{};
|
||||
lootMsg.target = member->GetObjectID();
|
||||
lootMsg.ownerID = member->GetObjectID();
|
||||
lootMsg.sourceID = self->GetObjectID();
|
||||
lootMsg.item = powerupToDrop;
|
||||
lootMsg.count = 1;
|
||||
lootMsg.spawnPos = self->GetPosition();
|
||||
Loot::DropItem(*member, lootMsg, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user