Jump to content

[patch] Implement Mixology


Guest yavi

Recommended Posts

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

Implement spell 53042

* For which repository revision was the patch created?

9071

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

yavi

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 0b6737a..1503512 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2568,6 +2568,20 @@ void Spell::EffectApplyAura(uint32 i)
        return;
    }

+    if(caster->GetTypeId() == TYPEID_PLAYER && Aur->GetSpellProto()->SpellFamilyName == SPELLFAMILY_POTION
+        && caster->HasAura(53042))
+    {
+        SpellSpecific spellSpec = GetSpellSpecific(Aur->GetSpellProto()->Id);
+        if(spellSpec == SPELL_BATTLE_ELIXIR || spellSpec == SPELL_GUARDIAN_ELIXIR || spellSpec == SPELL_FLASK_ELIXIR)
+        {
+            if(caster->HasSpell(Aur->GetSpellProto()->EffectTriggerSpell[0]))
+            {
+               duration *= 2.0f;
+               Aur->GetModifier()->m_amount *= 1.3f;
+            }
+        }
+    }
+
    if(duration != Aur->GetAuraMaxDuration())
    {
        Aur->SetAuraMaxDuration(duration);

1.3f amount is arbitrary - absolutely no idea where do blue logo guys take it from/store it.

Also, maybe there is a better place for the code than AddAura.

Link to comment
Share on other sites

  • 2 weeks later...

Hm simply giving some percentage bonus is definitely not correct.

It seems to add a specific stats budget, depending on the level and type (flasks getting twice as much as elixiers, probably because they take both elixir slots at once).

For stats cost, see http://www.wowwiki.com/Item_level

For the northrend elixiers it's always 20.something budget points, e.g. 20 of some combat rating, 41 AP, 23 spell Power, 10 mp5, 280 armor etc.

For buffs that increase more than one stat, it seems to follow the same formular as items too, e.g. Guru's Elixier does not give a bonus of 20/5 = 4 to all stats, but 8 to all stats because the budget is calculated as (5*8^1.709)^(1/1.709) = 20.something.

The bonus of northrend flasks also matches the buff of Flask of the North, which you cannot use while having regular elixier/flask buffs, so Flask of the North is clearly designed to give you the same profession benefit where you cannot use flasks (read: arena).

Unfortunately there are very few comments about lower level elixiers and flasks, i cannot conclude a formula based on item level or required level to use yet.

Link to comment
Share on other sites

  • 2 months later...

I dont thing that simply item level is the way to implement the bonus so made a little research (with mixlogy/normal) - ( p means the number is reapeating to eternity :) )

flask

http://www.wowhead.com/?item=46376 172 spellpower = 1.376

http://www.wowhead.com/?item=46377 242 AP = 1.455p

http://www.wowhead.com/?item=46378 65 mp/5s = 1,444p

http://www.wowhead.com/?item=46379 1950hp = 1,5

elixir

http://www.wowhead.com/?item=44325 65 hit rating = 1.444p

http://www.wowhead.com/?item=44331 65 haste rating = 1.444p

http://www.wowhead.com/?item=44327 65 crit rating = 1.444p

http://www.wowhead.com/?item=39666 65 agil = 1.444p

http://www.wowhead.com/?item=40076 28 all stats = 1.4

Elixirs are nearly the same, but flask are different. So it realy needs more scripting that just one number, with 140% (alchemy in 3.2. was buffed) precentage it works, but not accurately.

Simply precentage bonus is realy not correct, but that double duration is absolutely right.

So it will be nice to include this patch even without the "Aur->GetModifier()->m_amount *= 1.3f" line in next revision. Mixology will only double duration of flasks/elixirs, and we can wait for someone who can write more complex impelentation of the bonus with this most important alchemy advantage partialy working.

Link to comment
Share on other sites

it should? but how? I have looked to wowhead to more dataz (i know that it isnt any "official ingame data" but it may help to take a picture of how it works, or it can even completely misguide me :) ):

All have information about Mixology bonus in comments. Sorted according to item level. 1.66p means 1.66666-endlessly, 1,57cca means 1,547868797.... All entries with 3.2+ game version should be accurate on offic. servers.

syntax: [wowhead link]_[bonus]_[bonus with mixology]=[bonus with mix/normal bonus] [game version of information]

Elixirs

Battle

http://www.wowhead.com/?item=2454 4 6=1.5 (3.0.3)

