mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-28 08:27:22 +00:00
8d37d9b681
* Organize dScripts whitespace Remove parent scope Remove parent scope from initial setter Remove debug Remove helper programs * Fix NtImagimeterVisibility script Co-authored-by: aronwk-aaron <aronwk.aaron@gmail.com>
16 lines
536 B
C++
16 lines
536 B
C++
#include "AmTeapotServer.h"
|
|
#include "InventoryComponent.h"
|
|
#include "GameMessages.h"
|
|
|
|
|
|
void AmTeapotServer::OnUse(Entity* self, Entity* user) {
|
|
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
|
|
if (!inventoryComponent) return;
|
|
|
|
if (inventoryComponent->GetLotCount(BLUE_FLOWER_LEAVES) >= 10) {
|
|
inventoryComponent->RemoveItem(BLUE_FLOWER_LEAVES, 10);
|
|
inventoryComponent->AddItem(WU_S_IMAGINATION_TEA, 1);
|
|
}
|
|
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
|
}
|