Hello, the problem recently popped out of nowhere and I can't seem to find what's wrong in my script. The mapindex_name2id error is with the map poring_c01 after killing a Lucky Chest. Somehow, it interferes with the areawarp part of the script, making it unable to warp the player out of the map.
/*This script was made on the 25-07-2012. More mini-games will be
added later on. For now, there is only the "Lucky Chest" mini-game.
The mini-game is a tweaked script of my submission to the Dev. Team
but the concept remains the same. Coordinates, OnClock, NPCs, etc.
can be modified any time for updates and to suit the server's needs.
-Hylian/PiXLCAT*/
/*A big thank you to the LRO Community for the clown names.
Frankly, I suck at naming characters! Derp! -Hylian/PiXLCAT*/
/*@Lina: Since you're the one that tweak scripts, you can change
whatever you deem necessary, especially NPC/Warp/Mob coordinates and
OnClock times (those needs to be changed). Thanks a bunches! <3
-Hylian/PiXLCAT*/
//=====================NPC: JUGGLES=======================
prontera,220,184,3 script Juggles::jug_welcm 715,{
mes "[Juggles]";
mes "Step right up!";
next;
mes "[Juggles]";
mes "Step right up!";
mes "Don't be shy!";
next;
mes "[Juggles]";
mes "Step right up!";
mes "Don't be shy!";
mes "Try out our mini-games!";
close;
}
//=====================NPC: BOBO==========================
prontera,220,179,2 script Bobo::bo_welcm 715,{
mes "[bobo]";
mes "The mini-games that we have";
mes "currently are the followings...";
next;
switch(select("Lucky Chest:I'm not interested."))
{
case 1:
mes "[bobo]";
mes "Destroy the chest of your";
mes "choice to win a prize.";
next;
mes "[bobo]";
mes "Each chest contains a";
mes "different prize inside and";
mes "you have a time limit of";
mes "1 minute, so choose wisely!";
close;
case 2:
mes "[bobo]";
mes "Oh! How sad!";
emotion e_sob;
close;
}
}
//=====================NPC: WARP POINT====================
prontera,219,181,0 warp gamewarp0 2,2,poring_w02,94,200
//Lucky Chest mini-game warp.
//More to come once I have other game ideas.
//=====================NPC: GAME WARP=====================
prontera,219,181,0 script Game Warp::game_warp -1,{
end;
OnInit:
disablenpc "gamewarp0";
end;
//Starting time(s), can add and/or change.
OnClock1745:
announce "The Lucky Chest mini-game has started! Have fun!",bc_all,0xFFFF00;
enablenpc "gamewarp0";
end;
//Ending time(s), can add and/or change.
OnClock1755:
announce "The Lucky Chest mini-game has ended! Thank you for playing!",bc_all,0xFFFF00;
disablenpc "gamewarp0";
end;
}
//========================================================
//LUCKY CHEST MINI-GAME
//========================================================
//=======================WAITING ROOM=====================
poring_w02,96,200,5 script Bobo::lc_wait 715,{
end;
OnInit:
delwaitingroom "Lucky Chest";
waitingroom "Lucky Chest",8,"lc_wait::OnWarpToArea",1;
end;
OnWarpToArea:
setmapflag "poring_c01",mf_nomobloot;
setmapflag "poring_c01",mf_noskill;
setmapflag "poring_c01",mf_nosave;
warpwaitingpc "poring_c01",104,102;
initnpctimer "lc_game";
end;
}
//====================NPC: LC GAME========================
poring_c01,104,102,0 script LC Game::lc_game -1,{
end;
OnLCKill:
setarray .@i[0],671,1,671,2,671,3,512,1,513,1,514,1,515,1;
set .@j, rand(getarraysize(.@i)/2);
getitem .@i[2*.@j], .@i[2*.@j+1];
/*671: Gold Coin
512: Apple
513: Banana
514: Grape
515: Carrot*/
set $LCAmount, $LCAmount - 1;
if($LCAmount <= 8)
{
killmonsterall "poring_c01","lc_game::OnLCKill";
mapannounce "poring_C01","Come play again!",0;
areawarp "poring_c01",97,115,119,95,"prontera",158,185;
stopnpctimer "lc_game";
detachnpctimer "lc_game";
end;
}
OnTimer3000:
mapannounce "poring_c01","You have 1 minute to destroy the treasure chest of your choice.",0;
end;
OnTimer8000:
mapannounce "poring_c01","If lucky, you can get a pretty nice prize!",0;
end;
OnTimer13000:
mapannounce "poring_c01","Are you ready? Get set! Go!",0;
monster "poring_c01",100,102,"Lucky Chest",1348,1,"lc_game::OnLCKill";
monster "poring_c01",103,102,"Lucky Chest",1348,1,"lc_game::OnLCKill";
monster "poring_c01",106,102,"Lucky Chest",1348,1,"lc_game::OnLCKill";
monster "poring_c01",100,97,"Lucky Chest",1348,1,"lc_game::OnLCKill";
monster "poring_c01",103,97,"Lucky Chest",1348,1,"lc_game::OnLCKill";
monster "poring_c01",106,97,"Lucky Chest",1348,1,"lc_game::OnLCKill";
monster "poring_c01",100,92,"Lucky Chest",1348,1,"lc_game::OnLCKill";
monster "poring_c01",103,92,"Lucky Chest",1348,1,"lc_game::OnLCKill";
monster "poring_c01",106,92,"Lucky Chest",1348,1,"lc_game::OnLCKill";
end;
OnTimer88600:
mapannounce "poring_c01","Time's up! Come play again!",0;
killmonsterall "poring_c01","lc_game::OnLCKill";
areawarp "poring_c01",97,115,119,95,"prontera",158,185;
stopnpctimer "lc_game";
detachnpctimer "lc_game";
end;
OnPCLogoutEvent:
savepoint "prontera",158,185;
if($LCAmount <= 9)
{
killmonster "poring_c01","lc_game::OnLCKill";
stopnpctimer"lc_game";
detachnpctimer "lc_game";
end;
}
}
Question
PiXLCAT
Hello, the problem recently popped out of nowhere and I can't seem to find what's wrong in my script. The mapindex_name2id error is with the map poring_c01 after killing a Lucky Chest. Somehow, it interferes with the areawarp part of the script, making it unable to warp the player out of the map.
Bump.
Thanks for the codebox edit Arcenciel.
Edited by ArcencielCodeboxed
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.