BrunoLohs Posted October 26, 2016 Posted October 26, 2016 Hello friends, I would like to ask you a script that announced when the mvp appear on your source map. Quote
1 anacondaq Posted October 27, 2016 Posted October 27, 2016 (edited) 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). 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. 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 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)); Edited October 27, 2016 by Anacondaqq 4 Quote
0 HappyMan Posted October 27, 2016 Posted October 27, 2016 do you mean you want a mvp announcer? when a player kill mvp monster it will broadcast player name,mvp name location? right? Quote
0 Athan17 Posted October 27, 2016 Posted October 27, 2016 (edited) 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 October 27, 2016 by Athan17 1 Quote
0 BrunoLohs Posted October 27, 2016 Author Posted October 27, 2016 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). 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. 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 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)); Thanks! 1 Quote
0 Athan17 Posted October 27, 2016 Posted October 27, 2016 yeah, modifying src is way better for this problem. im gonna try this 1 Quote
0 Radian Posted March 6, 2017 Posted March 6, 2017 @Anacondaqq what about announcing it advance for 5 minutes? Quote
0 anacondaq Posted March 6, 2017 Posted March 6, 2017 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 =) Quote
0 Hijirikawa Posted March 6, 2017 Posted March 6, 2017 5 minutes announcement before mvp spawn, idk if thats possible Quote
0 Radian Posted March 6, 2017 Posted March 6, 2017 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.. Quote
0 anacondaq Posted August 19, 2017 Posted August 19, 2017 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. Quote
0 Aisha Posted August 20, 2017 Posted August 20, 2017 If you attach a script to bosses, it should be do-able. Quote
0 anacondaq Posted August 20, 2017 Posted August 20, 2017 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. Quote
0 nitrous Posted August 20, 2017 Posted August 20, 2017 (edited) 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 August 20, 2017 by Nitrous Quote
0 Virtue Posted January 25, 2023 Posted January 25, 2023 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 ) Quote
Question
BrunoLohs
Hello friends, I would like to ask you a script that announced when the mvp appear on your source map.
14 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.