prontera,154,171,5 script Investor 100,{
.@price$ = "#CASHPOINTS";
.@cost = 10;
.@bmax = 99;
.@jmax = 50;
if( compare(jobname(Class),"Mechanic")
&& BaseLevel == .@bmax
&& JobLevel == .@jmax ) {
mes "[ Investor ]";
mes "So would you like to invest in this big project I'm working on?";
mes "It'll cost you 10 cash points!";
next;
if(select("Yes:No")==1) {
if(getd(.@price$)>=.@cost) {
investment++;
.@i = investment;
setd(.@price$,getd(.@price$)-.@cost);
callfunc( "package_func",
929, 20, 50, //Immortal Heart
970, 20, 50, //Alcohol
909, 100, 100, //Jellopy
7444, 5, 20, //Treasure Box
603, 1, 1*.@i, //Old Blue Box
4047, 1, 1 //Ghostring Card
);
mes "[ Investor ]";
mes "Congratulations, but maybe next time you'll get something even better!";
} else {
mes "[ Investor ]";
mes "It seems you don't have enough cash points better luck next time.";
}
close;
}
mes "[ Investor ]";
mes "Alright, maybe next time.";
} else {
mes "[ Investor ]";
mes "I don't have time for you!";
}
close;
}
/// callfunc("package_func",<itemid>,<amount>,<chance>{,<itemid>,<amount>,<chance>{,<itemid>,<amount>,<chance>{,...},<accountid>}})
function script package_func {
set .@len, getargcount()-((getarg(getargcount()-1)>=2000000)?1:0);
set .@id, ((getarg(getargcount()-1)>=2000000)?getarg(getargcount()-1):getcharid(3));
while(set(.@i,.@i+3)-3<.@len)
if(rand(101)<=getarg(.@i-1))
getitem(set(@package_item[.@a++-1],getarg(.@i-3)),set(@package_amount[.@a-1],getarg(.@i-2)),.@id);
return .@a;
}