[Quest API] Sit method (#1449)

* quest api sit method

* alphabetical

* Fix

* fix again

* Ok real fix unprivated

* Add Lua Export

Co-authored-by: ProducerZekServer <go@away.com>
Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Gangsta 2021-08-01 18:58:05 -07:00 committed by GitHub
parent bb3c918eac
commit 38a84cae93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 2 deletions

View File

@ -2010,6 +2010,10 @@ void Client::Stand() {
SetAppearance(eaStanding, false);
}
void Client::Sit() {
SetAppearance(eaSitting, false);
}
void Client::ChangeLastName(const char* in_lastname) {
memset(m_pp.last_name, 0, sizeof(m_pp.last_name));
strn0cpy(m_pp.last_name, in_lastname, sizeof(m_pp.last_name));

View File

@ -394,6 +394,7 @@ public:
void Duck();
void Stand();
void Sit();
virtual void SetMaxHP();
int32 LevelRegen();

View File

@ -94,6 +94,11 @@ void Lua_Client::Duck() {
self->Duck();
}
void Lua_Client::Sit() {
Lua_Safe_Call_Void();
self->Sit();
}
void Lua_Client::DyeArmorBySlot(uint8 slot, uint8 red, uint8 green, uint8 blue) {
Lua_Safe_Call_Void();
self->DyeArmorBySlot(slot, red, green, blue);
@ -2080,7 +2085,7 @@ void Lua_Client::SetAAEXPModifier(uint32 zone_id, double aa_modifier) {
void Lua_Client::SetEXPModifier(uint32 zone_id, double exp_modifier) {
Lua_Safe_Call_Void();
self->SetEXPModifier(zone_id, exp_modifier);
self->SetEXPModifier(zone_id, exp_modifier);
}
void Lua_Client::AddLDoNLoss(uint32 theme_id) {
@ -2181,6 +2186,7 @@ luabind::scope lua_register_client() {
.def("SetAFK", (void(Lua_Client::*)(uint8))&Lua_Client::SetAFK)
.def("GetAnon", (int(Lua_Client::*)(void))&Lua_Client::GetAnon)
.def("SetAnon", (void(Lua_Client::*)(uint8))&Lua_Client::SetAnon)
.def("Sit", (void(Lua_Client::*)(void))&Lua_Client::Sit)
.def("Duck", (void(Lua_Client::*)(void))&Lua_Client::Duck)
.def("DyeArmorBySlot", (void(Lua_Client::*)(uint8,uint8,uint8,uint8))&Lua_Client::DyeArmorBySlot)
.def("DyeArmorBySlot", (void(Lua_Client::*)(uint8,uint8,uint8,uint8,uint8))&Lua_Client::DyeArmorBySlot)

View File

@ -31,6 +31,7 @@ public:
}
void SendSound();
void Sit();
void Save();
void Save(int commit_now);
void SaveBackup();
@ -56,7 +57,7 @@ public:
bool GetGM();
void SetBaseClass(int v);
void SetBaseRace(int v);
void SetBaseGender(int v);
void SetBaseGender(int v);
int GetClassBitmask();
int GetRaceBitmask();
int GetBaseFace();

View File

@ -2111,6 +2111,19 @@ XS(XS_Client_IsStanding)
XSRETURN(1);
}
XS(XS_Client_Sit);
XS(XS_Client_Sit) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Client::Sit(THIS)");
{
Client *THIS;
VALIDATE_THIS_IS_CLIENT;
THIS->Sit();
}
XSRETURN_EMPTY;
}
XS(XS_Client_IsSitting); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_IsSitting) {
dXSARGS;
@ -5702,6 +5715,7 @@ XS(boot_Client) {
newXSproto(strcpy(buf, "SetTitleSuffix"), XS_Client_SetTitleSuffix, file, "$$;$");
newXSproto(strcpy(buf, "SetZoneFlag"), XS_Client_SetZoneFlag, file, "$$");
newXSproto(strcpy(buf, "SilentMessage"), XS_Client_SilentMessage, file, "$$");
newXSproto(strcpy(buf, "Sit"), XS_Client_Sit, file, "$");
newXSproto(strcpy(buf, "SlotConvert2"), XS_Client_SlotConvert2, file, "$$");
newXSproto(strcpy(buf, "Stand"), XS_Client_Stand, file, "$");
newXSproto(strcpy(buf, "SummonItem"), XS_Client_SummonItem, file, "$$;$$$$$$$$");