Jump to content
  • 0

Summon Boss support script


Question

Posted
Quote

pay_dun00,0,0,0,0    monster    MH_COELACANTH_Y_A1    1002,1,90000,0,0
pay_dun00,0,0,0,0    monster    MH_COELACANTH_Y_A2    1002,1,90000,0,0
pay_dun00,0,0,0,0    monster    MH_COELACANTH_Y_A3    1002,1,90000,0,0
pay_dun00,0,0,0,0    monster    MH_COELACANTH_Y_A4    1002,1,90000,0,0
 

-    script    BL_NPC    -1,{
OnInit:
    set .bspawn,0;                //Where the kills will be saved(don't change)
    set .bneed,4;                //Kills needed
    set .bossid,1090;            //Boss ID
    set .minibossid,1002;        //Mini Boss ID
    set .reward,512;            //Reward for killing the Boss
    set .map$,"pay_dun00";            //Name of the map you kill mini bosses
    end;
    
OnNPCKillEvent:
    if (killedrid == .minibossid){
        set .bspawn,.bspawn +1;
        if (.bspawn >= .bneed){ 
            mapannounce .map$,"The map boss has appeared!",0;
            monster "pay_dun00", 0, 0, "Mastering", .bossid, 1, strnpcinfo(0) + "::OnBossKill";
            //monster .map$,0,0,0,0,"Mastering",.bossid,1,"BOSSSPAWN::OnBossKill";
            set .bspawn, 0;
        }
    }
    end;

OnBossKill:
    mapannounce "The player "+strcharinfo(0)+" has killed the boss!",
    getitem (.reward,1),

    end;
}

Script CREDIT TO @DoomSlayer

Hi guys,

I was looking a few scripts online and found the best that close to what I want.

What I want?
Basically killing a few mobs, and then spawn a boss.

The problem :
The script above works perfectly, however if you kill more and more poring it will continue to spawn more2 mastering. 

Question :
Does anyone knows how to limit the amount of mastering present in the map? Like if the script spawn 1 mastering by killing 4 porings, it won't spawn another mastering unless the current mastering is killed.

 

Thanks!

2 answers to this question

Recommended Posts

  • 1
Posted

Add below OnNPCKillEvent:

if (mobcount(.map$, strnpcinfo(0)+"::OnBossKill"))
	end;

*mobcount("<map name>","<event label>")

This function will count all the monsters on the specified map that have a given
event label and return the number or 0 if it can't find any.

 

Your mapannounce is missing some values.

*mapannounce "<map name>","<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}}};

This command will work like 'announce' but will only broadcast to characters
currently residing on the specified map.

So the correct is:

mapannounce .map$, "The player "+strcharinfo(0)+" has killed the boss!", bc_map;

 

  • Upvote 1
  • 0
Posted

Thanks @racaae the problem is solve. You're awesome.

On 4/7/2021 at 1:42 AM, Racaae said:

Add below OnNPCKillEvent:


if (mobcount(.map$, strnpcinfo(0)+"::OnBossKill"))
	end;

*mobcount("<map name>","<event label>")

This function will count all the monsters on the specified map that have a given
event label and return the number or 0 if it can't find any.

Hi @Racaae, since we're still on this topic. I want to ask your advice regarding map announce in OnBossKill: . Do you know why it did not announce The player ***** has kill the boss?

The weird thing is that, the player gets the item but the map was not announced he killed the boss.

 

On 4/7/2021 at 7:40 PM, Racaae said:

Your mapannounce is missing some values.

*mapannounce "<map name>","<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}}};

This command will work like 'announce' but will only broadcast to characters
currently residing on the specified map.

So the correct is:


mapannounce .map$, "The player "+strcharinfo(0)+" has killed the boss!", bc_map;

 

Amazing, previously I tried some sample mapannounce script too it didn't work because i was using "," instead of ";". But after changing few lines it work. ❤️ you're awesome @Racaae

Join the conversation

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

Guest
Answer this question...

×   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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...