viewing paste castle manage ( incomplete ) | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
 
 
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;
}
 
Viewed 1245 times, submitted by Emistry.