Skip to content

Commit

Permalink
[Feature] Change mana_used to int32 (#2321)
Browse files Browse the repository at this point in the history
* Changed mana_used to use int32,
to match int32 mana_cost
This will allow higher mana costs to function

* Corrected DoHPToManaCovert to Int32

* Removed unused uint16 GetMana function call from Server/zone/questmgr.h

* Change GetSkillDmgAmt from Int16 to Int32 (SkillDamageAmount2 which uses function is Int32)

* Delete mob.cpp

* Revert "Delete mob.cpp"

This reverts commit 3db8bf0.

* Revert "Change GetSkillDmgAmt from Int16 to Int32 (SkillDamageAmount2 which uses function is Int32)"

This reverts commit cf5dbc9.

Co-authored-by: dmcintosh-BCT <dan@blackcreektechnologies.com>
  • Loading branch information
2 people authored and mackal committed Sep 3, 2022
1 parent 1a19663 commit db5f702
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions zone/mob.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ class Mob : public Entity {
int32 mana_cost = -1, uint32* oSpellWillFinish = 0, uint32 item_slot = 0xFFFFFFFF,
uint32 timer = 0xFFFFFFFF, uint32 timer_duration = 0, int16 resist_adjust = 0,
uint32 aa_id = 0);
void CastedSpellFinished(uint16 spell_id, uint32 target_id, EQ::spells::CastingSlot slot, uint16 mana_used,
void CastedSpellFinished(uint16 spell_id, uint32 target_id, EQ::spells::CastingSlot slot, int mana_used,
uint32 inventory_slot = 0xFFFFFFFF, int16 resist_adjust = 0);
bool SpellFinished(uint16 spell_id, Mob *target, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, uint16 mana_used = 0,
bool SpellFinished(uint16 spell_id, Mob *target, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int mana_used = 0,
uint32 inventory_slot = 0xFFFFFFFF, int16 resist_adjust = 0, bool isproc = false, int level_override = -1, uint32 timer = 0xFFFFFFFF, uint32 timer_duration = 0, bool from_casted_spell = false, uint32 aa_id = 0);
void SendBeginCast(uint16 spell_id, uint32 casttime);
virtual bool SpellOnTarget(uint16 spell_id, Mob* spelltar, int reflect_effectiveness = 0,
Expand Down Expand Up @@ -886,7 +886,7 @@ class Mob : public Entity {
int16 GetSkillDmgAmt(uint16 skill);
int16 GetPositionalDmgAmt(Mob* defender);
inline bool CanBlockSpell() const { return(spellbonuses.FocusEffects[focusBlockNextSpell]); }
bool DoHPToManaCovert(uint16 mana_cost = 0);
bool DoHPToManaCovert(int32 mana_cost = 0);
int8 GetDecayEffectValue(uint16 spell_id, uint16 spelleffect);
int64 GetExtraSpellAmt(uint16 spell_id, int64 extra_spell_amt, int64 base_spell_dmg);
void MeleeLifeTap(int64 damage);
Expand Down
1 change: 0 additions & 1 deletion zone/questmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ class QuestManager {
bool createBot(const char *name, const char *lastname, uint8 level, uint16 race, uint8 botclass, uint8 gender);
#endif

inline uint16 GetMana(uint32 spell_id) { return( spells[spell_id].mana); }

private:
std::stack<running_quest> quests_running_;
Expand Down
2 changes: 1 addition & 1 deletion zone/spell_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7077,7 +7077,7 @@ uint16 Mob::GetSympatheticSpellProcID(uint16 spell_id)
return 0;
}

bool Mob::DoHPToManaCovert(uint16 mana_cost)
bool Mob::DoHPToManaCovert(int32 mana_cost)
{
if (spellbonuses.HPToManaConvert){
int64 hp_cost = spellbonuses.HPToManaConvert * mana_cost / 100;
Expand Down
4 changes: 2 additions & 2 deletions zone/spells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ void Mob::StopCastSpell(int32 spell_id, bool send_spellbar_enable)
// just check timed spell specific things before passing off to SpellFinished
// which figures out proper targets etc
void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slot,
uint16 mana_used, uint32 inventory_slot, int16 resist_adjust)
int32 mana_used, uint32 inventory_slot, int16 resist_adjust)
{
if (!IsValidSpell(spell_id))
{
Expand Down Expand Up @@ -2260,7 +2260,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
// only used from CastedSpellFinished, and procs
// we can't interrupt in this, or anything called from this!
// if you need to abort the casting, return false
bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, uint16 mana_used,
bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, int32 mana_used,
uint32 inventory_slot, int16 resist_adjust, bool isproc, int level_override,
uint32 timer, uint32 timer_duration, bool from_casted_spell, uint32 aa_id)
{
Expand Down

0 comments on commit db5f702

Please sign in to comment.