Jump to content
  • 0

MVP announcer


Radian

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Hi i was wondering why some normal monsters when killed this script announce it.

-	script	MVPAnnounce	-1,{
OnNPCKillEvent: 
	//if ( getmonsterinfo( killedrid,21 )&0x0020 && getgmlevel() > 0 )
	if ( getmonsterinfo( killedrid,21 )&0x0020)
		announce "[ Player ] "+strcharinfo(0)+" has slain [ "+getmonsterinfo(killedrid,0)+" ] at the map of [ "+strcharinfo(3)+" ]",0, 0x9A2EFE;
	end;
}

I was hoping that it will only announce MVP monsters. mini boss/normal mobs are not included.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Use MOB_MVPEXP instead. (Only MVPs give MVP experience, but non-MVPs also have MD_BOSS mode.)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

like this right?

if (getmonsterinfo(killedrid,MOB_MVPEXP))

thank Euphy, its working now..


Hi i was wondering why some normal monsters when killed this script announce it.

-	script	MVPAnnounce	-1,{
OnNPCKillEvent: 
	//if ( getmonsterinfo( killedrid,21 )&0x0020 && getgmlevel() > 0 )
	if ( getmonsterinfo( killedrid,21 )&0x0020)
		announce "[ Player ] "+strcharinfo(0)+" has slain [ "+getmonsterinfo(killedrid,0)+" ] at the map of [ "+strcharinfo(3)+" ]",0, 0x9A2EFE;
	end;
}

I was hoping that it will only announce MVP monsters. mini boss/normal mobs are not included.

 

How can i modify this script and only announce specific maps of the MVP's?

Edited by Ginji
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

if( strcharinfo(3) == "mapname" && getmonsterinfo( killedrid,MOB_MVPEXP ) )

edit the mapname

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

If you're only announcing certain monsters, why don't you just attach a label to those monsters? That way you won't be unnecessarily running an event on every monster you kill.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

If you're only announcing certain monsters, why don't you just attach a label to those monsters? That way you won't be unnecessarily running an event on every monster you kill.

 

how can i do that? can you give me an example?

 

is this a correct example of what you are saying?

    mes "I will spawn 5 Porings for you!";
    close2;
    monster "this",0,0,"Poring 1",1002,1,strnpcinfo(0)+"::OnPoring1Dead";
    monster "this",0,0,"Poring 2",1002,1,strnpcinfo(0)+"::OnPoring2Dead";
    monster "this",0,0,"Poring 3",1002,1,strnpcinfo(0)+"::OnPoring3Dead";
    monster "this",0,0,"Poring 4",1002,1,strnpcinfo(0)+"::OnPoring4Dead";
    monster "this",0,0,"Poring 5",1002,1,strnpcinfo(0)+"::OnPoring5Dead";
    end;

OnPoring1Dead:
    mes "You killed Poring 1";
    close;
OnPoring2Dead:
    mes "You killed Poring 2";
    close;
OnPoring3Dead:
    mes "You killed Poring 3";
    close;
OnPoring4Dead:
    mes "You killed Poring 4";
    close;
OnPoring5Dead:
    mes "You killed Poring 5";
    close;
Edited by Ginji
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

Yes I guess @Euphy mean so, by doing monster label your server will not trigger an OnNPCKillEvent check every time a player killed something which will reduce your server load. But don't forget to disable the default monster script unless you planning to modify the file itself.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

You can actually add an event in a normal monster spawn -- for some reason, a lot of people seem to be unaware of this, but it's clearly stated in the documentation:

** Create a permanent monster spawn:

<map name>,<x>,<y>,<xs>,<ys>%TAB%monster%TAB%<monster name>%TAB%<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>}

...

Event is a script event to be executed when the mob is killed. The event must

be in the form "NPCName::OnEventName" to execute, and the event name label

should start with "On". As with all events, if the NPC is an on-touch NPC, the

player who triggers the script must be within 'trigger' range for the event to

work.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Yes I guess @Euphy mean so, by doing monster label your server will not trigger an OnNPCKillEvent check every time a player killed something which will reduce your server load. But don't forget to disable the default monster script unless you planning to modify the file itself.

 

Alright, thanks for the information =) 

 

 

You can actually add an event in a normal monster spawn -- for some reason, a lot of people seem to be unaware of this, but it's clearly stated in the documentation:

** Create a permanent monster spawn:

<map name>,<x>,<y>,<xs>,<ys>%TAB%monster%TAB%<monster name>%TAB%<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>}

...

Event is a script event to be executed when the mob is killed. The event must

be in the form "NPCName::OnEventName" to execute, and the event name label

should start with "On". As with all events, if the NPC is an on-touch NPC, the

player who triggers the script must be within 'trigger' range for the event to

work.

 

 

Thank you, i will work on this. i was searching on the rAthena wiki and all i can find is that example. but anyway thank you again..

Edited by Ginji
Link to comment
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
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.

×
×
  • Create New...