mirror of
https://github.com/Squareville/wonderland-server.git
synced 2026-01-12 09:22:22 -06:00
23 lines
935 B
C++
23 lines
935 B
C++
#include "ZonePlayer.h"
|
|
#include "GameMessages.h"
|
|
#include "CharacterComponent.h"
|
|
#include "Entity.h"
|
|
#include "eStateChangeType.h"
|
|
|
|
void ZonePlayer::OnUse(Entity* self, Entity* user) {
|
|
GameMessages::SendSetStunned(user->GetObjectID(), eStateChangeType::PUSH, user->GetSystemAddress(), self->GetObjectID(),
|
|
true /* bCantAttack */,
|
|
false /* bCantEquip */,
|
|
true /* bCantInteract */,
|
|
false /* bCantJump */,
|
|
true /* bCantMove */);
|
|
|
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"ZonePlayerFromServer", 0, 0, LWOOBJID_EMPTY, "", user->GetSystemAddress());
|
|
auto* const characterComponent = user->GetComponent<CharacterComponent>();
|
|
auto* const character = user->GetCharacter();
|
|
if (characterComponent && character && self->HasVar(u"zoneID") && self->HasVar(u"spawnPoint")) {
|
|
character->SetTargetScene(self->GetVarAsString(u"spawnPoint"));
|
|
characterComponent->SendToZone(self->GetVarAs<LWOMAPID>(u"zoneID"));
|
|
}
|
|
}
|