TrinityCore / TrinityCore

TrinityCore Open Source MMO Framework (master = 11.0.5.57388, 3.3.5 = 3.3.5a.12340, cata classic = 4.4.1.57294)
http://www.trinitycore.org
GNU General Public License v2.0
9.62k stars 6.06k forks source link

[FIX] Dummy effect for spells 11885, 11886, 11887, 11888 and 11889 #445

Closed click closed 12 years ago

click commented 13 years ago

Implement dummy effect for spells triggered by Treant Muisek Vessel, Mountain Giant Muissek Vessel, Hippogryph Muisek Vessel, Faerie Dragon Muisek Vessel and Beast Muisek Vessel. Unit creatures will properly despawn("shrink") after using one of these items on them. [http://pastebin.com/NvybVXr5/ Patch on pastebin]

click commented 13 years ago

Author: silviu what you did here is redundant check as unit typeid will always be valid and TYPEID_UNIT.

Star-lion commented 12 years ago

diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 389c848..3c3f37a 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -797,6 +797,15 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
                     unitTarget->ToCreature()->setDeathState(JUST_ALIVED);
                     return;
                 }
+                case 11885:                                 // Capture Treant
+                case 11886:                                 // Capture Beast
+                case 11887:                                 // Capture Hippogryph
+                case 11888:                                 // Capture Faerie Dragon
+                case 11889:                                 // Capture Mountain Giant
+                    if (!unitTarget || unitTarget->GetTypeId() != TYPEID_CORPSE)
+                        return;
+                    unitTarget->ToCreature()->ForcedDespawn();
+                    return;
                 case 12162:                                 // Deep wounds
                 case 12850:                                 // (now good common check for this spells)
                 case 12868:

pretty sure it should be this

also should be in a spell script which im working on.

Subv commented 12 years ago

@kandera TYPEID_CORPSE is not set for creatures NEVER, even if they are dead

Star-lion commented 12 years ago

diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 389c848..3c3f37a 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -797,6 +797,14 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
                     unitTarget->ToCreature()->setDeathState(JUST_ALIVED);
                     return;
                 }
+                case 11885:                                 // Capture Treant
+                case 11886:                                 // Capture Beast
+                case 11887:                                 // Capture Hippogryph
+                case 11888:                                 // Capture Faerie Dragon
+                case 11889:                                 // Capture Mountain Giant
+                    if (unitTarget && unitTarget->isDead())
+                        unitTarget->ToCreature()->ForcedDespawn();
+                    return;
                 case 12162:                                 // Deep wounds
                 case 12850:                                 // (now good common check for this spells)
                 case 12868:

how about this? :D