Update for saved bot data to use new spells id values

This commit is contained in:
Uleat 2017-02-26 06:26:59 -05:00
parent 9ae585dd81
commit a49e3d6471
4 changed files with 76 additions and 46 deletions

View File

@ -32,7 +32,7 @@
#define CURRENT_BINARY_DATABASE_VERSION 9106 #define CURRENT_BINARY_DATABASE_VERSION 9106
#ifdef BOTS #ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9012 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9013
#else #else
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 0 // must be 0 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 0 // must be 0
#endif #endif

View File

@ -11,6 +11,7 @@
9010|2017_02_20_bots_bard_spell_update.sql|SELECT * FROM `bot_spells_entries` WHERE `npc_spells_id` = 711 AND (`type` & 0xFFFF0000) = 0xFFFF0000|empty| 9010|2017_02_20_bots_bard_spell_update.sql|SELECT * FROM `bot_spells_entries` WHERE `npc_spells_id` = 711 AND (`type` & 0xFFFF0000) = 0xFFFF0000|empty|
9011|2017_02_23_bots_spell_casting_chances.sql|SHOW TABLES LIKE 'bot_spell_casting_chances'|empty| 9011|2017_02_23_bots_spell_casting_chances.sql|SHOW TABLES LIKE 'bot_spell_casting_chances'|empty|
9012|2017_02_26_bots_npc_spells_update_for_bots.sql|SELECT * FROM `npc_spells` WHERE `id` = '701' AND `name` = 'Cleric Bot'|not_empty| 9012|2017_02_26_bots_npc_spells_update_for_bots.sql|SELECT * FROM `npc_spells` WHERE `id` = '701' AND `name` = 'Cleric Bot'|not_empty|
9013|2017_02_26_bots_spells_id_update_for_saved_bots.sql|SELECT * FROM `bot_data` WHERE `spells_id` >= '701' AND `spells_id` <= '712'|not_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,17 @@
-- Update spells_id to new values
UPDATE `bot_data` SET `spells_id` = '3001' WHERE `class` = '1';
UPDATE `bot_data` SET `spells_id` = '3002' WHERE `class` = '2';
UPDATE `bot_data` SET `spells_id` = '3003' WHERE `class` = '3';
UPDATE `bot_data` SET `spells_id` = '3004' WHERE `class` = '4';
UPDATE `bot_data` SET `spells_id` = '3005' WHERE `class` = '5';
UPDATE `bot_data` SET `spells_id` = '3006' WHERE `class` = '6';
UPDATE `bot_data` SET `spells_id` = '3007' WHERE `class` = '7';
UPDATE `bot_data` SET `spells_id` = '3008' WHERE `class` = '8';
UPDATE `bot_data` SET `spells_id` = '3009' WHERE `class` = '9';
UPDATE `bot_data` SET `spells_id` = '3010' WHERE `class` = '10';
UPDATE `bot_data` SET `spells_id` = '3011' WHERE `class` = '11';
UPDATE `bot_data` SET `spells_id` = '3012' WHERE `class` = '12';
UPDATE `bot_data` SET `spells_id` = '3013' WHERE `class` = '13';
UPDATE `bot_data` SET `spells_id` = '3014' WHERE `class` = '14';
UPDATE `bot_data` SET `spells_id` = '3015' WHERE `class` = '15';
UPDATE `bot_data` SET `spells_id` = '3016' WHERE `class` = '16';

View File

