Index: trunk/src/game/SpellMgr.h
===================================================================
--- trunk/src/game/SpellMgr.h (revision 122)
+++ trunk/src/game/SpellMgr.h (revision 131)
@@ -649,5 +649,10 @@
 typedef std::map<uint32, SpellExtraAttribute> SpellExtraAttrMap;
 
-typedef std::map<int32, int32> SpellLinkedMap;
+struct SpellLinkedSpell
+{
+    int32 spell;
+    uint32 type;
+};
+typedef std::map<int32, SpellLinkedSpell> SpellLinkedMap;
 
 class SpellMgr
@@ -858,9 +863,9 @@
         }
 
-        int32 GetSpellLinked(int32 spell_id) const
+        int32 GetSpellLinked(int32 spell_id, uint32 type) const
         {
             SpellLinkedMap::const_iterator itr = mSpellLinkedMap.find(spell_id);
             if(itr != mSpellLinkedMap.end())
-                return itr->second;
+                return itr->second.type == type ? itr->second.spell : 0;
             else
                 return 0;
Index: trunk/src/game/Unit.cpp
===================================================================
--- trunk/src/game/Unit.cpp (revision 120)
+++ trunk/src/game/Unit.cpp (revision 131)
@@ -4163,4 +4163,16 @@
             if(caster->GetTypeId()==TYPEID_UNIT && ((Creature*)caster)->isTotem() && ((Totem*)caster)->GetTotemType()==TOTEM_STATUE)
                 statue = ((Totem*)caster);
+
+
+    if(int32 spell_triggered = spellmgr.GetSpellLinked(-(int32)Aur->GetSpellProto()->Id, 0))
+    {
+        if(spell_triggered > 0)
+        {
+            if(Unit* caster = Aur->GetCaster())
+                CastSpell(this, spell_triggered, true, 0, 0, caster->GetGUID());
+        }
+        else
+            RemoveAurasDueToSpell(-spell_triggered);
+    }
 
     sLog.outDebug("Aura %u now is remove mode %d",Aur->GetModifier()->m_auraname, mode);
Index: trunk/src/game/Spell.cpp
===================================================================
--- trunk/src/game/Spell.cpp (revision 122)
+++ trunk/src/game/Spell.cpp (revision 131)
@@ -923,4 +923,12 @@
     if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->AI())
         ((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo);
+
+    if(int32 spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id, 1))
+    {
+        if(spell_triggered > 0)
+            m_caster->CastSpell(unit, spell_triggered, true);
+        else
+            unit->RemoveAurasDueToSpell(-spell_triggered);
+    }
 }
 
@@ -1287,14 +1295,15 @@
         radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
 
+    uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i];
+    uint32 unMaxTargets = m_spellInfo->MaxAffectedTargets;
     if(m_originalCaster)
+    {
         if(Player* modOwner = m_originalCaster->GetSpellModOwner())
+        {
             modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius,this);
-
-    uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i];
-    if(m_originalCaster)
-        if(Player* modOwner = m_originalCaster->GetSpellModOwner())
             modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget, this);
-
-    uint32 unMaxTargets = m_spellInfo->MaxAffectedTargets;
+        }
+    }
+
     switch(cur)
     {
@@ -1552,6 +1561,12 @@
                     m_targets.setDestination(goScriptTarget->GetPositionX(),goScriptTarget->GetPositionY(),goScriptTarget->GetPositionZ());
             }
+            else
+            {
+                if(creatureScriptTarget)
+                    TagUnitMap.push_back(creatureScriptTarget);
+                else if(goScriptTarget)
+                    AddGOTarget(goScriptTarget, i);
+            }
         }break;
-
 
         // dummy
@@ -2176,4 +2191,12 @@
             }
         }
+    }
+
+    if(int32 spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id, 0))
+    {
+        if(spell_triggered > 0)
+            m_caster->CastSpell(m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster, spell_triggered, true);
+        else
+            m_caster->RemoveAurasDueToSpell(-spell_triggered);
     }
 
Index: trunk/src/game/SpellMgr.cpp
===================================================================
--- trunk/src/game/SpellMgr.cpp (revision 122)
+++ trunk/src/game/SpellMgr.cpp (revision 131)
@@ -2052,6 +2052,6 @@
     uint32 count = 0;
 
-    //                                                0       1
-    QueryResult *result = WorldDatabase.Query("SELECT spell0, spell1 FROM spell_linked_spell");
+    //                                                0              1             2
+    QueryResult *result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell");
     if( !result )
     {
@@ -2059,5 +2059,5 @@
         bar.step();
         sLog.outString();
-        sLog.outString( ">> Loaded %u spell pet auras", count );
+        sLog.outString( ">> Loaded %u linked spells", count );
         return;
     }
@@ -2071,44 +2071,25 @@
         bar.step();
 
-        uint16 spell = fields[0].GetUInt16();
-        uint16 pet = fields[1].GetUInt16();
-        uint16 aura = fields[2].GetUInt16();
-
-        SpellPetAuraMap::iterator itr = mSpellPetAuraMap.find(spell);
-        if(itr != mSpellPetAuraMap.end())
-        {
-            itr->second.AddAura(pet, aura);
-        }
-        else
-        {
-            SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell);
-            if (!spellInfo)
-            {
-                sLog.outErrorDb("Spell %u listed in `spell_pet_auras` does not exist", spell);
-                continue;
-            }
-            int i = 0;
-            for(; i < 3; ++i)
-                if((spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA &&
-                    spellInfo->EffectApplyAuraName[i] == SPELL_AURA_DUMMY) ||
-                    spellInfo->Effect[i] == SPELL_EFFECT_DUMMY)
-                    break;
-
-            if(i == 3)
-            {
-                sLog.outError("Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell);
-                continue;
-            }
-
-            SpellEntry const* spellInfo2 = sSpellStore.LookupEntry(aura);
-            if (!spellInfo2)
-            {
-                sLog.outErrorDb("Aura %u listed in `spell_pet_auras` does not exist", aura);
-                continue;
-            }
-
-            PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[i] == TARGET_PET, spellInfo->EffectBasePoints[i] + spellInfo->EffectBaseDice[i]);
-            mSpellPetAuraMap[spell] = pa;
-        }
+        int32 trigger = fields[0].GetInt32();
+        int32 effect = fields[1].GetInt32();
+        int32 type = fields[2].GetInt32();
+
+        SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(trigger));
+        if (!spellInfo)
+        {
+            sLog.outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(trigger));
+            continue;
+        }
+        spellInfo = sSpellStore.LookupEntry(abs(effect));
+        if (!spellInfo)
+        {
+            sLog.outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(effect));
+            continue;
+        }
+
+        SpellLinkedSpell linkedSpell;
+        linkedSpell.spell = effect;
+        linkedSpell.type = type;
+        mSpellLinkedMap[trigger] = linkedSpell;
 
         ++count;
@@ -2118,5 +2099,5 @@
 
     sLog.outString();
-    sLog.outString( ">> Loaded %u spell pet auras", count );
+    sLog.outString( ">> Loaded %u linked spells", count );
 }
 
