mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Udpated SE_ReclaimPet - Correct forumla for mana returned to properly return 75% of actual pet spell mana cost.
Implemented SE_ImprovedReclaimEnergy - Modifies % mana returned from SE_ReclaimPet. Required SQL update.
This commit is contained in:
@@ -1270,6 +1270,15 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon)
|
||||
newbon->Metabolism += base1;
|
||||
break;
|
||||
|
||||
case SE_ImprovedReclaimEnergy:
|
||||
{
|
||||
if((base1 < 0) && (newbon->ImprovedReclaimEnergy > base1))
|
||||
newbon->ImprovedReclaimEnergy = base1;
|
||||
|
||||
else if(newbon->ImprovedReclaimEnergy < base1)
|
||||
newbon->ImprovedReclaimEnergy = base1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2741,6 +2750,16 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
|
||||
newbon->Metabolism += effect_value;
|
||||
break;
|
||||
|
||||
case SE_ImprovedReclaimEnergy:
|
||||
{
|
||||
if((effect_value < 0) && (newbon->ImprovedReclaimEnergy > effect_value))
|
||||
newbon->ImprovedReclaimEnergy = effect_value;
|
||||
|
||||
else if(newbon->ImprovedReclaimEnergy < effect_value)
|
||||
newbon->ImprovedReclaimEnergy = effect_value;
|
||||
break;
|
||||
}
|
||||
|
||||
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
|
||||
if (IsAISpellEffect) {
|
||||
|
||||
|
||||
@@ -1177,7 +1177,7 @@ uint32 Client::CalcCurrentWeight() {
|
||||
Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;
|
||||
}
|
||||
|
||||
float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat;
|
||||
float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat;
|
||||
if (Packrat > 0)
|
||||
Total = (uint32)((float)Total * (1.0f - ((Packrat * 1.0f) / 100.0f))); //AndMetal: 1% per level, up to 5% (calculated from Titanium client). verified thru client that it reduces coin weight by the same %
|
||||
//without casting to float & back to uint32, this didn't work right
|
||||
|
||||
@@ -422,6 +422,7 @@ struct StatBonuses {
|
||||
int8 StunBashChance; // chance to stun with bash.
|
||||
int8 IncreaseChanceMemwipe; // increases chance to memory wipe
|
||||
int8 CriticalMend; // chance critical monk mend
|
||||
int16 ImprovedReclaimEnergy; // Modifies amount of mana returned from reclaim energy
|
||||
};
|
||||
|
||||
typedef struct
|
||||
|
||||
+14
-7
@@ -1551,15 +1551,22 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
||||
GetPetType() != petCharmed
|
||||
)
|
||||
{
|
||||
int lvlmod = 4;
|
||||
if(caster->IsClient() && caster->CastToClient()->GetAA(aaImprovedReclaimEnergy))
|
||||
lvlmod = 8; //this is an unconfirmed number, I made it up
|
||||
if(caster->IsClient() && caster->CastToClient()->GetAA(aaImprovedReclaimEnergy2))
|
||||
lvlmod = 8; //this is an unconfirmed number, I made it up
|
||||
caster->SetMana(caster->GetMana()+(GetLevel()*lvlmod));
|
||||
uint16 pet_spellid = CastToNPC()->GetPetSpellID();
|
||||
uint16 pet_ActSpellCost = caster->GetActSpellCost(pet_spellid, spells[pet_spellid].mana);
|
||||
int16 ImprovedReclaimMod = caster->spellbonuses.ImprovedReclaimEnergy +
|
||||
caster->itembonuses.ImprovedReclaimEnergy +
|
||||
caster->aabonuses.ImprovedReclaimEnergy;
|
||||
|
||||
if (!ImprovedReclaimMod)
|
||||
ImprovedReclaimMod = 75; //Reclaim Energy default is 75% of actual mana cost
|
||||
|
||||
pet_ActSpellCost = pet_ActSpellCost*ImprovedReclaimMod/100;
|
||||
|
||||
caster->SetMana(caster->GetMana() + pet_ActSpellCost);
|
||||
|
||||
if(caster->IsClient())
|
||||
caster->CastToClient()->SetPet(0);
|
||||
|
||||
SetOwnerID(0); // this will kill the pet
|
||||
}
|
||||
break;
|
||||
@@ -5804,7 +5811,7 @@ bool Mob::TryDispel(uint8 caster_level, uint8 buff_level, int level_modifier){
|
||||
|
||||
/*This should provide a somewhat accurate conversion between pre 5/14 base values and post.
|
||||
until more information is avialble - Kayen*/
|
||||
if (level_modifier > 100)
|
||||
if (level_modifier >= 100)
|
||||
level_modifier = level_modifier/100;
|
||||
|
||||
//Dispels - Check level of caster agianst buffs level (level of the caster who cast the buff)
|
||||
|
||||
Reference in New Issue
Block a user