Jump to content

Dancing Rune Weapon


Guest laise

Recommended Posts

updated version:

mangos part:

diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 7f58b26..e9c0369 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -2457,6 +2457,7 @@ enum SummonType
    SUMMON_TYPE_TOTEM       = 121,
    SUMMON_TYPE_UNKNOWN3    = 181,
    SUMMON_TYPE_UNKNOWN4    = 187,
+    SUMMON_TYPE_RUNE_BLADE  = 208,
    SUMMON_TYPE_UNKNOWN1    = 247,
    SUMMON_TYPE_CRITTER2    = 407,
    SUMMON_TYPE_CRITTER3    = 307,
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 74dd44f..c2102ec 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3379,6 +3379,7 @@ void Spell::EffectSummonType(uint32 i)
        case SUMMON_TYPE_POSESSED2:
        case SUMMON_TYPE_FORCE_OF_NATURE:
        case SUMMON_TYPE_GUARDIAN2:
+        case SUMMON_TYPE_RUNE_BLADE:
        case SUMMON_TYPE_GUARDIAN3:
            // Jewelery statue case (totem like)
            if(m_spellInfo->SpellIconID == 2056)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 36f0cc6..a1b92f8 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -6487,7 +6487,16 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                    return false;
                // TODO: wite script for this "fights on its own, doing the same attacks"
                // NOTE: Trigger here on every attack and spell cast
-                return false;
+                Pet* runeBlade = FindGuardianWithEntry(27893);
+                if (!runeBlade)
+                   return false;
+                else
+                {
+                    // only melee based spells?
+                    if(procSpell)
+                        runeBlade->CastSpell(pVictim,procSpell,true,castItem,triggeredByAura);
+                    return true;
+                }
            }
            // Mark of Blood
            if (dummySpell->Id == 49005)

mangos sql:

DELETE FROM `spell_proc_event` WHERE `entry` IN (49028);
INSERT INTO `spell_proc_event` VALUES
(49028, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00010010, 0x00010000, 0.000000, 0.000000, 0);

SD2 part:

Index: scripts/world/npcs_special.cpp
===================================================================
--- scripts/world/npcs_special.cpp    (revision 1493)
+++ scripts/world/npcs_special.cpp    (working copy)
@@ -1451,6 +1451,43 @@
    return true;
}

+struct MANGOS_DLL_DECL npc_rune_blade : public ScriptedAI
+{
+    npc_rune_blade(Creature* pCreature) : ScriptedAI(pCreature) {Reset();}
+    void Reset()
+    {
+        Unit * owner = m_creature->GetOwner();
+        if (!owner || owner->GetTypeId() != TYPEID_PLAYER)
+            return;
+
+        // Cannot be Selected or Attacked
+        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+        // Add visible weapon
+        if (Item const * item = ((Player *)owner)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
+            m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, item->GetProto()->ItemId);
+
+        // Add stats scaling
+        int32 damageDone=owner->CalculateDamage(BASE_ATTACK, true); // might be average damage instead ?
+        int32 meleeSpeed=owner->m_modAttackSpeedPct[bASE_ATTACK];
+        m_creature->CastCustomSpell(m_creature, 51906, &damageDone, &meleeSpeed, NULL, true);
+
+        // Visual Glow
+        m_creature->CastSpell(m_creature, 53160, true);
+
+        // Start Chasing victim
+        if (uint64 guid = ((Player*)owner)->GetSelection())
+            if (Unit *target = m_creature->GetUnit(*owner,guid))
+                if (!target->IsFriendlyTo(owner))
+                    m_creature->Attack(target,true);
+
+    }
+};
+CreatureAI* GetAI_npc_rune_blade(Creature* pCreature)
+{
+    return new npc_rune_blade(pCreature);
+}
void AddSC_npcs_special()
{
    Script *newscript;
@@ -1528,4 +1565,9 @@
    newscript->pGossipHello = &GossipHello_npc_sayge;
    newscript->pGossipSelect = &GossipSelect_npc_sayge;
    newscript->RegisterSelf();
+
+    newscript = new Script;
+    newscript->Name = "npc_runeblade";
+    newscript->GetAI = &GetAI_npc_rune_blade;
+    newscript->RegisterSelf();
}

SD2 sql:

update creature_template set ScriptName='npc_runeblade' where entry=27893;

yeay gj patch working with latest rev

Link to comment
Share on other sites

  • 3 weeks later...
updated version:

mangos part:

diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 7f58b26..e9c0369 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -2457,6 +2457,7 @@ enum SummonType
    SUMMON_TYPE_TOTEM       = 121,
    SUMMON_TYPE_UNKNOWN3    = 181,
...
....
.....

After commit [8944] this doesn't work anymore

Link to comment
Share on other sites

After commit [8944] this doesn't work anymore

This is how i did

void Spell::EffectSummonType(uint32 i)
{
   uint32 prop_id = m_spellInfo->EffectMiscValueB[i];
   SummonPropertiesEntry const *summon_prop = sSummonPropertiesStore.LookupEntry(prop_id);
   if(!summon_prop)
   {
       sLog.outError("EffectSummonType: Unhandled summon type %u", prop_id);
       return;
   }
   if (prop_id == 208)
   {
       EffectSummonGuardian(i, summon_prop->FactionId);
       return;
   }

and add the rest of the sd as it says

i did the same way with the mirror image

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...
  • 2 months later...
×
×
  • 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