http://www.wowhead.com/?item=6373 10 15=1.5 (3.0.3)

http://www.wowhead.com/?item=3391 8 13=1.625 (3.0.9.)

http://www.wowhead.com/?item=8949 15 25=1.66p (3.0.9.)

http://www.wowhead.com/?item=9155 20 32=1.6 (3.0.3)

http://www.wowhead.com/?item=9187 25 36=1.44 (3.2.0)

http://www.wowhead.com/?item=13452 25+10 30+15= 1,2+1,5 (3.2)

http://www.wowhead.com/?item=28103 24+24t 37+32= 1.54cca+1,33p (3.0.9)

http://www.wowhead.com/?item=28104 15 21=1.4 (3.2.0)

http://www.wowhead.com/?item=40068 90 122=1.35) (3.0.3)

http://www.wowhead.com/?item=44325 45 65=1.44p (3.2.2)

http://www.wowhead.com/?item=44331 45 65=1.44p (3.2.2)

http://www.wowhead.com/?item=44327 45 65=1.44p (3.2.2)

http://www.wowhead.com/?item=39666 45 65=1.44p (3.2.2)

http://www.wowhead.com/?item=40076 20 28=1.4 (3.3.2)

Guardian

http://www.wowhead.com/?item=2458 27 42=1.55p (3.0.3)

http://www.wowhead.com/?item=3383 6 11=1.833p (3.0.3)

http://www.wowhead.com/?item=3389 150 220=1.466 (3.0.3)

http://www.wowhead.com/?item=32067 30 38=1.266p (3.0.3)

http://www.wowhead.com/?item=44328 45 65=1.44p (3.2.0)

http://www.wowhead.com/?item=40078 350 550=1.57cca (3.2.0)

http://www.wowhead.com/?item=40109 30 40=1.33p (3.0.9)

http://www.wowhead.com/?item=44332 45 65=1.44p (3.2.0)

http://www.wowhead.com/?item=40097 800 1080=1.35 (3.2.0)

http://www.wowhead.com/?item=40072 50 70=1.4 (3.3.2)

Flask

http://www.wowhead.com/?item=13511 65 85=1.30cca (3.0.3)

http://www.wowhead.com/?item=22854 120 160=1.33p (3.0.3)

http://www.wowhead.com/?item=44939 50 90=1.8 (3.2.2.)

http://www.wowhead.com/?item=40079 50 90=1.8 (3.2.2.)

http://www.wowhead.com/?item=46376 120 172=1.376 (3.3.2)

http://www.wowhead.com/?item=46377 180 242 = 1.34p (3.3.2)

http://www.wowhead.com/?item=46378 45 65 = 1,444p (3.3.2)

http://www.wowhead.com/?item=46379 1300 1950= 1,5 (3.3.2)

So it realy seems not too simple. Give all flasks/elixirs "hard" precentage bonus is realy not the cleanest way, but im not able to think any clean and easy solution, different to give bonuses one by one to each elixir/flask. At least the double duration is unquestionable.

Link to comment
Share on other sites

You can see mixology bonus only in stats/defenses/spell tab on your character, tooltips of elixirs/flask remain the same, so it is completly server side. And maybe there is realy another db table for mixology. But we need more data from to do it accurately, thanks to 3.2. mixology buff we can just guess the right values on the low level elixirs. Or make it mixed, low level 3.0.3 mixology bonus and high 3.2. mixology bonus.

But i think for now we can solve this bug with patch above. The double duration is absolutely right in this patch. The flat 130% increase off all effect is realy not accurate, but it was made pre 3.2.2 alchemy buff, so is realy underpowered!. With this change it will look like

http://www.wowhead.com/?item=46376 120spellpower*1,3=156 spell power (172 on live now)

http://www.wowhead.com/?item=39666 45*1,3=58,5 (65 on live now)

It will give alchemy some bonuses, it will not be working like on life servers it will be nerfed.

So please, in know this is not a complex solution but for now, we/you can just let it work with this reduced effect, and wait for more complex solution.

Or maybe, there is even dirtiest way to fix it, but only for top level players. Remove http://www.wowhead.com/?item=47499 Flask of the North flask=(guardian+battle elixir) status, so high level player can have buff from flask of the north (=bonus from mixology) at the same time with any other flask/elixir

Link to comment
Share on other sites

