diff --git a/changelog.txt b/changelog.txt index 41d858899..de7572176 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,11 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 08/31/2014 == +KLS: Fixed a bug in fishing in S3D zones +KLS: Fixed a bug in turnins with new any abstraction +KLS: Fixed a few quest related inconsistencies. +KLS: Added Lua EntityList::ChannelMessage(from, type, msg, language) + == 08/30/2014 == demonstar55: (noudess) Merchants should be more descriptive of why they don't sell to you diff --git a/ucs/database.cpp b/ucs/database.cpp index 8eb8746b3..a2f61c438 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -522,7 +522,7 @@ void Database::ExpireMail() { query = StringFormat("DELETE FROM `mail` WHERE `status`=4 AND `timestamp` < %i", time(nullptr) - RuleI(Mail, ExpireTrash)); results = QueryDatabase(query); - if(!results.Success()) + if(results.Success()) _log(UCS__ERROR, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); else _log(UCS__INIT, "Expired %i trash messages.", results.RowsAffected()); @@ -534,7 +534,7 @@ void Database::ExpireMail() { query = StringFormat("DELETE FROM `mail` WHERE `status` = 3 AND `timestamp` < %i", time(nullptr) - RuleI(Mail, ExpireRead)); results = QueryDatabase(query); - if(!results.Success()) + if(results.Success()) _log(UCS__INIT, "Expired %i read messages.", results.RowsAffected()); else _log(UCS__ERROR, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); @@ -545,7 +545,7 @@ void Database::ExpireMail() { query = StringFormat("DELETE FROM `mail` WHERE `status`=1 AND `timestamp` < %i", time(nullptr) - RuleI(Mail, ExpireUnread)); results = QueryDatabase(query); - if(!results.Success()) + if(results.Success()) _log(UCS__INIT, "Expired %i unread messages.", results.RowsAffected()); else _log(UCS__ERROR, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 9fffc6a9b..d56d8386a 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -6225,7 +6225,7 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) if(!currentdoor) { Message(0,"Unable to find door, please notify a GM (DoorID: %i).",cd->doorid); - return; + return; } char buf[20]; diff --git a/zone/embparser.cpp b/zone/embparser.cpp index f577bcb11..c7a67c388 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -1130,8 +1130,10 @@ void PerlembParser::ExportEventVariables(std::string &package_name, QuestEventID case EVENT_TRADE: { if(extra_pointers) { - for(size_t i = 0; i < extra_pointers->size(); ++i) { + size_t sz = extra_pointers->size(); + for(size_t i = 0; i < sz; ++i) { ItemInst *inst = EQEmu::any_cast(extra_pointers->at(i)); + std::string var_name = "item"; var_name += std::to_string(static_cast(i + 1)); diff --git a/zone/entity.cpp b/zone/entity.cpp index 16fbe7077..7054ba8a1 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -3242,7 +3242,8 @@ void EntityList::ProcessMove(Client *c, float x, float y, float z) for (auto iter = events.begin(); iter != events.end(); ++iter) { quest_proximity_event& evt = (*iter); if (evt.npc) { - parse->EventNPC(evt.event_id, evt.npc, evt.client, "", 0); + std::vector args; + parse->EventNPC(evt.event_id, evt.npc, evt.client, "", 0, &args); } else { std::vector args; args.push_back(&evt.area_id); diff --git a/zone/forage.cpp b/zone/forage.cpp index e85cbda4a..4a39d508d 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -235,7 +235,7 @@ bool Client::CanFish() { dest.y = RodY; dest.z = z_pos+10; - RodZ = zone->zonemap->FindBestZ(dest, nullptr) - 1; + RodZ = zone->zonemap->FindBestZ(dest, nullptr) + 4; bool in_lava = zone->watermap->InLava(RodX, RodY, RodZ); bool in_water = zone->watermap->InWater(RodX, RodY, RodZ) || zone->watermap->InVWater(RodX, RodY, RodZ); //Message(0, "Rod is at %4.3f, %4.3f, %4.3f, InWater says %d, InLava says %d", RodX, RodY, RodZ, in_water, in_lava); @@ -355,11 +355,11 @@ void Client::GoFish() safe_delete(inst); inst = m_inv.GetItem(MainCursor); } - } - std::vector args; - args.push_back(inst); - parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst != nullptr ? inst->GetItem()->ID : 0, &args); + std::vector args; + args.push_back(inst); + parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst->GetID(), &args); + } } else { @@ -469,11 +469,11 @@ void Client::ForageItem(bool guarantee) { safe_delete(inst); inst = m_inv.GetItem(MainCursor); } - } - std::vector args; - args.push_back(inst); - parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst ? inst->GetItem()->ID : 0, &args); + std::vector args; + args.push_back(inst); + parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst->GetID(), &args); + } int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems; if(!guarantee && MakeRandomInt(0,99) < ChanceSecondForage) { diff --git a/zone/lua_entity_list.cpp b/zone/lua_entity_list.cpp index 32bd9a89d..eace84a69 100644 --- a/zone/lua_entity_list.cpp +++ b/zone/lua_entity_list.cpp @@ -416,6 +416,11 @@ void Lua_EntityList::SignalAllClients(int signal) { self->SignalAllClients(signal); } +void Lua_EntityList::ChannelMessage(Lua_Mob from, int channel_num, int language, const char *message) { + Lua_Safe_Call_Void(); + self->ChannelMessage(from, channel_num, language, message); +} + luabind::scope lua_register_entity_list() { return luabind::class_("EntityList") .def(luabind::constructor<>()) @@ -479,7 +484,8 @@ luabind::scope lua_register_entity_list() { .def("GetObjectList", (Lua_Object_List(Lua_EntityList::*)(void))&Lua_EntityList::GetObjectList) .def("GetDoorsList", (Lua_Doors_List(Lua_EntityList::*)(void))&Lua_EntityList::GetDoorsList) .def("GetSpawnList", (Lua_Spawn_List(Lua_EntityList::*)(void))&Lua_EntityList::GetSpawnList) - .def("SignalAllClients", (void(Lua_EntityList::*)(int))&Lua_EntityList::SignalAllClients); + .def("SignalAllClients", (void(Lua_EntityList::*)(int))&Lua_EntityList::SignalAllClients) + .def("ChannelMessage", (void(Lua_EntityList::*)(Lua_Mob,int,int,const char*))&Lua_EntityList::ChannelMessage); } luabind::scope lua_register_mob_list() { diff --git a/zone/lua_entity_list.h b/zone/lua_entity_list.h index dc9c1a5ed..823499f24 100644 --- a/zone/lua_entity_list.h +++ b/zone/lua_entity_list.h @@ -106,6 +106,7 @@ public: Lua_Doors_List GetDoorsList(); Lua_Spawn_List GetSpawnList(); void SignalAllClients(int signal); + void ChannelMessage(Lua_Mob from, int channel_num, int language, const char *message); }; #endif diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 878f82225..ccb35f479 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -1451,11 +1451,7 @@ luabind::scope lua_register_slot() { luabind::value("General6", static_cast(MainGeneral6)), luabind::value("General7", static_cast(MainGeneral7)), luabind::value("General8", static_cast(MainGeneral8)), - //luabind::value("General9", static_cast(MainGeneral9)), - //luabind::value("General10", static_cast(MainGeneral10)), luabind::value("Cursor", static_cast(MainCursor)), - //luabind::value("EquipmentBegin", static_cast(EmuConstants::EQUIPMENT_BEGIN)), - //luabind::value("EquipmentEnd", static_cast(EmuConstants::EQUIPMENT_END)), luabind::value("PersonalBegin", static_cast(EmuConstants::GENERAL_BEGIN)), // deprecated luabind::value("GeneralBegin", static_cast(EmuConstants::GENERAL_BEGIN)), luabind::value("PersonalEnd", static_cast(EmuConstants::GENERAL_END)), // deprecated @@ -1483,7 +1479,6 @@ luabind::scope lua_register_material() { luabind::value("Secondary", static_cast(MaterialSecondary)), luabind::value("Max", static_cast(_MaterialCount)), // deprecated luabind::value("Count", static_cast(_MaterialCount)), - //luabind::value("TintCount", static_cast(_MaterialCount - 2)), luabind::value("Invalid", static_cast(_MaterialInvalid)) ]; } @@ -1498,8 +1493,7 @@ luabind::scope lua_register_client_version() { luabind::value("SoF", static_cast(EQClientSoF)), luabind::value("SoD", static_cast(EQClientSoD)), luabind::value("Underfoot", static_cast(EQClientUnderfoot)), - luabind::value("RoF", static_cast(EQClientRoF))//, - //luabind::value("RoF2", static_cast(EQClientRoF2)) + luabind::value("RoF", static_cast(EQClientRoF)) ]; } diff --git a/zone/lua_parser_events.cpp b/zone/lua_parser_events.cpp index 87155d97b..89f08a81f 100644 --- a/zone/lua_parser_events.cpp +++ b/zone/lua_parser_events.cpp @@ -54,9 +54,12 @@ void handle_npc_event_trade(QuestInterface *parse, lua_State* L, NPC* npc, Mob * ident << npc->GetNPCTypeID(); if(extra_pointers) { - for(size_t i = 0; i < extra_pointers->size(); ++i) { + size_t sz = extra_pointers->size(); + for(size_t i = 0; i < sz; ++i) { std::string prefix = "item" + std::to_string(static_cast(i + 1)); - Lua_ItemInst l_inst = EQEmu::any_cast(extra_pointers->at(i)); + ItemInst *inst = EQEmu::any_cast(extra_pointers->at(i)); + + Lua_ItemInst l_inst = inst; luabind::adl::object l_inst_o = luabind::adl::object(L, l_inst); l_inst_o.push(L); diff --git a/zone/trading.cpp b/zone/trading.cpp index ea9e36a31..c89af4010 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -871,7 +871,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st items[i - EmuConstants::TRADE_BEGIN] = inst->GetItem()->ID; item_list.push_back(inst); } else { - item_list.push_back(nullptr); + item_list.push_back((ItemInst*)nullptr); continue; }