I wrote up an item alternator script. Basically, the purpose of this script is to allow for some weapon variations... For example, I set up two swords, attach this script to both, have have them reference each other. One sword is set to stab only, the other is set to slash. Now, when link attacks, he randomly gets either a slash -or- a stab. For kicks, I tweaked the stab to do more damage than the slash, to compensate for reduced attack area. Pretty nifty. The rate at which they swap can also be tweaked. I'm sure someone can think of some nifty things to do with this... I know I've already thought of a few...
Anyways, heres the script.
CODE
//Sword strike alternator Item script
//This script causes a weapon to randomly change to the input item number when used, and remove the current item from links inventory
//for best use, attatch to two weapons and cycle between them (but thats not the only use ^^)
//Script by Xiion
item script alternator
{
void run(int new_item, int current_item, int rand_rate)
// new_item: this is the item number of the item you want to switch to
// current_item: this is the item number of the item that will be removed when the script is triggered
// rand_rate: gives a 1:rand_rate rate of change. higher values make the change less frequent
{
if (Rand(rand_rate)<=1) // alter values to adjust frequency of change
{
Link->Item[current_item] = 0;
Link->Item[new_item] =1;
}
}
}
//This script causes a weapon to randomly change to the input item number when used, and remove the current item from links inventory
//for best use, attatch to two weapons and cycle between them (but thats not the only use ^^)
//Script by Xiion
item script alternator
{
void run(int new_item, int current_item, int rand_rate)
// new_item: this is the item number of the item you want to switch to
// current_item: this is the item number of the item that will be removed when the script is triggered
// rand_rate: gives a 1:rand_rate rate of change. higher values make the change less frequent
{
if (Rand(rand_rate)<=1) // alter values to adjust frequency of change
{
Link->Item[current_item] = 0;
Link->Item[new_item] =1;
}
}
}
Anyways, there you go. Ask if you have questions, let me know if you see an improvement. Have fun!