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} };
|
2023-10-09 20:33:22 +00:00
|
|
|
Loot::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);
|
|
|
|
});
|
|
|
|
}
|