Jump to content

Eye of Acherus.


Recommended Posts

  • Replies 244
  • Created
  • Last Reply

Top Posters In This Topic

no need for a new patch, he worked, but there is a problem with the core,

because each gobject with a spell does not work (as the portals gobjects)

here is a quick solution for the problem:

just add this in ebon_hold.cpp among others scripts:

/*######
## go_eye_of_acherus
######*/

bool GOHello_go_eye_of_acherus(Player *player, GameObject* _GO)
{
if (player->GetQuestStatus(12641) == QUEST_STATUS_INCOMPLETE)
player->CastSpell(player, 51852, true);

return true;
}

and at the end of the ebon_hold.cpp add this between the others:

newscript = new Script;
newscript->Name = "go_eye_of_acherus";
newscript->pGOHello = &GOHello_go_eye_of_acherus;
newscript->RegisterSelf();

important:

and do not forget to comment on these lines in npc_eye_of_acherus code:

//m_creature->RemoveMonsterMoveFlag(MONSTER_MOVE_SPLINE_FLY);

and:
//m_creature->SetMonsterMoveFlags(MONSTER_MOVE_SPLINE_FLY);

and compile again only scriptdev2

and last import into database mangos:

UPDATE `gameobject_template` SET `ScriptName` = 'go_eye_of_acherus' WHERE `entry` = 191609;

DELETE FROM `creature_template_addon` WHERE `entry` = 28511;
INSERT INTO `creature_template_addon` (`entry`, `moveflags`) VALUES
(28511, 33562624);

edit:

or get the whole patch again. (fixed) eye of acherus patch for MaNGOS rev.9346

http://filebeam.com/18a2103ff0a57aba41ffc65746d0e548

Take it and apply the patch with command: patch -p1 < name.patch

(can shorten its name)

and remind you again, that the patch is composed of three parts:

1. for mangos source

2. for scriptdev2 source

3. and for database mangos

Thank you. work on mango 9348 test ok ;)

Link to comment
Share on other sites

Please, help! We edit a file SpellEffects.cpp. After we must recompiling MANGOS server?

After any change in the source code of mangos you must to compile again

(I mean to start again Build Solution in Microsoft Visual C++)

edit:

btw here is eye of acherus patch that supports MaNGOS core rev. 9401

(I have not tested it yet, but should works)

http://filebeam.com/f874ac74cae529939c6221ad56212920

Link to comment
Share on other sites

well here is: updated patch (eye_of_acherus) for MaNGOS code rev. 9407

http://filebeam.com/de7bfce3b5abf1a04fe8af5ce207b497

Note:

The patch consists of three parts:

1. for mangos source

2. for scriptdev2 source

3. and for database mangos

(bad news) known bugs:

In the menu-track(Objectives) does not change, that the quest worked or the quest complete.

Link to comment
Share on other sites

Here it's updated patch (eye of acherus) for MaNGOS (source code) rev. 9410

http://filebeam.com/219b91ba1ee89c9e5484831497b3ff2e

edit:

eye of acherus patch for MaNGOS (source code) rev. 9424

http://filebeam.com/c64dd0230cf50fffca33abebf85880b0

Note:

how to patching ScriptDev2

pull ScriptDev2 (source code) with TortoiseSVN or Git,

then put the patch in ScriptDev2 main folder

and then on ScriptDev2 folder with Git, apply the patch with command:

patch -p1 < eye_scriptdev2.patch

Link to comment
Share on other sites

make death knight and login -> server crash.

Exception code: C0000005 ACCESS_VIOLATION
Fault address:  0000000140001659 01:0000000000000659 C:\\mangos\\mangosd.exe

Registers:
RAX:0000000000000000
RBX:0000000008D7D8B0
RCX:0000000000000041
RDX:0000000000000041
RSI:000007FFEAD17F10
RDI:00000001402DD3D0
R8: 0000000000000000
R9: 0000000140733E40
R10:000007FFE53B4000
R11:0000000000000000
R12:0000000000000000
R13:0000000000000000
R14:0000000000000000
R15:00000000098DDA80
CS:RIP:0033:0000000140001659
SS:RSP:002B:00000000098DE020  RBP:00000000
DS:002B  ES:002B  FS:0053  GS:002B
Flags:00010206

