Jump to content

[bug+fix] Spell - Plague Vial


Guest Edder

Recommended Posts

Mangos Version: 10654

Custom Patches: \\

SD2 Version: 1847

Database Name and Version: UDB 393

How it SHOULD work: Plague Vial should trigger North Fleet Reservist Kill Credit if the player hits one of the crewmember for Quest Test at Sea. But only trigger if the crewmember dont have the Plague Vial buff.

How it DOES work: No serversidescript for this spell, so no trigger...

Possible fix:

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index cac3f9e..dd63c35 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2013,6 +2013,21 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                        if (roll_chance_i(20))              // backfire stun
                            target->CastSpell(target, 51581, true, NULL, this);
                        return;
+                    case 43115:
+                    {
+                        if (target->GetTypeId() == TYPEID_UNIT)
+                            if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+                                return;
+                        if (Unit* caster = GetCaster())
+                        {
+                            if (caster->GetTypeId() != TYPEID_PLAYER)
+                                return;
+
+                            caster->CastSpell(caster, 43138, true);
+                        }
+                        target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+                        return;
+                    }
                    case 43873:                             // Headless Horseman Laugh
                        target->PlayDistanceSound(11965);
                        return;
@@ -2235,6 +2250,13 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                target->CastSpell(target, 36731, true, NULL, this);
                return;
            }
+            case 43115:
+            {
+                if (target->GetTypeId() == TYPEID_UNIT)
+                    if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+                        target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+                return;
+            }
            case 44191:                                     // Flame Strike
            {
                if (target->GetMap()->IsDungeon())

I used UNIT_FLAG_NON_ATTACKABLE to mark the npc's as unattackable if they got the buff and remove this flag when the buff expires.

There is also a taxi flight needed for this quest, but this is possible with database (UDB or SD2 ? ).

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