mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Bots] Cleanup Fast Rest Regen (#2626)
This commit is contained in:
parent
88e8b25fa1
commit
86af0f0759
32
zone/bot.cpp
32
zone/bot.cpp
@ -2147,16 +2147,12 @@ bool Bot::Process()
|
||||
|
||||
SpellProcess();
|
||||
|
||||
if(tic_timer.Check()) {
|
||||
if (tic_timer.Check()) {
|
||||
|
||||
// 6 seconds, or whatever the rule is set to has passed, send this position to everyone to avoid ghosting
|
||||
if(!IsMoving() && !IsEngaged()) {
|
||||
|
||||
if(IsSitting()) {
|
||||
|
||||
if (!rest_timer.Enabled()) {
|
||||
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
||||
}
|
||||
if (!IsEngaged()) {
|
||||
if (!rest_timer.Enabled()) {
|
||||
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2277,25 +2273,21 @@ void Bot::SpellProcess() {
|
||||
}
|
||||
|
||||
void Bot::BotMeditate(bool isSitting) {
|
||||
if(isSitting) {
|
||||
if(GetManaRatio() < 99.0f || GetHPRatio() < 99.0f) {
|
||||
if (!IsEngaged() && !IsSitting())
|
||||
if (isSitting) {
|
||||
if (GetManaRatio() < 99.0f || GetHPRatio() < 99.0f) {
|
||||
if (!IsEngaged() && !IsSitting()) {
|
||||
Sit();
|
||||
}
|
||||
} else {
|
||||
if(IsSitting())
|
||||
if (IsSitting()) {
|
||||
Stand();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(IsSitting())
|
||||
if (IsSitting()) {
|
||||
Stand();
|
||||
}
|
||||
}
|
||||
|
||||
if(IsSitting()) {
|
||||
if(!rest_timer.Enabled())
|
||||
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
||||
}
|
||||
else
|
||||
rest_timer.Disable();
|
||||
}
|
||||
|
||||
void Bot::BotRangedAttack(Mob* other) {
|
||||
|
||||
@ -1269,13 +1269,11 @@ bool Merc::Process()
|
||||
if(tic_timer.Check())
|
||||
{
|
||||
//6 seconds, or whatever the rule is set to has passed, send this position to everyone to avoid ghosting
|
||||
if(!IsMoving() && !IsEngaged())
|
||||
if (!IsEngaged())
|
||||
{
|
||||
SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0);
|
||||
if(IsSitting()) {
|
||||
if(!rest_timer.Enabled()) {
|
||||
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
||||
}
|
||||
if (!rest_timer.Enabled()) {
|
||||
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4305,33 +4303,27 @@ void Merc::MercMeditate(bool isSitting) {
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(isSitting) {
|
||||
if (isSitting) {
|
||||
// If the merc is a caster and has less than 99% mana while its not engaged, he needs to sit to meditate
|
||||
if(GetManaRatio() < 99.0f)
|
||||
if (GetManaRatio() < 99.0f)
|
||||
{
|
||||
if(!IsSitting())
|
||||
if(!IsSitting()) {
|
||||
Sit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(IsSitting())
|
||||
if (IsSitting()) {
|
||||
Stand();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(IsSitting())
|
||||
if (IsSitting()) {
|
||||
Stand();
|
||||
}
|
||||
|
||||
if(IsSitting()) {
|
||||
if(!rest_timer.Enabled()) {
|
||||
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
||||
}
|
||||
}
|
||||
else {
|
||||
rest_timer.Disable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user