PDA

View Full Version : Simple idea, perfered help.



Sir_Johnamus
06-11-2007, 04:51 PM
I would like to have an item script to attach to an item. The idea is for a weapon that increases in power when you lose hearts. If you have at most 1 heart left, the item's power tripples. And help would be nice, and if you don't want to, that's fine too.

Dan Furst
06-13-2007, 11:34 AM
I'm just guessing here, but you might be able to use Item->Class->Level to change the level of a sword if your HP is below a threshold. Something like:

item script PerilSword{
void run()
{
itemclass ic = this->Class;
if(Link->HP < (2*16)+1) // Link has 2 hearts or less
{
ic->Level = 4; // master sword
}
else
{
ic->Level = 1; // wooden sword
}
}
}

...but that probably won't actually change the power. I think you would need direct access to something like Item->Power, which isn't available yet.

Go ahead and play with it, though.

Sir_Johnamus
06-14-2007, 06:01 PM
Thanks. That works pretty well. Here's to waiting for direct access. I will use the script until then.