EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Database/World Building (https://www.eqemulator.org/forums/forumdisplay.php?f=596)
-   -   Tunare's Renewal: (https://www.eqemulator.org/forums/showthread.php?t=26279)

So_1337 09-23-2008 11:01 AM

Tunare's Renewal:
 
Couldn't find anything through search on this though I could swear I've posted this same problem before. Sorry if this is a repost.

I've spent the better part of the morning trying to find why this spell and the shaman equivalent both only heal a character to 75%. For those not familiar, here's a link and a quick explanation:

This spell heals for 2,925 HP, or 75% of the target's maximum health, whichever is less.

Examples:
  • If cast on a character with 5,000 maximum hitpoints, it heals for 2925.
  • If cast on a lowbie character with 200 maximum hitpoints, it heals for 150.
Currently, the spell is functioning in a way that makes it heal a person to 75% health and not past. A 5k warrior, no matter where their health is, gets healed to 3,750 hitpoints (75% of his total).

The spell was originally released on September 26th 2002, just before Planes of Power's release. The Titanium client is far past that, so I don't believe that it's an issue with the spell files. I believe there's actually a code problem at work here. Has someone already figured this out?

Thanks for any help.

So_1337 09-23-2008 11:22 AM

Wow, I must've misclicked the proper forum. Could a mod move this to Bug Reports, please? Appreciated.

Derision 09-23-2008 12:35 PM

In zone/spell_effects.cpp, around line 180:

Try changing:

Code:

                        case SE_PercentalHeal:
                        {
#ifdef SPELL_EFFECT_SPAM
                                snprintf(effect_desc, _EDLEN, "Percental Heal: %+i (%d%% max)", spell.max[i], effect_value);
#endif
                                //im not 100% sure about this implementation.
                                //the spell value forumula dosent work for these... at least spell 3232 anyways
                                sint32 val = spell.max[i];

                                if(caster)
                                        val = caster->GetActSpellHealing(spell_id, val);

                                sint32 mhp = GetMaxHP();
                                sint32 chp = GetHP();
                                sint32 cap = mhp * spell.base[i] / 100;
                                if((chp + val) > cap)
                                        val = cap - chp;
                                if(val > 0)
                                        HealDamage(val, caster);
                                break;
                        }

To:

Code:

                        case SE_PercentalHeal:
                        {
#ifdef SPELL_EFFECT_SPAM
                                snprintf(effect_desc, _EDLEN, "Percental Heal: %+i (%d%% max)", spell.max[i], effect_value);
#endif
                                //im not 100% sure about this implementation.
                                //the spell value forumula dosent work for these... at least spell 3232 anyways
                                sint32 val = spell.max[i];

                                if(caster)
                                        val = caster->GetActSpellHealing(spell_id, val);

                                sint32 mhp = GetMaxHP();
                                sint32 cap = mhp * spell.base[i] / 100;

                                if(cap < val)
                                        val = cap;

                                if(val > 0)
                                        HealDamage(val, caster);

                                break;
                        }

I did a quick test on it, but spell mechanics is not really my area, so you should run some tests on on various spells with % Heal effects to check if this doesn't have any unintended consequences :)

So_1337 09-26-2008 05:05 PM

Thank you very much for the code. However, I've no way to test this. Anyone else running a server with unhappy druids feel like giving this a compile and checking it out?

cavedude 09-26-2008 05:28 PM

I'll add it to my list to get into PEQ.


All times are GMT -4. The time now is 12:58 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.