summaryrefslogblamecommitdiff
path: root/npc/012-7/politics.txt
blob: c33b2905074a1ae8f5f00c9ef4a992a0de24de56 (plain) (tree)



































                                                                                         
                 






                                   
               







                 
// TMW2 Scripts
// Author:
//    Jesusalva
// Description:
//    Town Administrator file, see npc/functions/politics.txt
// User variables:
//    #POL_APPLYWEEK = Week of last application
//    #POL_VOTEDAY = Day of last vote

012-7,51,60,0	script	Hurnscald Office	NPC_POLITICS,{
do
{
    mesc ".:: "+l("Hurnscald Townhall")+" ::.", 2;
    mesc l("Current Town Administrator: ")+$HURNS_MAYOR$, 3;
    mesc l("Application fee: @@ GP", .applytax);
    next;
    select
        l("Information"),
        rif(#POL_APPLYWEEK != gettimeparam(GETTIME_WEEKDAY), l("Apply for the office!")),
        l("View Candidate List and cast a vote"),
        l("[Quit]");

    switch (@menu) {
        case 1:
            POL_Information();
            break;
        case 2:
            // array_push might be too sensible for getd/setd
            if (Zeny < .applytax)
                break;
            Zeny-=.applytax;
            $HURNS_MONEY+=.applytax;
            #POL_APPLYWEEK=gettimeparam(GETTIME_WEEKDAY);
            array_push($HURNS_CANDIDATE$, strcharinfo(0));
            array_push($HURNS_VOTES, 0);
            mesc l("Application successful!"), 3;
            next;
            break;
        case 3:
            POL_Candidate("HURNS");
            break;
        default:
            close;
    }
} while (true);
end;

OnInit:
    .applytax=50;
    .distance=4;
    end;
}