mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Bots] Cleanup various Bot Spell Focus methods (#2649)
* [Bots] Cleanup GetFocusEffect & GetActSpellDamage * Remove unused CalcBotFocusEffect * Cleanup unneeded derived class methods * compile error
This commit is contained in:
parent
f188c1394a
commit
f12090d109
967
zone/bot.cpp
967
zone/bot.cpp
File diff suppressed because it is too large
Load Diff
@ -364,7 +364,6 @@ public:
|
|||||||
|
|
||||||
// Mob Spell Virtual Override Methods
|
// Mob Spell Virtual Override Methods
|
||||||
virtual void SpellProcess();
|
virtual void SpellProcess();
|
||||||
virtual int64 GetActSpellDamage(uint16 spell_id, int64 value, Mob* target = nullptr);
|
|
||||||
virtual int64 GetActSpellHealing(uint16 spell_id, int64 value, Mob* target = nullptr);
|
virtual int64 GetActSpellHealing(uint16 spell_id, int64 value, Mob* target = nullptr);
|
||||||
virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime);
|
virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime);
|
||||||
virtual int32 GetActSpellCost(uint16 spell_id, int32 cost);
|
virtual int32 GetActSpellCost(uint16 spell_id, int32 cost);
|
||||||
@ -389,7 +388,7 @@ public:
|
|||||||
void EquipBot(std::string* error_message);
|
void EquipBot(std::string* error_message);
|
||||||
bool CheckLoreConflict(const EQ::ItemData* item);
|
bool CheckLoreConflict(const EQ::ItemData* item);
|
||||||
virtual void UpdateEquipmentLight() { m_Light.Type[EQ::lightsource::LightEquipment] = m_inv.FindBrightestLightType(); m_Light.Level[EQ::lightsource::LightEquipment] = EQ::lightsource::TypeToLevel(m_Light.Type[EQ::lightsource::LightEquipment]); }
|
virtual void UpdateEquipmentLight() { m_Light.Type[EQ::lightsource::LightEquipment] = m_inv.FindBrightestLightType(); m_Light.Level[EQ::lightsource::LightEquipment] = EQ::lightsource::TypeToLevel(m_Light.Type[EQ::lightsource::LightEquipment]); }
|
||||||
inline EQ::InventoryProfile& GetBotInv() { return m_inv; }
|
inline EQ::InventoryProfile& GetInv() { return m_inv; }
|
||||||
|
|
||||||
// Static Class Methods
|
// Static Class Methods
|
||||||
//static void DestroyBotRaidObjects(Client* client); // Can be removed after bot raids are dumped
|
//static void DestroyBotRaidObjects(Client* client); // Can be removed after bot raids are dumped
|
||||||
@ -737,9 +736,6 @@ protected:
|
|||||||
virtual void PetAIProcess();
|
virtual void PetAIProcess();
|
||||||
virtual void BotMeditate(bool isSitting);
|
virtual void BotMeditate(bool isSitting);
|
||||||
virtual bool CheckBotDoubleAttack(bool Triple = false);
|
virtual bool CheckBotDoubleAttack(bool Triple = false);
|
||||||
virtual int32 GetBotFocusEffect(focusType bottype, uint16 spell_id, bool from_buff_tic = false);
|
|
||||||
virtual int32 CalcBotFocusEffect(focusType bottype, uint16 focus_id, uint16 spell_id, bool best_focus=false);
|
|
||||||
virtual int32 CalcBotAAFocus(focusType type, uint32 aa_ID, uint32 points, uint16 spell_id);
|
|
||||||
virtual void PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client* client);
|
virtual void PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client* client);
|
||||||
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
|
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
|
||||||
|
|
||||||
|
|||||||
@ -3727,7 +3727,7 @@ void bot_command_item_use(Client* c, const Seperator* sep)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto equipped_item = bot_iter->GetBotInv()[slot_iter];
|
auto equipped_item = bot_iter->GetInv()[slot_iter];
|
||||||
|
|
||||||
if (equipped_item && !empty_only) {
|
if (equipped_item && !empty_only) {
|
||||||
linker.SetItemInst(equipped_item);
|
linker.SetItemInst(equipped_item);
|
||||||
|
|||||||
@ -947,7 +947,6 @@ public:
|
|||||||
void SendClearPlayerAA();
|
void SendClearPlayerAA();
|
||||||
inline uint32 GetAAXP() const { return m_pp.expAA; }
|
inline uint32 GetAAXP() const { return m_pp.expAA; }
|
||||||
inline uint32 GetAAPercent() const { return m_epp.perAA; }
|
inline uint32 GetAAPercent() const { return m_epp.perAA; }
|
||||||
int64 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id);
|
|
||||||
void SetAATitle(std::string title);
|
void SetAATitle(std::string title);
|
||||||
void SetTitleSuffix(std::string suffix);
|
void SetTitleSuffix(std::string suffix);
|
||||||
void MemorizeSpell(uint32 slot, uint32 spellid, uint32 scribing, uint32 reduction = 0);
|
void MemorizeSpell(uint32 slot, uint32 spellid, uint32 scribing, uint32 reduction = 0);
|
||||||
@ -1683,7 +1682,6 @@ protected:
|
|||||||
void MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message = true);
|
void MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message = true);
|
||||||
bool client_data_loaded;
|
bool client_data_loaded;
|
||||||
|
|
||||||
int64 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false);
|
|
||||||
uint16 GetSympatheticFocusEffect(focusType type, uint16 spell_id);
|
uint16 GetSympatheticFocusEffect(focusType type, uint16 spell_id);
|
||||||
|
|
||||||
void FinishAlternateAdvancementPurchase(AA::Rank *rank, bool ignore_cost);
|
void FinishAlternateAdvancementPurchase(AA::Rank *rank, bool ignore_cost);
|
||||||
|
|||||||
@ -57,7 +57,7 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) {
|
|||||||
value -= (GetLevel() - 40) * 20;
|
value -= (GetLevel() - 40) * 20;
|
||||||
|
|
||||||
//This adds the extra damage from the AA Unholy Touch, 450 per level to the AA Improved Harm TOuch.
|
//This adds the extra damage from the AA Unholy Touch, 450 per level to the AA Improved Harm TOuch.
|
||||||
if (spell_id == SPELL_IMP_HARM_TOUCH && IsClient()) //Improved Harm Touch
|
if (spell_id == SPELL_IMP_HARM_TOUCH && (IsClient() || IsBot())) //Improved Harm Touch
|
||||||
value -= GetAA(aaUnholyTouch) * 450; //Unholy Touch
|
value -= GetAA(aaUnholyTouch) * 450; //Unholy Touch
|
||||||
|
|
||||||
chance = RuleI(Spells, BaseCritChance); //Wizard base critical chance is 2% (Does not scale with level)
|
chance = RuleI(Spells, BaseCritChance); //Wizard base critical chance is 2% (Does not scale with level)
|
||||||
@ -65,12 +65,12 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) {
|
|||||||
chance += itembonuses.FrenziedDevastation + spellbonuses.FrenziedDevastation + aabonuses.FrenziedDevastation;
|
chance += itembonuses.FrenziedDevastation + spellbonuses.FrenziedDevastation + aabonuses.FrenziedDevastation;
|
||||||
|
|
||||||
//Crtical Hit Calculation pathway
|
//Crtical Hit Calculation pathway
|
||||||
if (chance > 0 || (IsClient() && GetClass() == WIZARD && GetLevel() >= RuleI(Spells, WizCritLevel))) {
|
if (chance > 0 || ((IsClient() || IsBot()) && GetClass() == WIZARD && GetLevel() >= RuleI(Spells, WizCritLevel))) {
|
||||||
|
|
||||||
int32 ratio = RuleI(Spells, BaseCritRatio); //Critical modifier is applied from spell effects only. Keep at 100 for live like criticals.
|
int32 ratio = RuleI(Spells, BaseCritRatio); //Critical modifier is applied from spell effects only. Keep at 100 for live like criticals.
|
||||||
|
|
||||||
//Improved Harm Touch is a guaranteed crit if you have at least one level of SCF.
|
//Improved Harm Touch is a guaranteed crit if you have at least one level of SCF.
|
||||||
if (spell_id == SPELL_IMP_HARM_TOUCH && IsClient() && (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0))
|
if (spell_id == SPELL_IMP_HARM_TOUCH && (IsClient() || IsBot()) && (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0))
|
||||||
chance = 100;
|
chance = 100;
|
||||||
|
|
||||||
if (spells[spell_id].override_crit_chance > 0 && chance > spells[spell_id].override_crit_chance)
|
if (spells[spell_id].override_crit_chance > 0 && chance > spells[spell_id].override_crit_chance)
|
||||||
@ -82,7 +82,7 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) {
|
|||||||
ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack;
|
ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ((IsClient() && GetClass() == WIZARD) || (IsMerc() && GetClass() == CASTERDPS)) {
|
else if (((IsClient() || IsBot()) && GetClass() == WIZARD) || (IsMerc() && GetClass() == CASTERDPS)) {
|
||||||
if ((GetLevel() >= RuleI(Spells, WizCritLevel)) && zone->random.Roll(RuleI(Spells, WizCritChance))){
|
if ((GetLevel() >= RuleI(Spells, WizCritLevel)) && zone->random.Roll(RuleI(Spells, WizCritChance))){
|
||||||
//Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio. (20-70 is parse confirmed)
|
//Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio. (20-70 is parse confirmed)
|
||||||
ratio += zone->random.Int(20,70);
|
ratio += zone->random.Int(20,70);
|
||||||
@ -90,7 +90,7 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsClient() && GetClass() == WIZARD)
|
if ((IsClient() || IsBot()) && GetClass() == WIZARD)
|
||||||
ratio += RuleI(Spells, WizCritRatio); //Default is zero
|
ratio += RuleI(Spells, WizCritRatio); //Default is zero
|
||||||
|
|
||||||
if (Critical){
|
if (Critical){
|
||||||
|
|||||||
@ -4213,22 +4213,26 @@ int EQ::InventoryProfile::GetItemStatValue(uint32 item_id, const char* identifie
|
|||||||
// Returns a slot's item ID (returns INVALID_ID if not found)
|
// Returns a slot's item ID (returns INVALID_ID if not found)
|
||||||
int32 Bot::GetItemIDAt(int16 slot_id) {
|
int32 Bot::GetItemIDAt(int16 slot_id) {
|
||||||
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
|
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
if ((((uint64)1 << slot_id) & GetBotInv().GetLookup()->PossessionsBitmask) == 0)
|
if ((((uint64)1 << slot_id) & GetInv().GetLookup()->PossessionsBitmask) == 0) {
|
||||||
return INVALID_ID;
|
return INVALID_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQ::invbag::GENERAL_BAGS_END && slot_id >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
else if (slot_id <= EQ::invbag::GENERAL_BAGS_END && slot_id >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((slot_id - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((slot_id - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
||||||
if ((((uint64)1 << temp_slot) & GetBotInv().GetLookup()->PossessionsBitmask) == 0)
|
if ((((uint64)1 << temp_slot) & GetInv().GetLookup()->PossessionsBitmask) == 0) {
|
||||||
return INVALID_ID;
|
return INVALID_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
|
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
|
||||||
if ((slot_id - EQ::invslot::BANK_BEGIN) >= GetBotInv().GetLookup()->InventoryTypeSize.Bank)
|
if ((slot_id - EQ::invslot::BANK_BEGIN) >= GetInv().GetLookup()->InventoryTypeSize.Bank) {
|
||||||
return INVALID_ID;
|
return INVALID_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQ::invbag::BANK_BAGS_END && slot_id >= EQ::invbag::BANK_BAGS_BEGIN) {
|
else if (slot_id <= EQ::invbag::BANK_BAGS_END && slot_id >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
auto temp_slot = (slot_id - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
|
auto temp_slot = (slot_id - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
|
||||||
if (temp_slot >= GetBotInv().GetLookup()->InventoryTypeSize.Bank)
|
if (temp_slot >= GetInv().GetLookup()->InventoryTypeSize.Bank) {
|
||||||
return INVALID_ID;
|
return INVALID_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQ::ItemInstance* inst = m_inv[slot_id];
|
const EQ::ItemInstance* inst = m_inv[slot_id];
|
||||||
@ -4243,22 +4247,26 @@ int32 Bot::GetItemIDAt(int16 slot_id) {
|
|||||||
// Pass in the slot ID of the item and which augslot you want to check (0-5)
|
// Pass in the slot ID of the item and which augslot you want to check (0-5)
|
||||||
int32 Bot::GetAugmentIDAt(int16 slot_id, uint8 augslot) {
|
int32 Bot::GetAugmentIDAt(int16 slot_id, uint8 augslot) {
|
||||||
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
|
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
if ((((uint64)1 << slot_id) & GetBotInv().GetLookup()->PossessionsBitmask) == 0)
|
if ((((uint64)1 << slot_id) & GetInv().GetLookup()->PossessionsBitmask) == 0) {
|
||||||
return INVALID_ID;
|
return INVALID_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQ::invbag::GENERAL_BAGS_END && slot_id >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
else if (slot_id <= EQ::invbag::GENERAL_BAGS_END && slot_id >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((slot_id - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((slot_id - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
||||||
if ((((uint64)1 << temp_slot) & GetBotInv().GetLookup()->PossessionsBitmask) == 0)
|
if ((((uint64)1 << temp_slot) & GetInv().GetLookup()->PossessionsBitmask) == 0) {
|
||||||
return INVALID_ID;
|
return INVALID_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
|
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
|
||||||
if ((slot_id - EQ::invslot::BANK_BEGIN) >= GetBotInv().GetLookup()->InventoryTypeSize.Bank)
|
if ((slot_id - EQ::invslot::BANK_BEGIN) >= GetInv().GetLookup()->InventoryTypeSize.Bank) {
|
||||||
return INVALID_ID;
|
return INVALID_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQ::invbag::BANK_BAGS_END && slot_id >= EQ::invbag::BANK_BAGS_BEGIN) {
|
else if (slot_id <= EQ::invbag::BANK_BAGS_END && slot_id >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
auto temp_slot = (slot_id - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
|
auto temp_slot = (slot_id - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
|
||||||
if (temp_slot >= GetBotInv().GetLookup()->InventoryTypeSize.Bank)
|
if (temp_slot >= GetInv().GetLookup()->InventoryTypeSize.Bank) {
|
||||||
return INVALID_ID;
|
return INVALID_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQ::ItemInstance* inst = m_inv[slot_id];
|
const EQ::ItemInstance* inst = m_inv[slot_id];
|
||||||
|
|||||||
@ -207,22 +207,22 @@ void Lua_Bot::SetSpellDurationGroup(int spell_id, int duration, bool allow_pets)
|
|||||||
|
|
||||||
int Lua_Bot::CountAugmentEquippedByID(uint32 item_id) {
|
int Lua_Bot::CountAugmentEquippedByID(uint32 item_id) {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetBotInv().CountAugmentEquippedByID(item_id);
|
return self->GetInv().CountAugmentEquippedByID(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lua_Bot::HasAugmentEquippedByID(uint32 item_id) {
|
bool Lua_Bot::HasAugmentEquippedByID(uint32 item_id) {
|
||||||
Lua_Safe_Call_Bool();
|
Lua_Safe_Call_Bool();
|
||||||
return self->GetBotInv().HasAugmentEquippedByID(item_id);
|
return self->GetInv().HasAugmentEquippedByID(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Bot::CountItemEquippedByID(uint32 item_id) {
|
int Lua_Bot::CountItemEquippedByID(uint32 item_id) {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetBotInv().CountItemEquippedByID(item_id);
|
return self->GetInv().CountItemEquippedByID(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lua_Bot::HasItemEquippedByID(uint32 item_id) {
|
bool Lua_Bot::HasItemEquippedByID(uint32 item_id) {
|
||||||
Lua_Safe_Call_Bool();
|
Lua_Safe_Call_Bool();
|
||||||
return self->GetBotInv().HasItemEquippedByID(item_id);
|
return self->GetInv().HasItemEquippedByID(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Bot::Escape() {
|
void Lua_Bot::Escape() {
|
||||||
|
|||||||
@ -1402,6 +1402,7 @@ public:
|
|||||||
int GetAlternateAdvancementCooldownReduction(AA::Rank *rank_in);
|
int GetAlternateAdvancementCooldownReduction(AA::Rank *rank_in);
|
||||||
void ExpendAlternateAdvancementCharge(uint32 aa_id);
|
void ExpendAlternateAdvancementCharge(uint32 aa_id);
|
||||||
void CalcAABonuses(StatBonuses* newbon);
|
void CalcAABonuses(StatBonuses* newbon);
|
||||||
|
int64 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id);
|
||||||
void ApplyAABonuses(const AA::Rank &rank, StatBonuses* newbon);
|
void ApplyAABonuses(const AA::Rank &rank, StatBonuses* newbon);
|
||||||
bool CheckAATimer(int timer);
|
bool CheckAATimer(int timer);
|
||||||
|
|
||||||
@ -1592,7 +1593,8 @@ protected:
|
|||||||
virtual
|
virtual
|
||||||
#endif
|
#endif
|
||||||
int GetBaseSkillDamage(EQ::skills::SkillType skill, Mob *target = nullptr);
|
int GetBaseSkillDamage(EQ::skills::SkillType skill, Mob *target = nullptr);
|
||||||
virtual int64 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false) { return 0; }
|
int64 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false);
|
||||||
|
virtual const EQ::InventoryProfile& GetInv() { return EQ::InventoryProfile(); }
|
||||||
void CalculateNewFearpoint();
|
void CalculateNewFearpoint();
|
||||||
float FindGroundZ(float new_x, float new_y, float z_offset=0.0);
|
float FindGroundZ(float new_x, float new_y, float z_offset=0.0);
|
||||||
float FindDestGroundZ(glm::vec3 dest, float z_offset=0.0);
|
float FindDestGroundZ(glm::vec3 dest, float z_offset=0.0);
|
||||||
|
|||||||
@ -285,8 +285,6 @@ public:
|
|||||||
content_db.GetFactionIdsForNPC(npc_faction_id, &faction_list, &primary_faction);
|
content_db.GetFactionIdsForNPC(npc_faction_id, &faction_list, &primary_faction);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64 GetFocusEffect(focusType type, uint16 spell_id, Mob* caster = nullptr);
|
|
||||||
|
|
||||||
glm::vec4 m_SpawnPoint;
|
glm::vec4 m_SpawnPoint;
|
||||||
|
|
||||||
uint32 GetMaxDMG() const {return max_dmg;}
|
uint32 GetMaxDMG() const {return max_dmg;}
|
||||||
@ -585,7 +583,7 @@ protected:
|
|||||||
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates = false);
|
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates = false);
|
||||||
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
|
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
|
||||||
AISpellsVar_Struct AISpellVar;
|
AISpellsVar_Struct AISpellVar;
|
||||||
int64 GetFocusEffect(focusType type, uint16 spell_id, Mob* caster, bool from_buff_tic = false);
|
int64 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false);
|
||||||
uint16 innate_proc_spell_id;
|
uint16 innate_proc_spell_id;
|
||||||
|
|
||||||
uint32 npc_spells_effects_id;
|
uint32 npc_spells_effects_id;
|
||||||
|
|||||||
@ -103,7 +103,7 @@ void Perl_Bot_RemoveBotItem(Bot* self, uint32 item_id)
|
|||||||
|
|
||||||
EQ::ItemInstance* Perl_Bot_GetAugmentAt(Bot* self, uint32 slot, uint32 aug_slot)
|
EQ::ItemInstance* Perl_Bot_GetAugmentAt(Bot* self, uint32 slot, uint32 aug_slot)
|
||||||
{
|
{
|
||||||
EQ::ItemInstance* inst = self->GetBotInv().GetItem(slot);
|
EQ::ItemInstance* inst = self->GetInv().GetItem(slot);
|
||||||
if (inst)
|
if (inst)
|
||||||
{
|
{
|
||||||
return inst->GetAugment(aug_slot);
|
return inst->GetAugment(aug_slot);
|
||||||
@ -113,22 +113,22 @@ EQ::ItemInstance* Perl_Bot_GetAugmentAt(Bot* self, uint32 slot, uint32 aug_slot)
|
|||||||
|
|
||||||
int Perl_Bot_CountAugmentEquippedByID(Bot* self, uint32 item_id)
|
int Perl_Bot_CountAugmentEquippedByID(Bot* self, uint32 item_id)
|
||||||
{
|
{
|
||||||
return self->GetBotInv().CountAugmentEquippedByID(item_id);
|
return self->GetInv().CountAugmentEquippedByID(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Perl_Bot_HasAugmentEquippedByID(Bot* self, uint32 item_id)
|
bool Perl_Bot_HasAugmentEquippedByID(Bot* self, uint32 item_id)
|
||||||
{
|
{
|
||||||
return self->GetBotInv().HasAugmentEquippedByID(item_id);
|
return self->GetInv().HasAugmentEquippedByID(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Bot_CountItemEquippedByID(Bot* self, uint32 item_id)
|
int Perl_Bot_CountItemEquippedByID(Bot* self, uint32 item_id)
|
||||||
{
|
{
|
||||||
return self->GetBotInv().CountItemEquippedByID(item_id);
|
return self->GetInv().CountItemEquippedByID(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Perl_Bot_HasItemEquippedByID(Bot* self, uint32 item_id)
|
bool Perl_Bot_HasItemEquippedByID(Bot* self, uint32 item_id)
|
||||||
{
|
{
|
||||||
return self->GetBotInv().HasItemEquippedByID(item_id);
|
return self->GetInv().HasItemEquippedByID(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl_Bot_GetRawItemAC(Bot* self) // @categories Inventory and Items
|
int Perl_Bot_GetRawItemAC(Bot* self) // @categories Inventory and Items
|
||||||
@ -288,7 +288,7 @@ int Perl_Bot_GetInstrumentMod(Bot* self, uint16 spell_id) // @categories Spells
|
|||||||
|
|
||||||
EQ::ItemInstance* Perl_Bot_GetItemAt(Bot* self, uint32 slot) // @categories Inventory and Items
|
EQ::ItemInstance* Perl_Bot_GetItemAt(Bot* self, uint32 slot) // @categories Inventory and Items
|
||||||
{
|
{
|
||||||
return self->GetBotInv().GetItem(slot);
|
return self->GetInv().GetItem(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Perl_Bot_IsGrouped(Bot* self) // @categories Account and Character, Group
|
bool Perl_Bot_IsGrouped(Bot* self) // @categories Account and Character, Group
|
||||||
|
|||||||
@ -200,7 +200,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
|
|||||||
}
|
}
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
else if (IsBot())
|
else if (IsBot())
|
||||||
act_power = CastToBot()->GetBotFocusEffect(focusPetPower, spell_id);
|
act_power = CastToBot()->GetFocusEffect(focusPetPower, spell_id);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (petpower > 0)
|
else if (petpower > 0)
|
||||||
|
|||||||
@ -4564,7 +4564,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
|
|||||||
CalcBonuses();
|
CalcBonuses();
|
||||||
}
|
}
|
||||||
|
|
||||||
int64 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id)
|
int64 Mob::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id)
|
||||||
{
|
{
|
||||||
const SPDat_Spell_Struct &spell = spells[spell_id];
|
const SPDat_Spell_Struct &spell = spells[spell_id];
|
||||||
|
|
||||||
@ -6348,7 +6348,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64 Client::GetFocusEffect(focusType type, uint16 spell_id, Mob *caster, bool from_buff_tic)
|
int64 Mob::GetFocusEffect(focusType type, uint16 spell_id, Mob *caster, bool from_buff_tic)
|
||||||
{
|
{
|
||||||
if (IsBardSong(spell_id) && type != focusFcBaseEffects && type != focusSpellDuration && type != focusReduceRecastTime) {
|
if (IsBardSong(spell_id) && type != focusFcBaseEffects && type != focusSpellDuration && type != focusReduceRecastTime) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -6448,38 +6448,40 @@ int64 Client::GetFocusEffect(focusType type, uint16 spell_id, Mob *caster, bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Tribute Focus
|
if (IsClient()) {
|
||||||
for (int x = EQ::invslot::TRIBUTE_BEGIN; x <= EQ::invslot::TRIBUTE_END; ++x)
|
//Tribute Focus
|
||||||
{
|
for (int x = EQ::invslot::TRIBUTE_BEGIN; x <= EQ::invslot::TRIBUTE_END; ++x)
|
||||||
TempItem = nullptr;
|
{
|
||||||
EQ::ItemInstance* ins = GetInv().GetItem(x);
|
TempItem = nullptr;
|
||||||
if (!ins)
|
EQ::ItemInstance* ins = GetInv().GetItem(x);
|
||||||
continue;
|
if (!ins)
|
||||||
TempItem = ins->GetItem();
|
continue;
|
||||||
if (TempItem && TempItem->Focus.Effect > 0 && TempItem->Focus.Effect != SPELL_UNKNOWN) {
|
TempItem = ins->GetItem();
|
||||||
if(rand_effectiveness) {
|
if (TempItem && TempItem->Focus.Effect > 0 && TempItem->Focus.Effect != SPELL_UNKNOWN) {
|
||||||
focus_max = CalcFocusEffect(type, TempItem->Focus.Effect, spell_id, true);
|
if(rand_effectiveness) {
|
||||||
if (focus_max > 0 && focus_max_real >= 0 && focus_max > focus_max_real) {
|
focus_max = CalcFocusEffect(type, TempItem->Focus.Effect, spell_id, true);
|
||||||
focus_max_real = focus_max;
|
if (focus_max > 0 && focus_max_real >= 0 && focus_max > focus_max_real) {
|
||||||
UsedItem = TempItem;
|
focus_max_real = focus_max;
|
||||||
UsedFocusID = TempItem->Focus.Effect;
|
UsedItem = TempItem;
|
||||||
} else if (focus_max < 0 && focus_max < focus_max_real) {
|
UsedFocusID = TempItem->Focus.Effect;
|
||||||
focus_max_real = focus_max;
|
} else if (focus_max < 0 && focus_max < focus_max_real) {
|
||||||
UsedItem = TempItem;
|
focus_max_real = focus_max;
|
||||||
UsedFocusID = TempItem->Focus.Effect;
|
UsedItem = TempItem;
|
||||||
|
UsedFocusID = TempItem->Focus.Effect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
else {
|
Total = CalcFocusEffect(type, TempItem->Focus.Effect, spell_id);
|
||||||
Total = CalcFocusEffect(type, TempItem->Focus.Effect, spell_id);
|
if (Total > 0 && realTotal >= 0 && Total > realTotal) {
|
||||||
if (Total > 0 && realTotal >= 0 && Total > realTotal) {
|
realTotal = Total;
|
||||||
realTotal = Total;
|
UsedItem = TempItem;
|
||||||
UsedItem = TempItem;
|
UsedFocusID = TempItem->Focus.Effect;
|
||||||
UsedFocusID = TempItem->Focus.Effect;
|
}
|
||||||
}
|
else if (Total < 0 && Total < realTotal) {
|
||||||
else if (Total < 0 && Total < realTotal) {
|
realTotal = Total;
|
||||||
realTotal = Total;
|
UsedItem = TempItem;
|
||||||
UsedItem = TempItem;
|
UsedFocusID = TempItem->Focus.Effect;
|
||||||
UsedFocusID = TempItem->Focus.Effect;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user