Jump to content
Sign in to follow this  
cyberpro98

Druid Bug Form - Dire Bear Form

Recommended Posts

I am using Oregon/Mangos Core  but when i use Druid Dire Bear form i am getting hp reseted to 1% 
and i don't have any idea how to fix it ? 
Maybe some script if anyone knows ? 
Thanks!

Share this post


Link to post
Share on other sites
On 11/2/2016 at 7:34 PM, cyberpro98 said:

-> image.png

This has already been fixed in the mangos zero core and you can apply the same fix to yours. See this highlighted code:

https://github.com/blizzlikegroup/blizzlikecore/blob/1ccf83bc084e23be0883ded9f2d8d42f8c8c633c/src/game/SpellAuras.cpp#L4996-L5036

You can replace this block with:

void Aura::HandleAuraModIncreaseHealth(bool apply, bool Real)
{
    Unit* target = GetTarget();

    switch (GetId())
    {
        // Special case with temporary increase max/current health
            // Cases where we need to manually calculate the amount for the spell (by percentage)
            // recalculate to full amount at apply for proper remove
        // Backport notive TBC: no cases yet
            // no break here

            // Cases where m_amount already has the correct value (spells cast with CastCustomSpell or absolute values)
        case 1178:                                          // Bear Form (Passive)
        case 9635:                                          // Dire Bear Form (Passive)
        {
            if(Real)
            {
                float pct = target->GetHealthPercent();
                target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply);
                target->SetHealthPercent(pct);
            }
            return;
        }
        case 12976:                                         // Warrior Last Stand triggered spell (Cast with percentage-value by CastCustomSpell)
        case 28726:                                         // Nightmare Seed
        case 34511:                                         // Valor (Bulwark of Kings, Bulwark of the Ancient Kings)
        case 44055:                                         // Tremendous Fortitude (Battlemaster's Alacrity)
        {
            if (Real)
            {
                if (apply)
                {
                    target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply);
                    target->ModifyHealth(m_modifier.m_amount);
                }
                else
                {
                    if (int32(target->GetHealth()) > m_modifier.m_amount)
                        target->ModifyHealth(-m_modifier.m_amount);
                    else
                        target->SetHealth(1);
                    target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply);
                }
            }
            return;
        }
        // generic case
        default:
            target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply);
    }
}

Let me know if it works ;)

Share this post


Link to post
Share on other sites

I changed the only thing  in this cript is -> 

 float pct = target->GetHealth();  //HERE WAS          " GetHealthPercentage();
                target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply);
                target->SetHealth(pct);    // HERE WAS " SetHealthPercent(pct); " 

Share this post


Link to post
Share on other sites

So madness, this isn't working.

i FOUND IN SPELLAURAS.CPP this code -> 

Quote

// Heart of the Wild --> Changed 02/11/2016 DRUID FIX BUG SPELL
            if (HotWSpellId)
            {
                Unit::AuraList const& mModTotalStatPct = m_target->GetAurasByType(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE);
                for (Unit::AuraList::const_iterator i = mModTotalStatPct.begin(); i != mModTotalStatPct.end(); ++i)
                {
                    if ((*i)->GetSpellProto()->SpellIconID == 240 && (*i)->GetModifier()->m_miscvalue == 4) // ORIGINALLY 3 BUT CHANGED TO 4
                    {
                        int32 HotWMod = (*i)->GetModifier()->m_amount;
                        if (GetModifier()->m_miscvalue == FORM_CAT)
                            HotWMod /= 3;   //ORIGNILLAY 2 but changed to 3

So    i changed  if ((*i)->GetSpellProto()->SpellIconID == 240 && (*i)->GetModifier()->m_miscvalue == 5) // ORIGINALLY 3 BUT CHANGED TO 5

AND I CHANGED ->  HotWMod /= 5;   //ORIGNILLAY 2 but changed to 5 

and when i used dudu druid bear form it didn't reseted hp but even the effect of spell didn't take a effect ( like  if i use that bear form it doesn't give me more hp as usual ) 

and intellect ... blabla  

 

????? What to do ? 

Share this post


Link to post
Share on other sites

if i use originally thing or  this one -> 

 

" if ((*i)->GetSpellProto()->SpellIconID == 240 && (*i)->GetModifier()->m_miscvalue == 5) // ORIGINALLY 3 BUT CHANGED TO 5

AND I CHANGED ->  HotWMod /= 5;   //ORIGNILLAY 2 but changed to 5 

 " 

the druid bear form hp is ok but intellect isn't anymore how it was it decrases fro 20% and 

the cat form low dmg, and duudu too ...  ( it increases his armor but not hp ) ... 

 

Share this post


Link to post
Share on other sites

I'm not really sure what the code is you posted. The code I posted should work, maybe your not implementing it properly? Can you paste the file your code with my changes?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...