Fix for bot load buffs instrument mod. More tweaks to bot movement hack

This commit is contained in:
Uleat 2017-02-02 19:10:10 -05:00
parent b0ad9524bc
commit 1999982e6a
2 changed files with 19 additions and 14 deletions

View File

@ -2299,7 +2299,6 @@ void Bot::AI_Process() {
float newZ = 0; float newZ = 0;
FaceTarget(GetTarget()); FaceTarget(GetTarget());
if (PlotPositionAroundTarget(this, newX, newY, newZ)) { if (PlotPositionAroundTarget(this, newX, newY, newZ)) {
Emote("steps back from %s", GetTarget()->GetCleanName());
CalculateNewPosition2(newX, newY, newZ, GetRunspeed()); CalculateNewPosition2(newX, newY, newZ, GetRunspeed());
return; return;
} }
@ -2493,24 +2492,28 @@ void Bot::AI_Process() {
} }
} }
else if(AI_movement_timer->Check()) { 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(); int speed = GetRunspeed();
if (cur_dist < GetFollowDistance() + 1000) { if (cur_dist < GetFollowDistance() + 2000) {
speed = GetWalkspeed(); speed = GetWalkspeed();
} }
else if (cur_dist >= GetFollowDistance() + 8000) { else if (cur_dist >= GetFollowDistance() + 10000) { // 100
if (cur_dist >= 22500) { // 150
auto leader = follow; auto leader = follow;
while (leader->GetFollowID()) { while (leader->GetFollowID()) {
leader = entity_list.GetMob(leader->GetFollowID()); leader = entity_list.GetMob(leader->GetFollowID());
if (!leader || leader == this) if (!leader || leader == this)
break; break;
} if (leader->GetRunspeed() > speed)
if (leader && leader != this && leader->GetRunspeed() > speed)
speed = leader->GetRunspeed(); speed = leader->GetRunspeed();
speed = (float)speed * 1.8f; // special bot sprint mod if (leader->IsClient())
break;
}
}
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()) { if (cur_dist > GetFollowDistance()) {
CalculateNewPosition2(follow->GetX(), follow->GetY(), follow->GetZ(), speed); CalculateNewPosition2(follow->GetX(), follow->GetY(), follow->GetZ(), speed);
if (rest_timer.Enabled()) if (rest_timer.Enabled())

View File

@ -617,7 +617,8 @@ bool BotDatabase::LoadBuffs(Bot* bot_inst)
" `caston_x`," " `caston_x`,"
" `caston_y`," " `caston_y`,"
" `caston_z`," " `caston_z`,"
" `extra_di_chance`" " `extra_di_chance`,"
" `instrument_mod`"
" FROM `bot_buffs`" " FROM `bot_buffs`"
" WHERE `bot_id` = '%u'", " WHERE `bot_id` = '%u'",
bot_inst->GetBotID() 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_y = atoi(row[14]);
bot_buffs[buff_count].caston_z = atoi(row[15]); bot_buffs[buff_count].caston_z = atoi(row[15]);
bot_buffs[buff_count].ExtraDIChance = atoi(row[16]); bot_buffs[buff_count].ExtraDIChance = atoi(row[16]);
bot_buffs[buff_count].instrument_mod = atoi(row[17]);
bot_buffs[buff_count].casterid = 0; bot_buffs[buff_count].casterid = 0;
++buff_count; ++buff_count;
} }