Call stack:
Address   Frame     Function      SourceFile
0000000140001659  00000000098DF080  Object::GetFloatValue+39  c:\\users\\administrator\\documents\\mangos\\src\\game\\object.h line 182
0000000140095DB9  00000000098E1120  Unit::GetCombatDistance+29  c:\\users\\administrator\\documents\\mangos\\src\\game\\unit.cpp line 8919
000000014036D167  00000000098E41F0  CreatureAI::CanCastSpell+1F7  c:\\users\\administrator\\documents\\mangos\\src\\game\\creatureai.cpp line 62
000000014036D3B9  00000000098E5290  CreatureAI::DoCastSpellIfCan+159  c:\\users\\administrator\\documents\\mangos\\src\\game\\creatureai.cpp line 101
0000000009539C38  00000000098E52D0  ?GetVisibility@Unit@@QEBA?AW4UnitVisibility@@XZ+76F8
00000001400C5530  00000000098EB4F0  Creature::Update+720  c:\\users\\administrator\\documents\\mangos\\src\\game\\creature.cpp line 470
0000000140123355  00000000098EB580  MaNGOS::ObjectUpdater::Visit+F5  c:\\users\\administrator\\documents\\mangos\\src\\game\\gridnotifiersimpl.h line 48
000000014012324D  00000000098EB5F0  VisitorHelper<MaNGOS::ObjectUpdater,Creature>+1D  c:\\users\\administrator\\documents\\mangos\\src\\framework\\gamesystem\\typecontainervisitor.h line 48
000000014012269D  00000000098EB620  VisitorHelper<MaNGOS::ObjectUpdater,Creature,TypeList<DynamicObject,TypeList<Corpse,TypeNull> > >+1D  c:\\users\\administrator\\documents\\mangos\\src\\framework\\gamesystem\\typecontainervisitor.h line 54
0000000140122020  00000000098EB650  VisitorHelper<MaNGOS::ObjectUpdater,GameObject,TypeList<Creature,TypeList<DynamicObject,TypeList<Corpse,TypeNull> > > >+30  c:\\users\\administrator\\documents\\mangos\\src\\framework\\gamesystem\\typecontainervisitor.h line 55
000000014012199D  00000000098EB680  VisitorHelper<MaNGOS::ObjectUpdater,TypeList<GameObject,TypeList<Creature,TypeList<DynamicObject,TypeList<Corpse,TypeNull> > > > >+1D  c:\\users\\administrator\\documents\\mangos\\src\\framework\\gamesystem\\typecontainervisitor.h line 61
000000014011DD83  00000000098EF730  Map::Visit<MaNGOS::ObjectUpdater,TypeMapContainer<TypeList<GameObject,TypeList<Creature,TypeList<DynamicObject,TypeList<Corpse,TypeNull> > > > > >+113  c:\\users\\administrator\\documents\\mangos\\src\\game\\map.h line 614
000000014011718D  00000000098EF7C0  Cell::Visit<MaNGOS::ObjectUpdater,TypeMapContainer<TypeList<GameObject,TypeList<Creature,TypeList<DynamicObject,TypeList<Corpse,TypeNull> > > > > >+7D  c:\\users\\administrator\\documents\\mangos\\src\\game\\cellimpl.h line 47
00000001400FA393  00000000098EFB50  Map::Update+583  c:\\users\\administrator\\documents\\mangos\\src\\game\\map.cpp line 642
000000014033D27F  00000000098EFC40  MapManager::Update+19F  c:\\users\\administrator\\documents\\mangos\\src\\game\\mapmanager.cpp line 266
00000001402B73F3  00000000098EFE00  World::Update+733  c:\\users\\administrator\\documents\\mangos\\src\\game\\world.cpp line 1463
000000014003EA25  00000000098EFE40  WorldRunnable::run+A5  c:\\users\\administrator\\documents\\mangos\\src\\mangosd\\worldrunnable.cpp line 61
00000001402DD3F3  00000000098EFEB0  ACE_Based::Thread::ThreadTask+23  c:\\users\\administrator\\documents\\mangos\\src\\shared\\threading.cpp line 186
000007FEF808170B  00000000098EFEF0  ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B
00000000741D2FDF  00000000098EFF20  _endthreadex+47
00000000741D3080  00000000098EFF50  _endthreadex+E8
00000000776C466D  00000000098EFF80  BaseThreadInitThunk+D
00000000778C8791  00000000098EFFD0  RtlUserThreadStart+21

Link to comment
Share on other sites

still got errors with patch 9424 with git apply -p1 < eye_mangos.patch on the lastest rev

Use this command: patch -p1 < eye_mangos.patch

important:

and do not write this: git apply

see this example:

Welcome to Git (version 1.6.5.1-preview20091022)

Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.