@ -404,8 +404,10 @@ NPCType Bot::CreateDefaultNPCTypeStructForBot(std::string botName, std::string b
return Result; return Result;
} }
void Bot::GenerateBaseStats() { void Bot::GenerateBaseStats()
{
int BotSpellID = 0; int BotSpellID = 0;
// base stats // base stats
uint32 Strength = _baseSTR; uint32 Strength = _baseSTR;
uint32 Stamina = _baseSTA; uint32 Stamina = _baseSTA;
@ -421,24 +423,26 @@ void Bot::GenerateBaseStats() {
int32 PoisonResist = _basePR; int32 PoisonResist = _basePR;
int32 ColdResist = _baseCR; int32 ColdResist = _baseCR;
int32 CorruptionResist = _baseCorrup; int32 CorruptionResist = _baseCorrup;
switch(this->GetClass()) { switch(this->GetClass()) {
case 1: // Warrior (why not just use 'case WARRIOR:'?) case WARRIOR:
BotSpellID = 3001;
Strength += 10; Strength += 10;
Stamina += 20; Stamina += 20;
Agility += 10; Agility += 10;
Dexterity += 10; Dexterity += 10;
Attack += 12; Attack += 12;
break; break;
case 2: // Cleric case CLERIC:
BotSpellID = 701; BotSpellID = 3002;
Strength += 5; Strength += 5;
Stamina += 5; Stamina += 5;
Agility += 10; Agility += 10;
Wisdom += 30; Wisdom += 30;
Attack += 8; Attack += 8;
break; break;
case 3: // Paladin case PALADIN:
BotSpellID = 708; BotSpellID = 3003;
Strength += 15; Strength += 15;
Stamina += 5; Stamina += 5;
Wisdom += 15; Wisdom += 15;
@ -446,84 +450,86 @@ void Bot::GenerateBaseStats() {
Dexterity += 5; Dexterity += 5;
Attack += 17; Attack += 17;
break; break;
case 4: // Ranger case RANGER:
BotSpellID = 710; BotSpellID = 3004;
Strength += 15; Strength += 15;
Stamina += 10; Stamina += 10;
Agility += 10; Agility += 10;
Wisdom += 15; Wisdom += 15;
Attack += 17; Attack += 17;
break; break;
case 5: // Shadowknight case SHADOWKNIGHT:
BotSpellID = 709; BotSpellID = 3004;
Strength += 10; Strength += 10;
Stamina += 15; Stamina += 15;
Intelligence += 20; Intelligence += 20;
Charisma += 5; Charisma += 5;
Attack += 17; Attack += 17;
break; break;
case 6: // Druid case DRUID:
BotSpellID = 707; BotSpellID = 3006;
Stamina += 15; Stamina += 15;
Wisdom += 35; Wisdom += 35;
Attack += 5; Attack += 5;
break; break;
case 7: // Monk case MONK:
BotSpellID = 3007;
Strength += 5; Strength += 5;
Stamina += 15; Stamina += 15;
Agility += 15; Agility += 15;
Dexterity += 15; Dexterity += 15;
Attack += 17; Attack += 17;
break; break;
case 8: // Bard case BARD:
BotSpellID = 711; BotSpellID = 3008;
Strength += 15; Strength += 15;
Dexterity += 10; Dexterity += 10;
Charisma += 15; Charisma += 15;
Intelligence += 10; Intelligence += 10;
Attack += 17; Attack += 17;
break; break;
case 9: // Rogue case ROGUE:
BotSpellID = 3009;
Strength += 10; Strength += 10;
Stamina += 20; Stamina += 20;
Agility += 10; Agility += 10;
Dexterity += 10; Dexterity += 10;
Attack += 12; Attack += 12;
break; break;
case 10: // Shaman case SHAMAN:
BotSpellID = 706; BotSpellID = 3010;
Stamina += 10; Stamina += 10;
Wisdom += 30; Wisdom += 30;
Charisma += 10; Charisma += 10;
Attack += 28; Attack += 28;
break; break;
case 11: // Necromancer case NECROMANCER:
BotSpellID = 703; BotSpellID = 3011;
Dexterity += 10; Dexterity += 10;
Agility += 10; Agility += 10;
Intelligence += 30; Intelligence += 30;
Attack += 5; Attack += 5;
break; break;
case 12: // Wizard case WIZARD:
BotSpellID = 702; BotSpellID = 3012;
Stamina += 20; Stamina += 20;
Intelligence += 30; Intelligence += 30;
Attack += 5; Attack += 5;
break; break;
case 13: // Magician case MAGICIAN:
BotSpellID = 704; BotSpellID = 3013;
Stamina += 20; Stamina += 20;
Intelligence += 30; Intelligence += 30;
Attack += 5; Attack += 5;
break; break;
case 14: // Enchanter case ENCHANTER:
BotSpellID = 705; BotSpellID = 3014;
Intelligence += 25; Intelligence += 25;
Charisma += 25; Charisma += 25;
Attack += 5; Attack += 5;
break; break;
case 15: // Beastlord case BEASTLORD:
BotSpellID = 712; BotSpellID = 3015;
Stamina += 10; Stamina += 10;
Agility += 10; Agility += 10;
Dexterity += 5; Dexterity += 5;
@ -531,21 +537,24 @@ void Bot::GenerateBaseStats() {
Charisma += 5; Charisma += 5;
Attack += 31; Attack += 31;
break; break;
case 16: // Berserker case BERSERKER:
BotSpellID = 3016;
Strength += 10; Strength += 10;
Stamina += 15; Stamina += 15;
Dexterity += 15; Dexterity += 15;
Agility += 10; Agility += 10;
Attack += 25; Attack += 25;
break; break;
default:
break;
} }
float BotSize = GetSize(); float BotSize = GetSize();
switch(this->GetRace()) { switch(this->GetRace()) {
case 1: // Humans have no race bonus case HUMAN: // Humans have no race bonus
break; break;
case 2: // Barbarian case BARBARIAN:
Strength += 28; Strength += 28;
Stamina += 20; Stamina += 20;
Agility += 7; Agility += 7;
@ -556,7 +565,7 @@ void Bot::GenerateBaseStats() {
BotSize = 7.0; BotSize = 7.0;
ColdResist += 10; ColdResist += 10;
break; break;
case 3: // Erudite case ERUDITE:
Strength -= 15; Strength -= 15;
Stamina -= 5; Stamina -= 5;
Agility -= 5; Agility -= 5;
@ -567,7 +576,7 @@ void Bot::GenerateBaseStats() {
MagicResist += 5; MagicResist += 5;
DiseaseResist -= 5; DiseaseResist -= 5;
break; break;
case 4: // Wood Elf case WOOD_ELF:
Strength -= 10; Strength -= 10;
Stamina -= 10; Stamina -= 10;
Agility += 20; Agility += 20;
@ -575,7 +584,7 @@ void Bot::GenerateBaseStats() {
Wisdom += 5; Wisdom += 5;
BotSize = 5.0; BotSize = 5.0;
break; break;
case 5: // High Elf case HIGH_ELF:
Strength -= 20; Strength -= 20;
Stamina -= 10; Stamina -= 10;
Agility += 10; Agility += 10;
@ -584,7 +593,7 @@ void Bot::GenerateBaseStats() {
Intelligence += 12; Intelligence += 12;
Charisma += 5; Charisma += 5;
break; break;
case 6: // Dark Elf case DARK_ELF:
Strength -= 15; Strength -= 15;
Stamina -= 10; Stamina -= 10;
Agility += 15; Agility += 15;
@ -593,7 +602,7 @@ void Bot::GenerateBaseStats() {
Charisma -= 15; Charisma -= 15;
BotSize = 5.0; BotSize = 5.0;
break; break;
case 7: // Half Elf case HALF_ELF:
Strength -= 5; Strength -= 5;
Stamina -= 5; Stamina -= 5;
Agility += 15; Agility += 15;
@ -601,7 +610,7 @@ void Bot::GenerateBaseStats() {
Wisdom -= 15; Wisdom -= 15;
BotSize = 5.5; BotSize = 5.5;
break; break;
case 8: // Dwarf case DWARF:
Strength += 15; Strength += 15;
Stamina += 15; Stamina += 15;
Agility -= 5; Agility -= 5;
@ -613,7 +622,7 @@ void Bot::GenerateBaseStats() {
MagicResist -= 5; MagicResist -= 5;
PoisonResist += 5; PoisonResist += 5;
break; break;
case 9: // Troll case TROLL:
Strength += 33; Strength += 33;
Stamina += 34; Stamina += 34;
Agility += 8; Agility += 8;
@ -623,7 +632,7 @@ void Bot::GenerateBaseStats() {
BotSize = 8.0; BotSize = 8.0;
FireResist -= 20; FireResist -= 20;
break; break;
case 10: // Ogre case OGRE:
Strength += 55; Strength += 55;
Stamina += 77; Stamina += 77;
Agility -= 5; Agility -= 5;
@ -633,7 +642,7 @@ void Bot::GenerateBaseStats() {
Charisma -= 38; Charisma -= 38;
BotSize = 9.0; BotSize = 9.0;
break; break;
case 11: // Halfling case HALFLING:
Strength -= 5; Strength -= 5;
Agility += 20; Agility += 20;
Dexterity += 15; Dexterity += 15;
@ -644,7 +653,7 @@ void Bot::GenerateBaseStats() {
PoisonResist += 5; PoisonResist += 5;
DiseaseResist += 5; DiseaseResist += 5;
break; break;
case 12: // Gnome case GNOME:
Strength -= 15; Strength -= 15;
Stamina -= 5; Stamina -= 5;
Agility += 10; Agility += 10;
@ -654,7 +663,7 @@ void Bot::GenerateBaseStats() {
Charisma -= 15; Charisma -= 15;
BotSize = 3.0; BotSize = 3.0;
break; break;
case 128: // Iksar case IKSAR:
Strength -= 5; Strength -= 5;
Stamina -= 5; Stamina -= 5;
Agility += 15; Agility += 15;
@ -664,7 +673,7 @@ void Bot::GenerateBaseStats() {
MagicResist -= 5; MagicResist -= 5;
FireResist -= 5; FireResist -= 5;
break; break;
case 130: // Vah Shir case VAHSHIR:
Strength += 15; Strength += 15;
Agility += 15; Agility += 15;
Dexterity -= 5; Dexterity -= 5;
@ -675,7 +684,7 @@ void Bot::GenerateBaseStats() {
MagicResist -= 5; MagicResist -= 5;
FireResist -= 5; FireResist -= 5;
break; break;
case 330: // Froglok case FROGLOK:
Strength -= 5; Strength -= 5;
Stamina += 5; Stamina += 5;
Agility += 25; Agility += 25;
@ -685,7 +694,7 @@ void Bot::GenerateBaseStats() {
MagicResist -= 5; MagicResist -= 5;
FireResist -= 5; FireResist -= 5;
break; break;
case 522: // Drakkin case DRAKKIN:
Strength -= 5; Strength -= 5;
Stamina += 5; Stamina += 5;
Agility += 10; Agility += 10;
@ -698,7 +707,10 @@ void Bot::GenerateBaseStats() {
FireResist += 2; FireResist += 2;
ColdResist += 2; ColdResist += 2;
break; break;
default:
break;
} }
this->STR = Strength; this->STR = Strength;
this->STA = Stamina; this->STA = Stamina;
this->DEX = Dexterity; this->DEX = Dexterity;