mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
Fix for bot load buffs instrument mod. More tweaks to bot movement hack
This commit is contained in:
parent
b0ad9524bc
commit
1999982e6a
29
zone/bot.cpp
29
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())
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user