ACER-PC /c/Source/vehicle (master)
$ patch -p1 < eye_mangos.patch
patching file `src/game/Map.cpp'
patching file `src/game/Object.cpp'
patching file `src/game/Spell.h'
patching file `src/game/SpellEffects.cpp'

ACER-PC /c/Source/vehicle (master)
$

Link to comment
Share on other sites

Scriptdev part of this patch on svn(not git).

Index: scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp
===================================================================
--- scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp    (revision 1587)
+++ scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp    (working copy)
@@ -1100,6 +1100,113 @@
    return false;
}

+/*######
+## npc_eye_of_acherus
+######*/
+
+struct MANGOS_DLL_DECL npc_eye_of_acherusAI : public ScriptedAI
+{
+    npc_eye_of_acherusAI(Creature *pCreature) : ScriptedAI(pCreature)
+    {
+        m_creature->SetActiveObjectState(true);
+        Reset();
+    }
+
+    uint64 EyeGuid;
+    uint32 StartTimer;
+    bool Active;
+
+    void Reset()
+    {
+        EyeGuid = 0;
+        StartTimer = 2000;
+        Active = false;
+    }
+
+    void JustDied(Unit*u)
+    {
+        if(m_creature->GetCharmer()->GetTypeId()!= TYPEID_PLAYER)return;
+        Player* pl = ((Player*)m_creature->GetCharmer());
+
+            m_creature->GetMap()->CreatureRelocation(m_creature, 2325.0f, -5660.0f, 427.0f, 3.83f);
+            pl->RemoveAurasDueToSpell(51852);
+            pl->InterruptSpell(CURRENT_CHANNELED_SPELL);
+            pl->SetClientControl(m_creature, 0);
+            pl->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
+            pl->SetCharm(NULL);
+            pl->SetFarSightGUID(0);
+            pl->SetMover(NULL);
+            pl->RemovePetActionBar();
+            m_creature->SetCharmerGUID(0);
+    }
+
+    void AttackStart(Unit *)
+    {
+        m_creature->AttackStop();
+        m_creature->SetInCombatState(false)    ;
+    }
+
+    void MovementInform(uint32 uiType, uint32 uiPointId)
+    {
+        if (uiType != POINT_MOTION_TYPE)
+            return;
+
+        if (uiPointId == 0)
+        {
+        Unit *Eye1 = Unit::GetUnit((*m_creature), m_creature->GetGUID());
+        if (Eye1)
+            {
+            char * text1 = "The Eye of Acherus is in your control";
+            Eye1->MonsterTextEmote(text1, Eye1->GetGUID(), true);
+            //m_creature->RemoveMonsterMoveFlag(MONSTER_MOVE_SPLINE_FLY);
+            m_creature->SetSpeedRate(MOVE_FLIGHT, 2.8f, true);
+            m_creature->CastSpell(m_creature, 51890, true);
+            }
+        }
+
+    }
+
+    void UpdateAI(const uint32 uiDiff)
+    {
+        if (StartTimer < uiDiff && !Active)
+        {
+            EyeGuid = m_creature->GetGUID();
+            Unit *Eye = Unit::GetUnit((*m_creature), EyeGuid);
+            if (Eye)
+            {
+                char * text = "The Eye of Acherus launches towards its destination";
+                Eye->MonsterTextEmote(text, Eye->GetGUID(), true);
+                //m_creature->SetMonsterMoveFlags(MONSTER_MOVE_SPLINE_FLY);
+                m_creature->SetSpeedRate(MOVE_FLIGHT, 6.8f, true);
+                m_creature->SetSpeedRate(MOVE_WALK, 6.8f, true);
+                m_creature->GetMotionMaster()->MovePoint(0, 1711.0f, -5820.0f, 147.0f);
+                Active = true;
+            }
+        }
+        else StartTimer -= uiDiff;
+
+        DoMeleeAttackIfReady();
+    }
+};
+
+CreatureAI* GetAI_npc_eye_of_acherus(Creature* pCreature)
+{
+    return new npc_eye_of_acherusAI(pCreature);
+}
+
+/*######
+## go_eye_of_acherus
+######*/
+
+bool GOHello_go_eye_of_acherus(Player *player, GameObject* _GO)
+{
+    if (player->GetQuestStatus(12641) == QUEST_STATUS_INCOMPLETE)
+     player->CastSpell(player, 51852, true);
+
+    return true;
+}
+
+
void AddSC_ebon_hold()
{
    Script *newscript;
@@ -1136,4 +1243,14 @@
    newscript->Name = "go_acherus_soul_prison";
    newscript->pGOHello = &GOHello_go_acherus_soul_prison;
    newscript->RegisterSelf();
+
+    newscript = new Script;
+    newscript->Name = "npc_eye_of_acherus";
+    newscript->GetAI = &GetAI_npc_eye_of_acherus;
+    newscript->RegisterSelf();
+
+    newscript = new Script;
+    newscript->Name = "go_eye_of_acherus";
+    newscript->pGOHello = &GOHello_go_eye_of_acherus;
+    newscript->RegisterSelf();
}

