mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
Merge pull request #553 Fix Crux Prime Teapot
Add crux prime tea pot server script
This commit is contained in:
commit
85cd8c8833
15
dScripts/AmTeapotServer.cpp
Normal file
15
dScripts/AmTeapotServer.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#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());
|
||||
}
|
10
dScripts/AmTeapotServer.h
Normal file
10
dScripts/AmTeapotServer.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class AmTeapotServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
private:
|
||||
LOT BLUE_FLOWER_LEAVES = 12317;
|
||||
LOT WU_S_IMAGINATION_TEA = 12109;
|
||||
};
|
@ -226,6 +226,7 @@
|
||||
#include "AmSkullkinTower.h"
|
||||
#include "AmDarklingDragon.h"
|
||||
#include "AmBlueX.h"
|
||||
#include "AmTeapotServer.h"
|
||||
|
||||
// NJ Scripts
|
||||
#include "NjGarmadonCelebration.h"
|
||||
@ -704,6 +705,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
||||
script = new BaseEnemyApe();
|
||||
else if (scriptName == "scripts\\02_server\\Map\\AM\\L_BLUE_X.lua")
|
||||
script = new AmBlueX();
|
||||
else if (scriptName == "scripts\\02_server\\Map\\AM\\L_TEAPOT_SERVER.lua")
|
||||
script = new AmTeapotServer();
|
||||
|
||||
// Ninjago
|
||||
else if (scriptName == "scripts\\02_server\\Map\\njhub\\L_GARMADON_CELEBRATION_SERVER.lua")
|
||||
|
Loading…
Reference in New Issue
Block a user