mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 17:26:30 +00:00
More cleanup 1
This commit is contained in:
@@ -25,7 +25,7 @@ struct MethodHandlerEntry
|
|||||||
struct EQ::Net::WebsocketServer::Impl
|
struct EQ::Net::WebsocketServer::Impl
|
||||||
{
|
{
|
||||||
std::unique_ptr<TCPServer> server;
|
std::unique_ptr<TCPServer> server;
|
||||||
std::unique_ptr<EQ::Timer> ping_timer;
|
std::unique_ptr<EQ::Timer> m_ping_timer;
|
||||||
std::map<std::shared_ptr<websocket_connection>, std::unique_ptr<WebsocketServerConnection>> connections;
|
std::map<std::shared_ptr<websocket_connection>, std::unique_ptr<WebsocketServerConnection>> connections;
|
||||||
std::map<std::string, MethodHandlerEntry> methods;
|
std::map<std::string, MethodHandlerEntry> methods;
|
||||||
websocket_server ws_server;
|
websocket_server ws_server;
|
||||||
@@ -54,7 +54,7 @@ EQ::Net::WebsocketServer::WebsocketServer(const std::string &addr, int port)
|
|||||||
return websocketpp::lib::error_code();
|
return websocketpp::lib::error_code();
|
||||||
});
|
});
|
||||||
|
|
||||||
_impl->ping_timer = std::make_unique<EQ::Timer>(5000, true, [this](EQ::Timer *t) {
|
_impl->m_ping_timer = std::make_unique<EQ::Timer>(5000, true, [this](EQ::Timer *t) {
|
||||||
auto iter = _impl->connections.begin();
|
auto iter = _impl->connections.begin();
|
||||||
|
|
||||||
while (iter != _impl->connections.end()) {
|
while (iter != _impl->connections.end()) {
|
||||||
|
|||||||
+156
-142
@@ -127,24 +127,12 @@ bool IsMesmerizeSpell(uint16 spell_id)
|
|||||||
|
|
||||||
bool SpellBreaksMez(uint16 spell_id)
|
bool SpellBreaksMez(uint16 spell_id)
|
||||||
{
|
{
|
||||||
if (IsDetrimentalSpell(spell_id) && IsAnyDamageSpell(spell_id)) {
|
return (IsValidSpell(spell_id) && IsDetrimentalSpell(spell_id) && IsAnyDamageSpell(spell_id));
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsStunSpell(uint16 spell_id)
|
bool IsStunSpell(uint16 spell_id)
|
||||||
{
|
{
|
||||||
if (IsEffectInSpell(spell_id, SE_Stun)) {
|
return (IsValidSpell(spell_id) && IsEffectInSpell(spell_id, SE_Stun) || IsEffectInSpell(spell_id, SE_SpinTarget));
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsEffectInSpell(spell_id, SE_SpinTarget)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsSummonSpell(uint16 spell_id)
|
bool IsSummonSpell(uint16 spell_id)
|
||||||
@@ -171,6 +159,10 @@ bool IsSummonSpell(uint16 spell_id)
|
|||||||
|
|
||||||
bool IsDamageSpell(uint16 spell_id)
|
bool IsDamageSpell(uint16 spell_id)
|
||||||
{
|
{
|
||||||
|
if (!IsValidSpell(spell_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (IsLifetapSpell(spell_id)) {
|
if (IsLifetapSpell(spell_id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -192,6 +184,10 @@ bool IsDamageSpell(uint16 spell_id)
|
|||||||
|
|
||||||
bool IsAnyDamageSpell(uint16 spell_id)
|
bool IsAnyDamageSpell(uint16 spell_id)
|
||||||
{
|
{
|
||||||
|
if (!IsValidSpell(spell_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (IsLifetapSpell(spell_id)) {
|
if (IsLifetapSpell(spell_id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -200,6 +196,7 @@ bool IsAnyDamageSpell(uint16 spell_id)
|
|||||||
|
|
||||||
for (int i = 0; i < EFFECT_COUNT; i++) {
|
for (int i = 0; i < EFFECT_COUNT; i++) {
|
||||||
const auto effect_id = spell.effect_id[i];
|
const auto effect_id = spell.effect_id[i];
|
||||||
|
|
||||||
if (
|
if (
|
||||||
spell.base_value[i] < 0 &&
|
spell.base_value[i] < 0 &&
|
||||||
(
|
(
|
||||||
@@ -207,8 +204,8 @@ bool IsAnyDamageSpell(uint16 spell_id)
|
|||||||
(
|
(
|
||||||
effect_id == SE_CurrentHP &&
|
effect_id == SE_CurrentHP &&
|
||||||
spell.buff_duration < 1
|
spell.buff_duration < 1
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -678,11 +675,17 @@ bool IsAnyNukeOrStunSpell(uint16 spell_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsAnyAESpell(uint16 spell_id) {
|
bool IsAnyAESpell(uint16 spell_id) {
|
||||||
if (IsAESpell(spell_id) || IsPBAENukeSpell(spell_id) || IsPBAESpell(spell_id) || IsAERainSpell(spell_id) || IsAERainNukeSpell(spell_id) || IsAEDurationSpell(spell_id)) {
|
return (
|
||||||
return true;
|
IsValidSpell(spell_id) &&
|
||||||
}
|
(
|
||||||
|
IsAEDurationSpell(spell_id) ||
|
||||||
return false;
|
IsAESpell(spell_id) ||
|
||||||
|
IsAERainNukeSpell(spell_id) ||
|
||||||
|
IsAERainSpell(spell_id) ||
|
||||||
|
IsPBAESpell(spell_id) ||
|
||||||
|
IsPBAENukeSpell(spell_id)
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsAESpell(uint16 spell_id)
|
bool IsAESpell(uint16 spell_id)
|
||||||
@@ -1445,43 +1448,42 @@ bool IsCompleteHealSpell(uint16 spell_id)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsFastHealSpell(uint16 spell_id)
|
bool IsFastHealSpell(uint16 spell_id) {
|
||||||
{
|
spell_id = (
|
||||||
spell_id = (
|
IsEffectInSpell(spell_id, SE_CurrentHP) ?
|
||||||
IsEffectInSpell(spell_id, SE_CurrentHP) ?
|
spell_id :
|
||||||
spell_id :
|
GetSpellTriggerSpellID(spell_id, SE_CurrentHP)
|
||||||
GetSpellTriggerSpellID(spell_id, SE_CurrentHP)
|
);
|
||||||
);
|
|
||||||
|
|
||||||
if (!spell_id) {
|
if (!spell_id) {
|
||||||
spell_id = (
|
spell_id = (
|
||||||
IsEffectInSpell(spell_id, SE_CurrentHPOnce) ?
|
IsEffectInSpell(spell_id, SE_CurrentHPOnce) ?
|
||||||
spell_id :
|
spell_id :
|
||||||
GetSpellTriggerSpellID(spell_id, SE_CurrentHPOnce)
|
GetSpellTriggerSpellID(spell_id, SE_CurrentHPOnce)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spell_id) {
|
if (spell_id && IsValidSpell(spell_id)) {
|
||||||
if (
|
if (
|
||||||
spells[spell_id].cast_time <= MAX_FAST_HEAL_CASTING_TIME &&
|
spells[spell_id].cast_time <= MAX_FAST_HEAL_CASTING_TIME &&
|
||||||
spells[spell_id].good_effect &&
|
spells[spell_id].good_effect &&
|
||||||
!IsGroupSpell(spell_id)
|
!IsGroupSpell(spell_id)
|
||||||
) {
|
) {
|
||||||
for (int i = 0; i < EFFECT_COUNT; i++) {
|
for (int i = 0; i < EFFECT_COUNT; i++) {
|
||||||
if (
|
if (
|
||||||
spells[spell_id].base_value[i] > 0 &&
|
spells[spell_id].base_value[i] > 0 &&
|
||||||
(
|
(
|
||||||
spells[spell_id].effect_id[i] == SE_CurrentHP ||
|
spells[spell_id].effect_id[i] == SE_CurrentHP ||
|
||||||
spells[spell_id].effect_id[i] == SE_CurrentHPOnce
|
spells[spell_id].effect_id[i] == SE_CurrentHPOnce
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsVeryFastHealSpell(uint16 spell_id)
|
bool IsVeryFastHealSpell(uint16 spell_id)
|
||||||
@@ -1570,17 +1572,17 @@ bool IsRegularPetHealSpell(uint16 spell_id)
|
|||||||
IsEffectInSpell(spell_id, SE_CurrentHP) ?
|
IsEffectInSpell(spell_id, SE_CurrentHP) ?
|
||||||
spell_id :
|
spell_id :
|
||||||
GetSpellTriggerSpellID(spell_id, SE_CurrentHP)
|
GetSpellTriggerSpellID(spell_id, SE_CurrentHP)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!spell_id) {
|
if (!spell_id) {
|
||||||
spell_id = (
|
spell_id = (
|
||||||
IsEffectInSpell(spell_id, SE_CurrentHPOnce) ?
|
IsEffectInSpell(spell_id, SE_CurrentHPOnce) ?
|
||||||
spell_id :
|
spell_id :
|
||||||
GetSpellTriggerSpellID(spell_id, SE_CurrentHPOnce)
|
GetSpellTriggerSpellID(spell_id, SE_CurrentHPOnce)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spell_id) {
|
if (spell_id && IsValidSpell(spell_id)) {
|
||||||
if (
|
if (
|
||||||
(spells[spell_id].target_type == ST_Pet || spells[spell_id].target_type == ST_Undead) &&
|
(spells[spell_id].target_type == ST_Pet || spells[spell_id].target_type == ST_Undead) &&
|
||||||
!IsCompleteHealSpell(spell_id) &&
|
!IsCompleteHealSpell(spell_id) &&
|
||||||
@@ -1611,14 +1613,14 @@ bool IsRegularGroupHealSpell(uint16 spell_id)
|
|||||||
IsEffectInSpell(spell_id, SE_CurrentHP) ?
|
IsEffectInSpell(spell_id, SE_CurrentHP) ?
|
||||||
spell_id :
|
spell_id :
|
||||||
GetSpellTriggerSpellID(spell_id, SE_CurrentHP)
|
GetSpellTriggerSpellID(spell_id, SE_CurrentHP)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!spell_id) {
|
if (!spell_id) {
|
||||||
spell_id = (
|
spell_id = (
|
||||||
IsEffectInSpell(spell_id, SE_CurrentHPOnce) ?
|
IsEffectInSpell(spell_id, SE_CurrentHPOnce) ?
|
||||||
spell_id :
|
spell_id :
|
||||||
GetSpellTriggerSpellID(spell_id, SE_CurrentHPOnce)
|
GetSpellTriggerSpellID(spell_id, SE_CurrentHPOnce)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spell_id) {
|
if (spell_id) {
|
||||||
@@ -1634,8 +1636,8 @@ bool IsRegularGroupHealSpell(uint16 spell_id)
|
|||||||
(
|
(
|
||||||
spells[spell_id].effect_id[i] == SE_CurrentHP ||
|
spells[spell_id].effect_id[i] == SE_CurrentHP ||
|
||||||
spells[spell_id].effect_id[i] == SE_CurrentHPOnce
|
spells[spell_id].effect_id[i] == SE_CurrentHPOnce
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1645,36 +1647,36 @@ bool IsRegularGroupHealSpell(uint16 spell_id)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsGroupCompleteHealSpell(uint16 spell_id)
|
bool IsGroupCompleteHealSpell(uint16 spell_id) {
|
||||||
{
|
if (
|
||||||
if (
|
IsValidSpell(spell_id) &&
|
||||||
(
|
(
|
||||||
spell_id == SPELL_COMPLETE_HEAL ||
|
spell_id == SPELL_COMPLETE_HEAL ||
|
||||||
IsEffectInSpell(spell_id, SE_CompleteHeal) ||
|
IsEffectInSpell(spell_id, SE_CompleteHeal) ||
|
||||||
IsPercentalHealSpell(spell_id) ||
|
IsPercentalHealSpell(spell_id) ||
|
||||||
GetSpellTriggerSpellID(spell_id, SE_CompleteHeal)
|
GetSpellTriggerSpellID(spell_id, SE_CompleteHeal)
|
||||||
) &&
|
) &&
|
||||||
IsGroupSpell(spell_id)
|
IsGroupSpell(spell_id)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsGroupHealOverTimeSpell(uint16 spell_id)
|
bool IsGroupHealOverTimeSpell(uint16 spell_id) {
|
||||||
{
|
if (
|
||||||
if (
|
IsValidSpell(spell_id) &&
|
||||||
(
|
(
|
||||||
IsEffectInSpell(spell_id, SE_HealOverTime) ||
|
IsEffectInSpell(spell_id, SE_HealOverTime) ||
|
||||||
GetSpellTriggerSpellID(spell_id, SE_HealOverTime)
|
GetSpellTriggerSpellID(spell_id, SE_HealOverTime)
|
||||||
) &&
|
) &&
|
||||||
IsGroupSpell(spell_id)
|
IsGroupSpell(spell_id)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsAnyHealSpell(uint16 spell_id) {
|
bool IsAnyHealSpell(uint16 spell_id) {
|
||||||
@@ -1745,22 +1747,25 @@ bool IsEscapeSpell(uint16 spell_id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
return (
|
||||||
IsInvulnerabilitySpell(spell_id) ||
|
IsInvulnerabilitySpell(spell_id) ||
|
||||||
IsEffectInSpell(spell_id, SE_FeignDeath) ||
|
IsEffectInSpell(spell_id, SE_FeignDeath) ||
|
||||||
IsEffectInSpell(spell_id, SE_DeathSave) ||
|
IsEffectInSpell(spell_id, SE_DeathSave) ||
|
||||||
IsEffectInSpell(spell_id, SE_Destroy) ||
|
IsEffectInSpell(spell_id, SE_Destroy) ||
|
||||||
(IsEffectInSpell(spell_id, SE_WipeHateList) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_WipeHateList)] > 0)
|
(
|
||||||
) {
|
IsEffectInSpell(spell_id, SE_WipeHateList) &&
|
||||||
return true;
|
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_WipeHateList)] > 0
|
||||||
}
|
)
|
||||||
|
);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsDebuffSpell(uint16 spell_id)
|
bool IsDebuffSpell(uint16 spell_id)
|
||||||
{
|
{
|
||||||
if (
|
if (!IsValidSpell(spell_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !(
|
||||||
IsBeneficialSpell(spell_id) ||
|
IsBeneficialSpell(spell_id) ||
|
||||||
IsHealthSpell(spell_id) ||
|
IsHealthSpell(spell_id) ||
|
||||||
IsStunSpell(spell_id) ||
|
IsStunSpell(spell_id) ||
|
||||||
@@ -1773,11 +1778,7 @@ bool IsDebuffSpell(uint16 spell_id)
|
|||||||
IsFearSpell(spell_id) ||
|
IsFearSpell(spell_id) ||
|
||||||
IsEffectInSpell(spell_id, SE_InstantHate) ||
|
IsEffectInSpell(spell_id, SE_InstantHate) ||
|
||||||
IsEffectInSpell(spell_id, SE_TossUp)
|
IsEffectInSpell(spell_id, SE_TossUp)
|
||||||
) {
|
);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsHateReduxSpell(uint16 spell_id) {
|
bool IsHateReduxSpell(uint16 spell_id) {
|
||||||
@@ -1785,20 +1786,29 @@ bool IsHateReduxSpell(uint16 spell_id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
return (
|
||||||
(IsEffectInSpell(spell_id, SE_InstantHate) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_InstantHate)] < 0) ||
|
(
|
||||||
(IsEffectInSpell(spell_id, SE_Hate) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_Hate)] < 0) ||
|
IsEffectInSpell(spell_id, SE_InstantHate) &&
|
||||||
(IsEffectInSpell(spell_id, SE_ReduceHate) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_ReduceHate)] < 0)
|
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_InstantHate)] < 0
|
||||||
) {
|
) ||
|
||||||
return true;
|
(
|
||||||
}
|
IsEffectInSpell(spell_id, SE_Hate) &&
|
||||||
|
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_Hate)] < 0
|
||||||
return false;
|
) ||
|
||||||
|
(
|
||||||
|
IsEffectInSpell(spell_id, SE_ReduceHate) &&
|
||||||
|
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_ReduceHate)] < 0
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsResistDebuffSpell(uint16 spell_id)
|
bool IsResistDebuffSpell(uint16 spell_id)
|
||||||
{
|
{
|
||||||
if (
|
if (!IsValidSpell(spell_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
!IsBeneficialSpell(spell_id) &&
|
!IsBeneficialSpell(spell_id) &&
|
||||||
(
|
(
|
||||||
IsEffectInSpell(spell_id, SE_ResistFire) ||
|
IsEffectInSpell(spell_id, SE_ResistFire) ||
|
||||||
@@ -1809,42 +1819,34 @@ bool IsResistDebuffSpell(uint16 spell_id)
|
|||||||
IsEffectInSpell(spell_id, SE_ResistAll) ||
|
IsEffectInSpell(spell_id, SE_ResistAll) ||
|
||||||
IsEffectInSpell(spell_id, SE_ResistCorruption)
|
IsEffectInSpell(spell_id, SE_ResistCorruption)
|
||||||
)
|
)
|
||||||
) {
|
);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsSelfConversionSpell(uint16 spell_id)
|
bool IsSelfConversionSpell(uint16 spell_id)
|
||||||
{
|
{
|
||||||
if (
|
if (!IsValidSpell(spell_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
GetSpellTargetType(spell_id) == ST_Self &&
|
GetSpellTargetType(spell_id) == ST_Self &&
|
||||||
IsEffectInSpell(spell_id, SE_CurrentMana) &&
|
IsEffectInSpell(spell_id, SE_CurrentMana) &&
|
||||||
IsEffectInSpell(spell_id, SE_CurrentHP) &&
|
IsEffectInSpell(spell_id, SE_CurrentHP) &&
|
||||||
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentMana)] > 0 &&
|
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentMana)] > 0 &&
|
||||||
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentHP)] < 0
|
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentHP)] < 0
|
||||||
) {
|
);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true for both detrimental and beneficial buffs
|
// returns true for both detrimental and beneficial buffs
|
||||||
bool IsBuffSpell(uint16 spell_id)
|
bool IsBuffSpell(uint16 spell_id)
|
||||||
{
|
{
|
||||||
if (
|
return (
|
||||||
IsValidSpell(spell_id) &&
|
IsValidSpell(spell_id) &&
|
||||||
(
|
(
|
||||||
spells[spell_id].buff_duration ||
|
spells[spell_id].buff_duration ||
|
||||||
spells[spell_id].buff_duration_formula
|
spells[spell_id].buff_duration_formula
|
||||||
)
|
)
|
||||||
) {
|
);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsPersistDeathSpell(uint16 spell_id)
|
bool IsPersistDeathSpell(uint16 spell_id)
|
||||||
@@ -2777,18 +2779,14 @@ bool IsLichSpell(uint16 spell_id)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
return (
|
||||||
GetSpellTargetType(spell_id) == ST_Self &&
|
GetSpellTargetType(spell_id) == ST_Self &&
|
||||||
IsEffectInSpell(spell_id, SE_CurrentMana) &&
|
IsEffectInSpell(spell_id, SE_CurrentMana) &&
|
||||||
IsEffectInSpell(spell_id, SE_CurrentHP) &&
|
IsEffectInSpell(spell_id, SE_CurrentHP) &&
|
||||||
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentMana)] > 0 &&
|
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentMana)] > 0 &&
|
||||||
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentHP)] < 0 &&
|
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentHP)] < 0 &&
|
||||||
spells[spell_id].buff_duration > 0
|
spells[spell_id].buff_duration > 0
|
||||||
) {
|
);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsValidSpellAndLoS(uint32 spell_id, bool has_los) {
|
bool IsValidSpellAndLoS(uint32 spell_id, bool has_los) {
|
||||||
@@ -2804,15 +2802,25 @@ bool IsValidSpellAndLoS(uint32 spell_id, bool has_los) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsInstantHealSpell(uint32 spell_id) {
|
bool IsInstantHealSpell(uint32 spell_id) {
|
||||||
if (IsRegularSingleTargetHealSpell(spell_id) || IsRegularGroupHealSpell(spell_id) || IsRegularPetHealSpell(spell_id) || IsRegularGroupHealSpell(spell_id) || spell_id == SPELL_COMPLETE_HEAL) {
|
if (!IsValidSpell(spell_id)) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return (
|
||||||
|
IsRegularSingleTargetHealSpell(spell_id) ||
|
||||||
|
IsRegularGroupHealSpell(spell_id) ||
|
||||||
|
IsRegularPetHealSpell(spell_id) ||
|
||||||
|
IsRegularGroupHealSpell(spell_id) ||
|
||||||
|
spell_id == SPELL_COMPLETE_HEAL
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsResurrectSpell(uint16 spell_id)
|
bool IsResurrectSpell(uint16 spell_id)
|
||||||
{
|
{
|
||||||
|
if (!IsValidSpell(spell_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return IsEffectInSpell(spell_id, SE_Revive);
|
return IsEffectInSpell(spell_id, SE_Revive);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2869,12 +2877,18 @@ bool IsDamageShieldOnlySpell(uint16 spell_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsHateSpell(uint16 spell_id) {
|
bool IsHateSpell(uint16 spell_id) {
|
||||||
if (
|
if (!IsValidSpell(spell_id)) {
|
||||||
(IsEffectInSpell(spell_id, SE_Hate) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_Hate)] > 0) ||
|
return false;
|
||||||
(IsEffectInSpell(spell_id, SE_InstantHate) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_InstantHate)] > 0)
|
|
||||||
) {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return (
|
||||||
|
(
|
||||||
|
IsEffectInSpell(spell_id, SE_Hate) &&
|
||||||
|
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_Hate)] > 0
|
||||||
|
) ||
|
||||||
|
(
|
||||||
|
IsEffectInSpell(spell_id, SE_InstantHate) &&
|
||||||
|
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_InstantHate)] > 0
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -419,6 +419,10 @@ bool IsPullingBotSpellType(uint16 spell_type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16 GetCorrectBotSpellType(uint16 spell_type, uint16 spell_id) {
|
uint16 GetCorrectBotSpellType(uint16 spell_type, uint16 spell_id) {
|
||||||
|
if (!IsValidSpell(spell_id)) {
|
||||||
|
return UINT16_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
uint16 correct_type = UINT16_MAX;
|
uint16 correct_type = UINT16_MAX;
|
||||||
SPDat_Spell_Struct spell = spells[spell_id];
|
SPDat_Spell_Struct spell = spells[spell_id];
|
||||||
std::string teleport_zone = spell.teleport_zone;
|
std::string teleport_zone = spell.teleport_zone;
|
||||||
|
|||||||
+5
-5
@@ -1295,8 +1295,8 @@ bool Mob::CheckLosFN(glm::vec3 posWatcher, float sizeWatcher, glm::vec3 posTarge
|
|||||||
return zone->zonemap->CheckLoS(posWatcher, posTarget);
|
return zone->zonemap->CheckLoS(posWatcher, posTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mob::CheckPositioningLosFN(Mob* other, float posX, float posY, float posZ) {
|
bool Mob::CheckPositioningLosFN(Mob* other, float x, float y, float z) {
|
||||||
if (zone->zonemap == nullptr) {
|
if (!zone->zonemap) {
|
||||||
//not sure what the best return is on error
|
//not sure what the best return is on error
|
||||||
//should make this a database variable, but im lazy today
|
//should make this a database variable, but im lazy today
|
||||||
#ifdef LOS_DEFAULT_CAN_SEE
|
#ifdef LOS_DEFAULT_CAN_SEE
|
||||||
@@ -1318,9 +1318,9 @@ bool Mob::CheckPositioningLosFN(Mob* other, float posX, float posY, float posZ)
|
|||||||
oloc.y = other->GetY();
|
oloc.y = other->GetY();
|
||||||
oloc.z = other->GetZ() + (other->GetSize() == 0.0 ? LOS_DEFAULT_HEIGHT : other->GetSize()) / 2 * SEE_POSITION;
|
oloc.z = other->GetZ() + (other->GetSize() == 0.0 ? LOS_DEFAULT_HEIGHT : other->GetSize()) / 2 * SEE_POSITION;
|
||||||
|
|
||||||
myloc.x = posX;
|
myloc.x = x;
|
||||||
myloc.y = posY;
|
myloc.y = y;
|
||||||
myloc.z = posZ + (GetSize() == 0.0 ? LOS_DEFAULT_HEIGHT : GetSize()) / 2 * HEAD_POSITION;
|
myloc.z = z + (GetSize() == 0.0 ? LOS_DEFAULT_HEIGHT : GetSize()) / 2 * HEAD_POSITION;
|
||||||
|
|
||||||
#if LOSDEBUG>=5
|
#if LOSDEBUG>=5
|
||||||
LogDebug("LOS from ([{}], [{}], [{}]) to ([{}], [{}], [{}]) sizes: ([{}], [{}])", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize);
|
LogDebug("LOS from ([{}], [{}], [{}]) to ([{}], [{}], [{}]) sizes: ([{}], [{}])", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize);
|
||||||
|
|||||||
+2
-2
@@ -1250,8 +1250,8 @@ int64 Mob::GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, in
|
|||||||
(
|
(
|
||||||
!IsBot() ||
|
!IsBot() ||
|
||||||
(IsBot() && !RuleB(Bots, AllowBotEquipAnyClassGear))
|
(IsBot() && !RuleB(Bots, AllowBotEquipAnyClassGear))
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+535
-234
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1112,7 +1112,7 @@ private:
|
|||||||
unsigned int RestRegenMana;
|
unsigned int RestRegenMana;
|
||||||
unsigned int RestRegenEndurance;
|
unsigned int RestRegenEndurance;
|
||||||
Timer rest_timer;
|
Timer rest_timer;
|
||||||
Timer ping_timer;
|
Timer m_ping_timer;
|
||||||
int32 base_end;
|
int32 base_end;
|
||||||
int32 cur_end;
|
int32 cur_end;
|
||||||
int32 max_end;
|
int32 max_end;
|
||||||
@@ -1121,7 +1121,7 @@ private:
|
|||||||
Timer m_rogue_evade_timer; // Rogue evade timer
|
Timer m_rogue_evade_timer; // Rogue evade timer
|
||||||
Timer m_monk_evade_timer; // Monk evade FD timer
|
Timer m_monk_evade_timer; // Monk evade FD timer
|
||||||
Timer m_auto_defend_timer;
|
Timer m_auto_defend_timer;
|
||||||
Timer auto_save_timer;
|
Timer m_auto_save_timer;
|
||||||
|
|
||||||
Timer m_combat_jitter_timer;
|
Timer m_combat_jitter_timer;
|
||||||
bool m_combat_jitter_flag;
|
bool m_combat_jitter_flag;
|
||||||
|
|||||||
Reference in New Issue
Block a user