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"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void AgPicnicBlanket::OnUse(Entity* self, Entity* user) {
|
|
|
|
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
}
|