קוד PHP:
var status = 0;
var type = 0, gained = 0, choice = 0;
function start(w) {
cm.sendSimple(cm.getMapId() == 970020000 ? "#b#h ##k currently has #b"+ cm.getPlayer().getFPs() +"#k Points. How may I help you? #b\r\n#L0#I've caught a fish for you.#l\r\n#L1#There is an item that I need.#l" : "Just Think--the spotlight, the dancing, the music! I'm talking about my school talent show! And I, Gaga, will win! I know because, you see, Cassandra shared a big secret with me. There are supposedly types of fish that you can catch in the ocean known as: Beltin, Breakin, and Poppin. When eaten they transform you into an amazing signer or dancer!\r\nWould you, #b#h #,#k kindly go catch me#b a Beltin, a Breakin, and a Popping#k ? \b\r\n #L2##b Sure, I'll give you a hand!#k#l");
}
function action(m,s) {
var txt = ["Which fish would you like to give to me? #b\b", "#b#h ##k, you currently have #b"+ cm.getPlayer().getFPs() +"#k Points. Please select the item you wish to have. \b"];
if (m > 0) {
status++;
if (status == 1) {
for (var i = (s==0 ? 3 : 6); i < (s==0 ? 6 : 8); (s==0 ? txt[0] += "\r\n#L"+i+"##t"+(4001184+i)+"##l" : txt[1]+="\r\n#L"+i+"##b#v"+(i==6 ? 1072380:2049103)+"##t"+(i==6 ? 1072380:2049103)+"##l"), i++);
cm.sendSimple(txt[s==0 ?0:1]);
if(s==2) {
cm.warp(970020000);
cm.dispose();
}
} else if (status == 2) {
for(var i=3; i < 6; i++) {
if(s == i && cm.haveItem(4001184+i)) {
type = i-2;
cm.sendGetNumber("How many fish did you catch? \r\n #b< Total No. of #t400118"+(i+4)+"#(s) : #c"+(4001186-2+i)+"# >", cm.itemQuantity(4001186-2+i), 1, 30000);
}
}
if(s == 6 || s == 7) {
choice = (s==6 ? 1 : 2);
cm.sendYesNo("You need to have #b"+(s==6?300:100)+"#k Points in order to recieve "+(s==6 ?"" : "a")+"#t"+(s==6 ? 1072380:2049103)+"#. Are you sure you want that item?");
}
for(var i=3; i < 6; i++) {
if(s == i && !cm.haveItem(4001184+i) && choice == 0) {
cm.sendOk("Psst!! You don't have a single fish on you...");
cm.dispose();
}
}
} else if (status == 3) {
for(var i=1; i < 3; i++) {
if(choice == i && cm.getPlayer().getFPs() >= (i == 1 ? 300 : 100)) {
if(cm.canHold((i == 1 ? 1072380 : 2049103))){
cm.gainItem((i == 1 ? 1072380 : 2049103), 1);
cm.getPlayer().gainFPs(-(i == 1 ? 300 : 100));
cm.sendNext("You have #b"+ cm.getPlayer().getFPs() +"#k Points remaining. Have a nice day!");
cm.dispose();
choice = -1;
break;
} else {
cm.sendOk("Please make some room in your#b "+(i == 1 ? "Equip" : "Use")+" tab #kto recieve your prize.");
cm.dispose();
choice = -1;
break;
}
} else if(choice == 1 && cm.getPlayer().getFPs() < 300 || choice == 2 && cm.getPlayer().getFPs() < 100){
cm.sendOk("You don't have enough points to buy that item! \r\nPlease come back when you have the required points.");
cm.dispose();
break;
}
}
if(choice ==0) {
for(var i=0; i < 3; i++) {
if(type == 1+i) {
cm.gainItem(4001187 + i, -s);
gained = (i == 0 ? 1 : i == 1 ? 3 : 5)*s;
}
}
cm.getPlayer().gainFPs(gained);
cm.sendNext("Yay! Now I have the potential to win the talent show! I'll reserve you some points as a token of my gratitude. Now, with the #b"+gained+"Points#k you've recieved, you have accumulated a total of #b"+ cm.getPlayer().getFPs() +"#k Points. You can trade in your points for any item you need..");
cm.dispose();
}
}
} else {
cm.dispose();
}
}