[Quest API] Add CloneAppearance() to Perl/Lua. (#2531)

* [Quest API] Add CloneAppearance() to Perl/Lua.

# Perl
- Add `$client->CloneAppearance(other)` to Perl.
- Add `$client->CloneAppearance(other, clone_name)` to Perl.

# Lua
- Add `client:CloneAppearance(other)` to Lua.
- Add `client:CloneAppearance(other, clone_name)` to Lua.

# Notes
- Allows operators to easily clone appearance between mobs in a script without relying on a plugin or module.

* Update mob_appearance.cpp

* Update mob.cpp
This commit is contained in:
Kinglykrab
2022-11-14 14:05:05 -05:00
committed by GitHub
parent 8a449b0152
commit 31e5622dad
7 changed files with 196 additions and 27 deletions
+12
View File
@@ -2478,6 +2478,16 @@ Lua_Mob Lua_Mob::GetUltimateOwner() {
return Lua_Mob(self->GetUltimateOwner());
}
void Lua_Mob::CloneAppearance(Lua_Mob other) {
Lua_Safe_Call_Void();
self->CloneAppearance(other);
}
void Lua_Mob::CloneAppearance(Lua_Mob other, bool clone_name) {
Lua_Safe_Call_Void();
self->CloneAppearance(other, clone_name);
}
luabind::scope lua_register_mob() {
return luabind::class_<Lua_Mob, Lua_Entity>("Mob")
.def(luabind::constructor<>())
@@ -2557,6 +2567,8 @@ luabind::scope lua_register_mob() {
.def("CheckLoSToLoc", (bool(Lua_Mob::*)(double,double,double,double))&Lua_Mob::CheckLoSToLoc)
.def("CheckNumHitsRemaining", &Lua_Mob::CheckNumHitsRemaining)
.def("ClearSpecialAbilities", (void(Lua_Mob::*)(void))&Lua_Mob::ClearSpecialAbilities)
.def("CloneAppearance", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CloneAppearance)
.def("CloneAppearance", (void(Lua_Mob::*)(Lua_Mob,bool))&Lua_Mob::CloneAppearance)
.def("CombatRange", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CombatRange)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int64,int,int))&Lua_Mob::Damage)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int64,int,int,bool))&Lua_Mob::Damage)