Jump to content
  • 0

Need help to make this script work with eamod ?


Question

Posted (edited)


- script treasurebox_event -1,{

OnInit:

// treasure box id + amount to spawn

setarray .treasure_box,1902,1;

// map list

setarray .map$,

"geffen";

// zeny gain upon killing box

.gain_zeny = 1000000;

// item gain upon killing box

setarray .item,607,3,671,5;

.map_size = getarraysize( .map$ );

.item_size = getarraysize( .item );

.npc_name$ = strnpcinfo(0);

// end;

OnClock0200:

OnClock0400:

OnClock0600:

OnClock0800:

OnClock1000:

OnClock1200:

OnClock1400:

OnClock1600:

OnClock1800:

OnClock2000:

OnClock2200:

OnClock0000:

// etc

.@index = rand( .map_size );

.map_name$ = setchar( .map$[.@index], strtoupper( charat( .map$[.@index],0 ) ), 0 );

announce "A Rare Treasure Box has Been Spawned "+.treasure_box[1]+" x "+getmonsterinfo( .treasure_box[0],MOB_NAME )+" at "+.map_name$,bc_all;

// monster .map$,0,0,"--ja--",.treasure_box[0],.treasure_box[1],.npc_name$+"::OnKill";

monster .map$[.@index],0,0,"--ja--",.treasure_box[0],.treasure_box[1],.npc_name$+"::OnKill";

end;

OnKill:

.@box_amount = mobcount( strcharinfo(3),.npc_name$+"::OnKill" );

Zeny += .gain_zeny;

if( .item_size > 1 )

for( .@i = 0; .@i < ( .item_size - 1 ); .@i += 2 )

getitem .item[.@i],.item[.@i+1];

announce strcharinfo(0)+" Gained "+.gain_zeny+" Zeny, 3 Yggdrasil Berries & 5 RO Coins for Killing the Treasure Box. "+( ( .@box_amount )?"Left "+.@box_amount+" at "+.map_name$:"" )+".",bc_all;

end;

}

Edited by Skorm
Added code box there were no tabs x_x...

6 answers to this question

Recommended Posts

Posted (edited)

Please post the erros too,

 

 

Looking quickly, I found this error:

Zeny += .gain_zeny;

it should be

set Zeny += gain_zeny;
 
Edited by TecnoCronus
Posted

Hmm try...

-	script	treasurebox_event	-1,{
OnInit:
	setarray .treasure_box,1902,1; // treasure box id + amount to spawn
	setarray .map$, "geffen"; // map list
	set .gain_zeny, 1000000; // zeny gain upon killing box
	setarray .item,607,3,671,5; // item gain upon killing box
	set .map_size, getarraysize( .map$ );
	set .item_size, getarraysize( .item );
	set .npc_name$, strnpcinfo(0);
	// end;
	
OnClock0200:
OnClock0400:
OnClock0600:
OnClock0800:
OnClock1000:
OnClock1200:
OnClock1400:
OnClock1600:
OnClock1800:
OnClock2000:
OnClock2200:
OnClock0000:
	set .@index, rand( .map_size );
	announce "A Rare Treasure Box has Been Spawned "+.treasure_box[1]+" x "+getmonsterinfo( .treasure_box[0],MOB_NAME )+" at "+.map$[.@index],bc_all;
	monster .map$[.@index],0,0,"--ja--",.treasure_box[0],.treasure_box[1],.npc_name$+"::OnKill";
	end;
	
OnKill:
	set .@box_amount, mobcount( strcharinfo(3),.npc_name$+"::OnKill" );
	set Zeny, Zeny+.gain_zeny;
	if( .item_size > 1 )
	for( set(.@i, 0); .@i < ( .item_size - 1 ); set(.@i,.@i + 2) )
	getitem .item[.@i],.item[.@i+1];
	announce strcharinfo(0)+" Gained "+.gain_zeny+" Zeny, 3 Yggdrasil Berries & 5 RO Coins for Killing the Treasure Box. "+( ( .@box_amount )?"Left "+.@box_amount+" at "+.map_name$:"" )+".",bc_all;
	end;
}
Posted

Please post the erros too,

Looking quickly, I found this error:

Zeny += .gain_zeny;
it should be
set Zeny += gain_zeny;

Uh...this is still wrong lol; in fact, it wouldn't even work on eAthena or eAmod. The proper conversion would be:

set Zeny, Zeny + .gain_zeny;
Variables that were set in a similar manner should follow this conversion for the script to run properly; that or just drop eAmod and use a real emulator.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...