mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
test: ms_time
This commit is contained in:
@@ -5,9 +5,10 @@
|
|||||||
#include "Trigger.h"
|
#include "Trigger.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
|
#include "Timer.h"
|
||||||
|
|
||||||
Trigger::Trigger(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :
|
Trigger::Trigger(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :
|
||||||
AiNamedObject(botAI, name), checkInterval(checkInterval), lastCheckTime(time(nullptr) - rand() % checkInterval)
|
AiNamedObject(botAI, name), checkInterval(checkInterval == 1 ? 1 : (checkInterval < 100 ? checkInterval * 1000 : checkInterval)), lastCheckTime(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ bool Trigger::needCheck()
|
|||||||
if (checkInterval < 2)
|
if (checkInterval < 2)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
time_t now = time(nullptr);
|
uint32 now = getMSTime();
|
||||||
if (!lastCheckTime || now - lastCheckTime >= checkInterval)
|
if (!lastCheckTime || now - lastCheckTime >= checkInterval)
|
||||||
{
|
{
|
||||||
lastCheckTime = now;
|
lastCheckTime = now;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Trigger : public AiNamedObject
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int32 checkInterval;
|
int32 checkInterval;
|
||||||
time_t lastCheckTime;
|
uint32 lastCheckTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TriggerNode
|
class TriggerNode
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
#include "Value.h"
|
#include "Value.h"
|
||||||
#include "PerformanceMonitor.h"
|
#include "PerformanceMonitor.h"
|
||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
|
#include "Timer.h"
|
||||||
|
|
||||||
UnitCalculatedValue::UnitCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) : CalculatedValue<Unit*>(botAI, name, checkInterval)
|
UnitCalculatedValue::UnitCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) : CalculatedValue<Unit*>(botAI, name, checkInterval)
|
||||||
{
|
{
|
||||||
lastCheckTime = time(nullptr) - checkInterval / 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string const UnitCalculatedValue::Format()
|
std::string const UnitCalculatedValue::Format()
|
||||||
@@ -47,7 +47,7 @@ std::string const FloatCalculatedValue::Format()
|
|||||||
CDPairCalculatedValue::CDPairCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :
|
CDPairCalculatedValue::CDPairCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :
|
||||||
CalculatedValue<CreatureData const*>(botAI, name, checkInterval)
|
CalculatedValue<CreatureData const*>(botAI, name, checkInterval)
|
||||||
{
|
{
|
||||||
lastCheckTime = time(nullptr) - checkInterval / 2;
|
// lastCheckTime = getMSTime() - checkInterval / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string const CDPairCalculatedValue::Format()
|
std::string const CDPairCalculatedValue::Format()
|
||||||
@@ -65,7 +65,7 @@ std::string const CDPairCalculatedValue::Format()
|
|||||||
CDPairListCalculatedValue::CDPairListCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :
|
CDPairListCalculatedValue::CDPairListCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :
|
||||||
CalculatedValue<std::vector<CreatureData const*>>(botAI, name, checkInterval)
|
CalculatedValue<std::vector<CreatureData const*>>(botAI, name, checkInterval)
|
||||||
{
|
{
|
||||||
lastCheckTime = time(nullptr) - checkInterval / 2;
|
// lastCheckTime = time(nullptr) - checkInterval / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string const CDPairListCalculatedValue::Format()
|
std::string const CDPairListCalculatedValue::Format()
|
||||||
@@ -84,7 +84,7 @@ std::string const CDPairListCalculatedValue::Format()
|
|||||||
ObjectGuidCalculatedValue::ObjectGuidCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :
|
ObjectGuidCalculatedValue::ObjectGuidCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :
|
||||||
CalculatedValue<ObjectGuid>(botAI, name, checkInterval)
|
CalculatedValue<ObjectGuid>(botAI, name, checkInterval)
|
||||||
{
|
{
|
||||||
lastCheckTime = time(nullptr) - checkInterval / 2;
|
// lastCheckTime = time(nullptr) - checkInterval / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string const ObjectGuidCalculatedValue::Format()
|
std::string const ObjectGuidCalculatedValue::Format()
|
||||||
@@ -96,7 +96,6 @@ std::string const ObjectGuidCalculatedValue::Format()
|
|||||||
ObjectGuidListCalculatedValue::ObjectGuidListCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :
|
ObjectGuidListCalculatedValue::ObjectGuidListCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :
|
||||||
CalculatedValue<GuidVector>(botAI, name, checkInterval)
|
CalculatedValue<GuidVector>(botAI, name, checkInterval)
|
||||||
{
|
{
|
||||||
lastCheckTime = time(nullptr) - checkInterval / 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string const ObjectGuidListCalculatedValue::Format()
|
std::string const ObjectGuidListCalculatedValue::Format()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "AiObject.h"
|
#include "AiObject.h"
|
||||||
#include "ObjectGuid.h"
|
#include "ObjectGuid.h"
|
||||||
#include "PerformanceMonitor.h"
|
#include "PerformanceMonitor.h"
|
||||||
|
#include "Timer.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
@@ -45,23 +46,28 @@ class CalculatedValue : public UntypedValue, public Value<T>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CalculatedValue(PlayerbotAI* botAI, std::string const name = "value", uint32 checkInterval = 1) : UntypedValue(botAI, name),
|
CalculatedValue(PlayerbotAI* botAI, std::string const name = "value", uint32 checkInterval = 1) : UntypedValue(botAI, name),
|
||||||
checkInterval(checkInterval), lastCheckTime(0) { }
|
checkInterval(checkInterval == 1 ? 1 : (checkInterval < 100 ? checkInterval * 1000 : checkInterval)) /*turn s -> ms?*/, lastCheckTime(0) { }
|
||||||
|
|
||||||
virtual ~CalculatedValue() { }
|
virtual ~CalculatedValue() { }
|
||||||
|
|
||||||
T Get() override
|
T Get() override
|
||||||
{
|
{
|
||||||
time_t now = time(nullptr);
|
if (checkInterval < 2) {
|
||||||
if (!lastCheckTime || checkInterval < 2 || now - lastCheckTime >= checkInterval / 2)
|
|
||||||
{
|
|
||||||
lastCheckTime = now;
|
|
||||||
|
|
||||||
PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr);
|
PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr);
|
||||||
value = Calculate();
|
value = Calculate();
|
||||||
if (pmo)
|
if (pmo)
|
||||||
pmo->finish();
|
pmo->finish();
|
||||||
|
} else {
|
||||||
|
time_t now = getMSTime();
|
||||||
|
if (!lastCheckTime || now - lastCheckTime >= checkInterval)
|
||||||
|
{
|
||||||
|
lastCheckTime = now;
|
||||||
|
PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr);
|
||||||
|
value = Calculate();
|
||||||
|
if (pmo)
|
||||||
|
pmo->finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +87,7 @@ class CalculatedValue : public UntypedValue, public Value<T>
|
|||||||
virtual T Calculate() = 0;
|
virtual T Calculate() = 0;
|
||||||
|
|
||||||
uint32 checkInterval;
|
uint32 checkInterval;
|
||||||
time_t lastCheckTime;
|
uint32 lastCheckTime;
|
||||||
T value;
|
T value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -674,9 +674,11 @@ bool MovementAction::MoveTo(Unit* target, float distance)
|
|||||||
|
|
||||||
float dx = cos(angle) * needToGo + bx;
|
float dx = cos(angle) * needToGo + bx;
|
||||||
float dy = sin(angle) * needToGo + by;
|
float dy = sin(angle) * needToGo + by;
|
||||||
float dz = std::max(bz, tz); // calc accurate z position to avoid stuck
|
float dz; // = std::max(bz, tz); // calc accurate z position to avoid stuck
|
||||||
if (distanceToTarget > CONTACT_DISTANCE) {
|
if (distanceToTarget > CONTACT_DISTANCE) {
|
||||||
dz = std::max(dz, bz + (tz - bz) * (needToGo / distanceToTarget));
|
dz = bz + (tz - bz) * (needToGo / distanceToTarget);
|
||||||
|
} else {
|
||||||
|
dz = tz;
|
||||||
}
|
}
|
||||||
return MoveTo(target->GetMapId(), dx, dy, dz);
|
return MoveTo(target->GetMapId(), dx, dy, dz);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class PlayerbotAI;
|
|||||||
class MarkOfTheWildOnPartyTrigger : public BuffOnPartyTrigger
|
class MarkOfTheWildOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MarkOfTheWildOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "mark of the wild", 2) { }
|
MarkOfTheWildOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "mark of the wild", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -21,7 +21,7 @@ class MarkOfTheWildOnPartyTrigger : public BuffOnPartyTrigger
|
|||||||
class MarkOfTheWildTrigger : public BuffTrigger
|
class MarkOfTheWildTrigger : public BuffTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MarkOfTheWildTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "mark of the wild", 2) { }
|
MarkOfTheWildTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "mark of the wild", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -29,7 +29,7 @@ class MarkOfTheWildTrigger : public BuffTrigger
|
|||||||
class ThornsOnPartyTrigger : public BuffOnPartyTrigger
|
class ThornsOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ThornsOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "thorns", 2) { }
|
ThornsOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "thorns", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -37,7 +37,7 @@ class ThornsOnPartyTrigger : public BuffOnPartyTrigger
|
|||||||
class ThornsTrigger : public BuffTrigger
|
class ThornsTrigger : public BuffTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ThornsTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "thorns", 2) { }
|
ThornsTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "thorns", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ DEFLECT_TRIGGER(FrostWardTrigger, "frost ward");
|
|||||||
class ArcaneIntellectOnPartyTrigger : public BuffOnPartyTrigger
|
class ArcaneIntellectOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ArcaneIntellectOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "arcane intellect", 2) { }
|
ArcaneIntellectOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "arcane intellect", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -24,7 +24,7 @@ class ArcaneIntellectOnPartyTrigger : public BuffOnPartyTrigger
|
|||||||
class ArcaneIntellectTrigger : public BuffTrigger
|
class ArcaneIntellectTrigger : public BuffTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ArcaneIntellectTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "arcane intellect", 2) { }
|
ArcaneIntellectTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "arcane intellect", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -32,7 +32,7 @@ class ArcaneIntellectTrigger : public BuffTrigger
|
|||||||
class MageArmorTrigger : public BuffTrigger
|
class MageArmorTrigger : public BuffTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MageArmorTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "mage armor", 5) { }
|
MageArmorTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "mage armor", 5 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -75,13 +75,13 @@ INTERRUPT_TRIGGER(RepentanceInterruptTrigger, "repentance");
|
|||||||
class BlessingOnPartyTrigger : public BuffOnPartyTrigger
|
class BlessingOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BlessingOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "blessing of kings,blessing of might,blessing of wisdom", 2) { }
|
BlessingOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "blessing of kings,blessing of might,blessing of wisdom", 2 * 2000) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class BlessingTrigger : public BuffTrigger
|
class BlessingTrigger : public BuffTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BlessingTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "blessing of sanctuary", 2) { }
|
BlessingTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "blessing of sanctuary", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -202,18 +202,18 @@ public:
|
|||||||
class BlessingOfKingsOnPartyTrigger : public BuffOnPartyTrigger
|
class BlessingOfKingsOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BlessingOfKingsOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "blessing of kings", 2) { }
|
BlessingOfKingsOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "blessing of kings", 2 * 2000) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class BlessingOfWisdomOnPartyTrigger : public BuffOnPartyTrigger
|
class BlessingOfWisdomOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BlessingOfWisdomOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "blessing of might,blessing of wisdom", 2) { }
|
BlessingOfWisdomOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "blessing of might,blessing of wisdom", 2 * 2000) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class BlessingOfMightOnPartyTrigger : public BuffOnPartyTrigger
|
class BlessingOfMightOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BlessingOfMightOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "blessing of might,blessing of wisdom", 2) { }
|
BlessingOfMightOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "blessing of might,blessing of wisdom", 2 * 2000) { }
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ BOOST_TRIGGER_A(ShadowfiendTrigger, "shadowfiend");
|
|||||||
class PowerWordFortitudeOnPartyTrigger : public BuffOnPartyTrigger
|
class PowerWordFortitudeOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PowerWordFortitudeOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "power word: fortitude", 4) { }
|
PowerWordFortitudeOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "power word: fortitude", 4 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -51,7 +51,7 @@ class PowerWordFortitudeOnPartyTrigger : public BuffOnPartyTrigger
|
|||||||
class PowerWordFortitudeTrigger : public BuffTrigger
|
class PowerWordFortitudeTrigger : public BuffTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PowerWordFortitudeTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "power word: fortitude", 4) { }
|
PowerWordFortitudeTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "power word: fortitude", 4 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -59,7 +59,7 @@ class PowerWordFortitudeTrigger : public BuffTrigger
|
|||||||
class DivineSpiritOnPartyTrigger : public BuffOnPartyTrigger
|
class DivineSpiritOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DivineSpiritOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "divine spirit", 4) { }
|
DivineSpiritOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "divine spirit", 4 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -67,7 +67,7 @@ class DivineSpiritOnPartyTrigger : public BuffOnPartyTrigger
|
|||||||
class DivineSpiritTrigger : public BuffTrigger
|
class DivineSpiritTrigger : public BuffTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DivineSpiritTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "divine spirit", 4) { }
|
DivineSpiritTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "divine spirit", 4 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -75,7 +75,7 @@ class DivineSpiritTrigger : public BuffTrigger
|
|||||||
class PrayerOfFortitudeTrigger : public BuffOnPartyTrigger
|
class PrayerOfFortitudeTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PrayerOfFortitudeTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "prayer of fortitude", 3) { }
|
PrayerOfFortitudeTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "prayer of fortitude", 3 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -83,7 +83,7 @@ class PrayerOfFortitudeTrigger : public BuffOnPartyTrigger
|
|||||||
class PrayerOfSpiritTrigger : public BuffOnPartyTrigger
|
class PrayerOfSpiritTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PrayerOfSpiritTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "prayer of spirit", 2) { }
|
PrayerOfSpiritTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "prayer of spirit", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class PlayerbotAI;
|
|||||||
class ShamanWeaponTrigger : public BuffTrigger
|
class ShamanWeaponTrigger : public BuffTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ShamanWeaponTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "rockbiter weapon", 2) { }
|
ShamanWeaponTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "rockbiter weapon", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ class WaterWalkingTrigger : public BuffTrigger
|
|||||||
class WaterBreathingTrigger : public BuffTrigger
|
class WaterBreathingTrigger : public BuffTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WaterBreathingTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "water breathing", 5) { }
|
WaterBreathingTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "water breathing", 5 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -120,7 +120,7 @@ class WaterBreathingTrigger : public BuffTrigger
|
|||||||
class WaterWalkingOnPartyTrigger : public BuffOnPartyTrigger
|
class WaterWalkingOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WaterWalkingOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "water walking on party", 2) { }
|
WaterWalkingOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "water walking on party", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -128,7 +128,7 @@ class WaterWalkingOnPartyTrigger : public BuffOnPartyTrigger
|
|||||||
class WaterBreathingOnPartyTrigger : public BuffOnPartyTrigger
|
class WaterBreathingOnPartyTrigger : public BuffOnPartyTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WaterBreathingOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "water breathing on party", 2) { }
|
WaterBreathingOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "water breathing on party", 2 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Unit;
|
|||||||
class NeedCureTrigger : public SpellTrigger
|
class NeedCureTrigger : public SpellTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NeedCureTrigger(PlayerbotAI* botAI, std::string const spell, uint32 dispelType) : SpellTrigger(botAI, spell, 2), dispelType(dispelType) { }
|
NeedCureTrigger(PlayerbotAI* botAI, std::string const spell, uint32 dispelType) : SpellTrigger(botAI, spell, 2 * 1000), dispelType(dispelType) { }
|
||||||
|
|
||||||
std::string const GetTargetName() override { return "self target"; }
|
std::string const GetTargetName() override { return "self target"; }
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
#include "TemporarySummon.h"
|
#include "TemporarySummon.h"
|
||||||
|
#include "Timer.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
bool LowManaTrigger::IsActive()
|
bool LowManaTrigger::IsActive()
|
||||||
@@ -224,16 +225,16 @@ bool SpellNoCooldownTrigger::IsActive()
|
|||||||
return !bot->HasSpellCooldown(spellId);
|
return !bot->HasSpellCooldown(spellId);
|
||||||
}
|
}
|
||||||
|
|
||||||
RandomTrigger::RandomTrigger(PlayerbotAI* botAI, std::string const name, int32 probability) : Trigger(botAI, name), probability(probability), lastCheck(time(nullptr))
|
RandomTrigger::RandomTrigger(PlayerbotAI* botAI, std::string const name, int32 probability) : Trigger(botAI, name), probability(probability), lastCheck(getMSTime())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RandomTrigger::IsActive()
|
bool RandomTrigger::IsActive()
|
||||||
{
|
{
|
||||||
if (time(nullptr) - lastCheck < sPlayerbotAIConfig->repeatDelay / 1000)
|
if (getMSTime() - lastCheck < sPlayerbotAIConfig->repeatDelay)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
lastCheck = time(nullptr);
|
lastCheck = getMSTime();
|
||||||
int32 k = (int32)(probability / sPlayerbotAIConfig->randomChangeMultiplier);
|
int32 k = (int32)(probability / sPlayerbotAIConfig->randomChangeMultiplier);
|
||||||
if (k < 1)
|
if (k < 1)
|
||||||
k = 1;
|
k = 1;
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ class RandomTrigger : public Trigger
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int32 probability;
|
int32 probability;
|
||||||
time_t lastCheck;
|
uint32 lastCheck;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AndTrigger : public Trigger
|
class AndTrigger : public Trigger
|
||||||
@@ -415,7 +415,7 @@ END_TRIGGER()
|
|||||||
class NoPetTrigger : public Trigger
|
class NoPetTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NoPetTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no pet", 5) { }
|
NoPetTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no pet", 5 * 1000) { }
|
||||||
|
|
||||||
virtual bool IsActive() override;
|
virtual bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -423,7 +423,7 @@ class NoPetTrigger : public Trigger
|
|||||||
class HasPetTrigger : public Trigger
|
class HasPetTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HasPetTrigger(PlayerbotAI* ai) : Trigger(ai, "has pet", 5) {}
|
HasPetTrigger(PlayerbotAI* ai) : Trigger(ai, "has pet", 5 * 1000) {}
|
||||||
|
|
||||||
virtual bool IsActive() override;
|
virtual bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -431,7 +431,7 @@ public:
|
|||||||
class ItemCountTrigger : public Trigger
|
class ItemCountTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ItemCountTrigger(PlayerbotAI* botAI, std::string const item, int32 count, int32 interval = 30) : Trigger(botAI, item, interval), item(item), count(count) { }
|
ItemCountTrigger(PlayerbotAI* botAI, std::string const item, int32 count, int32 interval = 30 * 1000) : Trigger(botAI, item, interval), item(item), count(count) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
std::string const getName() override { return "item count"; }
|
std::string const getName() override { return "item count"; }
|
||||||
@@ -444,7 +444,7 @@ class ItemCountTrigger : public Trigger
|
|||||||
class AmmoCountTrigger : public ItemCountTrigger
|
class AmmoCountTrigger : public ItemCountTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AmmoCountTrigger(PlayerbotAI* botAI, std::string const item, uint32 count = 1, int32 interval = 30) : ItemCountTrigger(botAI, item, count, interval) { }
|
AmmoCountTrigger(PlayerbotAI* botAI, std::string const item, uint32 count = 1, int32 interval = 30 * 1000) : ItemCountTrigger(botAI, item, count, interval) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class HasAuraTrigger : public Trigger
|
class HasAuraTrigger : public Trigger
|
||||||
@@ -612,7 +612,7 @@ class InterruptEnemyHealerTrigger : public SpellTrigger
|
|||||||
class RandomBotUpdateTrigger : public RandomTrigger
|
class RandomBotUpdateTrigger : public RandomTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RandomBotUpdateTrigger(PlayerbotAI* botAI) : RandomTrigger(botAI, "random bot update", 30) { }
|
RandomBotUpdateTrigger(PlayerbotAI* botAI) : RandomTrigger(botAI, "random bot update", 30 * 1000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -620,7 +620,7 @@ class RandomBotUpdateTrigger : public RandomTrigger
|
|||||||
class NoNonBotPlayersAroundTrigger : public Trigger
|
class NoNonBotPlayersAroundTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NoNonBotPlayersAroundTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no non bot players around", 10) { }
|
NoNonBotPlayersAroundTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no non bot players around", 10 * 1000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -628,7 +628,7 @@ class NoNonBotPlayersAroundTrigger : public Trigger
|
|||||||
class NewPlayerNearbyTrigger : public Trigger
|
class NewPlayerNearbyTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NewPlayerNearbyTrigger(PlayerbotAI* botAI) : Trigger(botAI, "new player nearby", 10) { }
|
NewPlayerNearbyTrigger(PlayerbotAI* botAI) : Trigger(botAI, "new player nearby", 10 * 1000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -644,7 +644,7 @@ class CollisionTrigger : public Trigger
|
|||||||
class StayTimeTrigger : public Trigger
|
class StayTimeTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StayTimeTrigger(PlayerbotAI* botAI, uint32 delay, std::string const name) : Trigger(botAI, name, 5), delay(delay) { }
|
StayTimeTrigger(PlayerbotAI* botAI, uint32 delay, std::string const name) : Trigger(botAI, name, 5 * 1000), delay(delay) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
|
|
||||||
@@ -667,7 +667,7 @@ class ReturnTrigger : public StayTimeTrigger
|
|||||||
class GiveItemTrigger : public Trigger
|
class GiveItemTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GiveItemTrigger(PlayerbotAI* botAI, std::string const name, std::string const item) : Trigger(botAI, name, 2), item(item) { }
|
GiveItemTrigger(PlayerbotAI* botAI, std::string const name, std::string const item) : Trigger(botAI, name, 2 * 1000), item(item) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
|
|
||||||
@@ -702,7 +702,7 @@ class IsMountedTrigger : public Trigger
|
|||||||
class CorpseNearTrigger : public Trigger
|
class CorpseNearTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CorpseNearTrigger(PlayerbotAI* botAI) : Trigger(botAI, "corpse near", 10) { }
|
CorpseNearTrigger(PlayerbotAI* botAI) : Trigger(botAI, "corpse near", 10 * 1000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -710,7 +710,7 @@ class CorpseNearTrigger : public Trigger
|
|||||||
class IsFallingTrigger : public Trigger
|
class IsFallingTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IsFallingTrigger(PlayerbotAI* botAI) : Trigger(botAI, "falling", 10) { }
|
IsFallingTrigger(PlayerbotAI* botAI) : Trigger(botAI, "falling", 10 * 1000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -718,7 +718,7 @@ class IsFallingTrigger : public Trigger
|
|||||||
class IsFallingFarTrigger : public Trigger
|
class IsFallingFarTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IsFallingFarTrigger(PlayerbotAI* botAI) : Trigger(botAI, "falling far", 10) { }
|
IsFallingFarTrigger(PlayerbotAI* botAI) : Trigger(botAI, "falling far", 10 * 1000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class PlayerbotAI;
|
|||||||
class LfgProposalActiveTrigger : public Trigger
|
class LfgProposalActiveTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LfgProposalActiveTrigger(PlayerbotAI* botAI) : Trigger(botAI, "lfg proposal active", 20) { }
|
LfgProposalActiveTrigger(PlayerbotAI* botAI) : Trigger(botAI, "lfg proposal active", 20 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
@@ -20,7 +20,7 @@ class LfgProposalActiveTrigger : public Trigger
|
|||||||
class UnknownDungeonTrigger : public Trigger
|
class UnknownDungeonTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UnknownDungeonTrigger(PlayerbotAI* botAI) : Trigger(botAI, "unknown dungeon", 20) { }
|
UnknownDungeonTrigger(PlayerbotAI* botAI) : Trigger(botAI, "unknown dungeon", 20 * 2000) { }
|
||||||
|
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Unit;
|
|||||||
class AttackersValue : public ObjectGuidListCalculatedValue
|
class AttackersValue : public ObjectGuidListCalculatedValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AttackersValue(PlayerbotAI* botAI) : ObjectGuidListCalculatedValue(botAI, "attackers", 2) { }
|
AttackersValue(PlayerbotAI* botAI) : ObjectGuidListCalculatedValue(botAI, "attackers", 2 * 1000) { }
|
||||||
|
|
||||||
GuidVector Calculate();
|
GuidVector Calculate();
|
||||||
static bool IsPossibleTarget(Unit* attacker, Player* bot, float range = sPlayerbotAIConfig->sightDistance);
|
static bool IsPossibleTarget(Unit* attacker, Player* bot, float range = sPlayerbotAIConfig->sightDistance);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class NearestEnemyPlayersValue : public PossibleTargetsValue
|
|||||||
class EnemyPlayerValue : public UnitCalculatedValue
|
class EnemyPlayerValue : public UnitCalculatedValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EnemyPlayerValue(PlayerbotAI* botAI, std::string const name = "enemy player") : UnitCalculatedValue(botAI, name, 2) { }
|
EnemyPlayerValue(PlayerbotAI* botAI, std::string const name = "enemy player") : UnitCalculatedValue(botAI, name, 2 * 1000) { }
|
||||||
|
|
||||||
Unit* Calculate() override;
|
Unit* Calculate() override;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class PlayerbotAI;
|
|||||||
class GroupMembersValue : public ObjectGuidListCalculatedValue
|
class GroupMembersValue : public ObjectGuidListCalculatedValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GroupMembersValue(PlayerbotAI* botAI) : ObjectGuidListCalculatedValue(botAI, "group members", 2) { }
|
GroupMembersValue(PlayerbotAI* botAI) : ObjectGuidListCalculatedValue(botAI, "group members", 2 * 1000) { }
|
||||||
|
|
||||||
GuidVector Calculate() override;
|
GuidVector Calculate() override;
|
||||||
};
|
};
|
||||||
@@ -66,7 +66,7 @@ class GroupBoolORValue : public BoolCalculatedValue, public Qualified
|
|||||||
class GroupReadyValue : public BoolCalculatedValue, public Qualified
|
class GroupReadyValue : public BoolCalculatedValue, public Qualified
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GroupReadyValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "group ready", 2) { }
|
GroupReadyValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "group ready", 2 * 2000) { }
|
||||||
|
|
||||||
bool Calculate()override;
|
bool Calculate()override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class SpellInfo;
|
|||||||
class ItemForSpellValue : public CalculatedValue<Item*>, public Qualified
|
class ItemForSpellValue : public CalculatedValue<Item*>, public Qualified
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ItemForSpellValue(PlayerbotAI* botAI, std::string const name = "item for spell") : CalculatedValue<Item*>(botAI, name) { }
|
ItemForSpellValue(PlayerbotAI* botAI, std::string const name = "item for spell") : CalculatedValue<Item*>(botAI, name, 20 * 1000) { }
|
||||||
|
|
||||||
Item* Calculate() override;
|
Item* Calculate() override;
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ typedef std::unordered_map<ItemUsage, std::vector<uint32>> itemUsageMap;
|
|||||||
class EntryLootUsageValue : public CalculatedValue<itemUsageMap>, public Qualified
|
class EntryLootUsageValue : public CalculatedValue<itemUsageMap>, public Qualified
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EntryLootUsageValue(PlayerbotAI* botAI) : CalculatedValue(botAI, "entry loot usage", 2) { }
|
EntryLootUsageValue(PlayerbotAI* botAI) : CalculatedValue(botAI, "entry loot usage", 2 * 1000) { }
|
||||||
|
|
||||||
itemUsageMap Calculate() override;
|
itemUsageMap Calculate() override;
|
||||||
};
|
};
|
||||||
@@ -67,7 +67,7 @@ class EntryLootUsageValue : public CalculatedValue<itemUsageMap>, public Qualifi
|
|||||||
class HasUpgradeValue : public BoolCalculatedValue, public Qualified
|
class HasUpgradeValue : public BoolCalculatedValue, public Qualified
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HasUpgradeValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "has upgrade", 2) { }
|
HasUpgradeValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "has upgrade", 2 * 1000) { }
|
||||||
|
|
||||||
bool Calculate() override;
|
bool Calculate() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class PlayerbotAI;
|
|||||||
class CanMoveAroundValue : public BoolCalculatedValue
|
class CanMoveAroundValue : public BoolCalculatedValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CanMoveAroundValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can move around", 2) { }
|
CanMoveAroundValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can move around", 2 * 2000) { }
|
||||||
|
|
||||||
bool Calculate() override;
|
bool Calculate() override;
|
||||||
};
|
};
|
||||||
@@ -20,7 +20,7 @@ class CanMoveAroundValue : public BoolCalculatedValue
|
|||||||
class ShouldHomeBindValue : public BoolCalculatedValue
|
class ShouldHomeBindValue : public BoolCalculatedValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ShouldHomeBindValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "should home bind", 2) { }
|
ShouldHomeBindValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "should home bind", 2 * 2000) { }
|
||||||
|
|
||||||
bool Calculate() override;
|
bool Calculate() override;
|
||||||
};
|
};
|
||||||
@@ -28,7 +28,7 @@ class ShouldHomeBindValue : public BoolCalculatedValue
|
|||||||
class ShouldRepairValue : public BoolCalculatedValue
|
class ShouldRepairValue : public BoolCalculatedValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ShouldRepairValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI,"should repair",2) { }
|
ShouldRepairValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI,"should repair",2 * 2000) { }
|
||||||
|
|
||||||
bool Calculate() override;
|
bool Calculate() override;
|
||||||
};
|
};
|
||||||
@@ -36,7 +36,7 @@ class ShouldRepairValue : public BoolCalculatedValue
|
|||||||
class CanRepairValue : public BoolCalculatedValue
|
class CanRepairValue : public BoolCalculatedValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CanRepairValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can repair",2) { }
|
CanRepairValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can repair",2 * 2000) { }
|
||||||
|
|
||||||
bool Calculate() override;
|
bool Calculate() override;
|
||||||
};
|
};
|
||||||
@@ -44,7 +44,7 @@ class CanRepairValue : public BoolCalculatedValue
|
|||||||
class ShouldSellValue : public BoolCalculatedValue
|
class ShouldSellValue : public BoolCalculatedValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ShouldSellValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "should sell",2) { }
|
ShouldSellValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "should sell",2 * 2000) { }
|
||||||
|
|
||||||
bool Calculate() override;
|
bool Calculate() override;
|
||||||
};
|
};
|
||||||
@@ -52,7 +52,7 @@ class ShouldSellValue : public BoolCalculatedValue
|
|||||||
class CanSellValue : public BoolCalculatedValue
|
class CanSellValue : public BoolCalculatedValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CanSellValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can sell",2) { }
|
CanSellValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can sell",2 * 2000) { }
|
||||||
|
|
||||||
bool Calculate() override;
|
bool Calculate() override;
|
||||||
};
|
};
|
||||||
@@ -60,7 +60,7 @@ class CanSellValue : public BoolCalculatedValue
|
|||||||
class CanFightEqualValue: public BoolCalculatedValue
|
class CanFightEqualValue: public BoolCalculatedValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CanFightEqualValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can fight equal",2) { }
|
CanFightEqualValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can fight equal",2 * 2000) { }
|
||||||
|
|
||||||
bool Calculate() override;
|
bool Calculate() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class NearestGameObjects : public ObjectGuidListCalculatedValue
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NearestGameObjects(PlayerbotAI* botAI, float range = sPlayerbotAIConfig->sightDistance, bool ignoreLos = false, std::string const name = "nearest game objects") :
|
NearestGameObjects(PlayerbotAI* botAI, float range = sPlayerbotAIConfig->sightDistance, bool ignoreLos = false, std::string const name = "nearest game objects") :
|
||||||
ObjectGuidListCalculatedValue(botAI, name), range(range) , ignoreLos(ignoreLos) { }
|
ObjectGuidListCalculatedValue(botAI, name, 2 * 1000), range(range) , ignoreLos(ignoreLos) { }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GuidVector Calculate() override;
|
GuidVector Calculate() override;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class NearestUnitsValue : public ObjectGuidListCalculatedValue
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NearestUnitsValue(PlayerbotAI* botAI, std::string const name = "nearest units", float range = sPlayerbotAIConfig->sightDistance, bool ignoreLos = false) :
|
NearestUnitsValue(PlayerbotAI* botAI, std::string const name = "nearest units", float range = sPlayerbotAIConfig->sightDistance, bool ignoreLos = false) :
|
||||||
ObjectGuidListCalculatedValue(botAI, name, 2), range(range), ignoreLos(ignoreLos) { }
|
ObjectGuidListCalculatedValue(botAI, name, 2 * 1000), range(range), ignoreLos(ignoreLos) { }
|
||||||
|
|
||||||
GuidVector Calculate() override;
|
GuidVector Calculate() override;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Unit;
|
|||||||
class PartyMemberToDispel : public PartyMemberValue, public Qualified
|
class PartyMemberToDispel : public PartyMemberValue, public Qualified
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PartyMemberToDispel(PlayerbotAI* botAI, std::string const name = "party member to dispel") : PartyMemberValue(botAI, name, 2), Qualified() { }
|
PartyMemberToDispel(PlayerbotAI* botAI, std::string const name = "party member to dispel") : PartyMemberValue(botAI, name, 2 * 1000), Qualified() { }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Unit* Calculate() override;
|
Unit* Calculate() override;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class PartyMemberValue : public UnitCalculatedValue
|
|||||||
class PartyMemberMainTankValue : public PartyMemberValue
|
class PartyMemberMainTankValue : public PartyMemberValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PartyMemberMainTankValue(PlayerbotAI* botAI) : PartyMemberValue(botAI, "main tank member", 2) {}
|
PartyMemberMainTankValue(PlayerbotAI* botAI) : PartyMemberValue(botAI, "main tank member", 2 * 1000) {}
|
||||||
virtual Unit* Calculate();
|
virtual Unit* Calculate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
|
|
||||||
SpellIdValue::SpellIdValue(PlayerbotAI* botAI) : CalculatedValue<uint32>(botAI, "spell id")
|
SpellIdValue::SpellIdValue(PlayerbotAI* botAI) : CalculatedValue<uint32>(botAI, "spell id", 20 * 1000)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class TravelTargetValue : public ManualSetValue<TravelTarget*>
|
|||||||
class LastLongMoveValue : public CalculatedValue<WorldPosition>
|
class LastLongMoveValue : public CalculatedValue<WorldPosition>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LastLongMoveValue(PlayerbotAI* botAI) : CalculatedValue<WorldPosition>(botAI, "last long move", 30) { }
|
LastLongMoveValue(PlayerbotAI* botAI) : CalculatedValue<WorldPosition>(botAI, "last long move", 30 * 1000) { }
|
||||||
|
|
||||||
WorldPosition Calculate() override;
|
WorldPosition Calculate() override;
|
||||||
};
|
};
|
||||||
@@ -72,7 +72,7 @@ class LastLongMoveValue : public CalculatedValue<WorldPosition>
|
|||||||
class HomeBindValue : public CalculatedValue<WorldPosition>
|
class HomeBindValue : public CalculatedValue<WorldPosition>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HomeBindValue(PlayerbotAI* botAI) : CalculatedValue<WorldPosition>(botAI, "home bind", 30) { }
|
HomeBindValue(PlayerbotAI* botAI) : CalculatedValue<WorldPosition>(botAI, "home bind", 30 * 1000) { }
|
||||||
|
|
||||||
WorldPosition Calculate() override;
|
WorldPosition Calculate() override;
|
||||||
};
|
};
|
||||||
@@ -101,7 +101,7 @@ class PullTargetValue : public ManualSetValue<ObjectGuid>
|
|||||||
class FindTargetValue : public UnitCalculatedValue, public Qualified
|
class FindTargetValue : public UnitCalculatedValue, public Qualified
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FindTargetValue(PlayerbotAI* ai) : UnitCalculatedValue(ai, "find target", 2) {}
|
FindTargetValue(PlayerbotAI* ai) : UnitCalculatedValue(ai, "find target", 2 * 1000) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Unit* Calculate();
|
Unit* Calculate();
|
||||||
@@ -117,7 +117,7 @@ class FindBossTargetStrategy : public FindTargetStrategy
|
|||||||
class BossTargetValue : public TargetValue, public Qualified
|
class BossTargetValue : public TargetValue, public Qualified
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BossTargetValue(PlayerbotAI* ai) : TargetValue(ai, "boss target", 1) {}
|
BossTargetValue(PlayerbotAI* ai) : TargetValue(ai, "boss target", 2 * 1000) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Unit* Calculate();
|
Unit* Calculate();
|
||||||
|
|||||||
Reference in New Issue
Block a user