Put merc and bot classes on the same stance standard (mercs)

This commit is contained in:
Uleat
2019-02-07 22:09:31 -05:00
parent b810e3aa71
commit 3cffe5f7ef
14 changed files with 210 additions and 166 deletions
+5 -9
View File
@@ -83,12 +83,8 @@ bool BotDatabase::LoadBotCommandSettings(std::map<std::string, std::pair<uint8,
return true;
}
static uint8 spell_casting_chances[MaxSpellTypes][PLAYER_CLASS_COUNT][MaxStances][cntHSND];
bool BotDatabase::LoadBotSpellCastingChances()
{
memset(spell_casting_chances, 0, sizeof(spell_casting_chances));
query =
"SELECT"
" `spell_type_index`,"
@@ -126,7 +122,7 @@ bool BotDatabase::LoadBotSpellCastingChances()
continue;
--class_index;
uint8 stance_index = atoi(row[2]);
if (stance_index >= MaxStances)
if (stance_index >= EQEmu::constants::STANCE_TYPE_MAX)
continue;
for (uint8 conditional_index = nHSND; conditional_index < cntHSND; ++conditional_index) {
@@ -136,7 +132,7 @@ bool BotDatabase::LoadBotSpellCastingChances()
if (value > 100)
value = 100;
spell_casting_chances[spell_type_index][class_index][stance_index][conditional_index] = value;
Bot::spell_casting_chances[spell_type_index][class_index][stance_index][conditional_index] = value;
}
}
@@ -877,7 +873,7 @@ bool BotDatabase::LoadStance(Bot* bot_inst, bool& stance_flag)
return true;
auto row = results.begin();
bot_inst->SetBotStance((BotStanceType)atoi(row[0]));
bot_inst->SetBotStance((EQEmu::constants::StanceType)atoi(row[0]));
stance_flag = true;
return true;
@@ -2857,12 +2853,12 @@ uint8 BotDatabase::GetSpellCastingChance(uint8 spell_type_index, uint8 class_ind
return 0;
if (class_index >= PLAYER_CLASS_COUNT)
return 0;
if (stance_index >= MaxStances)
if (stance_index >= EQEmu::constants::STANCE_TYPE_MAX)
return 0;
if (conditional_index >= cntHSND)
return 0;
return spell_casting_chances[spell_type_index][class_index][stance_index][conditional_index];
return Bot::spell_casting_chances[spell_type_index][class_index][stance_index][conditional_index];
}