Jump to content
  • 0

MVP announce


BrunoLohs

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   1
  • Joined:  11/21/13
  • Last Seen:  

Hello friends, I would like to ask you a script that announced when the mvp appear on your source map.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

This is not really script request. Because with scripts you should to do a lot of work for controlling mobs, do a lot of arrays, do a lot of checks, and you will not know exact time when MVP spawned. Why do you need to do all of this job, if you can try to use src edits?

 

Here what you need to do:

 

1. Open mob.c and find next function

int mob_delayspawn(int tid, unsigned int tick, int id, intptr_t data)

2. In this function find mob_spawn(md); and above or below add next code

		// if monster boss -> do announce
		if( md->spawn->state.boss ) {
			char message[128];
			sprintf(message, "[MVP Spawn]: %s has been spawned on his map.", md->name);
			clif_broadcast(&md->bl, message, strlen(message) + 1, BC_DEFAULT, ALL_CLIENT);
		}

P.S. if you do not understand where need to add code above, just look function uploaded here: https://gist.github.com/anacondaqq/b0c7729aa4ed9ee73c9a45705f8daec4

Or here is diff patch: link

 

Here is screen when i kill Tao, (tomb system enabled, mvp re-spawn time decreased in monster.conf to avoid log waiting for mvp re-spawn (just for testing this custom source mode above).
 

xPuXDmu.png

 

Then i go to another map just to confirm that mod showing announces for all connected players to the game on any map.

As you see i sitting at prt_fild, and just waiting for announce.

 

ZR5XPzP.png

 

So, as you see this mod show you if some mvp spawned. It will  NOT affect @reloadscript, and reloadmobdb, it will affect only spawn data if mob killed by someone.

Have fun /yawn/ok

 

P.S. if you wish to see where exactly spawned mob (like on screen below)

replace line in modification above:

sprintf(message, "[MVP Spawn]: %s has been spawned on his map.", md->name);

to:

sprintf(message, "[MVP Spawn]: %s has been spawned on %s map.", md->name, map_mapid2mapname(md->spawn->m));

FwXNro4.png

Edited by Anacondaqq
  • Upvote 3
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  191
  • Reputation:   24
  • Joined:  07/19/14
  • Last Seen:  

do you mean you want a mvp announcer?

 

when a player kill mvp monster it will broadcast player name,mvp name location? right?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  57
  • Reputation:   16
  • Joined:  09/26/16
  • Last Seen:  

do you mean you want a mvp announcer?

 

when a player kill mvp monster it will broadcast player name,mvp name location? right?

i believe he wants to announce when the MVP spawns.

i have a quick and dirty solution here,

this one needs to edit who you want to Announce each spawn ONE BY ONE. if youre going to support all MVPs, this is not a good solution.

for example, you want to announce Beelzebub to be announced each spawn.

first, you have to remove this line from npc/pre-re/mobs/dungeons/abbey.txt

abbey03,0,0,0,0	boss_monster	Beelzebub	1873,1,43200000,600000,1

second, you have to create your own script to spawn Beelzebub

OnHour3:
	monster "abbey03",0,0,"Beelzebub",1873,1;
	announce "Beelzebub has spawned @ abbey03!",bc_yellow|bc_all;
end;

this code summons Beelzebub every 3 hours, see more options here https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L857

you can also add an event when Beelzebub died.

please take note that:

this will make Beelzebub spawn every 3hours even if Beelzebub is still alive. Yes, this scripts can make Beelzebub more than 1 in the said map. but this problem can be solve with some tweaks in the code.

if your server is using Tomb NPC, it will NOT work with Beelzebub anymore.

if you add a lot of these codes in your server, it might cause LAG to your server.

lastly, this will make Beelzebub spawn exactly every 3 hours.

Edited by Athan17
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   1
  • Joined:  11/21/13
  • Last Seen:  

This is not really script request. Because with scripts you should to do a lot of work for controlling mobs, do a lot of arrays, do a lot of checks, and you will not know exact time when MVP spawned. Why do you need to do all of this job, if you can try to use src edits?

 

Here what you need to do:

 

1. Open mob.c and find next function

int mob_delayspawn(int tid, unsigned int tick, int id, intptr_t data)

2. In this function find mob_spawn(md); and above or below add next code

		// if monster boss -> do announce
		if( md->spawn->state.boss ) {
			char message[128];
			sprintf(message, "[MVP Spawn]: %s has been spawned on his map.", md->name);
			clif_broadcast(&md->bl, message, strlen(message) + 1, BC_DEFAULT, ALL_CLIENT);
		}

P.S. if you do not understand where need to add code above, just look function uploaded here: https://gist.github.com/anacondaqq/b0c7729aa4ed9ee73c9a45705f8daec4

Or here is diff patch: link

 

Here is screen when i kill Tao, (tomb system enabled, mvp re-spawn time decreased in monster.conf to avoid log waiting for mvp re-spawn (just for testing this custom source mode above).

 

xPuXDmu.png

 

Then i go to another map just to confirm that mod showing announces for all connected players to the game on any map.

As you see i sitting at prt_fild, and just waiting for announce.

 

ZR5XPzP.png

 

So, as you see this mod show you if some mvp spawned. It will  NOT affect @reloadscript, and reloadmobdb, it will affect only spawn data if mob killed by someone.

Have fun /yawn/ok

 

P.S. if you wish to see where exactly spawned mob (like on screen below)

replace line in modification above:

sprintf(message, "[MVP Spawn]: %s has been spawned on his map.", md->name);

to:

sprintf(message, "[MVP Spawn]: %s has been spawned on %s map.", md->name, map_mapid2mapname(md->spawn->m));

FwXNro4.png

Thanks!

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  57
  • Reputation:   16
  • Joined:  09/26/16
  • Last Seen:  

yeah, modifying src is way better for this problem. im gonna try this

  • Upvote 1
Link to comment
Share on other sites

  • 0

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

@Anacondaqq what about announcing it advance for 5 minutes?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

27 minutes ago, Radian said:

@Anacondaqq what about announcing it advance for 5 minutes?

My english is not good, can you explain with any example? I want understand =)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

5 minutes announcement before mvp spawn, idk if thats possible

Link to comment
Share on other sites

  • 0

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

On 3/6/2017 at 2:45 PM, Hijirikawa said:

5 minutes announcement before mvp spawn, idk if thats possible

I hope its possible I'll ask others if they know how to do it..

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

On 3/7/2017 at 0:54 AM, Radian said:

I hope its possible I'll ask others if they know how to do it..

i think it possible to do, but not sure if it actual.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   2
  • Joined:  06/27/17
  • Last Seen:  

If you attach a script to bosses, it should be do-able.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

10 minutes ago, Aisha said:

If you attach a script to bosses, it should be do-able.

no, with script engine i don't think it possible, i talk about source mods. 

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

It can be done through source edits/additions.

You would need to create a new timer function and make it trigger 5 minutes before the spawn of the monster. That function will send the announcement that the monster will spawn.

In mob_setdelayspawn, you will have to check if the mob is an MvP, then call add_timer with the current tick of the server + spawn time - 5 minutes.

Edited by Nitrous
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  92
  • Topics Per Day:  0.02
  • Content Count:  354
  • Reputation:   22
  • Joined:  11/17/11
  • Last Seen:  

On 8/21/2017 at 7:01 AM, nitrous said:

It can be done through source edits/additions.

You would need to create a new timer function and make it trigger 5 minutes before the spawn of the monster. That function will send the announcement that the monster will spawn.

In mob_setdelayspawn, you will have to check if the mob is an MvP, then call add_timer with the current tick of the server + spawn time - 5 minutes.

Sorry for necroing this post, I was trying too see if anyone was able to make or implement something like this. ( setting an announcement a few minutes before a mob spawns )

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