Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

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

8 replies · 3,852 views · Started 17 February 2007

(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". 😛

// 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. 😊

Well done! Another spectacular script by Pikaguy! It is a great script indeed! Now time to look for your next task!

Din wrote: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....

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.

_L_ wrote: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

Amaster42 wrote: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...

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.