Merge branch 'master' into nats

Conflicts:
	zone/loottables.cpp
This commit is contained in:
Xackery 2018-02-16 15:11:21 -08:00
commit feec425be9
39 changed files with 1146 additions and 197 deletions

View File

@ -1,5 +1,23 @@
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
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
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

View File

@ -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<float>(d) / 64.0f;
}
float EQ19toFloat(int d)
{
return ( float(d)/float(1<<3));
return static_cast<float>(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<int>(d * 64.0f);
}
int FloatToEQ19(float d)
{
return int(d*float(1<<3));
return static_cast<int>(d * 8.0f);
}
float EQ12toFloat(int d)
{
return static_cast<float>(d) / 4.0f;
}
int FloatToEQ12(float d)
{
return static_cast<int>((d + 2048.0f) * 4.0f) % 2048;
}
float EQ10toFloat(int d)
{
return static_cast<float>(d) / 20.0f;
}
int FloatToEQ10(float d)
{
return static_cast<int>(d * 20.0f);
}
float EQSpeedRunToFloat(int d)
{
return static_cast<float>(d) / 40.0f;
}
int FloatToEQSpeedRun(float d)
{
return static_cast<int>(d * 40.0f);
}
/*

View File

@ -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);

View File

@ -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;
};

View File

@ -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)

View File

@ -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 9120
#ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9018
#else

View File

@ -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 (<FILE>) {
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";
}

View File

@ -372,6 +372,8 @@
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|
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

View File

@ -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;

View File

@ -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)
);

View File

@ -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

View File

@ -68,6 +68,7 @@ SET(zone_sources
exp.cpp
fearpath.cpp
forage.cpp
global_loot_manager.cpp
groups.cpp
guild.cpp
guild_mgr.cpp
@ -159,6 +160,7 @@ SET(zone_headers
errmsg.h
event_codes.h
forage.h
global_loot_manager.h
groups.h
guild_mgr.h
hate_list.h

View File

@ -360,7 +360,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
@ -3614,13 +3614,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?
@ -4448,6 +4448,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;

View File

@ -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()

View File

@ -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);

View File

@ -4408,7 +4408,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));
@ -4418,7 +4418,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;
@ -4563,7 +4563,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
@ -4616,7 +4616,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 */
@ -4635,7 +4635,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));

View File

@ -1962,57 +1962,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)

View File

@ -360,9 +360,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) ||
@ -2462,7 +2464,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
@ -3861,6 +3865,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()) {
@ -8753,7 +8763,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) {
@ -8858,11 +8868,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.",
@ -9180,14 +9188,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]);
@ -10445,6 +10452,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

View File

@ -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);

View File

@ -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...");
}
}
}

View File

@ -0,0 +1,98 @@
#include "global_loot_manager.h"
#include "npc.h"
#include "client.h"
std::vector<int> 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<int> 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;
}

View File

@ -0,0 +1,61 @@
#ifndef GLOBAL_LOOT_MANAGER_H
#define GLOBAL_LOOT_MANAGER_H
#include <vector>
#include <string>
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<GlobalLoot::Rule> 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<GlobalLootEntry> m_entries;
public:
std::vector<int> 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 */

View File

@ -27,6 +27,7 @@
#include "npc.h"
#include "zonedb.h"
#include "nats_manager.h"
#include "global_loot_manager.h"
#include <iostream>
#include <stdlib.h>
@ -40,10 +41,14 @@ extern NatsManager nats;
// 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)
@ -58,17 +63,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) {
@ -83,6 +90,7 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* ite
*copper = cash;
}
uint32 global_loot_multiplier = RuleI(Zone, GlobalLootMultiplier);
// Do items
@ -448,3 +456,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);
}
}

View File

@ -268,6 +268,7 @@ Mob::Mob(const char* in_name,
IsFullHP = (cur_hp == max_hp);
qglobal = 0;
spawned = false;
rare_spawn = false;
InitializeBuffSlots();
@ -1110,7 +1111,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;
@ -1518,12 +1519,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;
@ -1537,10 +1538,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;
@ -1554,7 +1555,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)
@ -2441,18 +2442,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
@ -2465,7 +2466,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;
@ -2634,7 +2635,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;
@ -4682,16 +4683,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<float>(new_x));
spu->delta_y = NewFloatToEQ13(static_cast<float>(new_y));
spu->delta_z = NewFloatToEQ13(static_cast<float>(pushup));
spu->heading = FloatToEQ19(GetHeading());
spu->delta_x = FloatToEQ13(static_cast<float>(new_x));
spu->delta_y = FloatToEQ13(static_cast<float>(new_y));
spu->delta_z = FloatToEQ13(static_cast<float>(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);
@ -5011,7 +5012,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());
}
@ -5648,8 +5649,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;
@ -5663,15 +5663,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;
@ -5679,13 +5677,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;

View File

@ -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
@ -689,6 +690,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) { }
@ -968,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);
@ -1225,6 +1228,7 @@ protected:
uint32 follow;
uint32 follow_dist;
bool no_target_hotkey;
bool rare_spawn;
uint32 m_PlayerState;
uint32 GetPlayerState() { return m_PlayerState; }

View File

@ -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;
@ -2148,6 +2151,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;

View File

@ -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;
};

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -2120,16 +2120,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())
@ -2659,7 +2659,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());
}

View File

@ -2651,7 +2651,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;
@ -2691,16 +2691,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);
@ -3535,7 +3535,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;
@ -3997,16 +3997,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);
@ -5733,8 +5733,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
@ -5742,8 +5742,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);
@ -5808,7 +5808,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;
@ -5823,8 +5824,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;
@ -5845,7 +5848,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;
@ -5889,7 +5892,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;

View File

@ -170,6 +170,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);
}
@ -193,6 +195,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);
}
@ -558,4 +562,4 @@ void Trap::UpdateTrap(bool respawn, bool repopnow)
{
database.SetTrapData(this, repopnow);
}
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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<int, item_tick_struct> tick_items;
inline std::vector<int> 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

View File

@ -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()) {

View File

@ -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);

View File

@ -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 {