Jump to content
cyberpro98

Boss is not casting exactly spell

Recommended Posts

21 hours ago, cyberpro98 said:

Hello, i am trying to make an script for BOSS.
But everything works good, the only thing is that the boss won't cast LAY OF HANDS spell when he has got 10% of hp.
So i don't know what to do, anyone have idea ? 

http://pastebin.com/DpczPs0Y

is this trinitycore ? As much as i know a bos script should be bound to an instance if you want to create a worldboss you'd go with a creature script instead and for god sake replace 

#define SPELL_MORTAL_WOUND      30641
#define H_SPELL_MORTAL_WOUND    36814
#define SPELL_SURGE             34645
#define SPELL_RETALIATION       22857
#define SPELL_HOLY_LIGHT        43451
#define SPELL_LAY_OF_HANDS      17233

 

enum My_boss_name_Spells{
    SPELL_MORTAL_WOUND      = 30641,
    H_SPELL_MORTAL_WOUND    = 36814,
    SPELL_SURGE             = 34645,
    SPELL_RETALIATION       = 22857,
    SPELL_HOLY_LIGHT        = 43451,
    SPELL_LAY_OF_HANDS      = 17233
}

Also when you copy/paste an existing boss script make sure you remove the instance related code like 

 pInstance = c->GetInstanceData();
 HeroicMode = me->GetMap()->IsHeroic();

because it will check if boss is in instance else script won't be applied 

 

 

EDIT: Getting back to the subject you might want to check out 

Lay_of_Hands_Timer = 900000; //this mean the timer for lay of hands is set to 15 minutes after boss reset

and 

if ((me->GetHealth() * 100) / me->GetMaxHealth() < 90)
        {
            if (Lay_of_Hands_Timer <= diff) // diff mean the number of seconds passed since you started fighting with the boss
            {
                DoCast(me, SPELL_LAY_OF_HANDS);
                Lay_of_Hands_Timer = 600000; // this code mean boss casted the spell and set the new cast time to 10 minutes
            }
            else Lay_of_Hands_Timer -= diff; // if the timer does not meet the requirements it remove the passed seconds from original timer until it reach 0
        }

that mean there's a chance to cast the lay of hands after 10-15 minutes after you start fighting with a condition that the boss have less than 10% HP but i doubt your boss would last so much at 10% hp so just set the timer to 1-2 minutes beware that timer is in milliseconds not seconds

Share this post


Link to post
Share on other sites

So i have to add 

 

Lay_of_Hands_Timer = 250000; //this mean the timer for lay of hands is set to 4.16 minutes after boss reset
if ((me->GetHealth() * 100) / me->GetMaxHealth() < 90)
        {
            if (Lay_of_Hands_Timer <= diff) // diff mean the number of seconds passed since you started fighting with the boss
            {
                DoCast(me, SPELL_LAY_OF_HANDS);
                Lay_of_Hands_Timer = 90000; // this code mean boss casted the spell and set the new cast time 1.5min ? 
            }
            else Lay_of_Hands_Timer -= diff; // if the timer does not meet the requirements it remove the passed seconds from original timer until it reach 0
        }

Share this post


Link to post
Share on other sites

not really... after some time  the players said me that he uses instantly that spell lol :D the  lay of hands he casts is all the time ..  

After 5 mins or 10 mins  i mean 

Share this post


Link to post
Share on other sites

You need to do vigorous testing. The code looks okay so it should work. Perhaps your timings are wrong? If the timings are okay then are you sure the health checks are correct? You can add some chat messages at different times to check if the timers are working properly. Make the chat message appear at the times of the spells for example.

Share this post


Link to post
Share on other sites
5 minutes ago, cyberpro98 said:

Madnesssss lel i am lazy to write again stuff ... 

I can't help if there's no information >.< Do the other spells work okay?

Share this post


Link to post
Share on other sites

One thing you can try, is replacing the spell for another one. If the other one works then you know exactly where your problem is ;) (with the spell itself).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...