mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-09 22:20:24 +00:00
Merge branch 'build' into feature/remove_boost
This commit is contained in:
+103
-7
@@ -267,6 +267,11 @@ void Lua_Mob::ChangeSize(double in_size, bool no_restriction) {
|
||||
self->ChangeSize(static_cast<float>(in_size), no_restriction);
|
||||
}
|
||||
|
||||
void Lua_Mob::RandomizeFeatures(bool send_illusion, bool save_variables) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RandomizeFeatures(send_illusion, save_variables);
|
||||
}
|
||||
|
||||
void Lua_Mob::GMMove(double x, double y, double z) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->GMMove(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z));
|
||||
@@ -317,6 +322,16 @@ bool Lua_Mob::FindBuff(int spell_id) {
|
||||
return self->FindBuff(spell_id);
|
||||
}
|
||||
|
||||
uint16 Lua_Mob::FindBuffBySlot(int slot) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->FindBuffBySlot(slot);
|
||||
}
|
||||
|
||||
uint32 Lua_Mob::BuffCount() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->BuffCount();
|
||||
}
|
||||
|
||||
bool Lua_Mob::FindType(int type) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->FindType(type);
|
||||
@@ -728,9 +743,9 @@ void Lua_Mob::Message(int type, const char *message) {
|
||||
self->Message(type, message);
|
||||
}
|
||||
|
||||
void Lua_Mob::Message_StringID(int type, int string_id, uint32 distance) {
|
||||
void Lua_Mob::MessageString(int type, int string_id, uint32 distance) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Message_StringID(type, string_id, distance);
|
||||
self->MessageString(type, string_id, distance);
|
||||
}
|
||||
|
||||
void Lua_Mob::Say(const char *message) {
|
||||
@@ -738,9 +753,72 @@ void Lua_Mob::Say(const char *message) {
|
||||
self->Say(message);
|
||||
}
|
||||
|
||||
void Lua_Mob::Say(const char* message, int language) {
|
||||
Lua_Safe_Call_Void();
|
||||
entity_list.ChannelMessage(self, ChatChannel_Say, language, message); // these run through the client channels and probably shouldn't for NPCs, but oh well
|
||||
}
|
||||
|
||||
void Lua_Mob::QuestSay(Lua_Client client, const char *message) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->QuestJournalledSay(client, message);
|
||||
Journal::Options journal_opts;
|
||||
journal_opts.speak_mode = Journal::SpeakMode::Say;
|
||||
journal_opts.journal_mode = RuleB(NPC, EnableNPCQuestJournal) ? Journal::Mode::Log2 : Journal::Mode::None;
|
||||
journal_opts.language = 0;
|
||||
journal_opts.message_type = Chat::NPCQuestSay;
|
||||
journal_opts.target_spawn_id = 0;
|
||||
self->QuestJournalledSay(client, message, journal_opts);
|
||||
}
|
||||
|
||||
void Lua_Mob::QuestSay(Lua_Client client, const char *message, luabind::adl::object opts) {
|
||||
Lua_Safe_Call_Void();
|
||||
|
||||
Journal::Options journal_opts;
|
||||
// defaults
|
||||
journal_opts.speak_mode = Journal::SpeakMode::Say;
|
||||
journal_opts.journal_mode = Journal::Mode::Log2;
|
||||
journal_opts.language = 0;
|
||||
journal_opts.message_type = Chat::NPCQuestSay;
|
||||
journal_opts.target_spawn_id = 0;
|
||||
|
||||
if (luabind::type(opts) == LUA_TTABLE) {
|
||||
auto cur = opts["speak_mode"];
|
||||
if (luabind::type(cur) != LUA_TNIL) {
|
||||
try {
|
||||
journal_opts.speak_mode = static_cast<Journal::SpeakMode>(luabind::object_cast<int>(cur));
|
||||
} catch (luabind::cast_failed) {
|
||||
}
|
||||
}
|
||||
|
||||
cur = opts["journal_mode"];
|
||||
if (luabind::type(cur) != LUA_TNIL) {
|
||||
try {
|
||||
journal_opts.journal_mode = static_cast<Journal::Mode>(luabind::object_cast<int>(cur));
|
||||
} catch (luabind::cast_failed) {
|
||||
}
|
||||
}
|
||||
|
||||
cur = opts["language"];
|
||||
if (luabind::type(cur) != LUA_TNIL) {
|
||||
try {
|
||||
journal_opts.language = luabind::object_cast<int>(cur);
|
||||
} catch (luabind::cast_failed) {
|
||||
}
|
||||
}
|
||||
|
||||
cur = opts["message_type"];
|
||||
if (luabind::type(cur) != LUA_TNIL) {
|
||||
try {
|
||||
journal_opts.message_type = luabind::object_cast<int>(cur);
|
||||
} catch (luabind::cast_failed) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if rule disables it, we override provided
|
||||
if (!RuleB(NPC, EnableNPCQuestJournal))
|
||||
journal_opts.journal_mode = Journal::Mode::None;
|
||||
|
||||
self->QuestJournalledSay(client, message, journal_opts);
|
||||
}
|
||||
|
||||
void Lua_Mob::Shout(const char *message) {
|
||||
@@ -748,6 +826,11 @@ void Lua_Mob::Shout(const char *message) {
|
||||
self->Shout(message);
|
||||
}
|
||||
|
||||
void Lua_Mob::Shout(const char* message, int language) {
|
||||
Lua_Safe_Call_Void();
|
||||
entity_list.ChannelMessage(self, ChatChannel_Shout, language, message);
|
||||
}
|
||||
|
||||
void Lua_Mob::Emote(const char *message) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Emote(message);
|
||||
@@ -2086,6 +2169,11 @@ int Lua_Mob::GetWeaponDamageBonus(Lua_Item weapon, bool offhand) {
|
||||
return self->GetWeaponDamageBonus(weapon, offhand);
|
||||
}
|
||||
|
||||
int Lua_Mob::GetItemStat(uint32 itemid, const char* identifier) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetItemStat(itemid, identifier);
|
||||
}
|
||||
|
||||
Lua_StatBonuses Lua_Mob::GetItemBonuses()
|
||||
{
|
||||
Lua_Safe_Call_Class(Lua_StatBonuses);
|
||||
@@ -2202,6 +2290,7 @@ luabind::scope lua_register_mob() {
|
||||
.def("DoAnim", (void(Lua_Mob::*)(int,int,bool,int))&Lua_Mob::DoAnim)
|
||||
.def("ChangeSize", (void(Lua_Mob::*)(double))&Lua_Mob::ChangeSize)
|
||||
.def("ChangeSize", (void(Lua_Mob::*)(double,bool))&Lua_Mob::ChangeSize)
|
||||
.def("RandomizeFeatures", (void(Lua_Mob::*)(bool,bool))&Lua_Mob::RandomizeFeatures)
|
||||
.def("GMMove", (void(Lua_Mob::*)(double,double,double))&Lua_Mob::GMMove)
|
||||
.def("GMMove", (void(Lua_Mob::*)(double,double,double,double))&Lua_Mob::GMMove)
|
||||
.def("GMMove", (void(Lua_Mob::*)(double,double,double,double,bool))&Lua_Mob::GMMove)
|
||||
@@ -2212,6 +2301,8 @@ luabind::scope lua_register_mob() {
|
||||
.def("IsInvisible", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsInvisible)
|
||||
.def("SetInvisible", &Lua_Mob::SetInvisible)
|
||||
.def("FindBuff", &Lua_Mob::FindBuff)
|
||||
.def("FindBuffBySlot", (uint16(Lua_Mob::*)(int))&Lua_Mob::FindBuffBySlot)
|
||||
.def("BuffCount", &Lua_Mob::BuffCount)
|
||||
.def("FindType", (bool(Lua_Mob::*)(int))&Lua_Mob::FindType)
|
||||
.def("FindType", (bool(Lua_Mob::*)(int,bool))&Lua_Mob::FindType)
|
||||
.def("FindType", (bool(Lua_Mob::*)(int,bool,int))&Lua_Mob::FindType)
|
||||
@@ -2242,6 +2333,7 @@ luabind::scope lua_register_mob() {
|
||||
.def("IsWarriorClass", &Lua_Mob::IsWarriorClass)
|
||||
.def("GetHP", &Lua_Mob::GetHP)
|
||||
.def("GetMaxHP", &Lua_Mob::GetMaxHP)
|
||||
.def("GetItemStat", (int(Lua_Mob::*)(uint32,const char*))&Lua_Mob::GetItemStat)
|
||||
.def("GetItemHPBonuses", &Lua_Mob::GetItemHPBonuses)
|
||||
.def("GetSpellHPBonuses", &Lua_Mob::GetSpellHPBonuses)
|
||||
.def("GetWalkspeed", &Lua_Mob::GetWalkspeed)
|
||||
@@ -2294,10 +2386,14 @@ luabind::scope lua_register_mob() {
|
||||
.def("SetCurrentWP", &Lua_Mob::SetCurrentWP)
|
||||
.def("GetSize", &Lua_Mob::GetSize)
|
||||
.def("Message", &Lua_Mob::Message)
|
||||
.def("Message_StringID", &Lua_Mob::Message_StringID)
|
||||
.def("Say", &Lua_Mob::Say)
|
||||
.def("QuestSay", &Lua_Mob::QuestSay)
|
||||
.def("Shout", &Lua_Mob::Shout)
|
||||
.def("MessageString", &Lua_Mob::MessageString)
|
||||
.def("Message_StringID", &Lua_Mob::MessageString)
|
||||
.def("Say", (void(Lua_Mob::*)(const char*))& Lua_Mob::Say)
|
||||
.def("Say", (void(Lua_Mob::*)(const char*, int))& Lua_Mob::Say)
|
||||
.def("QuestSay", (void(Lua_Mob::*)(Lua_Client,const char *))&Lua_Mob::QuestSay)
|
||||
.def("QuestSay", (void(Lua_Mob::*)(Lua_Client,const char *,luabind::adl::object))&Lua_Mob::QuestSay)
|
||||
.def("Shout", (void(Lua_Mob::*)(const char*))& Lua_Mob::Shout)
|
||||
.def("Shout", (void(Lua_Mob::*)(const char*, int))& Lua_Mob::Shout)
|
||||
.def("Emote", &Lua_Mob::Emote)
|
||||
.def("InterruptSpell", (void(Lua_Mob::*)(void))&Lua_Mob::InterruptSpell)
|
||||
.def("InterruptSpell", (void(Lua_Mob::*)(int))&Lua_Mob::InterruptSpell)
|
||||
|
||||
Reference in New Issue
Block a user