Update npc_types table.

- d_meele_texture1 -> d_melee_texture1
- d_meele_texture2 -> d_melee_texture2
- Required SQL: 2014_12_24_npc_types_update.sql
This commit is contained in:
Kinglykrab 2014-12-24 01:26:07 -05:00
parent 3bb816ad1d
commit 1329a2f9ba
16 changed files with 49 additions and 46 deletions

View File

@ -30,7 +30,7 @@
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/ */
#define CURRENT_BINARY_DATABASE_VERSION 9062 #define CURRENT_BINARY_DATABASE_VERSION 9063
#define COMPILE_DATE __DATE__ #define COMPILE_DATE __DATE__
#define COMPILE_TIME __TIME__ #define COMPILE_TIME __TIME__
#ifndef WIN32 #ifndef WIN32

View File

@ -316,6 +316,7 @@
9060|2014_12_09_items_table_update.sql|SHOW COLUMNS FROM `items` LIKE 'herosforgemodel'|empty| 9060|2014_12_09_items_table_update.sql|SHOW COLUMNS FROM `items` LIKE 'herosforgemodel'|empty|
9061|2014_12_13_inventory_table_update.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornament_hero_model'|empty| 9061|2014_12_13_inventory_table_update.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornament_hero_model'|empty|
9062|2014_12_15_multiple_table_updates.sql|SHOW COLUMNS FROM `items` LIKE 'augslot6type'|empty| 9062|2014_12_15_multiple_table_updates.sql|SHOW COLUMNS FROM `items` LIKE 'augslot6type'|empty|
9063|2014_12_24_npc_types_update.sql|SHOW COLUMNS FROM `npc_types` LIKE 'd_melee_texture1'|empty|
# Upgrade conditions: # Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not # This won't be needed after this system is implemented, but it is used database that are not

View File

@ -0,0 +1,2 @@
ALTER TABLE `npc_types` CHANGE `d_meele_texture1` `d_melee_texture1` INT(11) DEFAULT NULL;
ALTER TABLE `npc_types` CHANGE `d_meele_texture2` `d_melee_texture2` INT(11) DEFAULT NULL;

View File

@ -844,8 +844,8 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration)
make_npc->loottable_id = 0; make_npc->loottable_id = 0;
make_npc->merchanttype = 0; make_npc->merchanttype = 0;
make_npc->d_meele_texture1 = 0; make_npc->d_melee_texture1 = 0;
make_npc->d_meele_texture2 = 0; make_npc->d_melee_texture2 = 0;
NPC* npca = new NPC(make_npc, 0, GetX(), GetY(), GetZ(), GetHeading(), FlyMode3); NPC* npca = new NPC(make_npc, 0, GetX(), GetY(), GetZ(), GetHeading(), FlyMode3);

View File