Link to comment
Share on other sites

  • 3 weeks later...

for MaNGOS 9565. not tested yet

diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index befc8e1..2ac75c4 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -926,11 +926,36 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang
                creature->SetNeedNotify();
            }
        }
+        // hack for eye of acherus part 1
+        if(creature->isCharmed())
+        {
+            NGridType* oldGrid = getNGrid(old_cell.GridX(), old_cell.GridY());
+            RemoveFromGrid(creature->GetCharmerOrOwnerPlayerOrPlayerItself(), oldGrid, old_cell);
+            if(!old_cell.DiffGrid(new_cell))
+                AddToGrid(creature->GetCharmerOrOwnerPlayerOrPlayerItself(), oldGrid, new_cell);
+            else
+                EnsureGridLoadedAtEnter(new_cell, creature->GetCharmerOrOwnerPlayerOrPlayerItself());
+        }
    }
    else
    {
        creature->Relocate(x, y, z, ang);
        creature->SetNeedNotify();
+        // hack for eye of acherus part 2
+        if(creature->isCharmed())
+        {
+            UpdatePlayerVisibility(creature->GetCharmerOrOwnerPlayerOrPlayerItself(), new_cell, new_val);
+            UpdateObjectsVisibilityFor(creature->GetCharmerOrOwnerPlayerOrPlayerItself(), new_cell, new_val);
+            PlayerRelocationNotify(creature->GetCharmerOrOwnerPlayerOrPlayerItself(), new_cell, new_val);
+
+            bool same_cell = (new_cell == old_cell);
+            NGridType* newGrid = getNGrid(new_cell.GridX(), new_cell.GridY());
+            if( !same_cell && newGrid->GetGridState()!= GRID_STATE_ACTIVE )
+            {
+            ResetGridExpiry(*newGrid, 0.1f);
+            newGrid->SetGridState(GRID_STATE_ACTIVE);
+            }
+        }
    }

    assert(CheckGridIntegrity(creature,true));
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 9ec6a5b..9de6ded 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1453,6 +1453,10 @@ void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsB
{
    WorldPacket data(SMSG_MESSAGECHAT, 200);
    BuildMonsterChat(&data,IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE,text,LANG_UNIVERSAL,GetName(),TargetGuid);
+    Unit * eye = Unit::GetUnit((*this), TargetGuid);
+    if (eye && eye->isCharmed() && eye->GetEntry() == 28511)
+        SendMessageToSet(&data, true);
+    else
    SendMessageToSetInRange(&data,sWorld.getConfig(IsBossEmote ? CONFIG_FLOAT_LISTEN_RANGE_YELL : CONFIG_FLOAT_LISTEN_RANGE_TEXTEMOTE),true);
}

diff --git a/src/game/Spell.h b/src/game/Spell.h
index a09c7c0..1c9a2e0 100644
--- a/src/game/Spell.h
+++ b/src/game/Spell.h
@@ -241,6 +241,7 @@ class Spell
    friend void Unit::SetCurrentCastedSpell( Spell * pSpell );
    public:

+        void EffectSummonPosessed(SpellEffectIndex eff_idx);
        void EffectEmpty(SpellEffectIndex eff_idx);
        void EffectNULL(SpellEffectIndex eff_idx);
        void EffectUnused(SpellEffectIndex eff_idx);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 9c7d8f8..b303eb1 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3788,9 +3788,20 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
        }
        case SUMMON_PROP_GROUP_CONTROLLABLE:
        {
+            switch(prop_id)
+            {
+                //SUMMON_TYPE_POSESSED   = 65
+                //SUMMON_TYPE_POSESSED2   = 428
+                case 65:
+                case 428:
+                    EffectSummonPosessed(eff_idx);
+                    break;
+            default: DoSummonGuardian(eff_idx, summon_prop->FactionId);
+            break;
+            }
            // no type here
            // maybe wrong - but thats the handler currently used for those
-            DoSummonGuardian(eff_idx, summon_prop->FactionId);
+            // DoSummonGuardian(eff_idx, summon_prop->FactionId);
            break;
        }
        case SUMMON_PROP_GROUP_VEHICLE:
