Jump to content

[HELP] Implementing mixology


Auntie Mangos

Recommended Posts

http://www.wowhead.com/spell=53042

You receive an increased effect and duration when you drink any elixir or flask you are able to make.

What does mixology do?

* doubles (*2) duration off all flasks and elixirs

* increase effect of any flask/elixir

* all above happens only if you are able to make this flask/elixir

1. fix of double duration is in topic (not my work!)http://getmangos.eu/community/showthread.php?11752

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);

(i dont know if it is hacky, but it works)

2. In topic http://getmangos.eu/community/showthread.php?11752 was proved, that bonuses needs to be hardcoded somewhere and client has nothing to do with them. Because they show only in stats tab of character window.

Ideal place for this is "spell_elixir" table in UDB. Why? Becouse there are only two columns used (ID of elixir/flask spell, and type (battle/guardian/flask). I have nearly accurate data for all flasks/elixirs from retail servers.

So its no problem for me to create "value_1", "type_1","value_2", "type_2" (few flasks/elixir have more than one bonus) columns with accurate values. But working with mangos core and understanding its principles is realy hard for me. So im looking to somebody who has better mangos experience and understanding and can implement this to the core. I dont know how to make mangos understand what is in table, and how to add it to the player.

3. I realy dont know how to implement this, needs some love from experienced developer :)

Link to comment
Share on other sites

  • 40 years later...

if it is the right thing to do this in this table, or another table, you will have to discuss;

to your third point:

It would be possible, to iterate through all the available profession spells of a player, and look which fits;

or to iterate once through all profession skills, to create a table item <-> spell from which the information is taken (might have some problems with special spells),

or it would be possible to load this information from the DB table - which is safest, yet doubled information;

The first way has a high cpu-load - the other two (minor) memory load, so if you would implement it with a table, you just have to look: item->spell->hasSpell before applying the bonuses

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