@ -386,8 +386,8 @@ NPCType Bot::FillNPCTypeStruct(uint32 botSpellsID, std::string botName, std::str
BotNPCType.npc_id = 0; BotNPCType.npc_id = 0;
BotNPCType.texture = 0; BotNPCType.texture = 0;
BotNPCType.d_meele_texture1 = 0; BotNPCType.d_melee_texture1 = 0;
BotNPCType.d_meele_texture2 = 0; BotNPCType.d_melee_texture2 = 0;
BotNPCType.qglobal = false; BotNPCType.qglobal = false;
BotNPCType.attack_speed = 0; BotNPCType.attack_speed = 0;
BotNPCType.runspeed = 1.25; BotNPCType.runspeed = 1.25;
@ -431,8 +431,8 @@ NPCType Bot::CreateDefaultNPCTypeStructForBot(std::string botName, std::string b
Result.hp_regen = 1; Result.hp_regen = 1;
Result.mana_regen = 1; Result.mana_regen = 1;
Result.texture = 0; Result.texture = 0;
Result.d_meele_texture1 = 0; Result.d_melee_texture1 = 0;
Result.d_meele_texture2 = 0; Result.d_melee_texture2 = 0;
Result.qglobal = false; Result.qglobal = false;
Result.npc_spells_id = 0; Result.npc_spells_id = 0;
Result.attack_speed = 0; Result.attack_speed = 0;

View File

@ -6305,8 +6305,8 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
made_npc->drakkin_heritage = GetDrakkinHeritage(); made_npc->drakkin_heritage = GetDrakkinHeritage();
made_npc->drakkin_tattoo = GetDrakkinTattoo(); made_npc->drakkin_tattoo = GetDrakkinTattoo();
made_npc->drakkin_details = GetDrakkinDetails(); made_npc->drakkin_details = GetDrakkinDetails();
made_npc->d_meele_texture1 = GetEquipmentMaterial(MaterialPrimary); made_npc->d_melee_texture1 = GetEquipmentMaterial(MaterialPrimary);
made_npc->d_meele_texture2 = GetEquipmentMaterial(MaterialSecondary); made_npc->d_melee_texture2 = GetEquipmentMaterial(MaterialSecondary);
for (int i = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_END; i++) { for (int i = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_END; i++) {
made_npc->armor_tint[i] = GetEquipmentColor(i); made_npc->armor_tint[i] = GetEquipmentColor(i);
} }

View File

@ -6732,7 +6732,7 @@ void command_npcedit(Client *c, const Seperator *sep)
c->Message(15,"NPCID %u will have item graphic %i set to his primary on repop.", c->Message(15,"NPCID %u will have item graphic %i set to his primary on repop.",
npcTypeID, atoi(sep->arg[2])); npcTypeID, atoi(sep->arg[2]));
std::string query = StringFormat("UPDATE npc_types SET d_meele_texture1 = %i WHERE id = %i", std::string query = StringFormat("UPDATE npc_types SET d_melee_texture1 = %i WHERE id = %i",
atoi(sep->argplus[2]), npcTypeID); atoi(sep->argplus[2]), npcTypeID);
database.QueryDatabase(query); database.QueryDatabase(query);
c->LogSQL(query.c_str()); c->LogSQL(query.c_str());
@ -6743,7 +6743,7 @@ void command_npcedit(Client *c, const Seperator *sep)
c->Message(15,"NPCID %u will have item graphic %i set to his secondary on repop.", c->Message(15,"NPCID %u will have item graphic %i set to his secondary on repop.",
npcTypeID, atoi(sep->arg[2])); npcTypeID, atoi(sep->arg[2]));
std::string query = StringFormat("UPDATE npc_types SET d_meele_texture2 = %i WHERE id = %i", std::string query = StringFormat("UPDATE npc_types SET d_melee_texture2 = %i WHERE id = %i",
atoi(sep->argplus[2]), npcTypeID); atoi(sep->argplus[2]), npcTypeID);
database.QueryDatabase(query); database.QueryDatabase(query);
c->LogSQL(query.c_str()); c->LogSQL(query.c_str());

View File

@ -324,7 +324,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
what was this about??? what was this about???
if (((npc->GetRace()==127) && (npc->CastToMob()->GetOwnerID()!=0)) && (item2->Slots==24576) || (item2->Slots==8192) || (item2->Slots==16384)){ if (((npc->GetRace()==127) && (npc->CastToMob()->GetOwnerID()!=0)) && (item2->Slots==24576) || (item2->Slots==8192) || (item2->Slots==16384)){
npc->d_meele_texture2=atoi(newid); npc->d_melee_texture2=atoi(newid);
wc->wear_slot_id=8; wc->wear_slot_id=8;
if (item2->Material >0) if (item2->Material >0)
wc->material=item2->Material; wc->material=item2->Material;

View File

@ -1354,8 +1354,8 @@ void lua_create_npc(luabind::adl::object table, float x, float y, float z, float
LuaCreateNPCParse(max_dmg, uint32, 4); LuaCreateNPCParse(max_dmg, uint32, 4);
LuaCreateNPCParse(attack_count, int16, 0); LuaCreateNPCParse(attack_count, int16, 0);
LuaCreateNPCParseString(special_abilities, 512, ""); LuaCreateNPCParseString(special_abilities, 512, "");
LuaCreateNPCParse(d_meele_texture1, uint16, 0); LuaCreateNPCParse(d_melee_texture1, uint16, 0);
LuaCreateNPCParse(d_meele_texture2, uint16, 0); LuaCreateNPCParse(d_melee_texture2, uint16, 0);
LuaCreateNPCParseString(ammo_idfile, 32, ""); LuaCreateNPCParseString(ammo_idfile, 32, "");
LuaCreateNPCParse(prim_melee_type, uint8, 0); LuaCreateNPCParse(prim_melee_type, uint8, 0);
LuaCreateNPCParse(sec_melee_type, uint8, 0); LuaCreateNPCParse(sec_melee_type, uint8, 0);

View File

@ -287,8 +287,8 @@ protected:
uint16 skills[HIGHEST_SKILL+1]; uint16 skills[HIGHEST_SKILL+1];
uint32 equipment[EmuConstants::EQUIPMENT_SIZE]; //this is an array of item IDs uint32 equipment[EmuConstants::EQUIPMENT_SIZE]; //this is an array of item IDs
uint16 d_meele_texture1; //this is an item Material value uint16 d_melee_texture1; //this is an item Material value
uint16 d_meele_texture2; //this is an item Material value (offhand) uint16 d_melee_texture2; //this is an item Material value (offhand)
uint8 prim_melee_type; //Sets the Primary Weapon attack message and animation uint8 prim_melee_type; //Sets the Primary Weapon attack message and animation
uint8 sec_melee_type; //Sets the Secondary Weapon attack message and animation uint8 sec_melee_type; //Sets the Secondary Weapon attack message and animation

View File

@ -261,8 +261,8 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float
if(!IsMerc()) if(!IsMerc())
AI_Start(); AI_Start();
d_meele_texture1 = d->d_meele_texture1; d_melee_texture1 = d->d_melee_texture1;
d_meele_texture2 = d->d_meele_texture2; d_melee_texture2 = d->d_melee_texture2;
ammo_idfile = d->ammo_idfile; ammo_idfile = d->ammo_idfile;
memset(equipment, 0, sizeof(equipment)); memset(equipment, 0, sizeof(equipment));
prim_melee_type = d->prim_melee_type; prim_melee_type = d->prim_melee_type;
@ -270,9 +270,9 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float
ranged_type = d->ranged_type; ranged_type = d->ranged_type;
// If Melee Textures are not set, set attack type to Hand to Hand as default // If Melee Textures are not set, set attack type to Hand to Hand as default
if(!d_meele_texture1) if(!d_melee_texture1)
prim_melee_type = 28; prim_melee_type = 28;
if(!d_meele_texture2) if(!d_melee_texture2)
sec_melee_type = 28; sec_melee_type = 28;
//give NPCs skill values... //give NPCs skill values...
@ -924,8 +924,8 @@ NPC* NPC::SpawnNPC(const char* spawncommand, float in_x, float in_y, float in_z,
npc_type->texture = atoi(sep.arg[3]); npc_type->texture = atoi(sep.arg[3]);
npc_type->light = 0; npc_type->light = 0;
npc_type->runspeed = 1.25; npc_type->runspeed = 1.25;
npc_type->d_meele_texture1 = atoi(sep.arg[7]); npc_type->d_melee_texture1 = atoi(sep.arg[7]);
npc_type->d_meele_texture2 = atoi(sep.arg[8]); npc_type->d_melee_texture2 = atoi(sep.arg[8]);
npc_type->merchanttype = atoi(sep.arg[9]); npc_type->merchanttype = atoi(sep.arg[9]);
npc_type->bodytype = atoi(sep.arg[10]); npc_type->bodytype = atoi(sep.arg[10]);
@ -957,7 +957,7 @@ NPC* NPC::SpawnNPC(const char* spawncommand, float in_x, float in_y, float in_z,
client->Message(0, "Current/Max HP: %i", npc->max_hp); client->Message(0, "Current/Max HP: %i", npc->max_hp);
client->Message(0, "Gender: %u", npc->gender); client->Message(0, "Gender: %u", npc->gender);
client->Message(0, "Class: %u", npc->class_); client->Message(0, "Class: %u", npc->class_);
client->Message(0, "Weapon Item Number: %u/%u", npc->d_meele_texture1, npc->d_meele_texture2); client->Message(0, "Weapon Item Number: %u/%u", npc->d_melee_texture1, npc->d_melee_texture2);
client->Message(0, "MerchantID: %u", npc->MerchantType); client->Message(0, "MerchantID: %u", npc->MerchantType);
client->Message(0, "Bodytype: %u", npc->bodytype); client->Message(0, "Bodytype: %u", npc->bodytype);
} }
@ -1335,9 +1335,9 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
case MaterialChest: case MaterialChest:
return texture; return texture;
case MaterialPrimary: case MaterialPrimary:
return d_meele_texture1; return d_melee_texture1;
case MaterialSecondary: case MaterialSecondary:
return d_meele_texture2; return d_melee_texture2;
default: default:
//they have nothing in the slot, and its not a special slot... they get nothing. //they have nothing in the slot, and its not a special slot... they get nothing.
return(0); return(0);
@ -2136,10 +2136,10 @@ uint32 NPC::GetSpawnPointID() const
void NPC::NPCSlotTexture(uint8 slot, uint16 texture) void NPC::NPCSlotTexture(uint8 slot, uint16 texture)
{ {
if (slot == 7) { if (slot == 7) {
d_meele_texture1 = texture; d_melee_texture1 = texture;
} }
else if (slot == 8) { else if (slot == 8) {
d_meele_texture2 = texture; d_melee_texture2 = texture;
} }
else if (slot < 6) { else if (slot < 6) {
// Reserved for texturing individual armor slots // Reserved for texturing individual armor slots

View File

@ -492,8 +492,8 @@ protected:
uint16 skills[HIGHEST_SKILL+1]; uint16 skills[HIGHEST_SKILL+1];
uint32 equipment[EmuConstants::EQUIPMENT_SIZE]; //this is an array of item IDs uint32 equipment[EmuConstants::EQUIPMENT_SIZE]; //this is an array of item IDs
uint16 d_meele_texture1; //this is an item Material value uint16 d_melee_texture1; //this is an item Material value
uint16 d_meele_texture2; //this is an item Material value (offhand) uint16 d_melee_texture2; //this is an item Material value (offhand)
const char* ammo_idfile; //this determines projectile graphic "IT###" (see item field 'idfile') const char* ammo_idfile; //this determines projectile graphic "IT###" (see item field 'idfile')
uint8 prim_melee_type; //Sets the Primary Weapon attack message and animation uint8 prim_melee_type; //Sets the Primary Weapon attack message and animation
uint8 sec_melee_type; //Sets the Secondary Weapon attack message and animation uint8 sec_melee_type; //Sets the Secondary Weapon attack message and animation

View File

@ -573,8 +573,8 @@ void PathManager::SpawnPathNodes()
npc_type->texture = 1; npc_type->texture = 1;
npc_type->light = 0; npc_type->light = 0;
npc_type->runspeed = 0; npc_type->runspeed = 0;
npc_type->d_meele_texture1 = 1; npc_type->d_melee_texture1 = 1;
npc_type->d_meele_texture2 = 1; npc_type->d_melee_texture2 = 1;
npc_type->merchanttype = 1; npc_type->merchanttype = 1;
npc_type->bodytype = 1; npc_type->bodytype = 1;
@ -1561,8 +1561,8 @@ int32 PathManager::AddNode(float x, float y, float z, float best_z, int32 reques
npc_type->texture = 1; npc_type->texture = 1;
npc_type->light = 0; npc_type->light = 0;
npc_type->runspeed = 0; npc_type->runspeed = 0;
npc_type->d_meele_texture1 = 1; npc_type->d_melee_texture1 = 1;
npc_type->d_meele_texture2 = 1; npc_type->d_melee_texture2 = 1;
npc_type->merchanttype = 1; npc_type->merchanttype = 1;
npc_type->bodytype = 1; npc_type->bodytype = 1;
npc_type->STR = 150; npc_type->STR = 150;
@ -1621,8 +1621,8 @@ int32 PathManager::AddNode(float x, float y, float z, float best_z, int32 reques
npc_type->texture = 1; npc_type->texture = 1;
npc_type->light = 0; npc_type->light = 0;
npc_type->runspeed = 0; npc_type->runspeed = 0;
npc_type->d_meele_texture1 = 1; npc_type->d_melee_texture1 = 1;
npc_type->d_meele_texture2 = 1; npc_type->d_melee_texture2 = 1;
npc_type->merchanttype = 1; npc_type->merchanttype = 1;
npc_type->bodytype = 1; npc_type->bodytype = 1;
npc_type->STR = 150; npc_type->STR = 150;

View File

@ -315,8 +315,8 @@ void Trap::CreateHiddenTrigger()
make_npc->gender = 0; make_npc->gender = 0;
make_npc->loottable_id = 0; make_npc->loottable_id = 0;
make_npc->npc_spells_id = 0; make_npc->npc_spells_id = 0;
make_npc->d_meele_texture1 = 0; make_npc->d_melee_texture1 = 0;
make_npc->d_meele_texture2 = 0; make_npc->d_melee_texture2 = 0;
make_npc->trackable = 0; make_npc->trackable = 0;
make_npc->level = level; make_npc->level = level;
strcpy(make_npc->special_abilities, "19,1^20,1^24,1^25,1"); strcpy(make_npc->special_abilities, "19,1^20,1^24,1^25,1");

View File

@ -1747,8 +1747,8 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) {
"npc_types.WIS, npc_types.CHA, npc_types.MR, npc_types.CR, npc_types.DR, " "npc_types.WIS, npc_types.CHA, npc_types.MR, npc_types.CR, npc_types.DR, "
"npc_types.FR, npc_types.PR, npc_types.Corrup, npc_types.PhR," "npc_types.FR, npc_types.PR, npc_types.Corrup, npc_types.PhR,"
"npc_types.mindmg, npc_types.maxdmg, npc_types.attack_count, npc_types.special_abilities," "npc_types.mindmg, npc_types.maxdmg, npc_types.attack_count, npc_types.special_abilities,"
"npc_types.npc_spells_id, npc_types.npc_spells_effects_id, npc_types.d_meele_texture1," "npc_types.npc_spells_id, npc_types.npc_spells_effects_id, npc_types.d_melee_texture1,"
"npc_types.d_meele_texture2, npc_types.ammo_idfile, npc_types.prim_melee_type," "npc_types.d_melee_texture2, npc_types.ammo_idfile, npc_types.prim_melee_type,"
"npc_types.sec_melee_type, npc_types.ranged_type, npc_types.runspeed, npc_types.findable," "npc_types.sec_melee_type, npc_types.ranged_type, npc_types.runspeed, npc_types.findable,"
"npc_types.trackable, npc_types.hp_regen_rate, npc_types.mana_regen_rate, " "npc_types.trackable, npc_types.hp_regen_rate, npc_types.mana_regen_rate, "
"npc_types.aggroradius, npc_types.assistradius, npc_types.bodytype, npc_types.npc_faction_id, " "npc_types.aggroradius, npc_types.assistradius, npc_types.bodytype, npc_types.npc_faction_id, "
@ -1822,8 +1822,8 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) {
tmpNPCType->npc_spells_id = atoi(row[35]); tmpNPCType->npc_spells_id = atoi(row[35]);
tmpNPCType->npc_spells_effects_id = atoi(row[36]); tmpNPCType->npc_spells_effects_id = atoi(row[36]);
tmpNPCType->d_meele_texture1 = atoi(row[37]); tmpNPCType->d_melee_texture1 = atoi(row[37]);
tmpNPCType->d_meele_texture2 = atoi(row[38]); tmpNPCType->d_melee_texture2 = atoi(row[38]);
strn0cpy(tmpNPCType->ammo_idfile, row[39], 30); strn0cpy(tmpNPCType->ammo_idfile, row[39], 30);
tmpNPCType->prim_melee_type = atoi(row[40]); tmpNPCType->prim_melee_type = atoi(row[40]);
tmpNPCType->sec_melee_type = atoi(row[41]); tmpNPCType->sec_melee_type = atoi(row[41]);
@ -1968,7 +1968,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
"vwMercNpcTypes.CR, vwMercNpcTypes.DR, vwMercNpcTypes.FR, vwMercNpcTypes.PR, " "vwMercNpcTypes.CR, vwMercNpcTypes.DR, vwMercNpcTypes.FR, vwMercNpcTypes.PR, "
"vwMercNpcTypes.Corrup, vwMercNpcTypes.mindmg, vwMercNpcTypes.maxdmg, " "vwMercNpcTypes.Corrup, vwMercNpcTypes.mindmg, vwMercNpcTypes.maxdmg, "
"vwMercNpcTypes.attack_count, vwMercNpcTypes.special_abilities, " "vwMercNpcTypes.attack_count, vwMercNpcTypes.special_abilities, "
"vwMercNpcTypes.d_meele_texture1, vwMercNpcTypes.d_meele_texture2, " "vwMercNpcTypes.d_melee_texture1, vwMercNpcTypes.d_melee_texture2, "
"vwMercNpcTypes.prim_melee_type, vwMercNpcTypes.sec_melee_type, " "vwMercNpcTypes.prim_melee_type, vwMercNpcTypes.sec_melee_type, "
"vwMercNpcTypes.runspeed, vwMercNpcTypes.hp_regen_rate, vwMercNpcTypes.mana_regen_rate, " "vwMercNpcTypes.runspeed, vwMercNpcTypes.hp_regen_rate, vwMercNpcTypes.mana_regen_rate, "
"vwMercNpcTypes.bodytype, vwMercNpcTypes.armortint_id, " "vwMercNpcTypes.bodytype, vwMercNpcTypes.armortint_id, "
@ -2027,8 +2027,8 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
else else
tmpNPCType->special_abilities[0] = '\0'; tmpNPCType->special_abilities[0] = '\0';
tmpNPCType->d_meele_texture1 = atoi(row[28]); tmpNPCType->d_melee_texture1 = atoi(row[28]);
tmpNPCType->d_meele_texture2 = atoi(row[29]); tmpNPCType->d_melee_texture2 = atoi(row[29]);
tmpNPCType->prim_melee_type = atoi(row[30]); tmpNPCType->prim_melee_type = atoi(row[30]);
tmpNPCType->sec_melee_type = atoi(row[31]); tmpNPCType->sec_melee_type = atoi(row[31]);
tmpNPCType->runspeed= atof(row[32]); tmpNPCType->runspeed= atof(row[32]);

View File

@ -90,8 +90,8 @@ struct NPCType
uint32 max_dmg; uint32 max_dmg;
int16 attack_count; int16 attack_count;
char special_abilities[512]; char special_abilities[512];
uint16 d_meele_texture1; uint16 d_melee_texture1;
uint16 d_meele_texture2; uint16 d_melee_texture2;
char ammo_idfile[30]; char ammo_idfile[30];
uint8 prim_melee_type; uint8 prim_melee_type;
uint8 sec_melee_type; uint8 sec_melee_type;