item script Killer
{
int RandNum = 0;
int RandNPC = 0;
int Magic = 192;
void run()
{
if (Link->MP >= Magic)
{
int ScrnNPC = Screen->NumNPCs();
if (ScrnNPC == 0)
{
Quit();
}
else if (ScrnNPC == 1)
{
npc RandNPC = Screen->LoadNPC (1);
RandNPC->HP = 0;
}
else if (ScrnNPC == 2)
{
RandNum = 1 + Rand(2);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
else if (ScrnNPC == 3)
{
RandNum = 1 + Rand(3);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
else if (ScrnNPC == 4)
{
RandNum = 1 + Rand(4);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
else if (ScrnNPC == 5)
{
RandNum = 1 + Rand(5);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
else if (ScrnNPC == 6)
{
RandNum = 1 + Rand(6);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
else if (ScrnNPC == 7)
{
RandNum = 1 + Rand(7);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
else if (ScrnNPC == 8)
{
RandNum = 1 + Rand(8);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
else if (ScrnNPC == 9)
{
RandNum = 1 + Rand(9);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
else if (ScrnNPC == 10)
{
RandNum = 1 + Rand(10);
npc RandNPC = Screen->LoadNPC (RandNum);
RandNPC->HP = 0;
}
Link->MP = Link->MP - Magic;
}
}
}
Yes, all those checks are necessary. It'll crash ZC if it finds an invalid NPC, so... Oh yeah, you might want to disable this in Guy rooms. Otherwise, you'll KILL the guy. :O I think. Oh well. Have fun. Oh yeah, I'm still open to more requests. However....
If you request an item from Twilight Princess, you WILL be denied! But only because I haven't beaten the game yet and have yet to see very many items....
Edit: Yay, got the Magic to work. This script now takes away Magic when used, but if you don't have enough magic when you use it..... NOTHING HAPPENS. Just like the Lens. :O By the way, new Variable: Magic. It's pre-defined at a whopping SIX WHOLE Magic Containers worth of Magic (192 units!), but if you think that's too harsh, you're welcome to change it. If you want whole containers, multiply 32 (Magic units in one Magic Container) by the number of containers to take away. 6 times 32 is 192, so.... That's where I got 192 from. Good luck using this....
Edit 2: Oopsie. I made a minor mistake on my part. The Magic check isn't supposed to fail if you have more than the required amount of Magic. XD
Edited by Matthew, 15 February 2007 - 07:34 PM.