mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-22 15:28:07 +00:00
Public release of the DLU server code!
Have fun!
This commit is contained in:
25
dScripts/VeMissionConsole.cpp
Normal file
25
dScripts/VeMissionConsole.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "VeMissionConsole.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "Character.h"
|
||||
#include "GameMessages.h"
|
||||
|
||||
void VeMissionConsole::OnUse(Entity *self, Entity *user) {
|
||||
Loot::DropActivityLoot(user, self, 12551);
|
||||
|
||||
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
|
||||
if (inventoryComponent != nullptr) {
|
||||
inventoryComponent->AddItem(12547, 1); // Add the panel required for pickup
|
||||
}
|
||||
|
||||
// The flag to set is 101<number>
|
||||
const auto flagNumber = self->GetVar<std::u16string>(m_NumberVariable);
|
||||
const auto flag = std::stoi("101" + GeneralUtils::UTF16ToWTF8(flagNumber));
|
||||
|
||||
auto* character = user->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
character->SetPlayerFlag(flag, true);
|
||||
}
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"");
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
Reference in New Issue
Block a user