Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Change Mana Costs to use Signed Int #2384

Merged
merged 1 commit into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/spdat.h
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ struct SPDat_Spell_Struct
/* 016 */ uint32 buff_duration_formula; // -- DURATIONBASE
/* 017 */ uint32 buff_duration; // -- DURATIONCAP
/* 018 */ uint32 aoe_duration; // sentinel, rain of something -- IMPACTDURATION
/* 019 */ uint16 mana; // Mana Used -- MANACOST
Kinglykrab marked this conversation as resolved.
Show resolved Hide resolved
/* 019 */ int32 mana; // Mana Used -- MANACOST
/* 020 */ int base_value[EFFECT_COUNT]; //various purposes -- BASEAFFECT1 .. BASEAFFECT12
/* 032 */ int limit_value[EFFECT_COUNT]; //various purposes -- BASE_EFFECT2_1 ... BASE_EFFECT2_12
/* 044 */ int32 max_value[EFFECT_COUNT]; // -- AFFECT1CAP ... AFFECT12CAP
Expand Down
2 changes: 1 addition & 1 deletion zone/effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost)
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
if(itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
{
int16 mana_back = itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
int mana_back = itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
// Doesnt generate mana, so best case is a free spell
if(mana_back > cost)
mana_back = cost;
Expand Down
2 changes: 1 addition & 1 deletion zone/merc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2713,7 +2713,7 @@ int32 Merc::GetActSpellCost(uint16 spell_id, int32 cost)
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
if(itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
{
int16 mana_back = itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
int mana_back = itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
// Doesnt generate mana, so best case is a free spell
if(mana_back > cost)
mana_back = cost;
Expand Down
2 changes: 1 addition & 1 deletion zone/mob.h
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ class Mob : public Entity {
bool delaytimer;
uint16 casting_spell_targetid;
EQ::spells::CastingSlot casting_spell_slot;
uint16 casting_spell_mana;
int32 casting_spell_mana;
uint32 casting_spell_inventory_slot;
uint32 casting_spell_timer;
uint32 casting_spell_timer_duration;
Expand Down
8 changes: 4 additions & 4 deletions zone/perl_mob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,12 +930,12 @@ void Perl_Mob_SpellFinished(Mob* self, uint16 spell_id, Mob* target) // @categor
self->SpellFinished(spell_id, target, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty);
}

void Perl_Mob_SpellFinished(Mob* self, uint16 spell_id, Mob* target, uint16 mana_cost) // @categories Spells and Disciplines
void Perl_Mob_SpellFinished(Mob* self, uint16 spell_id, Mob* target, int32 mana_cost) // @categories Spells and Disciplines
{
self->SpellFinished(spell_id, target, EQ::spells::CastingSlot::Item, mana_cost, -1, spells[spell_id].resist_difficulty);
}

void Perl_Mob_SpellFinished(Mob* self, uint16 spell_id, Mob* target, uint16 mana_cost, uint16 resist_diff) // @categories Spells and Disciplines
void Perl_Mob_SpellFinished(Mob* self, uint16 spell_id, Mob* target, int32 mana_cost, uint16 resist_diff) // @categories Spells and Disciplines
{
self->SpellFinished(spell_id, target, EQ::spells::CastingSlot::Item, mana_cost, -1, resist_diff);
}
Expand Down Expand Up @@ -2933,8 +2933,8 @@ void perl_register_mob()
package.add("SpellEffect", (void(*)(Mob*, uint32, uint32, uint32, bool, uint32, bool, perl::nullable<Client*>, uint32, uint32))&Perl_Mob_SpellEffect);
package.add("SpellFinished", (void(*)(Mob*, uint16))&Perl_Mob_SpellFinished);
package.add("SpellFinished", (void(*)(Mob*, uint16, Mob*))&Perl_Mob_SpellFinished);
package.add("SpellFinished", (void(*)(Mob*, uint16, Mob*, uint16))&Perl_Mob_SpellFinished);
package.add("SpellFinished", (void(*)(Mob*, uint16, Mob*, uint16, uint16))&Perl_Mob_SpellFinished);
package.add("SpellFinished", (void(*)(Mob*, uint16, Mob*, int32))&Perl_Mob_SpellFinished);
package.add("SpellFinished", (void(*)(Mob*, uint16, Mob*, int32, uint16))&Perl_Mob_SpellFinished);
package.add("Spin", &Perl_Mob_Spin);
package.add("StartEnrage", &Perl_Mob_StartEnrage);
package.add("StopNavigation", &Perl_Mob_StopNavigation);
Expand Down
8 changes: 4 additions & 4 deletions zone/perl_npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,12 @@ float Perl_NPC_GetNPCStat(NPC* self, const char* identifier) // @categories Stat
return self->GetNPCStat(identifier);
}

void Perl_NPC_AddSpellToNPCList(NPC* self, int16 priority, uint16_t spell_id, uint32 type, int16 mana_cost, int recast_delay, int16 resist_adjust) // @categories Spells and Disciplines, Script Utility
void Perl_NPC_AddSpellToNPCList(NPC* self, int16 priority, uint16_t spell_id, uint32 type, int mana_cost, int recast_delay, int16 resist_adjust) // @categories Spells and Disciplines, Script Utility
{
self->AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust, 0, 0);
}

void Perl_NPC_AddSpellToNPCList(NPC* self, int16 priority, uint16_t spell_id, uint32 type, int16 mana_cost, int recast_delay, int16 resist_adjust, int8 min_hp, int8 max_hp) // @categories Spells and Disciplines, Script Utility
void Perl_NPC_AddSpellToNPCList(NPC* self, int16 priority, uint16_t spell_id, uint32 type, int mana_cost, int recast_delay, int16 resist_adjust, int8 min_hp, int8 max_hp) // @categories Spells and Disciplines, Script Utility
{
self->AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust, min_hp, max_hp);
}
Expand Down Expand Up @@ -674,8 +674,8 @@ void perl_register_npc()
package.add("AI_SetRoambox", (void(*)(NPC*, float, float, float, float, float))&Perl_NPC_AI_SetRoambox);
package.add("AI_SetRoambox", (void(*)(NPC*, float, float, float, float, float, uint32))&Perl_NPC_AI_SetRoambox);
package.add("AI_SetRoambox", (void(*)(NPC*, float, float, float, float, float, uint32, uint32))&Perl_NPC_AI_SetRoambox);
package.add("AddAISpell", (void(*)(NPC*, int16, uint16, uint32, int16, int, int16))&Perl_NPC_AddSpellToNPCList);
package.add("AddAISpell", (void(*)(NPC*, int16, uint16, uint32, int16, int, int16, int8, int8))&Perl_NPC_AddSpellToNPCList);
package.add("AddAISpell", (void(*)(NPC*, int16, uint16, uint32, int, int, int16))&Perl_NPC_AddSpellToNPCList);
package.add("AddAISpell", (void(*)(NPC*, int16, uint16, uint32, int, int, int16, int8, int8))&Perl_NPC_AddSpellToNPCList);
package.add("AddAISpellEffect", &Perl_NPC_AddAISpellEffect);
package.add("AddCash", &Perl_NPC_AddCash);
package.add("AddDefensiveProc", &Perl_NPC_AddDefensiveProc);
Expand Down