Revert "Spell Fizzle for < LDON expansions via lua_mod (#1118)"

This reverts commit e9d312fa86.
This commit is contained in:
Akkadius
2020-10-25 23:48:57 -05:00
parent 62efae2e00
commit ee7ef97506
8 changed files with 0 additions and 259 deletions
-6
View File
@@ -485,11 +485,6 @@ int Lua_Client::GetRawSkill(int skill_id) {
return self->GetRawSkill(static_cast<EQ::skills::SkillType>(skill_id));
}
int Lua_Client::GetSkill(int skill_id) {
Lua_Safe_Call_Int();
return self->GetSkill(static_cast<EQ::skills::SkillType>(skill_id));
}
bool Lua_Client::HasSkill(int skill_id) {
Lua_Safe_Call_Bool();
return self->HasSkill(static_cast<EQ::skills::SkillType>(skill_id));
@@ -1735,7 +1730,6 @@ luabind::scope lua_register_client() {
.def("IncreaseLanguageSkill", (void(Lua_Client::*)(int))&Lua_Client::IncreaseLanguageSkill)
.def("IncreaseLanguageSkill", (void(Lua_Client::*)(int,int))&Lua_Client::IncreaseLanguageSkill)
.def("GetRawSkill", (int(Lua_Client::*)(int))&Lua_Client::GetRawSkill)
.def("GetSkill", (int(Lua_Client::*)(int))&Lua_Client::GetSkill)
.def("HasSkill", (bool(Lua_Client::*)(int))&Lua_Client::HasSkill)
.def("CanHaveSkill", (bool(Lua_Client::*)(int))&Lua_Client::CanHaveSkill)
.def("SetSkill", (void(Lua_Client::*)(int,int))&Lua_Client::SetSkill)
-1
View File
@@ -122,7 +122,6 @@ public:
void IncreaseLanguageSkill(int skill_id);
void IncreaseLanguageSkill(int skill_id, int value);
int GetRawSkill(int skill_id);
int GetSkill(int skill_id);
bool HasSkill(int skill_id);
bool CanHaveSkill(int skill_id);
void SetSkill(int skill_id, int value);
-55
View File
@@ -632,59 +632,4 @@ void LuaMod::GetExperienceForKill(Client *self, Mob *against, uint32 &returnValu
}
}
void LuaMod::CheckFizzle(Client *self, uint16 &spell_id, SPDat_Spell_Struct spell_struct, bool &returnValue, bool &ignoreDefault) {
int start = lua_gettop(L);
try {
if (!m_has_check_fizzle) {
return;
}
lua_getfield(L, LUA_REGISTRYINDEX, package_name_.c_str());
lua_getfield(L, -1, "CheckFizzle");
Lua_Client l_self(self);
luabind::adl::object e = luabind::newtable(L);
e["self"] = l_self;
e["spell_id"] = spell_id;
e.push(L);
Lua_Spell l_spell(&spell_struct);
auto l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
if (lua_pcall(L, 1, 1, 0)) {
std::string error = lua_tostring(L, -1);
parser_->AddError(error);
lua_pop(L, 1);
return;
}
if (lua_type(L, -1) == LUA_TTABLE) {
luabind::adl::object ret(luabind::from_stack(L, -1));
auto IgnoreDefaultObj = ret["IgnoreDefault"];
if (luabind::type(IgnoreDefaultObj) == LUA_TBOOLEAN) {
ignoreDefault = ignoreDefault || luabind::object_cast<bool>(IgnoreDefaultObj);
}
auto returnValueObj = ret["ReturnValue"];
if (luabind::type(returnValueObj) == LUA_TBOOLEAN) {
returnValue = returnValue || luabind::object_cast<bool>(returnValueObj);
}
}
}
catch (std::exception& ex) {
parser_->AddError(ex.what());
}
int end = lua_gettop(L);
int n = end - start;
if (n > 0) {
lua_pop(L, n);
}
}
#endif
-2
View File
@@ -26,7 +26,6 @@ public:
void GetRequiredAAExperience(Client *self, uint32 &returnValue, bool &ignoreDefault);
void GetEXPForLevel(Client *self, uint16 level, uint32 &returnValue, bool &ignoreDefault);
void GetExperienceForKill(Client *self, Mob *against, uint32 &returnValue, bool &ignoreDefault);
void CheckFizzle(Client *self, uint16 &spell_id, SPDat_Spell_Struct spell_struct, bool &returnValue, bool &ignoreDefault);
private:
LuaParser *parser_;
lua_State *L;
@@ -41,5 +40,4 @@ private:
bool m_has_get_required_aa_experience;
bool m_has_get_exp_for_level;
bool m_has_get_experience_for_kill;
bool m_has_check_fizzle;
};
-9
View File
@@ -1377,13 +1377,4 @@ uint32 LuaParser::GetExperienceForKill(Client *self, Mob *against, bool &ignoreD
return retval;
}
bool LuaParser::CheckFizzle(Client *self, uint16 &spell_id, SPDat_Spell_Struct spell_struct, bool &ignoreDefault)
{
bool retValue = false;
for (auto &mod : mods_) {
mod.CheckFizzle(self, spell_id, spell_struct, retValue, ignoreDefault);
}
return retValue;
}
#endif
-2
View File
@@ -99,8 +99,6 @@ public:
uint32 GetRequiredAAExperience(Client *self, bool &ignoreDefault);
uint32 GetEXPForLevel(Client *self, uint16 level, bool &ignoreDefault);
uint32 GetExperienceForKill(Client *self, Mob *against, bool &ignoreDefault);
bool CheckFizzle(Client *self, uint16 &spell_id, SPDat_Spell_Struct spell_struct, bool &ignoreDefault);
private:
LuaParser();
-11
View File
@@ -82,7 +82,6 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "string_ids.h"
#include "worldserver.h"
#include "fastmath.h"
#include "lua_parser.h"
#include <assert.h>
#include <math.h>
@@ -735,16 +734,6 @@ bool Mob::CheckFizzle(uint16 spell_id)
bool Client::CheckFizzle(uint16 spell_id)
{
#ifdef LUA_EQEMU
bool ignoreDefault = false;
bool fizzle = LuaParser::Instance()->CheckFizzle(this, spell_id, spells[spell_id], ignoreDefault);
if (!fizzle) {
return false;
} else if (ignoreDefault) {
return true;
}
#endif
// GMs don't fizzle
if (GetGM()) return(true);