mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-06 17:43:52 +00:00
Added more elixir error constants
This commit is contained in:
parent
93a661a434
commit
8a79994b4e
159
zone/command.cpp
159
zone/command.cpp
@ -15918,78 +15918,99 @@ void command_elixircheck(Client* c, const Seperator* sep)
|
|||||||
Mob* outMob = nullptr;
|
Mob* outMob = nullptr;
|
||||||
const SPDat_Spell_Struct& spDat = spells[spellid];
|
const SPDat_Spell_Struct& spDat = spells[spellid];
|
||||||
auto result = c->ElixirCastSpellCheck(spellid, &outMob);
|
auto result = c->ElixirCastSpellCheck(spellid, &outMob);
|
||||||
if (result < 0) {
|
switch (result) {
|
||||||
switch (result) {
|
case ELIXIR_TARGET_CHANGE:
|
||||||
case ELIXIR_UNHANDLED_SPELL:
|
c->Message(Chat::White, "Elixir AI would return OK if target changes to %s to cast %s", outMob->GetCleanName(), spDat.name);
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (UNHANDLED_SPELL)", spDat.name, result);
|
return;
|
||||||
return;
|
case ELIXIR_OK:
|
||||||
case ELIXIR_CANNOT_CAST_BAD_STATE:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (CANNOT_CAST_BAD_STATE)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_NOT_ENOUGH_MANA:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NOT_ENOUGH_MANA)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_LULL_IGNORED:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (LULL_IGNORED)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_MEZ_IGNORED:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (MEZ_IGNORED)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_CHARM_IGNORED:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (CHARM_IGNORED)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_NO_TARGET:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NO_TARGET)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_INVALID_TARGET_BODYTYPE:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (INVALID_TARGET_BODYTYPE)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_TRANSPORT_IGNORED:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (TRANSPORT_IGNORED)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_NOT_LINE_OF_SIGHT:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NOT_LINE_OF_SIGHT)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_COMPONENT_REQUIRED:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (COMPONENT_REQUIRED)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_ALREADY_HAVE_BUFF:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ALREADY_HAVE_BUFF)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_ZONETYPE_FAIL:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ZONETYPE_FAIL)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_CANNOT_USE_IN_COMBAT:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (CANNOT_USE_IN_COMBAT)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_NOT_ENOUGH_ENDURANCE:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NOT_ENOUGH_ENDURANCE)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_ALREADY_HAVE_PET:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ALREADY_HAVE_PET)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_OUT_OF_RANGE:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (OUT_OF_RANGE)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_NO_PET:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NO_PET)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
case ELIXIR_NOT_NEEDED:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NOT_NEEDED)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (UNKNOWN)", spDat.name, result);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == 0) {
|
|
||||||
c->Message(Chat::White, "Elixir AI would return OK to cast %s", spDat.name);
|
c->Message(Chat::White, "Elixir AI would return OK to cast %s", spDat.name);
|
||||||
return;
|
return;
|
||||||
|
case ELIXIR_UNHANDLED_SPELL:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (UNHANDLED_SPELL)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_CANNOT_CAST_BAD_STATE:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (CANNOT_CAST_BAD_STATE)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_NOT_ENOUGH_MANA:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NOT_ENOUGH_MANA)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_LULL_IGNORED:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (LULL_IGNORED)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_MEZ_IGNORED:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (MEZ_IGNORED)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_CHARM_IGNORED:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (CHARM_IGNORED)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_NO_TARGET:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NO_TARGET)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_INVALID_TARGET_BODYTYPE:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (INVALID_TARGET_BODYTYPE)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_TRANSPORT_IGNORED:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (TRANSPORT_IGNORED)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_NOT_LINE_OF_SIGHT:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NOT_LINE_OF_SIGHT)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_COMPONENT_REQUIRED:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (COMPONENT_REQUIRED)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_ALREADY_HAVE_BUFF:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ALREADY_HAVE_BUFF)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_ZONETYPE_FAIL:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ZONETYPE_FAIL)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_CANNOT_USE_IN_COMBAT:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (CANNOT_USE_IN_COMBAT)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_NOT_ENOUGH_ENDURANCE:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NOT_ENOUGH_ENDURANCE)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_ALREADY_HAVE_PET:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ALREADY_HAVE_PET)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_OUT_OF_RANGE:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (OUT_OF_RANGE)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_NO_PET:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NO_PET)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_NOT_NEEDED:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (NOT_NEEDED)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_NOT_BEHIND_MOB:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ELIXIR_NOT_BEHIND_MOB)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_HP_NOT_LOW:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ELIXIR_HP_NOT_LOW)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_MANA_NOT_LOW:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ELIXIR_MANA_NOT_LOW)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_AE_LIMIT_NOT_MET:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ELIXIR_AE_LIMIT_NOT_MET)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_NO_HATE:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ELIXIR_NO_HATE)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_TARGET_MEZZED:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ELIXIR_TARGET_MEZZED)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_ATTACK_NOT_ALLOWED:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ELIXIR_ATTACK_NOT_ALLOWED)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
case ELIXIR_TARGET_ALREADY_STUNNED:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (ELIXIR_TARGET_ALREADY_STUNNED)", spDat.name, result);
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
c->Message(Chat::Red, "Elixir AI failed to cast %s due to error %d (UNKNOWN)", spDat.name, result);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (result == 1) {
|
|
||||||
c->Message(Chat::White, "Elixir AI would return OK if target changes to %s to cast %s", outMob->GetCleanName(), spDat.name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -356,12 +356,12 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
return ELIXIR_NO_TARGET;
|
return ELIXIR_NO_TARGET;
|
||||||
}
|
}
|
||||||
if (!BehindMob(target)) {
|
if (!BehindMob(target)) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_NOT_BEHIND_MOB;
|
||||||
}
|
}
|
||||||
if (!IsWithinSpellRange(target, spDat.range, spellID)) {
|
if (!IsWithinSpellRange(target, spDat.range, spellID)) {
|
||||||
return ELIXIR_OUT_OF_RANGE;
|
return ELIXIR_OUT_OF_RANGE;
|
||||||
}
|
}
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recourseID > 0) { //recourse buff attached
|
if (recourseID > 0) { //recourse buff attached
|
||||||
@ -461,19 +461,23 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPetSummon && HasPet()) return ELIXIR_ALREADY_HAVE_PET;
|
|
||||||
|
|
||||||
|
if (isPetSummon) {
|
||||||
|
if (HasPet()) return ELIXIR_ALREADY_HAVE_PET;
|
||||||
|
return ELIXIR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
if (targettype == ST_Pet && isHeal) {
|
if (targettype == ST_Pet && isHeal) {
|
||||||
if (!HasPet()) {
|
if (!HasPet()) {
|
||||||
return ELIXIR_NO_PET;
|
return ELIXIR_NO_PET;
|
||||||
}
|
}
|
||||||
if (GetPet()->GetHPRatio() <= healPercent) {
|
if (GetPet()->GetHPRatio() > healPercent) {
|
||||||
return 0;
|
return ELIXIR_HP_NOT_LOW;
|
||||||
}
|
}
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isBuff && targettype == ST_Pet && isBeneficial) {
|
if (isBuff && targettype == ST_Pet && isBeneficial) {
|
||||||
if (!HasPet()) {
|
if (!HasPet()) {
|
||||||
return ELIXIR_NO_PET;
|
return ELIXIR_NO_PET;
|
||||||
@ -495,8 +499,8 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
if (!IsWithinSpellRange(GetPet(), spDat.range, spellID)) {
|
if (!IsWithinSpellRange(GetPet(), spDat.range, spellID)) {
|
||||||
return ELIXIR_OUT_OF_RANGE;
|
return ELIXIR_OUT_OF_RANGE;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMana && targettype == ST_Self && ticks <= 0 && !isPetSummon) { // self only regen, like harvest, canni
|
if (isMana && targettype == ST_Self && ticks <= 0 && !isPetSummon) { // self only regen, like harvest, canni
|
||||||
@ -505,15 +509,14 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (GetManaRatio() > 50) {
|
if (GetManaRatio() > 50) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_MANA_NOT_LOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLifetap && GetHPRatio() <= healPercent) {
|
if (isLifetap && GetHPRatio() > healPercent) {
|
||||||
//TODO: check if it's a group recourse lifetap regen so necros can bond heal group
|
return ELIXIR_HP_NOT_LOW;
|
||||||
return ELIXIR_NOT_NEEDED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isHeal) { //heal logic
|
if (isHeal) { //heal logic
|
||||||
@ -587,13 +590,13 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isGroupSpell && groupHealCount < aeMinimum) {
|
if (isGroupSpell && groupHealCount < aeMinimum) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_AE_LIMIT_NOT_MET;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!*outMob) {
|
if (!*outMob) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_NOT_NEEDED;
|
||||||
}
|
}
|
||||||
return 1;
|
return ELIXIR_TARGET_CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -607,7 +610,7 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ticks == 0) {
|
if (ticks == 0) {
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
bool isBuffNeeded = true;
|
bool isBuffNeeded = true;
|
||||||
|
|
||||||
@ -627,7 +630,7 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isBuffNeeded) return 0;
|
if (isBuffNeeded) return ELIXIR_OK;
|
||||||
if (!isGroupSpell) return ELIXIR_NOT_NEEDED;
|
if (!isGroupSpell) return ELIXIR_NOT_NEEDED;
|
||||||
|
|
||||||
isBuffNeeded = true;
|
isBuffNeeded = true;
|
||||||
@ -653,7 +656,7 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
}
|
}
|
||||||
if (!isBuffNeeded) continue;
|
if (!isBuffNeeded) continue;
|
||||||
*outMob = grp->members[i];
|
*outMob = grp->members[i];
|
||||||
return 1;
|
return ELIXIR_TARGET_CHANGE;
|
||||||
}
|
}
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_NOT_NEEDED;
|
||||||
|
|
||||||
@ -696,10 +699,10 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
}
|
}
|
||||||
if (isBuffNeeded) {
|
if (isBuffNeeded) {
|
||||||
if (target && target->GetID() == GetID()) {
|
if (target && target->GetID() == GetID()) {
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
*outMob = this;
|
*outMob = this;
|
||||||
return 1;
|
return ELIXIR_TARGET_CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
for (int i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||||
@ -726,10 +729,10 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
}
|
}
|
||||||
if (isBuffNeeded) {
|
if (isBuffNeeded) {
|
||||||
if (target && target->GetID() == grp->members[i]->GetID()) {
|
if (target && target->GetID() == grp->members[i]->GetID()) {
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
*outMob = grp->members[i];
|
*outMob = grp->members[i];
|
||||||
return 1;
|
return ELIXIR_TARGET_CHANGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -747,9 +750,9 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
targetCount++;
|
targetCount++;
|
||||||
}
|
}
|
||||||
if (targetCount < aeMinimum) {
|
if (targetCount < aeMinimum) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_AE_LIMIT_NOT_MET;
|
||||||
}
|
}
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (damageAmount > 0 && (targettype == ST_AEClientV1 || targettype == ST_AreaClientOnly || targettype == ST_AECaster)) { // PB AE DD
|
if (damageAmount > 0 && (targettype == ST_AEClientV1 || targettype == ST_AreaClientOnly || targettype == ST_AECaster)) { // PB AE DD
|
||||||
@ -762,10 +765,10 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
targetCount++;
|
targetCount++;
|
||||||
}
|
}
|
||||||
if (targetCount < aeMinimum) {
|
if (targetCount < aeMinimum) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_AE_LIMIT_NOT_MET;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -786,24 +789,24 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
targetCount++;
|
targetCount++;
|
||||||
}
|
}
|
||||||
if (targetCount < aeMinimum) {
|
if (targetCount < aeMinimum) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_AE_LIMIT_NOT_MET;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (targettype == ST_Target && !isBeneficial) { // single target detrimental spell
|
if ((targettype == ST_Target || targettype == ST_Tap) && !isBeneficial) { // single target detrimental spell
|
||||||
if (target == nullptr) {
|
if (target == nullptr) {
|
||||||
return ELIXIR_NO_TARGET;
|
return ELIXIR_NO_TARGET;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isGroupHated) {
|
if (!isGroupHated) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_NO_HATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target->GetHPRatio() <= 0) {
|
if (target->GetHPRatio() <= 0) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_HP_NOT_LOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsWithinSpellRange(target, spDat.range, spellID)) {
|
if (!IsWithinSpellRange(target, spDat.range, spellID)) {
|
||||||
@ -811,22 +814,22 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (target->IsMezzed()) {
|
if (target->IsMezzed()) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_TARGET_MEZZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsAttackAllowed(target)) {
|
if (!IsAttackAllowed(target)) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_ATTACK_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStun) {
|
if (isStun) {
|
||||||
if (target->IsStunned()) {
|
if (target->IsStunned()) {
|
||||||
return ELIXIR_NOT_NEEDED;
|
return ELIXIR_TARGET_ALREADY_STUNNED;
|
||||||
}
|
}
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ticks == 0) {
|
if (ticks == 0) {
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
buffCount = target->GetMaxTotalSlots();
|
buffCount = target->GetMaxTotalSlots();
|
||||||
for (uint32 i = 0; i < buffCount; i++) {
|
for (uint32 i = 0; i < buffCount; i++) {
|
||||||
@ -842,7 +845,7 @@ int8 Mob::ElixirCastSpellCheck(uint16 spellID, Mob** outMob)
|
|||||||
}
|
}
|
||||||
// TODO: Immune Check
|
// TODO: Immune Check
|
||||||
}
|
}
|
||||||
return 0;
|
return ELIXIR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ELIXIR_UNHANDLED_SPELL;
|
return ELIXIR_UNHANDLED_SPELL;
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
enum ElixirError {
|
enum ElixirError {
|
||||||
|
ELIXIR_TARGET_CHANGE = 1,
|
||||||
|
ELIXIR_OK = 0,
|
||||||
ELIXIR_UNHANDLED_SPELL = -1,
|
ELIXIR_UNHANDLED_SPELL = -1,
|
||||||
ELIXIR_CANNOT_CAST_BAD_STATE = -2,
|
ELIXIR_CANNOT_CAST_BAD_STATE = -2,
|
||||||
ELIXIR_NOT_ENOUGH_MANA = -3,
|
ELIXIR_NOT_ENOUGH_MANA = -3,
|
||||||
@ -18,4 +20,12 @@ enum ElixirError {
|
|||||||
ELIXIR_OUT_OF_RANGE = -17,
|
ELIXIR_OUT_OF_RANGE = -17,
|
||||||
ELIXIR_NO_PET = -18,
|
ELIXIR_NO_PET = -18,
|
||||||
ELIXIR_NOT_NEEDED = -19,
|
ELIXIR_NOT_NEEDED = -19,
|
||||||
};
|
ELIXIR_NOT_BEHIND_MOB = -20,
|
||||||
|
ELIXIR_HP_NOT_LOW = -21,
|
||||||
|
ELIXIR_MANA_NOT_LOW = -22,
|
||||||
|
ELIXIR_AE_LIMIT_NOT_MET = -23,
|
||||||
|
ELIXIR_NO_HATE = -24,
|
||||||
|
ELIXIR_TARGET_MEZZED = -25,
|
||||||
|
ELIXIR_ATTACK_NOT_ALLOWED = -26,
|
||||||
|
ELIXIR_TARGET_ALREADY_STUNNED = -27
|
||||||
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user