QUOTE
1) An FFC script that plays background ambiance sfx, preferably with an option to set how many can be played and how many frames to wait before playing each one.
D0 is the sound, D1 is the time.
CODE
ffc script SoundPlayer
{
void run(int sound, int loopTime)
{
while(true)
{
Game->PlaySound(sound);
Waitframes(loopTime);
}
}
}
QUOTE
2) An item script that will make the sword flash when the spin attack is charged. This would most likely be attached to the spin attack scroll.
Can't be done with an item script. Has to be global.
CODE
int swordChargeTime;
global script SwordFlash
{
void run()
{
while(true)
{
DoSwordFlash();
Waitframe();
}
}
void DoSwordFlash()
{
if(Link->Action==LA_CHARGING)
{
swordChargeTime++;
if(swordChargeTime==63)
{
lweapon sword;
for(int i=Screen->NumLWeapons(); i>0; i--)
{
sword=Screen->LoadLWeapon(i);
if(sword->ID!=LW_SWORD)
continue;
sword->Flash=true;
return;
}
}
}
else if(swordChargeTime!=0)
{
swordChargeTime=0;
lweapon sword;
for(int i=Screen->NumLWeapons(); i>0; i--)
{
sword=Screen->LoadLWeapon(i);
if(sword->ID!=LW_SWORD)
continue;
sword->Flash=false;
sword->CSet=sword->OriginalCSet;
return;
}
}
}
}