So it looks like only way to fix it in blizzlike way is implement double duration in SpellEffects.cpp and make new special mixology_db_table with bonuses and link it with SpellEffect. New table becouse there isnt any accurate formula to add bonuses, so we need to define them manualy. I can provide nearly accurate data of bonuses of all elixirs/flask in game from wowdb sites, or even from my own research on blizz servers, but im realy not able to implementing things to the core.

Link to comment
Share on other sites

the double duration is absolutely blizzlike, so there should be no problem to implement it in mangos core and then wait for solution to bonus problem, so modified patch form above:

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 0b6737a..1503512 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2568,6 +2568,20 @@ void Spell::EffectApplyAura(uint32 i)
        return;
    }

+    if(caster->GetTypeId() == TYPEID_PLAYER && Aur->GetSpellProto()->SpellFamilyName == SPELLFAMILY_POTION
+        && caster->HasAura(53042))
+    {
+        SpellSpecific spellSpec = GetSpellSpecific(Aur->GetSpellProto()->Id);
+        if(spellSpec == SPELL_BATTLE_ELIXIR || spellSpec == SPELL_GUARDIAN_ELIXIR || spellSpec == SPELL_FLASK_ELIXIR)
+        {
+            if(caster->HasSpell(Aur->GetSpellProto()->EffectTriggerSpell[0]))
+            {
+               duration *= 2.0f;
+            }
+        }
+    }
+
    if(duration != Aur->GetAuraMaxDuration())
    {
        Aur->SetAuraMaxDuration(duration);

Can anybody of developement make a comment?

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

added some harcoded values for northrend flasks/elixirs, leaving 30% as default for everything else:

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 757400e..a28bc10 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2985,6 +2985,63 @@ void Spell::EffectApplyAura(SpellEffectIndex eff_idx)
        return;
    }

+    // Mixology: increase duration and effect of elixirs and flasks
+    if (Aur->GetSpellProto()->SpellFamilyName == SPELLFAMILY_POTION &&
+        caster->GetTypeId() == TYPEID_PLAYER && caster->HasAura(53042))
+    {
+        SpellSpecific spellSpec = GetSpellSpecific(Aur->GetId());
+        if ((spellSpec == SPELL_BATTLE_ELIXIR || spellSpec == SPELL_GUARDIAN_ELIXIR || spellSpec == SPELL_FLASK_ELIXIR) &&
+            !(Aur->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_UNK21) &&    // Unaffected by Mixology
+            caster->HasSpell(Aur->GetSpellProto()->EffectTriggerSpell[EFFECT_INDEX_0]))
+        {
+            duration *= 2;
+            int32 amount = 0;
+            switch (Aur->GetId())
+            {
+                case 53749:         // Guru's Elixir
+                    amount = 8;
+                    break;
+                case 28497:         // Elixir of Mighty Agility
+                case 53747:         // Elixir of Spirit
+                case 54212:         // Flask of Pure Mojo
+                case 60340:         // Elixir of Accuracy
+                case 60341:         // Elixir of Deadly Strikes
+                case 60343:         // Elixir of Mighty Defense
+                case 60344:         // Elixir of Expertise
+                case 60345:         // Elixir of Armor Piercing
+                case 60346:         // Elixir of Lightning Speed
+                case 60347:         // Elixir of Mighty Thoughts
+                    amount = 20;
+                    break;
+                case 53752:         // Lesser Flask of Toughness
+                case 62380:         // Lesser Flask of Resistance
+                    amount = 40;
+                    break;
+                case 53755:         // Flask of the Frost Wyrm
+                    amount = 47;
+                    break;
+                case 53760:         // Flask of Endless Rage
+                    amount = 82;
+                    break;
+                case 53751:         // Elixir of Mighty Fortitude
+                    amount = 200;
+                    break;
+                case 53763:         // Elixir of Protection
+                    amount = 280;
+                    break;
+                case 53758:         // Flask of Stoneblood
+                    amount = 650;
+                    break;
+                default:
+                    // default value for all other flasks/elixirs
+                    //TODO: add data to db table or find way of getting it from dbc
+                    amount = Aur->GetModifier()->m_amount * 30 / 100;
+                    break;
+            }
+            Aur->GetModifier()->m_amount += amount;
+        }
+    }
+
    if(duration != Aur->GetAuraMaxDuration())
    {
        Aur->SetAuraMaxDuration(duration);

edit: added exception for flasks not affected by mixology (Flask of the North)

Link to comment
Share on other sites

×
×
  • 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