Jump to content

[patch 303][7160] Profession Ability fix


Auntie Mangos

Recommended Posts

What bug does the patch fix? What features does the patch add?

Related to : http://getmangos.eu/community/viewtopic.php?id=5205

"When you learn a profession you get all ranks of it's profession spell(For example Toughness)"

About Thougness cumulative ranks effect :

Bug related to stacking ranks for this spell fixed in generic way for all passive auras in [6992]

@bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)

Need to activated new spells if player gets 75 or 150 or 225 or 300 or 375 skill's points

Note : this code support SkillGain.Gathering default value changes in mangosd.conf

@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 value )

learn spell if player has enought skill's points

For which repository revision was the patch created?

6995

Who has been writing this patch? Please include either forum user names or email addresses.

Index: src/game/Player.cpp
===================================================================
--- src/game/Player.cpp    (revision 205)
+++ src/game/Player.cpp    (working copy)
@@ -4789,6 +4789,15 @@
            new_value = MaxValue;

        SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),MAKE_SKILL_VALUE(new_value,MaxValue));
+        uint32 SkillLevels[]={75,150,225,300,375,450};
+        for(uint32 j = 0; j < sizeof(SkillLevels)/sizeof(uint32) - 1; j++)
+        {
+            if((SkillValue < SkillLevels[j] && new_value >= SkillLevels[j]))
+            {
+                learnSkillRewardedSpells( (GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF), SkillLevels[j]);
+                break;
+            }
+        }        
        GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL);
        sLog.outDebug("Player::UpdateSkillPro Chance=%3.1f%% taken", Chance/10.0);
        return true;
@@ -5046,7 +5055,7 @@
                    (*i)->ApplyModifier(true);

            // Learn all spells for skill
-            learnSkillRewardedSpells(id);
+            learnSkillRewardedSpells(id, 1);
            return;
        }
    }
@@ -17993,7 +18002,7 @@
    }
}

-void Player::learnSkillRewardedSpells(uint32 skill_id )
+void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value )
{
    uint32 raceMask  = getRaceMask();
    uint32 classMask = getClassMask();
@@ -18002,6 +18011,7 @@
        SkillLineAbilityEntry const *pAbility = sSkillLineAbilityStore.LookupEntry(j);
        if (!pAbility || pAbility->skillId!=skill_id || pAbility->learnOnGetSkill != ABILITY_LEARNED_ON_GET_PROFESSION_SKILL)
            continue;
        // Check race if set
        if (pAbility->racemask && !(pAbility->racemask & raceMask))
            continue;
@@ -18012,7 +18022,10 @@
        if (sSpellStore.LookupEntry(pAbility->spellId))
        {
            // Ok need learn spell
-            learnSpell(pAbility->spellId);
+            if(skill_value - pAbility->req_skill_value >= 75)
+            {
+                if(pAbility->req_skill_value > 1 && skill_value > 1)
+                    removeSpell(pAbility->spellId);
+            }
+            else
+                learnSpell(pAbility->spellId);
        }
    }
}
@@ -18026,7 +18039,7 @@

        uint32 pskill = GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF;

-        learnSkillRewardedSpells(pskill);
+        learnSkillRewardedSpells(pskill, 1);
    }
}

Index: src/game/Player.h
===================================================================
--- src/game/Player.h    (revision 205)
+++ src/game/Player.h    (working copy)
@@ -1745,7 +1745,7 @@
        uint16 GetPureSkillValue(uint32 skill) const;       // skill value
        int16 GetSkillTempBonusValue(uint32 skill) const;
        bool HasSkill(uint32 skill) const;
-        void learnSkillRewardedSpells( uint32 id );
+        void learnSkillRewardedSpells( uint32 id, uint32 value );
        void learnSkillRewardedSpells();

        void SetDontMove(bool dontMove);

Link to comment
Share on other sites

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

actually this patch works but the part for disable low spell rank in spellbook is not blizzlike and hardcode.

I don't see how to do it ...

Vladimir patch is blizzlike but spells aren't remove in spell book : http://getmangos.eu/community/showpost.php?p=54907&postcount=38

in my changes, this bug is fixed but it's in fact quick hack : http://getmangos.eu/community/showpost.php?p=54963&postcount=41

If you use all Vladimir work's && my "void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value )" Professions works

Link to comment
Share on other sites

  • 38 years later...

It works in this way :

Profession 1/75 --> You learn Spell/Ability Rank 1 (when you learn the profession)

