mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-10 02:08:20 +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
567 B
C++
16 lines
567 B
C++
#include "Binoculars.h"
|
|
#include "Character.h"
|
|
#include "GameMessages.h"
|
|
#include "Game.h"
|
|
#include "dServer.h"
|
|
|
|
void Binoculars::OnUse(Entity* self, Entity* user) {
|
|
const auto number = self->GetVarAsString(u"number");
|
|
|
|
int32_t flag = std::stoi(std::to_string(Game::server->GetZoneID()).substr(0, 2) + number);
|
|
if (user->GetCharacter()->GetPlayerFlag(flag) == false) {
|
|
user->GetCharacter()->SetPlayerFlag(flag, true);
|
|
GameMessages::SendFireEventClientSide(self->GetObjectID(), user->GetSystemAddress(), u"achieve", LWOOBJID_EMPTY, 0, -1, LWOOBJID_EMPTY);
|
|
}
|
|
}
|