mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Public release of the DLU server code!
Have fun!
This commit is contained in:
15
dScripts/Binoculars.cpp
Normal file
15
dScripts/Binoculars.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user