@@ -3805,6 +3816,61 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
    }
}

+void Spell::EffectSummonPosessed(SpellEffectIndex eff_idx)
+{
+    uint32 creature_entry = m_spellInfo->EffectMiscValue[eff_idx];
+    if (!creature_entry)
+        return;
+
+    int32 duration = GetSpellDuration(m_spellInfo);
+
+    float px, py, pz;
+    // If dest location if present
+    if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
+    {
+        // Summon 1 unit in dest location
+        px = m_targets.m_destX;
+        py = m_targets.m_destY;
+        pz = m_targets.m_destZ;
+    }
+    // Summon if dest location not present near caster
+    else
+        m_caster->GetClosePoint(px, py, pz, 1.0f);
+
+    TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_OR_DEAD_DESPAWN;
+    Creature *spawnCreature = m_caster->SummonCreature(creature_entry, px, py, pz, m_caster->GetOrientation(), summonType, duration);
+
+    if(!spawnCreature->IsPositionValid())
+    {
+        sLog.outError("Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
+        spawnCreature->GetGUIDLow(), spawnCreature->GetEntry(), spawnCreature->GetPositionX(), spawnCreature->GetPositionY());
+        delete spawnCreature;
+        return;
+    }
+
+    spawnCreature->setFaction(m_caster->getFaction());
+    spawnCreature->SetCharmerGUID(m_caster->GetGUID());
+    spawnCreature->SetCreatorGUID(m_caster->GetGUID());
+
+    CharmInfo *charmInfo = spawnCreature->InitCharmInfo(spawnCreature);
+    charmInfo->InitPossessCreateSpells();
+
+    if(m_caster->GetTypeId()==TYPEID_PLAYER)
+    {
+        ((Player*)m_caster)->SetCharm(spawnCreature);
+        ((Player*)m_caster)->SetFarSightGUID(spawnCreature->GetGUID());
+        ((Player*)m_caster)->SetClientControl(spawnCreature, 1);
+        ((Player*)m_caster)->SetMover(spawnCreature);
+        ((Player*)m_caster)->PossessSpellInitialize();
+    }
+
+    spawnCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
+    spawnCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+    spawnCreature->CombatStop();
+    spawnCreature->DeleteThreatList();
+}
+
void Spell::DoSummon(SpellEffectIndex eff_idx)
{
    if (m_caster->GetPetGUID())
@@ -5308,6 +5374,45 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
        {
            switch(m_spellInfo->Id)
            {
+                case 52694:                                 // Recall Eye of Acherus
+                {
+                    if(!m_caster || m_caster->GetTypeId() != TYPEID_UNIT || !(m_caster->isCharmed()))
+                        return;
+
+                    Creature *eye = ((Creature*)m_caster);
+                    if(m_caster->GetCharmer()->GetTypeId() != TYPEID_PLAYER)
+                    return;
+
+                    Player *player =((Player*)m_caster->GetCharmer());
+                    if(eye->isInCombat())
+                    return;
+
+                    eye->GetMap()->CreatureRelocation(eye, 2325.0f, -5660.0f, 427.0f, 3.83f);
+                    eye->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
+                    eye->SetCharmerGUID(0);
+
+                    player->InterruptSpell(CURRENT_CHANNELED_SPELL);
+                    player->RemoveAurasDueToSpell(51852);    // Remove The Eye of Acherus aura
+                    player->RemoveAurasDueToSpell(51923);
+                    player->RemoveAurasDueToSpell(51890);
+                    player->SetCharm(NULL);
+                    player->SetFarSightGUID(0);
+                    player->SetClientControl(m_caster, 0);
+                    player->SetMover(NULL);
+                    player->RemovePetActionBar();
+
+                    eye->CleanupsBeforeDelete();
+                    eye->AddObjectToRemoveList();
+                    return;
+                }
+                case 51904:                                 // Summon Ghouls On Scarlet Crusade
+                {
+                    if(!unitTarget)
+                        return;
+
+                    unitTarget->CastSpell(unitTarget, 54522, true);
+                    break;
+                }
                case 8856:                                  // Bending Shinbone
                {
                    if (!itemTarget && m_caster->GetTypeId()!=TYPEID_PLAYER)

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