From 1999982e6a43a526c6cff15873debe6ad1ab6e1e Mon Sep 17 00:00:00 2001 From: Uleat Date: Thu, 2 Feb 2017 19:10:10 -0500 Subject: [PATCH] Fix for bot load buffs instrument mod. More tweaks to bot movement hack --- zone/bot.cpp | 29 ++++++++++++++++------------- zone/bot_database.cpp | 4 +++- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 3759335a4..d5f6ff814 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -2299,7 +2299,6 @@ void Bot::AI_Process() { float newZ = 0; FaceTarget(GetTarget()); if (PlotPositionAroundTarget(this, newX, newY, newZ)) { - Emote("steps back from %s", GetTarget()->GetCleanName()); CalculateNewPosition2(newX, newY, newZ, GetRunspeed()); return; } @@ -2493,24 +2492,28 @@ void Bot::AI_Process() { } } else if(AI_movement_timer->Check()) { + // something is wrong with bot movement spell bonuses - based on logging.. + // ..this code won't need to be so complex once fixed... int speed = GetRunspeed(); - if (cur_dist < GetFollowDistance() + 1000) { + if (cur_dist < GetFollowDistance() + 2000) { speed = GetWalkspeed(); } - else if (cur_dist >= GetFollowDistance() + 8000) { - auto leader = follow; - while (leader->GetFollowID()) { - leader = entity_list.GetMob(leader->GetFollowID()); - if (!leader || leader == this) - break; + else if (cur_dist >= GetFollowDistance() + 10000) { // 100 + if (cur_dist >= 22500) { // 150 + auto leader = follow; + while (leader->GetFollowID()) { + leader = entity_list.GetMob(leader->GetFollowID()); + if (!leader || leader == this) + break; + if (leader->GetRunspeed() > speed) + speed = leader->GetRunspeed(); + if (leader->IsClient()) + break; + } } - if (leader && leader != this && leader->GetRunspeed() > speed) - speed = leader->GetRunspeed(); - speed = (float)speed * 1.8f; // special bot sprint mod + speed = (float)speed * (1.0f + ((float)speed * 0.03125f)); // 1/32 - special bot sprint mod } - // this needs work.. - // could probably eliminate the sprint mod with the correct logic if (cur_dist > GetFollowDistance()) { CalculateNewPosition2(follow->GetX(), follow->GetY(), follow->GetZ(), speed); if (rest_timer.Enabled()) diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index 04ce5b281..0f7553ada 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -617,7 +617,8 @@ bool BotDatabase::LoadBuffs(Bot* bot_inst) " `caston_x`," " `caston_y`," " `caston_z`," - " `extra_di_chance`" + " `extra_di_chance`," + " `instrument_mod`" " FROM `bot_buffs`" " WHERE `bot_id` = '%u'", bot_inst->GetBotID() @@ -657,6 +658,7 @@ bool BotDatabase::LoadBuffs(Bot* bot_inst) bot_buffs[buff_count].caston_y = atoi(row[14]); bot_buffs[buff_count].caston_z = atoi(row[15]); bot_buffs[buff_count].ExtraDIChance = atoi(row[16]); + bot_buffs[buff_count].instrument_mod = atoi(row[17]); bot_buffs[buff_count].casterid = 0; ++buff_count; }