prt_are_in,98,14,3 script Givu#arena 728,{
// Some servers have custom MAX_INVENTORY defines. Default: 100
set .@max_il,100;
getinventorylist;
if(@inventorylist_count>=.@max_il || MaxWeight-Weight < 2000){
mes "- Wait a moment! -";
mes "- You're currently carrying -";
mes "- too many items with you. -";
mes "- Please lighten your weight -";
mes "- and try again. -";
close;
}
mes "[Givu]";
mes "Hello there. Welcome to the world of Arena.";
mes "My name is Givu, I am in charge of the arena point exchange program.";
next;
mes "[Givu]";
mes "You can exchange your arena points with various things.";
mes "Please choose a menu below.";
next;
switch(select("Exchange with Consumable items","Exchange with EXP points","Take a Souvenir Picture","Check Current Arena Points")){
case 1:
mes "[Givu]";
mes "What consumable item do you wish to exchange?";
next;
// IDs
setarray .@cid[1],518,526,522,547,605,608,607,603,617,616;
// Display Names
setarray .@ctype$[1],"Honey","Royal Jelly","Mastela Fruit","Condensed White Potion","Anodyne","Yggdrasil Seed","Yggdrasilberry","Old Blue Box","Old Purple Box","Old Card Album";
// I'm so nice, I even added the plural forms for purrrrttyyfffull display.
setarray .@cptype$[1],"Honeys","Royal Jellies","Mastela Fruits","Condensed White Potions","Anodynes","Yggdrasil Seeds","Yggdrasilberries","Old Blue Boxes","Old Purple Boxes","Old Card Albums";
// Price (In Points)
setarray .@cpri[1],20,30,30,30,20,20,40,100,300,1000;
// Amount at Once
setarray .@camt[1],5,5,5,8,3,1,1,1,1,1;
// Weight * 10
setarray .@cwgt[1],100,150,30,50,200,300,300,200,200,50;
set .@csel$,"";
for(set .@i,0; .@i<10; set .@i,.@i+1){
set .@csel$,.@csel$+.@ctype$[.@i+1];
if(.@i<9)
set .@csel$,.@csel$+":";
}
set .@ch,select(.@csel$);
if(.@camt[.@ch]<2)
set .@cname$,.@ctype$[.@ch];
else
set .@cname$,.@cptype$[.@ch];
mes "[Givu]";
mes "Would you like to exchange your arena points for "+.@cptype$[.@ch]+"?";
mes "You can exchange ^3131FF"+.@cpri[.@ch]+" arena points for "+.@camt[.@ch]+" "+.@ctype$[.@ch]+"^000000.";
mes "If you wish to cancel, please enter 0. If you don't, please enter how many ^3131FFtimes^000000 you wish to purchase.";
input .@pamt;
next;
if(.@pamt==0){
mes "[Givu]";
mes "You have canceled your request.";
close;
}
else if(MaxWeight-Weight<.@pamt*.@cwgt[.@ch]){
mes "[Givu]";
mes "You have exceeded the maximum weight capacity.";
close;
}
set .@total,.@cpri[.@ch]*.@pamt;
set .@gamt,.@camt[.@ch]*.@pamt;
if (.@total > arena_point){
mes "[Givu]";
mes "You do not have enough arena points.";
mes "Please check the total amount of arena points you have.";
close;
}
set arena_point,arena_point-.@total;
getitem .@cid[.@ch],.@pamt;
mes "[Givu]";
mes "Thank you, please come again.";
close;
break; // Good practice to denote the end of a case
case 2:
mes "[Givu]";
mes "Would you like to exchange your arena points with experience points?";
mes "It requires 40 arena points.";
next;
if(select("Cancel","Yes")==1){
mes "[Givu]";
mes "You have canceled your request.";
close;
}
if (arena_point < 40){
mes "[Givu]";
mes "You do not have enough arena points.";
mes "Please check the total amount of arena points you have.";
close;
}
set arena_point,arena_point-40;
if(BaseLevel < 70)
getexp 3000,0;
else if(BaseLevel < 80)
getexp 9000,0;
else if(BaseLevel < 90)
getexp 10000,0;
else if(BaseLevel < 100)
getexp 30000,0;
mes "[Givu]";
mes "You have gained experience points. Thank you.";
close;
case 3:
mes "[Givu]";
mes "You have chosen a souvenir picture services.";
next;
if(select("About souvenir Picture Services","Take a picture")==1){
mes "[Givu]";
mes "Do you see stairs at the right side of me?";
next;
mes "[Givu]";
mes "At the stairs, you can take a screenshot with an NPC or a monster.";
next;
mes "[Givu]";
mes "When you choose an NPC or a monster, it will show some emotion icons ^FF0000for 1 minute^000000.";
next;
mes "[Givu]";
mes "Don't miss the chance to take a picture with your favorite NPC!";
close;
}
if($@arenapic){
mes "[Givu]";
mes "Souvenir picture services are already in progress. Please wait.";
close;
}
// This technique seems to work rather well.
setarray .@pname$[1],"Baphomet","Dark Lord","Doppelganger","Eddga","Dracula","Samurai","Stormy Knight","Phreeoni","Assassin","Girls","Valkyrie";
// eAthena currently lacks a sprite changing command for NPCs.
// Instead of crudely using @disguise or whatnot,
// I'm forced to use multiple NPCs.
// These are the hidden parts of their name to access them.
// This part should be updated as soon as the classchange command works.
setarray .@psyn$[1],"bapho","daro","dopple","edga","dracula","samurai","wind","prioni","assassin","rori","val";
set .@mcho$,"";
for(set .@i,0; .@i<10; set .@i,.@i+1){
set .@mcho$,.@mcho$+.@pname$[.@i+1];
if(.@i<9)
set .@mcho$,.@mcho$+":";
}
mes "[Givu]";
mes "Please choose an NPC at below.";
mes "The NPC will appear for 1 minute and this service requires 10 arena points.";
next;
set .@ch,select(.@mcho$);
if (arena_point < 10){
mes "[Givu]";
mes "You do not have enough arena points.";
mes "Please check the total amount of arena points you have.";
close;
}
mes "[Givu]";
mes "Would you like to take a picture with a "+.@pname$[.@ch]+"?";
next;
if(select("Yes","No")==2){
mes "[Givu]";
mes "Would you like to consider a little longer?";
close;
}
// Silly Gravity forgot a second check.
if($@arenapic){
mes "[Givu]";
mes "Sorry, but someone snatched";
mes "the chance for a picture";
mes "when you were too busy deciding";
mes "who you wanted next to you.";
close;
}
set arena_point,arena_point-10;
set $@arenapic,1;
set $@pic_npc,.@ch;
if($@pic_npc==10){ // rori (ugh, what a pain)
enablenpc "#pic_"+.@psyn$[.@ch]+"1";
enablenpc "#pic_"+.@psyn$[.@ch]+"2";
enablenpc "#pic_"+.@psyn$[.@ch]+"3";
enablenpc "#pic_"+.@psyn$[.@ch]+"4";
}
else if($@pic_npc==2){ // dark lord makes an annoying sound
movenpc "#pic_"+.@psyn$[.@ch],96,28;
enablenpc "#pic_"+.@psyn$[.@ch];
}
else{
enablenpc "#pic_"+.@psyn$[.@ch];
}
doevent "pic_timer::OnGo";
mes "[Givu]";
mes "Thank you.";
close;
break;
case 4:
mes "[Givu]";
mes "Let me check "+strcharinfo(0)+"'s current arena points.";
next;
mes "[Givu]";
mes ""+strcharinfo(0)+" has total ^3131FF"+arena_point+"^000000 points.";
close;
break;
}
close;
end;
OnInit:
initnpctimer;
stopnpctimer;
setnpctimer 0;
startnpctimer;
end;
OnTimer0500:
setarray .psyn$[0],"holl","bapho","daro","dopple","edga","dracula","samurai","wind","prioni","assassin","rori","val";
for(set .@i,0; .@i<13; set .@i,.@i+1){ // Might cause a warning if the NPCs aren't enabled yet, but better than loose NPCs
if(.@i==10){ // rori >>
disablenpc "#pic_"+.psyn$[.@i]+"1";
disablenpc "#pic_"+.psyn$[.@i]+"2";
disablenpc "#pic_"+.psyn$[.@i]+"3";
disablenpc "#pic_"+.psyn$[.@i]+"4";
}
else if(.@i==2){ // dark lord makes an annoying sound
disablenpc "#pic_"+.psyn$[.@i];
movenpc "#pic_"+.psyn$[.@i],86,6;
}
else{
disablenpc "#pic_"+.psyn$[.@i];
}
}
stopnpctimer;
end;
}
prt_are_in,96,28,5 script #pic_holl 85,{
end;
OnEmo:
emotion getvariableofnpc(.enum,"pic_timer");
end;
}
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_bapho 736
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_daro 737
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_dopple 739
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_edga 1115
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_dracula 1389
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_samurai 1492
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_wind 1251
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_prioni 1159
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_assassin 725
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_rori1 714
prt_are_in,96,26,5 duplicate(#pic_holl) #pic_rori2 714
prt_are_in,100,28,5 duplicate(#pic_holl) #pic_rori3 714
prt_are_in,102,26,5 duplicate(#pic_holl) #pic_rori4 714
prt_are_in,96,28,5 duplicate(#pic_holl) #pic_val 811
prt_are_in,98,14,1 script pic_timer 139,{
end;
OnGo:
set .emo,1;
addtimer 1000,"pic_timer::OnExec";
end;
OnExec:
// Intervals = Wait-2,Speak-3,(Announce-2, 3-1, 2-1, 1-1,)x6,(Emo-5)x5,Emo-2,Announce-
set $@arenapic,$@arenapic+1;
switch($@arenapic-1){
case 2:
announce "Givu : You should keep time with popping emotion icons~",bc_map,0xFFCE00;
break;
case 5:
announce "Emoticon : "+.pemo$[.emo],bc_map,0xFFCE00;
break;
case 7:
announce " 3 ",bc_map,0xFFCE00;
break;
case 8:
announce " 2 ",bc_map,0xFFCE00;
break;
case 9:
announce " 1 ",bc_map,0xFFCE00;
break;
case 10:
set .enum,.pemon[.emo];
if($@pic_npc==10){ // rori >__>
doevent "#pic_"+.psyn$[$@pic_npc]+"1::OnEmo";
doevent "#pic_"+.psyn$[$@pic_npc]+"2::OnEmo";
doevent "#pic_"+.psyn$[$@pic_npc]+"3::OnEmo";
doevent "#pic_"+.psyn$[$@pic_npc]+"4::OnEmo";
break;
}
doevent "#pic_"+.psyn$[$@pic_npc]+"::OnEmo";
break;
case 12:
if(.emo==6){
OnStop:
set $@arenapic,0;
announce "Time is over. Thank you for using my services.",bc_map,0xFFCE00;
if($@pic_npc==10){
disablenpc "#pic_"+.psyn$[$@pic_npc]+"1";
disablenpc "#pic_"+.psyn$[$@pic_npc]+"2";
disablenpc "#pic_"+.psyn$[$@pic_npc]+"3";
disablenpc "#pic_"+.psyn$[$@pic_npc]+"4";
}
else if(.@i==2){ // dark lord makes an annoying sound
disablenpc "#pic_"+.psyn$[.@i];
movenpc "#pic_"+.psyn$[.@i],86,6;
}
else{
disablenpc "#pic_"+.psyn$[$@pic_npc];
}
end;
}
break;
case 14:
set $@arenapic,5;
set .emo,.emo+1;
break;
}
addtimer 1000,"pic_timer::OnExec";
end;
OnInit:
setarray .psyn$[0],"holl","bapho","daro","dopple","edga","dracula","samurai","wind","prioni","assassin","rori","val";
setarray .pemo$[1],"/lv","/gawi","/no1","/huk","/gg","/lv2"; // I guess Huk is fist? (korean girlfriends = win)
setarray .pemon[1],3,10,21,11,29,14;
setarray .pcount$[1]," 1 "," 2 "," 3 ";
set $@arenapic,0;
end;
}