PDA

View Full Version : Item-3: Destruction Machine (Lame name, huh?)



Nimono
02-17-2007, 01:18 PM
(Copied-and-Pasted from original post at PureZC, with minor adjustments...)

Well, ignore the lame name for this script. The only other name I had for it was "Random Killer", and that didn't sound very good. This sounds a bit better. Variable "Magic" is the magic required to use this item, in 32nds of a Magic Container. Want to use whole containers? Multiply 32 by the number of containers you wish to use and tack that on as the value of variable "Magic". :p


// Destruction Machine- This item randomly kills one enemy in the current room.

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.

Okay, I need to say this: NO ONE HAS BEEN ABLE TO SHORTEN THIS SCRIPT AND MAKE IT WORK. If you think you can figure out a way to shorten this script, TEST IT FIRST BEFORE SENDING IT TO ME. I always got the exact same result from those at PureZC: The script failed to do anything but take away magic... So please, TEST THE SCRIPT BEFORE SENDING A "SHORTENED" VERSION TO ME. I'm getting quite annoyed at all the so-called "shortened" versions that don't work at all. -_- And why did I not post this here when I released it at PureZC? ...I didn't think it'd be right. XD But I decided to now. :)

Din
02-17-2007, 02:02 PM
Well done! Another spectacular script by Pikaguy! It is a great script indeed! Now time to look for your next task!

Nimono
02-17-2007, 02:08 PM
Well done! Another spectacular script by Pikaguy! It is a great script indeed! Now time to look for your next task!

Not for you, or anyone else, to know. >:P I'm keeping THAT a surprise..... By the way, check out my miniscript if you haven't already....

_L_
02-24-2007, 11:26 PM
Nifty!

(I'd have called it a "Voodoo Doll", though.)

Toss in some graphical effects, and you're on your way to implementing the Ether medallion.

Nimono
02-24-2007, 11:32 PM
Nifty!

(I'd have called it a "Voodoo Doll", though.)

Toss in some graphical effects, and you're on your way to implementing the Ether medallion.

What? ....I don't exactly remember the effects of the Ether Medallion besides revealing "invisible" floors. Oh yeah, and what's with you and the word "nifty"? You remind me of a certain episode of Xiaolin Showdown. XD

The_Amaster
02-24-2007, 11:35 PM
Thats warm, dode(Think Omi).

Seriously, "Item Dev."

Nimono
02-24-2007, 11:37 PM
Thats warm, dode(Think Omi).

Seriously, "Item Dev."

You watch it, too?

But, uh... I'm not so sure they'd accept me yet. They've already said once before at PureZC's chat that they've got enough devs right now. But who knows? Maybe I will get to be a dev. But will it happen by 2.5? ....It is a mystery...

Sir_Johnamus
07-04-2007, 01:29 PM
Ether medallion blew up all enemies on the screen, as well as lighting up floors. I loved that thing.

Great job with teh scrip, I love all the ones you've done.

An idea: It just seems to good. How about adding a small chance that LInk wil be struck doing heart damage? Just my 3 cents.

ShadowTiger
07-04-2007, 07:32 PM
FYI, Pikaguy is moving around the country at the moment.

BTW nice Bump. :blah: