mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-12 12:12:25 +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();
|
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
|
// 6 seconds, or whatever the rule is set to has passed, send this position to everyone to avoid ghosting
|
||||||
if(!IsMoving() && !IsEngaged()) {
|
if (!IsEngaged()) {
|
||||||
|
if (!rest_timer.Enabled()) {
|
||||||
if(IsSitting()) {
|
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
||||||
|
|
||||||
if (!rest_timer.Enabled()) {
|
|
||||||
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2277,25 +2273,21 @@ void Bot::SpellProcess() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Bot::BotMeditate(bool isSitting) {
|
void Bot::BotMeditate(bool isSitting) {
|
||||||
if(isSitting) {
|
if (isSitting) {
|
||||||
if(GetManaRatio() < 99.0f || GetHPRatio() < 99.0f) {
|
if (GetManaRatio() < 99.0f || GetHPRatio() < 99.0f) {
|
||||||
if (!IsEngaged() && !IsSitting())
|
if (!IsEngaged() && !IsSitting()) {
|
||||||
Sit();
|
Sit();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if(IsSitting())
|
if (IsSitting()) {
|
||||||
Stand();
|
Stand();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(IsSitting())
|
if (IsSitting()) {
|
||||||
Stand();
|
Stand();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsSitting()) {
|
|
||||||
if(!rest_timer.Enabled())
|
|
||||||
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
rest_timer.Disable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::BotRangedAttack(Mob* other) {
|
void Bot::BotRangedAttack(Mob* other) {
|
||||||
|
|||||||
@ -1269,13 +1269,11 @@ bool Merc::Process()
|
|||||||
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
|
//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);
|
SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0);
|
||||||
if(IsSitting()) {
|
if (!rest_timer.Enabled()) {
|
||||||
if(!rest_timer.Enabled()) {
|
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
||||||
rest_timer.Start(RuleI(Character, RestRegenTimeToActivate) * 1000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4305,33 +4303,27 @@ void Merc::MercMeditate(bool isSitting) {
|
|||||||
{
|
{
|
||||||
return;
|
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 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();
|
Sit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(IsSitting())
|
if (IsSitting()) {
|
||||||
Stand();
|
Stand();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(IsSitting())
|
if (IsSitting()) {
|
||||||
Stand();
|
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