Jump to content

Recommended Posts

  • Replies 106
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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 :)

Posted

It might work with 9582 the way it is but you will need to edit the sql file from

speed_walk

to

speed

the mirror image sql file will be in the sql folder after you apply the patch :)

  • 3 weeks later...
Posted

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)

  • 2 weeks later...
Posted

I have my hacky idea , somebody know how can i check if creator is in duel example if(creator->Isdueling), for change faction of clone . Else we can use creator->GetargetGuid(uint 64..) for choose target of clone ?

Posted

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);
}

Posted

I seeked the flag which is set and I found PLAYER_DUEL_TEAM or PLAYER_DUEL_ARBITER . So we need to check if it set . :D

We can make a new function IsDueling() which check GetUInt32Value(PLAYER_DUEL_TEAM) and GetUInt64Value(PLAYER_DUEL_ARBITER) .

Posted

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 ^^

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

Please could someone help me? Thanks in advance ^^

What is the script which you used ?

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