From c5e4bb08f4e1a4b740af20c0a7aa36e655b38058 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 10 Feb 2018 22:15:21 -0500 Subject: [PATCH 01/10] Implement global loot system Fixes #619 This should allow us to emulate lives global tables The options available to filter tables are min_level, max_level, race, rare, raid, race, class, bodytype, and zone. race, class, bodytype, and zone are a pipe | separated list of IDs --- changelog.txt | 10 ++ common/version.h | 2 +- utils/sql/db_update_manifest.txt | 1 + .../git/required/2018_02_10_GlobalLoot.sql | 19 ++++ zone/CMakeLists.txt | 2 + zone/command.cpp | 26 ++++- zone/command.h | 2 + zone/forage.cpp | 25 +++-- zone/global_loot_manager.cpp | 98 ++++++++++++++++ zone/global_loot_manager.h | 61 ++++++++++ zone/loottables.cpp | 105 ++++++++++++++++-- zone/mob.cpp | 1 + zone/mob.h | 3 + zone/npc.cpp | 3 + zone/npc.h | 3 + zone/questmgr.cpp | 8 ++ zone/spawn2.cpp | 2 + zone/trap.cpp | 6 +- zone/zone.cpp | 4 + zone/zone.h | 8 ++ zone/zonedb.cpp | 7 +- zone/zonedb.h | 1 + zone/zonedump.h | 2 + 23 files changed, 372 insertions(+), 27 deletions(-) create mode 100644 utils/sql/git/required/2018_02_10_GlobalLoot.sql create mode 100644 zone/global_loot_manager.cpp create mode 100644 zone/global_loot_manager.h diff --git a/changelog.txt b/changelog.txt index a7e75de62..a700ded31 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,15 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 02/10/2018 == +mackal: Add Global Loot system + +This will allow us to implement global loot similarly to how it works on live +This system reuses our current loottable tables which the global_loot table references. +The limits for the rules to govern if a table should be rolled are min level, max level, rare, +raid, race, class, bodytype, and zone + +race, class, bodytype, and zone are a pipe | separated list of IDs. + == 01/31/2018 == Uleat: Re-work of Bot::AI_Process(). Overall behavior is much improved. - Removed a 'ton' of unneeded packet updates diff --git a/common/version.h b/common/version.h index a79766ec3..928592a4a 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9118 +#define CURRENT_BINARY_DATABASE_VERSION 9119 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9018 #else diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 8463d979f..188db2162 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -372,6 +372,7 @@ 9116|2017_12_16_GroundSpawn_Respawn_Timer.sql|SHOW COLUMNS FROM `ground_spawns` WHERE Field = 'respawn_timer' AND Type = 'int(11) unsigned'|empty| 9117|2018_02_01_NPC_Spells_Min_Max_HP.sql|SHOW COLUMNS FROM `npc_spells_entries` LIKE 'min_hp'|empty| 9118|2018_02_04_Charm_Stats.sql|SHOW COLUMNS FROM `npc_types` LIKE 'charm_ac'|empty| +9119|2018_02_10_GlobalLoot.sql|SHOW TABLES LIKE 'global_loot'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/required/2018_02_10_GlobalLoot.sql b/utils/sql/git/required/2018_02_10_GlobalLoot.sql new file mode 100644 index 000000000..573ab8f71 --- /dev/null +++ b/utils/sql/git/required/2018_02_10_GlobalLoot.sql @@ -0,0 +1,19 @@ +ALTER TABLE `npc_types` ADD `skip_global_loot` TINYINT DEFAULT '0'; +ALTER TABLE `npc_types` ADD `rare_spawn` TINYINT DEFAULT '0'; + +CREATE TABLE global_loot ( + id INT NOT NULL AUTO_INCREMENT, + description varchar(255), + loottable_id INT NOT NULL, + enabled TINYINT NOT NULL DEFAULT 1, + min_level INT NOT NULL DEFAULT 0, + max_level INT NOT NULL DEFAULT 0, + rare TINYINT NULL, + raid TINYINT NULL, + race MEDIUMTEXT NULL, + class MEDIUMTEXT NULL, + bodytype MEDIUMTEXT NULL, + zone MEDIUMTEXT NULL, + PRIMARY KEY (id) +); + diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 0171c8eb9..49644cfcf 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -68,6 +68,7 @@ SET(zone_sources exp.cpp fearpath.cpp forage.cpp + global_loot_manager.cpp groups.cpp guild.cpp guild_mgr.cpp @@ -158,6 +159,7 @@ SET(zone_headers errmsg.h event_codes.h forage.h + global_loot_manager.h groups.h guild_mgr.h hate_list.h diff --git a/zone/command.cpp b/zone/command.cpp index 5b45f3a69..7a4366a4f 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -358,9 +358,11 @@ int command_init(void) command_add("showbonusstats", "[item|spell|all] Shows bonus stats for target from items or spells. Shows both by default.", 50, command_showbonusstats) || command_add("showbuffs", "- List buffs active on your target or you if no target", 50, command_showbuffs) || command_add("shownumhits", "Shows buffs numhits for yourself.", 0, command_shownumhits) || + command_add("shownpcgloballoot", "Show GlobalLoot entires on this npc", 50, command_shownpcgloballoot) || command_add("showskills", "- Show the values of your or your player target's skills", 50, command_showskills) || command_add("showspellslist", "Shows spell list of targeted NPC", 100, command_showspellslist) || command_add("showstats", "- Show details about you or your target", 50, command_showstats) || + command_add("showzonegloballoot", "Show GlobalLoot entires on this zone", 50, command_showzonegloballoot) || command_add("shutdown", "- Shut this zone process down", 150, command_shutdown) || command_add("size", "[size] - Change size of you or your target", 50, command_size) || command_add("spawn", "[name] [race] [level] [material] [hp] [gender] [class] [priweapon] [secweapon] [merchantid] - Spawn an NPC", 10, command_spawn) || @@ -2458,7 +2460,9 @@ void command_npctypespawn(Client *c, const Seperator *sep) if (npc && sep->IsNumber(2)) npc->SetNPCFactionID(atoi(sep->arg[2])); - npc->AddLootTable(); + npc->AddLootTable(); + if (npc->DropsGlobalLoot()) + npc->CheckGlobalLootTables(); entity_list.AddNPC(npc); } else @@ -3857,6 +3861,12 @@ void command_showstats(Client *c, const Seperator *sep) c->ShowStats(c); } +void command_showzonegloballoot(Client *c, const Seperator *sep) +{ + c->Message(0, "GlobalLoot for %s (%d:%d)", zone->GetShortName(), zone->GetZoneID(), zone->GetInstanceVersion()); + zone->ShowZoneGlobalLoot(c); +} + void command_mystats(Client *c, const Seperator *sep) { if (c->GetTarget() && c->GetPet()) { @@ -10441,6 +10451,20 @@ void command_shownumhits(Client *c, const Seperator *sep) return; } +void command_shownpcgloballoot(Client *c, const Seperator *sep) +{ + auto tar = c->GetTarget(); + + if (!tar || !tar->IsNPC()) { + c->Message(0, "You must target an NPC to use this command."); + return; + } + + auto npc = tar->CastToNPC(); + c->Message(0, "GlobalLoot for %s (%d)", npc->GetName(), npc->GetNPCTypeID()); + zone->ShowNPCGlobalLoot(c, npc); +} + void command_tune(Client *c, const Seperator *sep) { //Work in progress - Kayen diff --git a/zone/command.h b/zone/command.h index 8f6257949..b8d688a54 100644 --- a/zone/command.h +++ b/zone/command.h @@ -267,10 +267,12 @@ void command_setxp(Client *c, const Seperator *sep); void command_showbonusstats(Client *c, const Seperator *sep); void command_showbuffs(Client *c, const Seperator *sep); void command_shownumhits(Client *c, const Seperator *sep); +void command_shownpcgloballoot(Client *c, const Seperator *sep); void command_showpetspell(Client *c, const Seperator *sep); void command_showskills(Client *c, const Seperator *sep); void command_showspellslist(Client *c, const Seperator *sep); void command_showstats(Client *c, const Seperator *sep); +void command_showzonegloballoot(Client *c, const Seperator *sep); void command_shutdown(Client *c, const Seperator *sep); void command_size(Client *c, const Seperator *sep); void command_spawn(Client *c, const Seperator *sep); diff --git a/zone/forage.cpp b/zone/forage.cpp index be93d39ae..4dc3bc04f 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -277,20 +277,23 @@ void Client::GoFish() food_id = database.GetZoneFishing(m_pp.zone_id, fishing_skill, npc_id, npc_chance); //check for add NPC - if(npc_chance > 0 && npc_id) { - if(npc_chance < zone->random.Int(0, 99)) { - const NPCType* tmp = database.LoadNPCTypesData(npc_id); - if(tmp != nullptr) { - auto positionNPC = GetPosition(); - positionNPC.x = positionNPC.x + 3; - auto npc = new NPC(tmp, nullptr, positionNPC, FlyMode3); - npc->AddLootTable(); + if (npc_chance > 0 && npc_id) { + if (npc_chance < zone->random.Int(0, 99)) { + const NPCType *tmp = database.LoadNPCTypesData(npc_id); + if (tmp != nullptr) { + auto positionNPC = GetPosition(); + positionNPC.x = positionNPC.x + 3; + auto npc = new NPC(tmp, nullptr, positionNPC, FlyMode3); + npc->AddLootTable(); + if (npc->DropsGlobalLoot()) + npc->CheckGlobalLootTables(); - npc->AddToHateList(this, 1, 0, false); // no help yelling + npc->AddToHateList(this, 1, 0, false); // no help yelling - entity_list.AddNPC(npc); + entity_list.AddNPC(npc); - Message(MT_Emote, "You fish up a little more than you bargained for..."); + Message(MT_Emote, + "You fish up a little more than you bargained for..."); } } } diff --git a/zone/global_loot_manager.cpp b/zone/global_loot_manager.cpp new file mode 100644 index 000000000..8e990c0ac --- /dev/null +++ b/zone/global_loot_manager.cpp @@ -0,0 +1,98 @@ +#include "global_loot_manager.h" +#include "npc.h" +#include "client.h" + +std::vector GlobalLootManager::GetGlobalLootTables(NPC *mob) const +{ + // we may be able to add a cache here if performance is an issue, but for now + // just return NRVO'd vector + // The cache would have to be keyed by NPCType and level (for NPCs with Max Level set) + std::vector tables; + + for (auto &e : m_entries) { + if (e.PassesRules(mob)) { + tables.push_back(e.GetLootTableID()); + } + } + + return tables; +} + +void GlobalLootManager::ShowZoneGlobalLoot(Client *to) const +{ + for (auto &e : m_entries) + to->Message(0, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID()); +} + +void GlobalLootManager::ShowNPCGlobalLoot(Client *to, NPC *who) const +{ + for (auto &e : m_entries) { + if (e.PassesRules(who)) + to->Message(0, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID()); + } +} + +bool GlobalLootEntry::PassesRules(NPC *mob) const +{ + bool bRace = false; + bool bPassesRace = false; + bool bBodyType = false; + bool bPassesBodyType = false; + bool bClass = false; + bool bPassesClass = false; + + for (auto &r : m_rules) { + switch (r.type) { + case GlobalLoot::RuleTypes::LevelMin: + if (mob->GetLevel() < r.value) + return false; + break; + case GlobalLoot::RuleTypes::LevelMax: + if (mob->GetLevel() > r.value) + return false; + break; + case GlobalLoot::RuleTypes::Raid: // value == 0 must not be raid, value != 0 must be raid + if (mob->IsRaidTarget() && !r.value) + return false; + if (!mob->IsRaidTarget() && r.value) + return false; + break; + case GlobalLoot::RuleTypes::Rare: + if (mob->IsRareSpawn() && !r.value) + return false; + if (!mob->IsRareSpawn() && r.value) + return false; + break; + case GlobalLoot::RuleTypes::Race: // can have multiple races per rule set + bRace = true; // we must pass race + if (mob->GetRace() == r.value) + bPassesRace = true; + break; + case GlobalLoot::RuleTypes::Class: // can have multiple classes per rule set + bClass = true; // we must pass class + if (mob->GetClass() == r.value) + bPassesClass = true; + break; + case GlobalLoot::RuleTypes::BodyType: // can have multiple bodytypes per rule set + bBodyType = true; // we must pass BodyType + if (mob->GetBodyType() == r.value) + bPassesBodyType = true; + break; + default: + break; + } + } + + if (bRace && !bPassesRace) + return false; + + if (bClass && !bPassesClass) + return false; + + if (bBodyType && !bPassesBodyType) + return false; + + // we abort as early as possible if we fail a rule, so if we get here, we passed + return true; +} + diff --git a/zone/global_loot_manager.h b/zone/global_loot_manager.h new file mode 100644 index 000000000..fec5a7215 --- /dev/null +++ b/zone/global_loot_manager.h @@ -0,0 +1,61 @@ +#ifndef GLOBAL_LOOT_MANAGER_H +#define GLOBAL_LOOT_MANAGER_H + +#include +#include + +class NPC; +class Client; + +namespace GlobalLoot { + +enum class RuleTypes { + LevelMin = 0, + LevelMax = 1, + Race = 2, + Class = 3, + BodyType = 4, + Rare = 5, + Raid = 6, + Max +}; + +struct Rule { + RuleTypes type; + int value; + Rule(RuleTypes t, int v) : type(t), value(v) { } +}; + +}; + +class GlobalLootEntry { + int m_id; + int m_loottable_id; + std::string m_description; + std::vector m_rules; +public: + GlobalLootEntry(int id, int loottable, std::string des) + : m_id(id), m_loottable_id(loottable), m_description(std::move(des)) + { } + bool PassesRules(NPC *mob) const; + inline int GetLootTableID() const { return m_loottable_id; } + inline int GetID() const { return m_id; } + inline const std::string &GetDescription() const { return m_description; } + inline void SetLootTableID(int in) { m_loottable_id = in; } + inline void SetID(int in) { m_id = in; } + inline void SetDescription(const std::string &in) { m_description = in; } + inline void AddRule(GlobalLoot::RuleTypes rule, int value) { m_rules.emplace_back(rule, value); } +}; + +class GlobalLootManager { + std::vector m_entries; + +public: + std::vector GetGlobalLootTables(NPC *mob) const; + inline void Clear() { m_entries.clear(); } + inline void AddEntry(GlobalLootEntry &in) { m_entries.push_back(in); } + void ShowZoneGlobalLoot(Client *to) const; + void ShowNPCGlobalLoot(Client *to, NPC *who) const; +}; + +#endif /* !GLOBAL_LOOT_MANAGER_H */ diff --git a/zone/loottables.cpp b/zone/loottables.cpp index d9fa86257..961d66781 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -26,6 +26,7 @@ #include "mob.h" #include "npc.h" #include "zonedb.h" +#include "global_loot_manager.h" #include #include @@ -37,10 +38,14 @@ // Queries the loottable: adds item & coin to the npc void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* itemlist, uint32* copper, uint32* silver, uint32* gold, uint32* plat) { const LootTable_Struct* lts = nullptr; - *copper = 0; - *silver = 0; - *gold = 0; - *plat = 0; + // global loot passes nullptr for these + bool bGlobal = copper == nullptr && silver == nullptr && gold == nullptr && plat == nullptr; + if (!bGlobal) { + *copper = 0; + *silver = 0; + *gold = 0; + *plat = 0; + } lts = database.GetLootTable(loottable_id); if (!lts) @@ -55,17 +60,19 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* ite } uint32 cash = 0; - if(max_cash > 0 && lts->avgcoin > 0 && EQEmu::ValueWithin(lts->avgcoin, min_cash, max_cash)) { - float upper_chance = (float)(lts->avgcoin - min_cash) / (float)(max_cash - min_cash); - float avg_cash_roll = (float)zone->random.Real(0.0, 1.0); + if (!bGlobal) { + if(max_cash > 0 && lts->avgcoin > 0 && EQEmu::ValueWithin(lts->avgcoin, min_cash, max_cash)) { + float upper_chance = (float)(lts->avgcoin - min_cash) / (float)(max_cash - min_cash); + float avg_cash_roll = (float)zone->random.Real(0.0, 1.0); - if(avg_cash_roll < upper_chance) { - cash = zone->random.Int(lts->avgcoin, max_cash); + if(avg_cash_roll < upper_chance) { + cash = zone->random.Int(lts->avgcoin, max_cash); + } else { + cash = zone->random.Int(min_cash, lts->avgcoin); + } } else { - cash = zone->random.Int(min_cash, lts->avgcoin); + cash = zone->random.Int(min_cash, max_cash); } - } else { - cash = zone->random.Int(min_cash, max_cash); } if(cash != 0) { @@ -80,6 +87,7 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* ite *copper = cash; } + uint32 global_loot_multiplier = RuleI(Zone, GlobalLootMultiplier); // Do items @@ -444,3 +452,76 @@ void NPC::AddLootTable(uint32 ldid) { database.AddLootTableToNPC(this,ldid, &itemlist, &copper, &silver, &gold, &platinum); } } + +void NPC::CheckGlobalLootTables() +{ + auto tables = zone->GetGlobalLootTables(this); + + for (auto &id : tables) + database.AddLootTableToNPC(this, id, &itemlist, nullptr, nullptr, nullptr, nullptr); +} + +void ZoneDatabase::LoadGlobalLoot() +{ + auto query = StringFormat("SELECT id, loottable_id, description, min_level, max_level, rare, raid, race, " + "class, bodytype, zone FROM global_loot WHERE enabled = 1"); + + auto results = QueryDatabase(query); + if (!results.Success() || results.RowCount() == 0) + return; + + // we might need this, lets not keep doing it in a loop + auto zoneid = std::to_string(zone->GetZoneID()); + for (auto row = results.begin(); row != results.end(); ++row) { + // checking zone limits + if (row[10]) { + auto zones = SplitString(row[10], '|'); + + auto it = std::find(zones.begin(), zones.end(), zoneid); + if (it == zones.end()) // not in here, skip + continue; + } + + GlobalLootEntry e(atoi(row[0]), atoi(row[1]), row[2] ? row[2] : ""); + + auto min_level = atoi(row[3]); + if (min_level) + e.AddRule(GlobalLoot::RuleTypes::LevelMin, min_level); + + auto max_level = atoi(row[4]); + if (max_level) + e.AddRule(GlobalLoot::RuleTypes::LevelMax, max_level); + + // null is not used + if (row[5]) + e.AddRule(GlobalLoot::RuleTypes::Rare, atoi(row[5])); + + // null is not used + if (row[6]) + e.AddRule(GlobalLoot::RuleTypes::Raid, atoi(row[6])); + + if (row[7]) { + auto races = SplitString(row[7], '|'); + + for (auto &r : races) + e.AddRule(GlobalLoot::RuleTypes::Race, std::stoi(r)); + } + + if (row[8]) { + auto classes = SplitString(row[8], '|'); + + for (auto &c : classes) + e.AddRule(GlobalLoot::RuleTypes::Class, std::stoi(c)); + } + + if (row[9]) { + auto bodytypes = SplitString(row[9], '|'); + + for (auto &b : bodytypes) + e.AddRule(GlobalLoot::RuleTypes::Class, std::stoi(b)); + } + + zone->AddGlobalLootEntry(e); + } +} + diff --git a/zone/mob.cpp b/zone/mob.cpp index 9efdda70c..0c0e20d81 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -266,6 +266,7 @@ Mob::Mob(const char* in_name, IsFullHP = (cur_hp == max_hp); qglobal = 0; spawned = false; + rare_spawn = false; InitializeBuffSlots(); diff --git a/zone/mob.h b/zone/mob.h index f973dd022..c223a45b4 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -689,6 +689,8 @@ public: void SetFollowDistance(uint32 dist) { follow_dist = dist; } uint32 GetFollowID() const { return follow; } uint32 GetFollowDistance() const { return follow_dist; } + inline bool IsRareSpawn() const { return rare_spawn; } + inline void SetRareSpawn(bool in) { rare_spawn = in; } virtual void Message(uint32 type, const char* message, ...) { } virtual void Message_StringID(uint32 type, uint32 string_id, uint32 distance = 0) { } @@ -1225,6 +1227,7 @@ protected: uint32 follow; uint32 follow_dist; bool no_target_hotkey; + bool rare_spawn; uint32 m_PlayerState; uint32 GetPlayerState() { return m_PlayerState; } diff --git a/zone/npc.cpp b/zone/npc.cpp index de494bb05..8f070f7a9 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -245,6 +245,8 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, const glm::vec4& position, int if roambox_delay = 1000; p_depop = false; loottable_id = d->loottable_id; + skip_global_loot = d->skip_global_loot; + rare_spawn = d->rare_spawn; no_target_hotkey = d->no_target_hotkey; @@ -938,6 +940,7 @@ bool NPC::SpawnZoneController(){ npc_type->d_melee_texture2 = 0; npc_type->merchanttype = 0; npc_type->bodytype = 11; + npc_type->skip_global_loot = true; if (RuleB(Zone, EnableZoneControllerGlobals)) { npc_type->qglobal = true; diff --git a/zone/npc.h b/zone/npc.h index 0ff7f3b03..2e264ce24 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -185,6 +185,7 @@ public: void AddItem(uint32 itemid, uint16 charges, bool equipitem = true, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0); void AddLootTable(); void AddLootTable(uint32 ldid); + void CheckGlobalLootTables(); void DescribeAggro(Client *towho, Mob *mob, bool verbose); void RemoveItem(uint32 item_id, uint16 quantity = 0, uint16 slot = 0); void CheckMinMaxLevel(Mob *them); @@ -197,6 +198,7 @@ public: uint32 CountLoot(); inline uint32 GetLoottableID() const { return loottable_id; } virtual void UpdateEquipmentLight(); + inline bool DropsGlobalLoot() const { return !skip_global_loot; } inline uint32 GetCopper() const { return copper; } inline uint32 GetSilver() const { return silver; } @@ -562,6 +564,7 @@ protected: private: uint32 loottable_id; + bool skip_global_loot; bool p_depop; }; diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index c77e96979..6c0bdfe0a 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -210,6 +210,8 @@ Mob* QuestManager::spawn2(int npc_type, int grid, int unused, const glm::vec4& p { auto npc = new NPC(tmp, nullptr, position, FlyMode3); npc->AddLootTable(); + if (npc->DropsGlobalLoot()) + npc->CheckGlobalLootTables(); entity_list.AddNPC(npc,true,true); if(grid > 0) { @@ -232,6 +234,8 @@ Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, const glm::v { auto npc = new NPC(tmp, nullptr, position, FlyMode3); npc->AddLootTable(); + if (npc->DropsGlobalLoot()) + npc->CheckGlobalLootTables(); entity_list.AddNPC(npc,true,true); if(grid > 0) { @@ -308,6 +312,8 @@ Mob* QuestManager::spawn_from_spawn2(uint32 spawn2_id) found_spawn->SetNPCPointer(npc); npc->AddLootTable(); + if (npc->DropsGlobalLoot()) + npc->CheckGlobalLootTables(); npc->SetSp2(found_spawn->SpawnGroupID()); entity_list.AddNPC(npc); entity_list.LimitAddNPC(npc); @@ -1656,6 +1662,8 @@ void QuestManager::respawn(int npcTypeID, int grid) { { owner = new NPC(npcType, nullptr, owner->GetPosition(), FlyMode3); owner->CastToNPC()->AddLootTable(); + if (owner->CastToNPC()->DropsGlobalLoot()) + owner->CastToNPC()->CheckGlobalLootTables(); entity_list.AddNPC(owner->CastToNPC(),true,true); if(grid > 0) owner->CastToNPC()->AssignWaypoints(grid); diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 654c5e836..bfc474721 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -236,6 +236,8 @@ bool Spawn2::Process() { npcthis = npc; npc->AddLootTable(); + if (npc->DropsGlobalLoot()) + npc->CheckGlobalLootTables(); npc->SetSp2(spawngroup_id_); npc->SaveGuardPointAnim(anim); npc->SetAppearance((EmuAppearance)anim); diff --git a/zone/trap.cpp b/zone/trap.cpp index d5bcfbeb8..91e11c012 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -168,6 +168,8 @@ void Trap::Trigger(Mob* trigger) auto spawnPosition = randomOffset + glm::vec4(m_Position, 0.0f); auto new_npc = new NPC(tmp, nullptr, spawnPosition, FlyMode3); new_npc->AddLootTable(); + if (new_npc->DropsGlobalLoot()) + new_npc->CheckGlobalLootTables(); entity_list.AddNPC(new_npc); new_npc->AddToHateList(trigger,1); } @@ -191,6 +193,8 @@ void Trap::Trigger(Mob* trigger) auto spawnPosition = randomOffset + glm::vec4(m_Position, 0.0f); auto new_npc = new NPC(tmp, nullptr, spawnPosition, FlyMode3); new_npc->AddLootTable(); + if (new_npc->DropsGlobalLoot()) + new_npc->CheckGlobalLootTables(); entity_list.AddNPC(new_npc); new_npc->AddToHateList(trigger,1); } @@ -555,4 +559,4 @@ void Trap::UpdateTrap(bool respawn, bool repopnow) { database.SetTrapData(this, repopnow); } -} \ No newline at end of file +} diff --git a/zone/zone.cpp b/zone/zone.cpp index 8045e0fbf..fce562c94 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -968,6 +968,8 @@ bool Zone::Init(bool iStaticZone) { LoadAlternateAdvancement(); + database.LoadGlobalLoot(); + //Load merchant data zone->GetMerchantDataForZoneLoad(); @@ -2229,6 +2231,8 @@ void Zone::DoAdventureActions() { NPC* npc = new NPC(tmp, nullptr, glm::vec4(ds->assa_x, ds->assa_y, ds->assa_z, ds->assa_h), FlyMode3); npc->AddLootTable(); + if (npc->DropsGlobalLoot()) + npc->CheckGlobalLootTables(); entity_list.AddNPC(npc); npc->Shout("Rarrrgh!"); did_adventure_actions = true; diff --git a/zone/zone.h b/zone/zone.h index 3a5125eb4..158d414a4 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -28,6 +28,7 @@ #include "spawn2.h" #include "spawngroup.h" #include "aa_ability.h" +#include "global_loot_manager.h" struct ZonePoint { @@ -269,6 +270,11 @@ public: void UpdateHotzone(); std::unordered_map tick_items; + inline std::vector GetGlobalLootTables(NPC *mob) const { return m_global_loot.GetGlobalLootTables(mob); } + inline void AddGlobalLootEntry(GlobalLootEntry &in) { return m_global_loot.AddEntry(in); } + inline void ShowZoneGlobalLoot(Client *to) { m_global_loot.ShowZoneGlobalLoot(to); } + inline void ShowNPCGlobalLoot(Client *to, NPC *who) { m_global_loot.ShowNPCGlobalLoot(to, who); } + // random object that provides random values for the zone EQEmu::Random random; @@ -347,6 +353,8 @@ private: QGlobalCache *qGlobals; Timer hotzone_timer; + + GlobalLootManager m_global_loot; }; #endif diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 75ca99ac8..01add9944 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1969,7 +1969,9 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load "npc_types.charm_attack_delay, " "npc_types.charm_accuracy_rating, " "npc_types.charm_avoidance_rating, " - "npc_types.charm_atk " + "npc_types.charm_atk, " + "npc_types.skip_global_loot, " + "npc_types.rare_spawn " "FROM npc_types %s", where_condition.c_str() ); @@ -2156,6 +2158,9 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load temp_npctype_data->charm_avoidance_rating = atoi(row[105]); temp_npctype_data->charm_atk = atoi(row[106]); + temp_npctype_data->skip_global_loot = atoi(row[107]) != 0; + temp_npctype_data->rare_spawn = atoi(row[108]) != 0; + // If NPC with duplicate NPC id already in table, // free item we attempted to add. if (zone->npctable.find(temp_npctype_data->npc_id) != zone->npctable.end()) { diff --git a/zone/zonedb.h b/zone/zonedb.h index ec1a1d663..6f65bae91 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -424,6 +424,7 @@ public: uint32 GetMaxNPCSpellsID(); uint32 GetMaxNPCSpellsEffectsID(); bool GetAuraEntry(uint16 spell_id, AuraRecord &record); + void LoadGlobalLoot(); DBnpcspells_Struct* GetNPCSpells(uint32 iDBSpellsID); DBnpcspellseffects_Struct* GetNPCSpellsEffects(uint32 iDBSpellsEffectsID); diff --git a/zone/zonedump.h b/zone/zonedump.h index 636978475..66c7ec01d 100644 --- a/zone/zonedump.h +++ b/zone/zonedump.h @@ -141,6 +141,8 @@ struct NPCType bool ignore_despawn; bool show_name; // should default on bool untargetable; + bool skip_global_loot; + bool rare_spawn; }; namespace player_lootitem { From 68d563c72f17df7ba67ae95eca251cf06cc784fb Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 11 Feb 2018 13:26:00 -0500 Subject: [PATCH 02/10] Add optional file to implement global defiant tables [skip ci] This is destructive and will delete the loottable_entries currently holding defiant drops The level ranges maybe a bit wrong, kind of hard to tell, but it should be accurate enough --- .../git/optional/2018_02_11_GlobalDefiant.sql | 451 ++++++++++++++++++ 1 file changed, 451 insertions(+) create mode 100644 utils/sql/git/optional/2018_02_11_GlobalDefiant.sql diff --git a/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql b/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql new file mode 100644 index 000000000..86b75b71b --- /dev/null +++ b/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql @@ -0,0 +1,451 @@ +DELETE FROM lootdrop_entries WHERE item_id IN (50005, 50006, 50007, 50008, 50009, 50010, 50011, 50012, 50013, 50014, 50015, 50016, 50017, 50018, 50019, 50020, 50021, 50022, 50023, 50024, 50025, 50026, 50027, 50028, 50029, 50030, 50031, 50032, 50500, 50501, 50502, 50503, 50504, 50505, 50506, 50507, 50508, 50509, 50510, 50511, 50512, 50513, 50514, 50515, 50516, 50517, 50518); + +SELECT @loottable_id := MAX(id) + 1 FROM loottable; +INSERT INTO loottable SET id=@loottable_id, name="GLB-Crude-Defiant", mincash="0", maxcash="0", avgcoin="0"; +SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; +INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Crude-Defiant-Drop"; +INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50005, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50006, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50007, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50008, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50009, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50010, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50011, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50012, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50013, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50014, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50015, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50016, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50017, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50018, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50019, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50020, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50021, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50022, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50023, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50024, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50025, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50026, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50027, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50028, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50029, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50030, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50031, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50032, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50500, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50501, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50502, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50503, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50504, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50505, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50506, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50507, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50508, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50509, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50510, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50511, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50512, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50513, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50514, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50515, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50516, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50517, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50518, equip_item=1, item_charges=1, multiplier=1, chance=1; + +INSERT INTO global_loot SET description='GLB-Crude-Defiant', loottable_id=@loottable_id, max_level=15; + +DELETE FROM lootdrop_entries WHERE item_id IN (50033, 50034, 50035, 50036, 50037, 50038, 50039, 50040, 50041, 50042, 50043, 50044, 50045, 50046, 50047, 50048, 50049, 50050, 50051, 50052, 50053, 50054, 50055, 50056, 50057, 50058, 50059, 50060, 50519, 50520, 50521, 50522, 50523, 50524, 50525, 50526, 50527, 50528, 50529, 50530, 50531, 50532, 50533, 50534, 50535); + +SELECT @loottable_id := MAX(id) + 1 FROM loottable; +INSERT INTO loottable SET id=@loottable_id, name="GLB-Simple-Defiant", mincash="0", maxcash="0", avgcoin="0"; +SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; +INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Simple-Defiant-Drop"; +INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50033, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50034, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50035, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50036, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50037, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50038, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50039, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50040, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50041, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50042, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50043, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50044, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50045, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50046, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50047, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50048, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50049, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50050, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50051, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50052, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50053, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50054, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50055, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50056, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50057, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50058, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50059, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50060, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50519, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50520, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50521, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50522, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50523, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50524, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50525, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50526, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50527, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50528, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50529, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50530, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50531, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50532, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50533, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50534, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50535, equip_item=1, item_charges=1, multiplier=1, chance=1; + +INSERT INTO global_loot SET description='GLB-Simple-Defiant', loottable_id=@loottable_id, min_level=14, max_level=25; + +DELETE FROM lootdrop_entries WHERE item_id IN (50061, 50062, 50063, 50064, 50065, 50066, 50067, 50068, 50069, 50070, 50071, 50072, 50073, 50074, 50075, 50076, 50077, 50078, 50079, 50080, 50081, 50082, 50083, 50084, 50085, 50086, 50087, 50088, 50536, 50537, 50540, 50541, 50542, 50543, 50544, 50545, 50546, 50547, 50548, 50549, 50550, 50551, 50552, 50553); + +SELECT @loottable_id := MAX(id) + 1 FROM loottable; +INSERT INTO loottable SET id=@loottable_id, name="GLB-Rough-Defiant", mincash="0", maxcash="0", avgcoin="0"; +SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; +INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Rough-Defiant-Drop"; +INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50061, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50062, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50063, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50064, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50065, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50066, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50067, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50068, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50069, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50070, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50071, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50072, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50073, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50074, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50075, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50076, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50077, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50078, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50079, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50080, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50081, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50082, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50083, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50084, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50085, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50086, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50087, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50088, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50536, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50537, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50540, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50541, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50542, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50543, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50544, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50545, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50546, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50547, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50548, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50549, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50550, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50551, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50552, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50553, equip_item=1, item_charges=1, multiplier=1, chance=1; + +INSERT INTO global_loot SET description='GLB-Rough-Defiant', loottable_id=@loottable_id, min_level=24, max_level=36; + +DELETE FROM lootdrop_entries WHERE item_id IN (50089, 50090, 50091, 50092, 50093, 50094, 50095, 50096, 50097, 50098, 50099, 50100, 50101, 50102, 50103, 50104, 50105, 50106, 50107, 50108, 50109, 50110, 50111, 50112, 50113, 50114, 50115, 50116, 50554, 50555, 50556, 50557, 50558, 50559, 50560, 50561, 50562, 50563, 50564, 50565, 50566, 50567, 50568, 50569); + +SELECT @loottable_id := MAX(id) + 1 FROM loottable; +INSERT INTO loottable SET id=@loottable_id, name="GLB-Ornate-Defiant", mincash="0", maxcash="0", avgcoin="0"; +SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; +INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Ornate-Defiant-Drop"; +INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50089, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50090, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50091, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50092, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50093, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50094, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50095, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50096, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50097, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50098, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50099, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50100, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50101, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50102, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50103, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50104, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50105, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50106, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50107, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50108, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50109, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50110, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50111, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50112, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50113, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50114, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50115, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50116, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50554, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50555, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50556, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50557, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50558, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50559, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50560, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50561, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50562, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50563, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50564, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50565, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50566, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50567, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50568, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50569, equip_item=1, item_charges=1, multiplier=1, chance=1; + +INSERT INTO global_loot SET description='GLB-Ornate-Defiant', loottable_id=@loottable_id, min_level=35, max_level=47; + +DELETE FROM lootdrop_entries WHERE item_id IN (50117, 50118, 50119, 50120, 50121, 50122, 50123, 50124, 50125, 50126, 50127, 50128, 50129, 50130, 50131, 50132, 50133, 50134, 50135, 50136, 50137, 50138, 50139, 50140, 50141, 50142, 50143, 50144, 50570, 50571, 50572, 50573, 50574, 50575, 50576, 50577, 50578, 50579, 50580, 50581, 50582, 50583, 50584, 50585); + +SELECT @loottable_id := MAX(id) + 1 FROM loottable; +INSERT INTO loottable SET id=@loottable_id, name="GLB-Flawed-Defiant", mincash="0", maxcash="0", avgcoin="0"; +SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; +INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Flawed-Defiant-Drop"; +INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50117, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50118, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50119, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50120, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50121, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50122, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50123, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50124, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50125, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50126, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50127, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50128, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50129, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50130, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50131, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50132, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50133, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50134, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50135, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50136, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50137, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50138, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50139, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50140, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50141, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50142, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50143, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50144, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50570, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50571, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50572, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50573, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50574, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50575, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50576, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50577, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50578, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50579, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50580, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50581, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50582, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50583, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50584, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50585, equip_item=1, item_charges=1, multiplier=1, chance=1; + +INSERT INTO global_loot SET description='GLB-Flawed-Defiant', loottable_id=@loottable_id, enabled=0, min_level=44, max_level=55; + +DELETE FROM lootdrop_entries WHERE item_id IN (50145, 50146, 50147, 50148, 50149, 50150, 50151, 50152, 50153, 50154, 50155, 50156, 50157, 50158, 50159, 50160, 50161, 50162, 50163, 50164, 50165, 50166, 50167, 50168, 50169, 50170, 50171, 50172, 50173, 50174, 50175, 50176, 50177, 50178, 50586, 50587, 50588, 50589, 50590, 50591, 50592, 50593, 50594, 50595, 50596, 50597, 50598, 50599, 50600, 50601); + +SELECT @loottable_id := MAX(id) + 1 FROM loottable; +INSERT INTO loottable SET id=@loottable_id, name="GLB-Intricate-Defiant", mincash="0", maxcash="0", avgcoin="0"; +SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; +INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Intricate-Defiant-Drop"; +INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50145, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50146, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50147, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50148, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50149, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50150, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50151, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50152, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50153, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50154, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50155, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50156, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50157, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50158, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50159, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50160, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50161, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50162, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50163, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50164, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50165, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50166, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50167, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50168, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50169, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50170, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50171, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50172, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50173, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50174, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50175, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50176, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50177, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50178, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50586, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50587, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50588, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50589, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50590, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50591, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50592, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50593, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50594, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50595, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50596, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50597, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50598, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50599, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50600, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50601, equip_item=1, item_charges=1, multiplier=1, chance=1; + +INSERT INTO global_loot SET description='GLB-Intricate-Defiant', loottable_id=@loottable_id, enabled=0, min_level=54, max_level=65; + +DELETE FROM lootdrop_entries WHERE item_id IN (50179, 50180, 50181, 50182, 50183, 50184, 50185, 50186, 50187, 50188, 50189, 50190, 50191, 50192, 50193, 50194, 50195, 50196, 50197, 50198, 50199, 50200, 50201, 50202, 50203, 50204, 50205, 50206, 50207, 50208, 50209, 50210, 50211, 50212, 50602, 50603, 50604, 50605, 50606, 50607, 50608, 50609, 50610, 50611, 50612, 50613, 50614, 50615, 50616); + +SELECT @loottable_id := MAX(id) + 1 FROM loottable; +INSERT INTO loottable SET id=@loottable_id, name="GLB-Elaborate-Defiant", mincash="0", maxcash="0", avgcoin="0"; +SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; +INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Elaborate-Defiant-Drop"; +INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50179, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50180, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50181, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50182, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50183, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50184, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50185, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50186, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50187, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50188, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50189, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50190, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50191, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50192, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50193, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50194, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50195, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50196, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50197, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50198, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50199, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50200, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50201, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50202, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50203, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50204, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50205, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50206, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50207, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50208, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50209, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50210, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50211, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50212, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50602, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50603, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50604, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50605, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50606, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50607, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50608, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50609, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50610, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50611, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50612, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50613, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50614, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50615, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50616, equip_item=1, item_charges=1, multiplier=1, chance=1; + +INSERT INTO global_loot SET description='GLB-Elaborate-Defiant', loottable_id=@loottable_id, enabled=0, min_level=64, max_level=75; + +DELETE FROM lootdrop_entries WHERE item_id IN (50213, 50214, 50215, 50216, 50217, 50218, 50219, 50220, 50221, 50222, 50223, 50224, 50225, 50226, 50227, 50228, 50229, 50230, 50231, 50232, 50233, 50234, 50235, 50236, 50237, 50238, 50239, 50240, 50241, 50242, 50243, 50244, 50245, 50246, 50617, 50618, 50619, 50620, 50621, 50622, 50623, 50624, 50625, 50626, 50627, 50628, 50629, 50630, 50631); + +SELECT @loottable_id := MAX(id) + 1 FROM loottable; +INSERT INTO loottable SET id=@loottable_id, name="GLB-Elegant-Defiant", mincash="0", maxcash="0", avgcoin="0"; +SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; +INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Elegant-Defiant-Drop"; +INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50213, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50214, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50215, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50216, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50217, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50218, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50219, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50220, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50221, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50222, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50223, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50224, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50225, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50226, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50227, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50228, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50229, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50230, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50231, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50232, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50233, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50234, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50235, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50236, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50237, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50238, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50239, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50240, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50241, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50242, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50243, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50244, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50245, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50246, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50617, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50618, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50619, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50620, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50621, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50622, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50623, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50624, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50625, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50626, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50627, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50628, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50629, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50630, equip_item=1, item_charges=1, multiplier=1, chance=1; +INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50631, equip_item=1, item_charges=1, multiplier=1, chance=1; + +INSERT INTO global_loot SET description='GLB-Elegant-Defiant', loottable_id=@loottable_id, enabled=0, min_level=74, max_level=86; From e747ea851a1cef0c463fdb9a04ba4003d8aadc6c Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 11 Feb 2018 17:39:12 -0500 Subject: [PATCH 03/10] Fix issue with optional SQL [skip ci] --- .../git/optional/2018_02_11_GlobalDefiant.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql b/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql index 86b75b71b..00e36818c 100644 --- a/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql +++ b/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql @@ -4,7 +4,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Crude-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Crude-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50005, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50006, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50007, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -61,7 +61,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Simple-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Simple-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50033, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50034, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50035, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -116,7 +116,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Rough-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Rough-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50061, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50062, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50063, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -170,7 +170,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Ornate-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Ornate-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50089, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50090, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50091, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -224,7 +224,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Flawed-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Flawed-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50117, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50118, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50119, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -278,7 +278,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Intricate-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Intricate-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50145, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50146, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50147, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -338,7 +338,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Elaborate-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Elaborate-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50179, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50180, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50181, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -397,7 +397,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Elegant-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Elegant-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id='@loottable_id', lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50213, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50214, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50215, equip_item=1, item_charges=1, multiplier=1, chance=1; From d2360753fbbeedab8791a55c005c05ca8ec41b25 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 11 Feb 2018 17:40:49 -0500 Subject: [PATCH 04/10] Fix issue with optional SQL [skip ci] --- .../git/optional/2018_02_11_GlobalDefiant.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql b/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql index 00e36818c..10c918884 100644 --- a/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql +++ b/utils/sql/git/optional/2018_02_11_GlobalDefiant.sql @@ -4,7 +4,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Crude-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Crude-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id=@lootdrop_id, droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50005, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50006, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50007, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -61,7 +61,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Simple-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Simple-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id=@lootdrop_id, droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50033, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50034, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50035, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -116,7 +116,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Rough-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Rough-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id=@lootdrop_id, droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50061, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50062, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50063, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -170,7 +170,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Ornate-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Ornate-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id=@lootdrop_id, droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50089, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50090, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50091, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -224,7 +224,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Flawed-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Flawed-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id=@lootdrop_id, droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50117, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50118, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50119, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -278,7 +278,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Intricate-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Intricate-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id=@lootdrop_id, droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50145, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50146, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50147, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -338,7 +338,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Elaborate-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Elaborate-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id=@lootdrop_id, droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50179, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50180, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50181, equip_item=1, item_charges=1, multiplier=1, chance=1; @@ -397,7 +397,7 @@ SELECT @loottable_id := MAX(id) + 1 FROM loottable; INSERT INTO loottable SET id=@loottable_id, name="GLB-Elegant-Defiant", mincash="0", maxcash="0", avgcoin="0"; SELECT @lootdrop_id := MAX(id) + 1 FROM lootdrop; INSERT INTO lootdrop SET id=@lootdrop_id, name="GLB-Elegant-Defiant-Drop"; -INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id='@lootdrop_id', droplimit='0', mindrop='1', multiplier='1', probability='2'; +INSERT INTO loottable_entries SET loottable_id=@loottable_id, lootdrop_id=@lootdrop_id, droplimit='0', mindrop='1', multiplier='1', probability='2'; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50213, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50214, equip_item=1, item_charges=1, multiplier=1, chance=1; INSERT INTO lootdrop_entries SET lootdrop_id=@lootdrop_id, item_id=50215, equip_item=1, item_charges=1, multiplier=1, chance=1; From 3e39c0c11a9c947ba5d100d2f65a83984d72baa2 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Mon, 12 Feb 2018 10:51:21 -0500 Subject: [PATCH 05/10] Scaled AC and ATK if npc is scaling. --- zone/npc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zone/npc.cpp b/zone/npc.cpp index c13841358..74be84fa2 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -2130,6 +2130,8 @@ void NPC::LevelScale() { if(level > 15 && level <= 25) scale_adjust = 2; + AC += (int)(AC * scaling); + ATK += (int)(ATK * scaling); base_hp += (int)(base_hp * scaling); max_hp += (int)(max_hp * scaling); cur_hp = max_hp; From b5e9c0f996b63fb3210a3e9f49a1677579b72622 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 12 Feb 2018 19:41:48 -0500 Subject: [PATCH 06/10] Fix PVP arenas --- zone/client.cpp | 14 ++++++++------ zone/client.h | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 844188edb..69c43ef5a 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -336,6 +336,8 @@ Client::Client(EQStreamInterface* ieqs) for (int i = 0; i < InnateSkillMax; ++i) m_pp.InnateSkills[i] = InnateDisabled; + temp_pvp = false; + AI_Init(); } @@ -462,8 +464,8 @@ void Client::SendZoneInPackets() if (!GetHideMe()) entity_list.QueueClients(this, outapp, true); safe_delete(outapp); SetSpawned(); - if (GetPVP()) //force a PVP update until we fix the spawn struct - SendAppearancePacket(AT_PVP, GetPVP(), true, false); + if (GetPVP(false)) //force a PVP update until we fix the spawn struct + SendAppearancePacket(AT_PVP, GetPVP(false), true, false); //Send AA Exp packet: if (GetLevel() >= 51) @@ -1955,7 +1957,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) ns->spawn.gm = GetGM() ? 1 : 0; ns->spawn.guildID = GuildID(); // ns->spawn.linkdead = IsLD() ? 1 : 0; -// ns->spawn.pvp = GetPVP() ? 1 : 0; +// ns->spawn.pvp = GetPVP(false) ? 1 : 0; ns->spawn.show_name = true; @@ -8889,9 +8891,9 @@ void Client::CheckRegionTypeChanges() return; if (last_region_type == RegionTypePVP) - SetPVP(true, false); - else if (GetPVP()) - SetPVP(false, false); + temp_pvp = true; + else if (temp_pvp) + temp_pvp = false; } void Client::ProcessAggroMeter() diff --git a/zone/client.h b/zone/client.h index e0732fd92..039844f82 100644 --- a/zone/client.h +++ b/zone/client.h @@ -395,7 +395,7 @@ public: void SetGM(bool toggle); void SetPVP(bool toggle, bool message = true); - inline bool GetPVP() const { return m_pp.pvp != 0; } + inline bool GetPVP(bool inc_temp = true) const { return m_pp.pvp != 0 || (inc_temp && temp_pvp); } inline bool GetGM() const { return m_pp.gm != 0; } inline void SetBaseClass(uint32 i) { m_pp.class_=i; } @@ -1466,6 +1466,7 @@ private: PetInfo m_suspendedminion; // pet data for our suspended minion. MercInfo m_mercinfo[MAXMERCS]; // current mercenary InspectMessage_Struct m_inspect_message; + bool temp_pvp; void NPCSpawn(const Seperator* sep); uint32 GetEXPForLevel(uint16 level); From 91d3851d76b3deace7c6c6f182ad74daf9cd6674 Mon Sep 17 00:00:00 2001 From: Uleat Date: Wed, 14 Feb 2018 23:04:33 -0500 Subject: [PATCH 07/10] Fix for 'SoD' client unable to log into zone [ci skip] --- common/patches/sod_structs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/patches/sod_structs.h b/common/patches/sod_structs.h index 88ccd7788..88a78c6ee 100644 --- a/common/patches/sod_structs.h +++ b/common/patches/sod_structs.h @@ -924,7 +924,7 @@ struct PlayerProfile_Struct /*06488*/ uint32 silver_cursor; // Silver Pieces on cursor /*06492*/ uint32 copper_cursor; // Copper Pieces on cursor /*06496*/ uint32 skills[MAX_PP_SKILL]; // [400] List of skills // 100 dword buffer -/*06896*/ uint32 InnateSkills[MAX_PP_SKILL]; +/*06896*/ uint32 InnateSkills[MAX_PP_INNATE_SKILL]; /*06996*/ uint8 unknown04760[36]; /*07032*/ uint32 toxicity; // Potion Toxicity (15=too toxic, each potion adds 3) /*07036*/ uint32 thirst_level; // Drink (ticks till next drink) From a32dedeb48b5f90e9f0d16e1a0c8e90ce0d2d933 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 15 Feb 2018 18:20:16 -0500 Subject: [PATCH 08/10] Fix issue with heading being incorrectly handled So we've been doing heading wrong all these years. You will need to run a script to fix your quests and required SQL to fix DB. This fixes a ton of random issues with headings and as gives us a better resolution on headings :P --- changelog.txt | 7 ++ common/misc_functions.cpp | 48 ++++++++++---- common/misc_functions.h | 13 +++- common/patches/rof2_structs.h | 4 +- common/version.h | 2 +- utils/sql/db_update_manifest.txt | 1 + utils/sql/git/required/2018_02_13_Heading.sql | 3 + zone/attack.cpp | 14 ++-- zone/client_packet.cpp | 10 +-- zone/client_process.cpp | 57 ++++++---------- zone/command.cpp | 19 +++--- zone/mob.cpp | 65 +++++++++---------- zone/mob.h | 5 +- zone/position.cpp | 4 +- zone/spell_effects.cpp | 12 ++-- zone/spells.cpp | 46 +++++++------ zone/waypoints.cpp | 21 ------ 17 files changed, 169 insertions(+), 162 deletions(-) create mode 100644 utils/sql/git/required/2018_02_13_Heading.sql diff --git a/changelog.txt b/changelog.txt index a700ded31..8daf85938 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,12 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 02/14/2018 == +mackal: Fix Heading -- Quests broken + +Please report any other issues with heading, most things were tested and worked + +Run akkadius' script to fix your quests + == 02/10/2018 == mackal: Add Global Loot system diff --git a/common/misc_functions.cpp b/common/misc_functions.cpp index dcdbad561..aaa20f3d4 100644 --- a/common/misc_functions.cpp +++ b/common/misc_functions.cpp @@ -194,32 +194,52 @@ uint32 rnd_hash( time_t t, clock_t c ) float EQ13toFloat(int d) { - return ( float(d)/float(1<<2)); -} - -float NewEQ13toFloat(int d) -{ - return ( float(d)/float(1<<6)); + return static_cast(d) / 64.0f; } float EQ19toFloat(int d) { - return ( float(d)/float(1<<3)); + return static_cast(d) / 8.0f; } int FloatToEQ13(float d) { - return int(d*float(1<<2)); -} - -int NewFloatToEQ13(float d) -{ - return int(d*float(1<<6)); + return static_cast(d * 64.0f); } int FloatToEQ19(float d) { - return int(d*float(1<<3)); + return static_cast(d * 8.0f); +} + +float EQ12toFloat(int d) +{ + return static_cast(d) / 4.0f; +} + +int FloatToEQ12(float d) +{ + return static_cast((d + 2048.0f) * 4.0f) % 2048; +} + +float EQ10toFloat(int d) +{ + return static_cast(d) / 20.0f; +} + +int FloatToEQ10(float d) +{ + return static_cast(d * 20.0f); +} + +float EQSpeedRunToFloat(int d) +{ + return static_cast(d) / 40.0f; +} + +int FloatToEQSpeedRun(float d) +{ + return static_cast(d * 40.0f); } /* diff --git a/common/misc_functions.h b/common/misc_functions.h index 501244fda..9ecb08378 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -50,13 +50,22 @@ uint32 ResolveIP(const char* hostname, char* errbuf = 0); bool ParseAddress(const char* iAddress, uint32* oIP, uint16* oPort, char* errbuf = 0); void CoutTimestamp(bool ms = true); float EQ13toFloat(int d); -float NewEQ13toFloat(int d); float EQ19toFloat(int d); float EQHtoFloat(int d); int FloatToEQ13(float d); -int NewFloatToEQ13(float d); int FloatToEQ19(float d); int FloatToEQH(float d); + +float EQ12toFloat(int d); +int FloatToEQ12(float d); + +float EQ10toFloat(int d); +int FloatToEQ10(float d); + +// this is also a 10 bit float +float EQSpeedRunToFloat(int d); +int FloatToEQSpeedRun(float d); + uint32 SwapBits21and22(uint32 mask); uint32 Catch22(uint32 mask); diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index 5aa11977f..5d42d9046 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -400,7 +400,7 @@ struct Spawn_Struct_Position struct Spawn_Struct_Position { - signed padding0000:12; + signed angle:12; // pitch of camera? signed y:19; signed padding0001:1; @@ -416,7 +416,7 @@ struct Spawn_Struct_Position signed z:19; signed padding0020:3; - signed animation:10; // animation + signed animation:10; // SpeedRun signed deltaY:13; signed padding0023:9; }; diff --git a/common/version.h b/common/version.h index 928592a4a..412223b8c 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9119 +#define CURRENT_BINARY_DATABASE_VERSION 9120 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9018 #else diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 188db2162..4de5f3d8f 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -373,6 +373,7 @@ 9117|2018_02_01_NPC_Spells_Min_Max_HP.sql|SHOW COLUMNS FROM `npc_spells_entries` LIKE 'min_hp'|empty| 9118|2018_02_04_Charm_Stats.sql|SHOW COLUMNS FROM `npc_types` LIKE 'charm_ac'|empty| 9119|2018_02_10_GlobalLoot.sql|SHOW TABLES LIKE 'global_loot'|empty| +9120|2018_02_13_Heading.sql|SELECT value FROM variables WHERE varname = 'fixed_heading'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/required/2018_02_13_Heading.sql b/utils/sql/git/required/2018_02_13_Heading.sql new file mode 100644 index 000000000..4f4736625 --- /dev/null +++ b/utils/sql/git/required/2018_02_13_Heading.sql @@ -0,0 +1,3 @@ +UPDATE spawn2 SET heading = heading * 8.0 / 4.0; +UPDATE grid_entries SET heading = heading * 8.0 / 4.0 WHERE heading <> -1; +INSERT INTO variables (varname, value) VALUES ('fixed_heading', 1); -- hack diff --git a/zone/attack.cpp b/zone/attack.cpp index ce96675a0..58e1510ff 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -358,7 +358,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit) Mob *attacker = other; Mob *defender = this; - bool InFront = attacker->InFrontMob(this, attacker->GetX(), attacker->GetY()); + bool InFront = !attacker->BehindMob(this, attacker->GetX(), attacker->GetY()); /* This special ability adds a negative modifer to the defenders riposte/block/parry/chance @@ -3611,13 +3611,13 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const a->special = 2; else a->special = 0; - a->meleepush_xy = attacker ? attacker->GetHeading() * 2.0f : 0.0f; + a->meleepush_xy = attacker ? attacker->GetHeading() : 0.0f; if (RuleB(Combat, MeleePush) && damage > 0 && !IsRooted() && (IsClient() || zone->random.Roll(RuleI(Combat, MeleePushChance)))) { a->force = EQEmu::skills::GetSkillMeleePushForce(skill_used); // update NPC stuff - auto new_pos = glm::vec3(m_Position.x + (a->force * std::sin(a->meleepush_xy) + m_Delta.x), - m_Position.y + (a->force * std::cos(a->meleepush_xy) + m_Delta.y), m_Position.z); + auto new_pos = glm::vec3(m_Position.x + (a->force * std::cos(a->meleepush_xy) + m_Delta.x), + m_Position.y + (a->force * std::sin(a->meleepush_xy) + m_Delta.y), m_Position.z); if (zone->zonemap && zone->zonemap->CheckLoS(glm::vec3(m_Position), new_pos)) { // If we have LoS on the new loc it should be reachable. if (IsNPC()) { // Is this adequate? @@ -4445,6 +4445,12 @@ void Mob::DoRiposte(Mob *defender) if (!defender) return; + // so ahhh the angle you can riposte is larger than the angle you can hit :P + if (!defender->IsFacingMob(this)) { + defender->Message_StringID(MT_TooFarAway, CANT_SEE_TARGET); + return; + } + defender->Attack(this, EQEmu::inventory::slotPrimary, true); if (HasDied()) return; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 42a78cdaa..2de71acc8 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -4402,7 +4402,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) return; } - auto boat_delta = glm::vec4(ppu->delta_x, ppu->delta_y, ppu->delta_z, ppu->delta_heading); + auto boat_delta = glm::vec4(ppu->delta_x, ppu->delta_y, ppu->delta_z, EQ10toFloat(ppu->delta_heading)); boat->SetDelta(boat_delta); auto outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct)); @@ -4412,7 +4412,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) safe_delete(outapp); /* Update the boat's position on the server, without sending an update */ - boat->GMMove(ppu->x_pos, ppu->y_pos, ppu->z_pos, EQ19toFloat(ppu->heading), false); + boat->GMMove(ppu->x_pos, ppu->y_pos, ppu->z_pos, EQ12toFloat(ppu->heading), false); return; } else return; @@ -4557,7 +4557,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) } /* Update internal state */ - m_Delta = glm::vec4(ppu->delta_x, ppu->delta_y, ppu->delta_z, ppu->delta_heading); + m_Delta = glm::vec4(ppu->delta_x, ppu->delta_y, ppu->delta_z, EQ10toFloat(ppu->delta_heading)); if (IsTracking() && ((m_Position.x != ppu->x_pos) || (m_Position.y != ppu->y_pos))) { if (zone->random.Real(0, 100) < 70)//should be good @@ -4610,7 +4610,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) } } - float new_heading = EQ19toFloat(ppu->heading); + float new_heading = EQ12toFloat(ppu->heading); int32 new_animation = ppu->animation; /* Update internal server position from what the client has sent */ @@ -4629,7 +4629,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) if (is_client_moving || new_heading != m_Position.w || new_animation != animation) { animation = ppu->animation; - m_Position.w = EQ19toFloat(ppu->heading); + m_Position.w = EQ12toFloat(ppu->heading); /* Broadcast update to other clients */ auto outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct)); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 21863dbd3..c5801044f 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1960,57 +1960,40 @@ void Client::CalcRestState() { void Client::DoTracking() { - if(TrackingID == 0) + if (TrackingID == 0) return; Mob *m = entity_list.GetMob(TrackingID); - if(!m || m->IsCorpse()) - { + if (!m || m->IsCorpse()) { Message_StringID(MT_Skills, TRACK_LOST_TARGET); - TrackingID = 0; - return; } float RelativeHeading = GetHeading() - CalculateHeadingToTarget(m->GetX(), m->GetY()); - if(RelativeHeading < 0) - RelativeHeading += 256; + if (RelativeHeading < 0) + RelativeHeading += 512; - if((RelativeHeading <= 16) || (RelativeHeading >= 240)) - { + if (RelativeHeading > 480) Message_StringID(MT_Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); - } - else if((RelativeHeading > 16) && (RelativeHeading <= 48)) - { - Message_StringID(MT_Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "right"); - } - else if((RelativeHeading > 48) && (RelativeHeading <= 80)) - { - Message_StringID(MT_Skills, TRACK_TO_THE, m->GetCleanName(), "right"); - } - else if((RelativeHeading > 80) && (RelativeHeading <= 112)) - { - Message_StringID(MT_Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "right"); - } - else if((RelativeHeading > 112) && (RelativeHeading <= 144)) - { - Message_StringID(MT_Skills, TRACK_BEHIND_YOU, m->GetCleanName()); - } - else if((RelativeHeading > 144) && (RelativeHeading <= 176)) - { - Message_StringID(MT_Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "left"); - } - else if((RelativeHeading > 176) && (RelativeHeading <= 208)) - { - Message_StringID(MT_Skills, TRACK_TO_THE, m->GetCleanName(), "left"); - } - else if((RelativeHeading > 208) && (RelativeHeading < 240)) - { + else if (RelativeHeading > 416) Message_StringID(MT_Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "left"); - } + else if (RelativeHeading > 352) + Message_StringID(MT_Skills, TRACK_TO_THE, m->GetCleanName(), "left"); + else if (RelativeHeading > 288) + Message_StringID(MT_Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "left"); + else if (RelativeHeading > 224) + Message_StringID(MT_Skills, TRACK_BEHIND_YOU, m->GetCleanName()); + else if (RelativeHeading > 160) + Message_StringID(MT_Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "right"); + else if (RelativeHeading > 96) + Message_StringID(MT_Skills, TRACK_TO_THE, m->GetCleanName(), "right"); + else if (RelativeHeading > 32) + Message_StringID(MT_Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "right"); + else if (RelativeHeading >= 0) + Message_StringID(MT_Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); } void Client::HandleRespawnFromHover(uint32 Option) diff --git a/zone/command.cpp b/zone/command.cpp index 7a4366a4f..179a37ded 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -8759,7 +8759,7 @@ void command_object(Client *c, const Seperator *sep) od.x = c->GetX(); od.y = c->GetY(); od.z = c->GetZ() - (c->GetSize() * 0.625f); - od.heading = c->GetHeading() * 2.0f; // GetHeading() is half of actual. Compensate by doubling. + od.heading = c->GetHeading(); std::string query; if (id) { @@ -8864,11 +8864,9 @@ void command_object(Client *c, const Seperator *sep) // Bump player back to avoid getting stuck inside new object - // GetHeading() returns half of the actual heading, for some reason, so we'll double it here for - // computation - x2 = 10.0f * sin(c->GetHeading() * 2.0f / 256.0f * 3.14159265f); - y2 = 10.0f * cos(c->GetHeading() * 2.0f / 256.0f * 3.14159265f); - c->MovePC(c->GetX() - x2, c->GetY() - y2, c->GetZ(), c->GetHeading() * 2); + x2 = 10.0f * sin(c->GetHeading() / 256.0f * 3.14159265f); + y2 = 10.0f * cos(c->GetHeading() / 256.0f * 3.14159265f); + c->MovePC(c->GetX() - x2, c->GetY() - y2, c->GetZ(), c->GetHeading()); c->Message(0, "Spawning object with tentative id %u at location (%.1f, %.1f, %.1f heading %.1f). Use " "'#object Save' to save to database when satisfied with placement.", @@ -9186,14 +9184,13 @@ void command_object(Client *c, const Seperator *sep) (c->GetSize() * 0.625f); // Compensate for #loc bumping up Z coordinate by 62.5% of character's size. - o->SetHeading(c->GetHeading() * 2.0f); // Compensate for GetHeading() returning half of actual + o->SetHeading(c->GetHeading()); // Bump player back to avoid getting stuck inside object - // GetHeading() returns half of the actual heading, for some reason - x2 = 10.0f * sin(c->GetHeading() * 2.0f / 256.0f * 3.14159265f); - y2 = 10.0f * cos(c->GetHeading() * 2.0f / 256.0f * 3.14159265f); - c->MovePC(c->GetX() - x2, c->GetY() - y2, c->GetZ(), c->GetHeading() * 2.0f); + x2 = 10.0f * std::sin(c->GetHeading() / 256.0f * 3.14159265f); + y2 = 10.0f * std::cos(c->GetHeading() / 256.0f * 3.14159265f); + c->MovePC(c->GetX() - x2, c->GetY() - y2, c->GetZ(), c->GetHeading()); } // Move to x, y, z [h] else { od.x = atof(sep->arg[3]); diff --git a/zone/mob.cpp b/zone/mob.cpp index 0c0e20d81..3e9aff746 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1109,7 +1109,7 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) strn0cpy(ns->spawn.lastName, lastname, sizeof(ns->spawn.lastName)); } - ns->spawn.heading = FloatToEQ19(m_Position.w); + ns->spawn.heading = FloatToEQ12(m_Position.w); ns->spawn.x = FloatToEQ19(m_Position.x);//((int32)x_pos)<<3; ns->spawn.y = FloatToEQ19(m_Position.y);//((int32)y_pos)<<3; ns->spawn.z = FloatToEQ19(m_Position.z);//((int32)z_pos)<<3; @@ -1515,12 +1515,12 @@ void Mob::MakeSpawnUpdateNoDelta(PlayerPositionUpdateServer_Struct *spu) { spu->x_pos = FloatToEQ19(m_Position.x); spu->y_pos = FloatToEQ19(m_Position.y); spu->z_pos = FloatToEQ19(m_Position.z); - spu->delta_x = NewFloatToEQ13(0); - spu->delta_y = NewFloatToEQ13(0); - spu->delta_z = NewFloatToEQ13(0); - spu->heading = FloatToEQ19(m_Position.w); + spu->delta_x = FloatToEQ13(0); + spu->delta_y = FloatToEQ13(0); + spu->delta_z = FloatToEQ13(0); + spu->heading = FloatToEQ12(m_Position.w); spu->animation = 0; - spu->delta_heading = NewFloatToEQ13(0); + spu->delta_heading = FloatToEQ10(0); spu->padding0002 = 0; spu->padding0006 = 7; spu->padding0014 = 0x7f; @@ -1534,10 +1534,10 @@ void Mob::MakeSpawnUpdate(PlayerPositionUpdateServer_Struct* spu) { spu->x_pos = FloatToEQ19(m_Position.x); spu->y_pos = FloatToEQ19(m_Position.y); spu->z_pos = FloatToEQ19(m_Position.z); - spu->delta_x = NewFloatToEQ13(m_Delta.x); - spu->delta_y = NewFloatToEQ13(m_Delta.y); - spu->delta_z = NewFloatToEQ13(m_Delta.z); - spu->heading = FloatToEQ19(m_Position.w); + spu->delta_x = FloatToEQ13(m_Delta.x); + spu->delta_y = FloatToEQ13(m_Delta.y); + spu->delta_z = FloatToEQ13(m_Delta.z); + spu->heading = FloatToEQ12(m_Position.w); spu->padding0002 = 0; spu->padding0006 = 7; spu->padding0014 = 0x7f; @@ -1551,7 +1551,7 @@ void Mob::MakeSpawnUpdate(PlayerPositionUpdateServer_Struct* spu) { else spu->animation = pRunAnimSpeed;//animation; - spu->delta_heading = NewFloatToEQ13(m_Delta.w); + spu->delta_heading = FloatToEQ10(m_Delta.w); } void Mob::ShowStats(Client* client) @@ -2438,18 +2438,18 @@ float Mob::MobAngle(Mob *other, float ourx, float oury) const { float mobx = -(other->GetX()); // mob xloc (inverse because eq) float moby = other->GetY(); // mob yloc float heading = other->GetHeading(); // mob heading - heading = (heading * 360.0f) / 256.0f; // convert to degrees + heading = (heading * 360.0f) / 512.0f; // convert to degrees if (heading < 270) heading += 90; else heading -= 270; heading = heading * 3.1415f / 180.0f; // convert to radians - vectorx = mobx + (10.0f * cosf(heading)); // create a vector based on heading - vectory = moby + (10.0f * sinf(heading)); // of mob length 10 + vectorx = mobx + (10.0f * std::cos(heading)); // create a vector based on heading + vectory = moby + (10.0f * std::sin(heading)); // of mob length 10 // length of mob to player vector - lengthb = (float) sqrtf(((-ourx - mobx) * (-ourx - mobx)) + ((oury - moby) * (oury - moby))); + lengthb = (float) std::sqrt(((-ourx - mobx) * (-ourx - mobx)) + ((oury - moby) * (oury - moby))); // calculate dot product to get angle // Handle acos domain errors due to floating point rounding errors @@ -2462,7 +2462,7 @@ float Mob::MobAngle(Mob *other, float ourx, float oury) const { else if (dotp < -1) return 180.0f; - angle = acosf(dotp); + angle = std::acos(dotp); angle = angle * 180.0f / 3.1415f; return angle; @@ -2631,7 +2631,7 @@ bool Mob::PlotPositionAroundTarget(Mob* target, float &x_dest, float &y_dest, fl look_heading = target->GetHeading(); // Convert to sony heading to radians - look_heading = (look_heading / 256.0f) * 6.283184f; + look_heading = (look_heading / 512.0f) * 6.283184f; float tempX = 0; float tempY = 0; @@ -4676,16 +4676,16 @@ void Mob::DoKnockback(Mob *caster, uint32 pushback, uint32 pushup) spu->x_pos = FloatToEQ19(GetX()); spu->y_pos = FloatToEQ19(GetY()); spu->z_pos = FloatToEQ19(GetZ()); - spu->delta_x = NewFloatToEQ13(static_cast(new_x)); - spu->delta_y = NewFloatToEQ13(static_cast(new_y)); - spu->delta_z = NewFloatToEQ13(static_cast(pushup)); - spu->heading = FloatToEQ19(GetHeading()); + spu->delta_x = FloatToEQ13(static_cast(new_x)); + spu->delta_y = FloatToEQ13(static_cast(new_y)); + spu->delta_z = FloatToEQ13(static_cast(pushup)); + spu->heading = FloatToEQ12(GetHeading()); spu->padding0002 =0; spu->padding0006 =7; spu->padding0014 =0x7f; spu->padding0018 =0x5df27; spu->animation = 0; - spu->delta_heading = NewFloatToEQ13(0); + spu->delta_heading = FloatToEQ10(0); outapp_push->priority = 6; entity_list.QueueClients(this, outapp_push, true); CastToClient()->FastQueuePacket(&outapp_push); @@ -5003,7 +5003,7 @@ void Mob::DoGravityEffect() } if(IsClient()) - this->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), cur_x, cur_y, new_ground, GetHeading()*2); // I know the heading thing is weird(chance of movepc to halve the heading value, too lazy to figure out why atm) + this->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), cur_x, cur_y, new_ground, GetHeading()); else this->GMMove(cur_x, cur_y, new_ground, GetHeading()); } @@ -5640,8 +5640,7 @@ bool Mob::IsFacingMob(Mob *other) if (!other) return false; float angle = HeadingAngleToMob(other); - // what the client uses appears to be 2x our internal heading - float heading = GetHeading() * 2.0f; + float heading = GetHeading(); if (angle > 472.0 && heading < 40.0) angle = heading; @@ -5655,15 +5654,13 @@ bool Mob::IsFacingMob(Mob *other) } // All numbers derived from the client -float Mob::HeadingAngleToMob(Mob *other) +float Mob::HeadingAngleToMob(float other_x, float other_y) { - float mob_x = other->GetX(); - float mob_y = other->GetY(); float this_x = GetX(); float this_y = GetY(); - float y_diff = std::abs(this_y - mob_y); - float x_diff = std::abs(this_x - mob_x); + float y_diff = std::abs(this_y - other_y); + float x_diff = std::abs(this_x - other_x); if (y_diff < 0.0000009999999974752427) y_diff = 0.0000009999999974752427; @@ -5671,13 +5668,13 @@ float Mob::HeadingAngleToMob(Mob *other) // return the right thing based on relative quadrant // I'm sure this could be improved for readability, but whatever - if (this_y >= mob_y) { - if (mob_x >= this_x) + if (this_y >= other_y) { + if (other_x >= this_x) return (90.0f - angle + 90.0f) * 511.5f * 0.0027777778f; - if (mob_x <= this_x) + if (other_x <= this_x) return (angle + 180.0f) * 511.5f * 0.0027777778f; } - if (this_y > mob_y || mob_x > this_x) + if (this_y > other_y || other_x > this_x) return angle * 511.5f * 0.0027777778f; else return (90.0f - angle + 270.0f) * 511.5f * 0.0027777778f; diff --git a/zone/mob.h b/zone/mob.h index c223a45b4..23c0004df 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -177,7 +177,8 @@ public: inline bool InFrontMob(Mob *other = 0, float ourx = 0.0f, float oury = 0.0f) const { return (!other || other == this) ? true : MobAngle(other, ourx, oury) < 56.0f; } bool IsFacingMob(Mob *other); // kind of does the same as InFrontMob, but derived from client - float HeadingAngleToMob(Mob *other); // to keep consistent with client generated messages + float HeadingAngleToMob(Mob *other) { return HeadingAngleToMob(other->GetX(), other->GetY()); } + float HeadingAngleToMob(float other_x, float other_y); // to keep consistent with client generated messages virtual void RangedAttack(Mob* other) { } virtual void ThrowingAttack(Mob* other) { } // 13 = Primary (default), 14 = secondary @@ -970,7 +971,7 @@ public: inline bool IsBlind() { return spellbonuses.IsBlind; } inline bool CheckAggro(Mob* other) {return hate_list.IsEntOnHateList(other);} - float CalculateHeadingToTarget(float in_x, float in_y); + float CalculateHeadingToTarget(float in_x, float in_y) {return HeadingAngleToMob(in_x, in_y); } bool CalculateNewPosition(float x, float y, float z, int speed, bool checkZ = false, bool calcHeading = true); virtual bool CalculateNewPosition2(float x, float y, float z, int speed, bool checkZ = true, bool calcHeading = true); float CalculateDistance(float x, float y, float z); diff --git a/zone/position.cpp b/zone/position.cpp index 798ff145c..22885b4b1 100644 --- a/zone/position.cpp +++ b/zone/position.cpp @@ -150,13 +150,13 @@ float GetReciprocalHeading(const float heading) float result = 0; // Convert to radians - float h = (heading / 256.0f) * 6.283184f; + float h = (heading / 512.0f) * 6.283184f; // Calculate the reciprocal heading in radians result = h + 3.141592f; // Convert back to eq heading from radians - result = (result / 6.283184f) * 256.0f; + result = (result / 6.283184f) * 512.0f; return result; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 5f0305f3a..480479b2f 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -2115,16 +2115,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove spu->x_pos = FloatToEQ19(GetX()); spu->y_pos = FloatToEQ19(GetY()); spu->z_pos = FloatToEQ19(GetZ()); - spu->delta_x = NewFloatToEQ13(new_x); - spu->delta_y = NewFloatToEQ13(new_y); - spu->delta_z = NewFloatToEQ13(toss_amt); - spu->heading = FloatToEQ19(GetHeading()); + spu->delta_x = FloatToEQ13(new_x); + spu->delta_y = FloatToEQ13(new_y); + spu->delta_z = FloatToEQ13(toss_amt); + spu->heading = FloatToEQ12(GetHeading()); spu->padding0002 =0; spu->padding0006 =7; spu->padding0014 =0x7f; spu->padding0018 =0x5df27; spu->animation = 0; - spu->delta_heading = NewFloatToEQ13(0); + spu->delta_heading = FloatToEQ10(0); outapp_push->priority = 5; entity_list.QueueClients(this, outapp_push, true); if(IsClient()) @@ -2654,7 +2654,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove float new_ground = GetGroundZ(my_x, my_y); if(caster->IsClient()) - caster->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), my_x, my_y, new_ground, GetHeading()*2); + caster->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), my_x, my_y, new_ground, GetHeading()); else caster->GMMove(my_x, my_y, new_ground, GetHeading()); } diff --git a/zone/spells.cpp b/zone/spells.cpp index 8117a8018..78ef657aa 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2646,7 +2646,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { action->source = caster->GetID(); action->target = GetID(); action->spell = spell_id; - action->sequence = (uint32) (GetHeading() * 2); // just some random number + action->sequence = (uint32) (GetHeading()); // just some random number action->instrument_mod = caster->GetInstrumentMod(spell_id); action->buff_unknown = 0; action->level = buffs[buffs_i].casterlevel; @@ -2686,16 +2686,16 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { spu->x_pos = FloatToEQ19(GetX()); spu->y_pos = FloatToEQ19(GetY()); spu->z_pos = FloatToEQ19(GetZ()); - spu->delta_x = NewFloatToEQ13(new_x); - spu->delta_y = NewFloatToEQ13(new_y); - spu->delta_z = NewFloatToEQ13(spells[spell_id].pushup); - spu->heading = FloatToEQ19(GetHeading()); + spu->delta_x = FloatToEQ13(new_x); + spu->delta_y = FloatToEQ13(new_y); + spu->delta_z = FloatToEQ13(spells[spell_id].pushup); + spu->heading = FloatToEQ12(GetHeading()); spu->padding0002 =0; spu->padding0006 =7; spu->padding0014 =0x7f; spu->padding0018 =0x5df27; spu->animation = 0; - spu->delta_heading = NewFloatToEQ13(0); + spu->delta_heading = FloatToEQ10(0); outapp_push->priority = 6; entity_list.QueueClients(this, outapp_push, true); CastToClient()->FastQueuePacket(&outapp_push); @@ -3530,7 +3530,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r action->level = caster_level; // caster level, for animation only action->type = 231; // 231 means a spell action->spell = spell_id; - action->sequence = (uint32) (GetHeading() * 2); // just some random number + action->sequence = (uint32) (GetHeading()); // just some random number action->instrument_mod = GetInstrumentMod(spell_id); action->buff_unknown = 0; @@ -3992,16 +3992,16 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r spu->x_pos = FloatToEQ19(spelltar->GetX()); spu->y_pos = FloatToEQ19(spelltar->GetY()); spu->z_pos = FloatToEQ19(spelltar->GetZ()); - spu->delta_x = NewFloatToEQ13(new_x); - spu->delta_y = NewFloatToEQ13(new_y); - spu->delta_z = NewFloatToEQ13(spells[spell_id].pushup); - spu->heading = FloatToEQ19(spelltar->GetHeading()); + spu->delta_x = FloatToEQ13(new_x); + spu->delta_y = FloatToEQ13(new_y); + spu->delta_z = FloatToEQ13(spells[spell_id].pushup); + spu->heading = FloatToEQ12(spelltar->GetHeading()); spu->padding0002 =0; spu->padding0006 =7; spu->padding0014 =0x7f; spu->padding0018 =0x5df27; spu->animation = 0; - spu->delta_heading = NewFloatToEQ13(0); + spu->delta_heading = FloatToEQ10(0); outapp_push->priority = 6; entity_list.QueueClients(this, outapp_push, true); spelltar->CastToClient()->FastQueuePacket(&outapp_push); @@ -5727,8 +5727,8 @@ void Mob::CalcDestFromHeading(float heading, float distance, float MaxZDiff, flo if (!distance) { return; } if (!MaxZDiff) { MaxZDiff = 5; } - float ReverseHeading = 256 - heading; - float ConvertAngle = ReverseHeading * 1.40625f; + float ReverseHeading = 512 - heading; + float ConvertAngle = ReverseHeading * 360.0f / 512.0f; if (ConvertAngle <= 270) ConvertAngle = ConvertAngle + 90; else @@ -5736,8 +5736,8 @@ void Mob::CalcDestFromHeading(float heading, float distance, float MaxZDiff, flo float Radian = ConvertAngle * (3.1415927f / 180.0f); - float CircleX = distance * cos(Radian); - float CircleY = distance * sin(Radian); + float CircleX = distance * std::cos(Radian); + float CircleY = distance * std::sin(Radian); dX = CircleX + StartX; dY = CircleY + StartY; dZ = FindGroundZ(dX, dY, MaxZDiff); @@ -5802,7 +5802,8 @@ void Mob::BeamDirectional(uint16 spell_id, int16 resist_adjust) maxtarget_count++; } - if (maxtarget_count >= spells[spell_id].aemaxtargets) + // not sure if we need this check, but probably do, need to check if it should be default limited or not + if (spells[spell_id].aemaxtargets && maxtarget_count >= spells[spell_id].aemaxtargets) return; } ++iter; @@ -5817,8 +5818,10 @@ void Mob::ConeDirectional(uint16 spell_id, int16 resist_adjust) if (IsBeneficialSpell(spell_id) && IsClient()) beneficial_targets = true; - float angle_start = spells[spell_id].directional_start + (GetHeading() * 360.0f / 256.0f); - float angle_end = spells[spell_id].directional_end + (GetHeading() * 360.0f / 256.0f); + float heading = GetHeading() * 360.0f / 512.0f; // convert to degrees + + float angle_start = spells[spell_id].directional_start + heading; + float angle_end = spells[spell_id].directional_end + heading; while (angle_start > 360.0f) angle_start -= 360.0f; @@ -5839,7 +5842,7 @@ void Mob::ConeDirectional(uint16 spell_id, int16 resist_adjust) } float heading_to_target = - (CalculateHeadingToTarget((*iter)->GetX(), (*iter)->GetY()) * 360.0f / 256.0f); + (CalculateHeadingToTarget((*iter)->GetX(), (*iter)->GetY()) * 360.0f / 512.0f); while (heading_to_target < 0.0f) heading_to_target += 360.0f; @@ -5883,7 +5886,8 @@ void Mob::ConeDirectional(uint16 spell_id, int16 resist_adjust) } } - if (maxtarget_count >= spells[spell_id].aemaxtargets) + // my SHM breath could hit all 5 dummies I could summon in arena + if (spells[spell_id].aemaxtargets && maxtarget_count >= spells[spell_id].aemaxtargets) return; ++iter; diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 8f9c902bb..45d199277 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -435,27 +435,6 @@ float Mob::CalculateDistance(float x, float y, float z) { return (float)sqrtf(((m_Position.x - x)*(m_Position.x - x)) + ((m_Position.y - y)*(m_Position.y - y)) + ((m_Position.z - z)*(m_Position.z - z))); } -float Mob::CalculateHeadingToTarget(float in_x, float in_y) { - float angle; - - if (in_x - m_Position.x > 0) - angle = -90 + atan((float)(in_y - m_Position.y) / (float)(in_x - m_Position.x)) * 180 / M_PI; - else if (in_x - m_Position.x < 0) - angle = +90 + atan((float)(in_y - m_Position.y) / (float)(in_x - m_Position.x)) * 180 / M_PI; - else // Added? - { - if (in_y - m_Position.y > 0) - angle = 0; - else - angle = 180; - } - if (angle < 0) - angle += 360; - if (angle > 360) - angle -= 360; - return (256 * (360 - angle) / 360.0f); -} - bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, int speed, bool checkZ, bool calcHeading) { if (GetID() == 0) return true; From cbd68ff8c873c2641074bb3831bf5b3e6379c75d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Feb 2018 01:18:52 -0600 Subject: [PATCH 09/10] Add new heading format conversion routine - eqemu_server.pl quest_heading_convert --- utils/scripts/eqemu_server.pl | 142 +++++++++++++++++++++++++++++++++- 1 file changed, 141 insertions(+), 1 deletion(-) diff --git a/utils/scripts/eqemu_server.pl b/utils/scripts/eqemu_server.pl index c70862aaa..8921cf89f 100644 --- a/utils/scripts/eqemu_server.pl +++ b/utils/scripts/eqemu_server.pl @@ -776,6 +776,13 @@ sub show_menu_prompt { print "Enter a command #> "; $last_menu = trim($input); } + elsif($input eq "conversions"){ + print "\n>>> Conversions Menu\n\n"; + print " [quest_heading_convert] Converts old heading format in quest scripts to new (live format)\n"; + print " \n> main - go back to main menu\n"; + print "Enter a command #> "; + $last_menu = trim($input); + } elsif($input eq "assets"){ print "\n>>> Server Assets Menu\n\n"; print " [maps] Download latest maps\n"; @@ -784,7 +791,7 @@ sub show_menu_prompt { print " [plugins] Download latest plugins\n"; print " [lua_modules] Download latest lua_modules\n"; print " [utility_scripts] Download utility scripts to run and operate the EQEmu Server\n"; - if($OS eq "Windows"){ + if($OS eq "Windows") { print ">>> Windows\n"; print " [windows_server_download] Updates server via latest 'stable' code\n"; print " [windows_server_latest] Updates server via latest commit 'unstable'\n"; @@ -818,6 +825,7 @@ sub show_menu_prompt { elsif($input eq "new_server"){ new_server(); $dc = 1; } elsif($input eq "setup_bots"){ setup_bots(); $dc = 1; } elsif($input eq "linux_login_server_setup"){ do_linux_login_server_setup(); $dc = 1; } + elsif($input eq "quest_heading_convert"){ quest_heading_convert(); $dc = 1; } elsif($input eq "exit"){ exit; } @@ -868,6 +876,7 @@ sub print_main_menu { print " [assets] Manage server assets \n"; print " [new_server] New folder EQEmu/PEQ install - Assumes MySQL/Perl installed \n"; print " [setup_bots] Enables bots on server - builds code and database requirements \n"; + print " [conversions] Routines used for conversion of scripts/data \n"; print "\n"; print " exit \n"; print "\n"; @@ -2257,3 +2266,134 @@ sub generate_random_password { return $randpassword; } +sub quest_heading_convert { + + if(trim(get_mysql_result("SELECT value FROM variables WHERE varname = 'new_heading_conversion'")) eq "true") { + print "Conversion script has already ran... doing this again would skew proper heading values in function calls...\n"; + exit; + } + + %matches = ( + 0 => ["quest::spawn2", 6], + 1 => ["eq.spawn2", 6], + 2 => ["eq.unique_spawn", 6], + 3 => ["quest::unique_spawn", 6], + 4 => ["GMMove", 3], + 5 => ["MovePCInstance", 5], + 6 => ["MovePC", 4], + 7 => ["moveto", 3], + ); + + $total_matches = 0; + + use Scalar::Util qw(looks_like_number); + + my @files; + my $start_dir = "quests/."; + find( + sub { push @files, $File::Find::name unless -d; }, + $start_dir + ); + for my $file (@files) { + + #::: Skip non script files + if($file!~/lua|pl/i){ next; } + + if($file=~/lua|pl/i){ + $print_buffer = ""; + + $changes_made = 0; + + #::: Open and read line by line + open (FILE, $file); + while () { + chomp; + $line = $_; + + #::: Loop through matches + foreach my $key (sort(keys %matches)) { + $argument_position = $matches{$key}[1]; + $match = $matches{$key}[0]; + + if($line=~/$match/i) { + $line_temp = $line; + $line_temp =~s/$match\(//g; + $line_temp =~s/\(.*?\)//gs; + $line_temp =~s/\);.*//; + $line_temp =~s/\).*//; + $line_temp =~s/\):.*//; + $line_temp =~s/\);//g; + + @line_data = split(",", $line_temp); + + # use Data::Dumper; + # print Dumper(\@line_data); + + $heading_value = $line_data[$argument_position]; + $heading_value_clean = trim($heading_value); + $heading_value_raw = $line_data[$argument_position]; + $heading_value_before = $line_data[$argument_position - 1]; + + if (looks_like_number($heading_value) && $heading_value != 0 && ($heading_value * 2) <= 512) { + $heading_value_new = $heading_value * 2; + + $heading_value=~s/$heading_value_clean/$heading_value_new/g; + + $heading_value_search = quotemeta($heading_value_before . "," . $heading_value_raw); + $heading_value_replace = $heading_value_before . "," . $heading_value; + + print $file . "\n"; + print $line . "\n"; + $line=~s/$heading_value_search/$heading_value_replace/g; + print $line . "\n"; + print "\n"; + + $changes_made = 1; + } + elsif ($heading_value == 0){} #::: Do nothing + elsif ($heading_value=~/GetHeading|heading|\$h/i){} #::: Do nothing + else { + if ($file=~/\.pl/i) { + if($line_temp=~/#/i) { + $line .= " - needs_heading_validation"; + } + else { + $line .= " # needs_heading_validation"; + } + } + elsif ($file=~/\.lua/i) { + if($line_temp=~/--/i) { + $line .= " - needs_heading_validation"; + } + else { + $line .= " -- needs_heading_validation"; + } + } + + $changes_made = 1; + + print $line . "\n"; + } + + $total_matches++; + } + } + + $print_buffer .= $line . "\n"; + } + close (FILE); + + if($changes_made == 1) { + #::: Write changes + open (NEW_FILE, '>', $file); + print NEW_FILE $print_buffer; + close NEW_FILE; + } + } + } + + #::: Mark conversion as ran + print get_mysql_result("INSERT INTO `variables` (varname, value, information, ts) VALUES ('new_heading_conversion', 'true', 'Script ran against quests folder to convert new heading values', NOW())"); + + print "Total matches: " . $total_matches . "\n"; +} \ No newline at end of file From 27225b6047fe8f6b2839c6f270ec4cadf170d6f8 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 16 Feb 2018 15:38:17 -0500 Subject: [PATCH 10/10] Update changelog [skip ci] --- changelog.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 8daf85938..f515e8e49 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,7 +5,8 @@ mackal: Fix Heading -- Quests broken Please report any other issues with heading, most things were tested and worked -Run akkadius' script to fix your quests +You can use eqemu_server.pl to run a conversion to fix your headings in quests. +Some may need manual review. == 02/10/2018 == mackal: Add Global Loot system