Jump to content

Mirror Image


Recommended Posts

as i know mirror images should cast only frostbolt.

i was cleaned patch from trailing whitespaces and other...

http://paste2.org/p/688345 core

http://paste2.org/p/688346 sd2

but after applying the SD2 part server won't start... it says you missed some functions in mangosscript.dll

The patch for core works greate ,so SD2 part need to be reviewed but I would work on the agro bug when mirror image is casted.

Link to comment
Share on other sites

  • Replies 106
  • Created
  • Last Reply

Top Posters In This Topic

if (m_uiFrostBoltTimer < uiDiff) need change to?

1>..\\scripts\\world\\npcs_special.cpp(1042) : error C2065: 'uiDiff' : undeclared identifier

m_uiFrostBoltTimer -= uiDiff; need change to?

1>..\\scripts\\world\\npcs_special.cpp(1050) : error C2065: 'uiDiff' : undeclared identifier

- void UpdateAI(const uint32 diff)

+ void UpdateAI(const uint32 uidiff)

- npc_mirror_imageAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();}

+ npc_mirror_imageAI(Creature *pCreature) : ScriptedAI(pCreature)

+ {

+ Reset();

+ }

Changed - No Errors :)

Link to comment
Share on other sites

  • 3 weeks later...

i think we need new AI (similar to guardians) for all those kind of temp summons. I gave up and also implemented scriptedAI for MI. It is impossible to update target (m.i. should attack current creator target) and movement generator without this (there is small chance that periodic initialzing spell could handle this, but doubt this is way it should be done)

Link to comment
Share on other sites

  • 2 weeks later...

my AI, everything is on place except PvP handling. if you find out which flag has to be set give me a hint :/

/*########
# mob_mirror_image AI
#########*/

enum MirrorImage
{
   SPELL_FROSTBOLT = 59638,
   SPELL_FIREBLAST = 59637
};

struct MANGOS_DLL_DECL mob_mirror_imageAI : public ScriptedAI
{
   mob_mirror_imageAI(Creature* pCreature) : ScriptedAI(pCreature)
   {
       bLocked = false;
       Reset();
   }
   uint64 m_uiCreatorGUID;
   uint32 m_uiFrostboltTimer;
   uint32 m_uiFireBlastTimer;
   float fDist;
   float fAngle;
   bool bLocked;

   void Reset()
   {
       m_uiFrostboltTimer = urand(500, 1500);
       m_uiFireBlastTimer = urand(4500, 6000);
   }

   void UpdateAI(const uint32 uiDiff)
   {
       if (!bLocked)
       {
           m_uiCreatorGUID = m_creature->GetCreatorGUID();
           if (Player* pOwner = (Player*)Unit::GetUnit(*m_creature, m_uiCreatorGUID))
           {
               fDist = m_creature->GetDistance(pOwner);
               fAngle = m_creature->GetAngle(pOwner);
           }
           bLocked = true;
       }

       Player* pOwner = (Player*)Unit::GetUnit(*m_creature, m_uiCreatorGUID);
       if (!pOwner || !pOwner->IsInWorld())
       {
           m_creature->ForcedDespawn();
           return;
       }

       uint64 targetGUID = 0;

       if (Spell* pSpell = pOwner->GetCurrentSpell(CURRENT_GENERIC_SPELL))
           targetGUID = pSpell->m_targets.getUnitTargetGUID();
       else if (pOwner->getVictim())
           targetGUID = pOwner->getVictim()->GetGUID();

       Unit* pTarget = Unit::GetUnit(*m_creature, targetGUID);

       if (!pTarget || !m_creature->CanInitiateAttack() || !pTarget->isTargetableForAttack() ||
       !m_creature->IsHostileTo(pTarget) || !pTarget->isInAccessablePlaceFor(m_creature))
       {
           if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FOLLOW_MOTION_TYPE)
           {
               m_creature->InterruptNonMeleeSpells(false);
               m_creature->GetMotionMaster()->Clear();
               m_creature->GetMotionMaster()->MoveFollow(pOwner, fDist, fAngle);
           }
           return;
       }

       if (m_uiFrostboltTimer <= uiDiff)
       {
           m_creature->CastSpell(pTarget, SPELL_FROSTBOLT, false, NULL, NULL, pOwner->GetGUID());
           m_uiFrostboltTimer = urand(3000, 4500);
       } else m_uiFrostboltTimer -= uiDiff;

       if (m_uiFireBlastTimer <= uiDiff)
       {
           m_creature->CastSpell(pTarget, SPELL_FIREBLAST, false, NULL, NULL, pOwner->GetGUID());
           m_uiFireBlastTimer = urand(9000, 12000);
       } else m_uiFireBlastTimer -= uiDiff;
   }
};

CreatureAI* GetAI_mob_mirror_image(Creature* pCreature)
{
   return new mob_mirror_imageAI(pCreature);
}

Link to comment
Share on other sites

I have a problem compiling in on linux, on windows no problem but on my ubuntu:

../../../src/game/SkillHandler.cpp: In member function âvoid WorldSession::HandleMirrorImageDataRequest(WorldPacket&)â:

../../../src/game/SkillHandler.cpp:100: error: âObjectAccessorâ has not been declared

../../../src/game/SkillHandler.cpp:105: error: âObjectAccessorâ has not been declared

Please could someone help me? Thanks in advance ^^

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