Profession 75/X --> You learn Spell/Ability Rank 2 (when you get 75 skill's points)

Profession 150/X --> You learn Spell/Ability Rank 3 (when you get 150 skill's points)

Profession 225/X --> You learn Spell/Ability Rank 4 (when you get 225 skill's points)

Profession 300/X --> You learn Spell/Ability Rank 5 (when you get 300 skill's points)

Profession 375/X --> You learn Spell/Ability Rank 6 (when you get 375 skill's points)

Profession 450/X --> Rank 7 doesn't exist... useless I'm stupid... (I edit the code)

I'm not sure it is the Blizzlike working (I use informations from a blizz player)

Link to comment
Share on other sites

it somehow fixes the problem... but...

what happens:

at mining lvl1, learns toughness rank 1 (hp+30)

at mining lvl75, learns toughness rank 2 (hp+50)

at mining lvl150, learns toughness rank 3 (vit+70 bug... this should be hp+70)

at mining lvl225, learns toughness rank 4 (hp+100)

etc etc...

what should happen:

at mining lvl75, learns toughness rank 1 (hp+30)

at mining lvl150, learns toughness rank 2 (hp+50)

at mining lvl225, learns toughness rank 3 (hp+70)

etc etc...

Link to comment
Share on other sites

Profession 75/X --> You learn Spell/Ability Rank 1 (when you get 75 skill's points)

Profession 150/X --> You learn Spell/Ability Rank 2 (when you get 150 skill's points)

Profession 225/X --> You learn Spell/Ability Rank 3 (when you get 225 skill's points)

Profession 300/X --> You learn Spell/Ability Rank 4 (when you get 300 skill's points)

Profession 375/X --> You learn Spell/Ability Rank 5 (when you get 375 skill's points)

Profession 450/X --> You learn Spell/Ability Rank 6 (when you get 450 skill's points)

It's better ?

About toughness another bug? exist : it's normal that when you get the rank N, you have the effect of ranks N-1, N-2, N-3 etc.. ?

I'm not on my own computer so...

Link to comment
Share on other sites

Just to be sure, all profession work with this system ?

Profession 75/X --> You learn Spell/Ability Rank 1 (when you get 75 skill's points)

Profession 150/X --> You learn Spell/Ability Rank 2 (when you get 150 skill's points)

Profession 225/X --> You learn Spell/Ability Rank 3 (when you get 225 skill's points)

Profession 300/X --> You learn Spell/Ability Rank 4 (when you get 300 skill's points)

Profession 375/X --> You learn Spell/Ability Rank 5 (when you get 375 skill's points)

Profession 450/X --> You learn Spell/Ability Rank 6 (when you get 450 skill's points)

Link to comment
Share on other sites

it's ok about : "bonus skills/abilities/passive"

I just want to be sure that all professions in Blacksmithing, Mining, Leatherworking, Herbalism, alchemy use this system :

[is right]

Profession 75/X --> You learn Spell/Ability Rank 1 (when you get 75 skill's points)

Profession 150/X --> You learn Spell/Ability Rank 2 (when you get 150 skill's points)

Profession 225/X --> You learn Spell/Ability Rank 3 (when you get 225 skill's points)

Profession 300/X --> You learn Spell/Ability Rank 4 (when you get 300 skill's points)

Profession 375/X --> You learn Spell/Ability Rank 5 (when you get 375 skill's points)

Profession 450/X --> You learn Spell/Ability Rank 6 (when you get 450 skill's points)

[/is right]

and not this one :

[is wrong]

Profession 1/75 --> You learn Spell/Ability Rank 1 (when you learn the profession)

Profession 75/X --> You learn Spell/Ability Rank 2 (when you get 75 skill's points)

Profession 150/X --> You learn Spell/Ability Rank 3 (when you get 150 skill's points)

Profession 225/X --> You learn Spell/Ability Rank 4 (when you get 225 skill's points)

Profession 300/X --> You learn Spell/Ability Rank 5 (when you get 300 skill's points)

Profession 375/X --> You learn Spell/Ability Rank 6 (when you get 375 skill's points)

[/is wrong]

Link to comment
Share on other sites

no, not all professions give a "bonus" skill etc

only

Blacksmithing

Mining

Leatherworking

Herbalism

alchemy

have related bonus skills/abilities/passive traits at certain levels

yes i know -- not all...

but what i meant was, all those professions get the spells at 75/150/225/etc...

Link to comment
Share on other sites

Not sure that this is correct way. Why not use normal enable disabled spell functionality already existed in code for talent based learned spells?

In this case you know exactly known early spells.

i think this is a better approach to the problem...

i just don't know how to code this though...

will be waiting for someone who can...

much appreciated... thanks...

Link to comment
Share on other sites

In fact the problem is this one in :

[is right]

Profession 75/X --> You learn Spell/Ability Rank 1 (when you get 75 skill's points)

Profession 150/X --> You learn Spell/Ability Rank 2 (when you get 150 skill's points)

...

[/is right]

for example you can meet this two cases :

[is right]

You learn Profession with maxskill cap = 75

Profession 75/75 --> You learn Spell/Ability Rank 1 (when you get 75 skill's points)

You learn Profession with maxskill cap = 150 (but you are allowed to learn this profession if your current skill >= 50)

Profession 75/150 --> You learn Spell/Ability Rank 1 (when you get 75 skill's points)

[/is right]

In other words i see how to do a "spell learn spells", but for me it's the unique way to do a "skill value learn spell", however maybe I'm in wrong

Link to comment
Share on other sites

you should only have the effect of 1 rank on you.

ok so it's possible to have another bug in spell system...

maybe I'm wrong but it seems that with toughness rank 6 you cumulate effects of rank 1 + 2 + 3 + 4 + 5 + 6.

I try .unlearn 53123 (Toughness rank 4) on a player with Toughness rank 1 to 6 and this HP has changed... however I don't see how correct it...

Link to comment
Share on other sites

Profession 75/X --> You learn Spell/Ability Rank 1 (when you get 75 skill's points)

Profession 150/X --> You learn Spell/Ability Rank 2 (when you get 150 skill's points)

Profession 225/X --> You learn Spell/Ability Rank 3 (when you get 225 skill's points)

Profession 300/X --> You learn Spell/Ability Rank 4 (when you get 300 skill's points)

Profession 375/X --> You learn Spell/Ability Rank 5 (when you get 375 skill's points)

Profession 450/X --> You learn Spell/Ability Rank 6 (when you get 450 skill's points)

is correct.

and you should only have 1 rank of the skill, its not cumulative (just checked on live).

Link to comment
Share on other sites

Spell_chain does that maybe?

I test with these records :

53120 0 53120 1 0

53121 53120 53120 2 0

53122 53121 53120 3 0

53123 53122 53120 4 0

53124 53123 53120 5 0

53040 53124 53120 6 0

it doesn't work... when you learn the rank 2 you get the effect of rank 1 + rank 2

Maybe I must do the contrary : when a player learn a spell N+1 he unlearn spell N but it seems very hardcoded and bad...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use