prontera,155,181,5 script Sample 757,{
.@guild_id = getcharid(2);
if( !.@guild_id ){
mes "You dont have any guild.";
}else if( getcharid(0) != getguildmasterid( .@guild_id ) ){
mes "You're not guild master.";
}else{
while( .@i < .castle_size ){
if( getcastledata( .castle$[.@i],1 ) == .@guild_id ){
.@menu$ = .@menu$ + getcastlename( .castle$[.@i] );
.@castle_count++;
}
.@menu$ = .@menu$ + ":";
.@i++;
}
if( !.@castle_count ){
mes "You didnt owned any castle.";
}else{
mes "Select a Castle.";
.@castle = select( .@menu$ ) - 1;
for( .@i = 2; .@i <= 17; .@i++ )
if( .@i < 6 || .@i > 8 )
.@getcastledata[.@i] = getcastledata( .castle$[.@castle],.@i );
do{
mes "Pick Option";
switch( select(
( .@getcastledata[4] >= .max_daily_invest )?"":"Invest Castle Economy",
( .@getcastledata[5] >= .max_daily_invest )?"":"Invest Castle Defense",
( .@getcastledata[9] )?"":"Hire Kafra",
( .@getcastledata[10] )?"":"Hire Soldier Guardian",
( .@getcastledata[11] )?"":"Hire Soldier Guardian",
( .@getcastledata[12] )?"":"Hire Soldier Guardian",
( .@getcastledata[13] )?"":"Hire Archer Guardian",
( .@getcastledata[14] )?"":"Hire Archer Guardian",
( .@getcastledata[15] )?"":"Hire Knight Guardian",
( .@getcastledata[16] )?"":"Hire Knight Guardian",
( .@getcastledata[17] )?"":"Hire Knight Guardian"
)){
Case 1:
mes "Investment cost : "+.invest_cost+" zeny.";
if( Zeny >= .invest_cost ){
Zeny -= .invest_cost;
mes "Invested the castle economy.";
.@getcastledata[2] += 5;
.@getcastledata[4] += 1;
setcastledata .castle$[.@castle],2,.@getcastledata[2];
setcastledata .castle$[.@castle],4,.@getcastledata[4];
}
break;
Case 2:
mes "Investment cost : "+.invest_cost+" zeny.";
if( Zeny >= .invest_cost ){
Zeny -= .invest_cost;
mes "Invested the castle defense.";
.@getcastledata[3] += 5;
.@getcastledata[5] += 1;
setcastledata .castle$[.@castle],3,.@getcastledata[3];
setcastledata .castle$[.@castle],5,.@getcastledata[5];
}
break;
Case 3:
mes "You hired kafra.";
.@getcastledata[9] = 1;
setcastledata .castle$[.@castle],9,.@getcastledata[9];
break;
default:
mes "You hired a Guardian";
.@i = @menu + 6;
.@getcastledata[.@i] = 1;
setcastledata .castle$[.@castle],.@i,.@getcastledata[.@i];
// code to summon guardian...
break;
}
next;
}while( select( "Continue","Close" ) == 1 );
}
}
close;
OnInit:
.max_daily_invest = 2;
.invest_cost = 100000;
setarray .castle$,
"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05",
"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05";
.castle_size = getarraysize( .castle$ );
end;
}