Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/19/22 in all areas

  1. 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));
    1 point
  2. kinda fun making this script been awhile I scripted something like mission board function script rand__ { .@range = getarg(0); .@count = getarg(2, 0); .@count = ( .@count == 0 || .@count > .@range )? .@range : ( .@count > 128 )? 128 : .@count; while ( .@i < .@count ) { .@r = .@save = rand( .@i, .@range -1 ) ; if ( getd(".@tmp1_"+ .@i ) == 0 ) { .@r = ( getd(".@tmp1_"+ .@r ) )? getd( ".@tmp2_"+ .@r ) : .@r; setd ".@tmp2_"+ .@i, .@r; setd ".@tmp2_"+ .@save , .@i; setd ".@tmp1_"+ .@save , 1; set getelementofarray( getarg(1), .@i ), .@r; if ( .@save < .@count ) set getelementofarray( getarg(1), .@save ), .@i; } .@i++; } return .@count; } prontera,156,188,5 script khdfsdkjhf 100,{ // hatgame$ = ""; if ( hatgame$ != "" ) { explode @tmp$, hatgame$, "#"; callsub L_preview; next; for ( .@i = 1; .@i <= 3; .@i++ ) { if ( countitem( .itemreq[ atoi( @tmp$[ .@i ] ) *2 ] ) < .itemreq[ atoi( @tmp$[ .@i ] ) *2 +1 ] ) { mes "you don't have enough "+ getitemname( .itemreq[ atoi( @tmp$[ .@i ] ) *2 ] ); close; } } for ( .@i = 1; .@i <= 3; .@i++ ) delitem .itemreq[ atoi( @tmp$[ .@i ] ) *2 ], .itemreq[ atoi( @tmp$[ .@i ] ) *2 +1 ]; getitem atoi( @tmp$[0] ), 1; mes "congrats for "+ getitemname( atoi( @tmp$[0] ) ); hatgame$ = ""; close; } mes "to play a hat game you need "+ .itemstart[0] +" "+ getitemname(.itemstart[1])+"."; next; if ( select ( "Yes", "No" ) == 2 ) close; if ( countitem(.itemstart[1]) < .itemstart[0] ) { mes "you don't have enough required items"; close; } delitem .itemstart[1], .itemstart[0]; @tmp$[0] = .rewarditem[ rand( .rewarditemsize ) ] +""; set .@dummy, callfunc( "rand__", .itemreqsize, $@rand, 3 ); for ( .@i = 0; .@i < 3; .@i++ ) @tmp$[ .@i +1 ] = $@rand[ .@i ] +""; hatgame$ = implode( @tmp$, "#" ); callsub L_preview; close; L_preview: mes "headgear : "+ getitemname( atoi( @tmp$[0] ) ); mes "you have to bring"; for ( .@i = 1; .@i <= 3; .@i++ ) mes .itemreq[ atoi( @tmp$[ .@i ] ) *2 +1 ] +"x "+ getitemname( .itemreq[ atoi( @tmp$[ .@i ] ) *2 ] ); return; OnInit: setarray .itemstart, 10, 909; // 10 jellopy setarray .itemreq, 501, 10, // 10 red pot 502, 9, // 9 orange pot 503, 8, // 8 yellow pot 504, 7, // 7 white pot 505, 6, // 6 blue pot 512, 1, // 1 apple 513, 2, // 2 banana 514, 3, // 3 grape 515, 4; // 4 carrot setarray .rewarditem, 5001, 5002, 5003, 5004; .itemreqsize = getarraysize(.itemreq) / 2; .rewarditemsize = getarraysize(.rewarditem); end; } credit to keyworld for the shuffling algorithm
    1 point
×
×
  • Create New...