• 0
Sign in to follow this  
Sirique

Need help with ROTD script

Question

Hi,

I use Emistry's ROTD script and when the race change it doesn't seem to trigger the OnNPCKillEvent.

I was wondering if someone could enlight me on what part of the script my cause this.

 

Alyssandra,118,73,3	script	ROTD	436,{
set [email protected],getgmlevel();

do{
	set [email protected],select("^4EEE94ROTD Information^000000",
				( [email protected] < .gm_level )?"":"^FF0000[GM]^000000Set a New Monster's Race",
				( [email protected] < .gm_level )?"":"^FF0000[GM]^000000Set EXP Bonus",		
				( [email protected] < .gm_level )?"":"^FF0000[GM]^000000Set Item / Zeny Bonus",
				"Close" );
				
	switch( [email protected] ) {
		Case 1:
			mes "^FF0000ROTD^000000 refer to ^0000FFRace of the Day^000000";
			mes "In another word, it mean that the ^FF0000Monster's Race^000000 that you killed by day will grant you ^FF0000Extra Bonus EXP / Item / Zeny ^000000.";
			next;
			mes "[ ^FF0000Today's ROTD^000000 ]";
			mes "^0000FF"+.rotd$[.today_rotd]+"^000000 Race";
			if ( .rotd_exp_bonus ) mes " ~ ^777777"+.rotd_exp_bonus+"% more exp^000000";
			if ( ( .rotd_item_amount && .rotd_item_rate ) || .rotd_zeny || .rotd_exp_bonus ) {
				mes " ";
				mes "Reward : "+( ( .rotd_item_rate )? .rotd_item_rate+"%":"" )+" : ";
				if ( .rotd_item_amount && .rotd_item_rate ) mes " ~ ^777777"+.rotd_item_amount+" x "+getitemname( .rotd_item_id )+"^000000";
				if ( .rotd_zeny ) mes " ~ ^777777"+.rotd_zeny+" Zeny^000000";
				mes " ";
				mes "Amount are random...";
			}
			break;
		Case 2:
			mes "Select new race.";
			set .today_rotd,select( .rotd_menu$ ) - 1;
			if ( .today_rotd >= .rotd_size ) set .today_rotd,rand( .rotd_size );
			mes "New Race : ^777777"+.rotd$[.today_rotd]+"^000000";
			delwaitingroom;
			waitingroom "[ROTD]:"+.rotd$[.today_rotd]+" ",0;
			break;
		Case 3:
			mes "Set new exp bonus. (%)";
			input .rotd_exp_bonus,0,100;
			if ( .rotd_exp_bonus ) mes "ROTD EXP : "+.rotd_exp_bonus+" %";
			break;
		Case 4:
			mes "Set Rotd bonus";
			mes "Inset Zeny Bonus";
			input [email protected];
			mes "Insert Item ID";
			do{
				input [email protected],0,32767; 
				if ( [email protected] ) close;
			}while( getitemname( [email protected] ) == "null" );
			mes "Enter amount.";
			input [email protected],0,30000;
			mes "Enter Rate to gain.";
			input [email protected],0,100;
			if ( [email protected] && [email protected] ) {
				next;
				mes "Updated item bonus : ( "[email protected]+"% )";
				mes "^777777"[email protected]+" x "+getitemname( [email protected] )+"^000000";
				mes "^777777"[email protected]+" Zeny^000000";
				if ( select( "Confirm","Cancel" ) == 1 ) {
					set .rotd_item_id,[email protected];	
					set .rotd_item_amount,[email protected];
					set .rotd_item_rate,[email protected];
					set .rotd_zeny,[email protected];
					mes "Updated.";
				}
			}
		default: close;
	}
	next;
}while( [email protected] != 5 );
close;

OnInit:
	// min gm level
	set .gm_level,99;

	// monster race list
	setarray .rotd$[0],
		"Undead",
		"Undead",
		"Brute",
		"Plant",
		"Insect",
		"Fish",
		"Demon",
		"Fish",
		"Angel",
		"Dragon",
		"Brute",
		"Demon";
		
	set .rotd_size,getarraysize( .rotd$ );
	for( set [email protected],0; [email protected] < .rotd_size; set [email protected],[email protected] + 1 )
		set .rotd_menu$,.rotd_menu$ + .rotd$[[email protected]] +":";
	set .rotd_menu$,.rotd_menu$ + "^0055FFRandom Race^000000";

	// min party member lv to gain exp
	set .party_level_range,10;

// daily reset
OnClock0000:
	set .today_rotd,rand( .rotd_size );
	set .rotd_exp_bonus,rand( 1,100 );
	delwaitingroom;
	waitingroom "[ROTD]:"+.rotd$[.today_rotd]+" ",0;
	end;
	
OnNPCKillEvent:
if ( getmonsterinfo( killedrid,MOB_RACE ) == .today_rotd ) {
	set [email protected],getcharid(1);
	set [email protected]_base_exp,(( getmonsterinfo( killedrid,MOB_BASEEXP ) / 100 ) * .rotd_exp_bonus );
	set [email protected]_job_exp,(( getmonsterinfo( killedrid,MOB_JOBEXP ) / 100 ) * .rotd_exp_bonus );
	if ( [email protected] ) {
		set [email protected],getcharid(3);
		set [email protected],BaseLevel;
		set [email protected]$,strcharinfo(3);
		getpartymember [email protected],1;
		getpartymember [email protected],2;
		while( [email protected] < [email protected] ) {
			if ( isloggedin( [email protected][[email protected]],[email protected][[email protected]] ) )
				if ( attachrid( [email protected][[email protected]] ) )
					if ( strcharinfo(3) == [email protected]$ && ( BaseLevel - [email protected] ) <= .party_level_range && ( BaseLevel - [email protected] ) >= ~.party_level_range && Hp >= 1 ) {	
						set BaseExp,( BaseExp + [email protected]_base_exp );
						set JobExp,( JobExp + [email protected]_job_exp );
						dispbottom "[ROTD Party] : "[email protected]_base_exp+" EXP";
					}
			set [email protected],[email protected] + 1;
		}
		attachrid( [email protected] );
	}
	else {
		set BaseExp,( BaseExp + [email protected]_base_exp );
		set JobExp,( JobExp + [email protected]_job_exp );
		dispbottom "[ROTD SOLO] : "[email protected]_base_exp+" EXP";
	}
	if ( rand( 100 ) < .rotd_item_rate && .rotd_zeny ) 
		set Zeny,Zeny + rand( .rotd_zeny );
	if ( rand( 100 ) < .rotd_item_rate && .rotd_item_amount ) 
		getitem .rotd_item_id,rand( .rotd_item_amount ),[email protected];
}
end;
}

The only part I modified is the array of races I want the script to choose daily:

// monster race list
    setarray .rotd$[0],
        "Undead",
        "Undead",
        "Brute",
        "Plant",
        "Insect",
        "Fish",
        "Demon",
        "Fish",
        "Angel",
        "Dragon",
        "Brute",
        "Demon";

I tried to simply remove some races but it was showing up empty and no race were selected. I just wonder how the rand for how many races randomly selected daily actually work in this script.

Thank you.

Edited by Sirique

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.

Loading...
Sign in to follow this