2021-12-05 17:54:36 +00:00
|
|
|
#include "AgPicnicBlanket.h"
|
2023-01-07 05:17:05 +00:00
|
|
|
#include "Loot.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
#include "GameMessages.h"
|
2023-01-07 05:17:05 +00:00
|
|
|
#include "Entity.h"
|
2023-05-02 22:39:21 +00:00
|
|
|
#include "eTerminateType.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void AgPicnicBlanket::OnUse(Entity* self, Entity* user) {
|
2023-05-02 22:39:21 +00:00
|
|
|
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
2021-12-05 17:54:36 +00:00
|
|
|
if (self->GetVar<bool>(u"active"))
|
|
|
|
return;
|
|
|
|
self->SetVar<bool>(u"active", true);
|
|
|
|
|
|
|
|
auto lootTable = std::unordered_map<LOT, int32_t>{ {935, 3} };
|
2021-12-20 10:25:45 +00:00
|
|
|
LootGenerator::Instance().DropLoot(user, self, lootTable, 0, 0);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
self->AddCallbackTimer(5.0f, [self]() {
|
|
|
|
self->SetVar<bool>(u"active", false);
|
|
|
|
});
|
|
|
|
}
|