Okay here it is. It's pretty easy to use. Just place a ffc ontop of a solid combo. And set the arguments as such: D0 = the damage in quarter hearts, D1 = the delay in frames between link using the sword and shooting a fireball, D2 = the speed of the fireball, D3 should be set to 0 if you want it to shoot directly at link, otherwise set it to 1 for 4 way aiming., and finally D4 is the sound to play when a shot is fired.
CODE
ffc script FireballShooter{
void run(int damage, int delay, int speed, bool fourway, int firingsound){
while(true){
if(attacking()){
Waitframes(delay);
eweapon fireball= CreateEWeaponAt(EW_FIREBALL, this->X, this->Y);
fireball->Damage = damage;
if(!fourway){
fireball->Angular = true;
fireball->Angle = DegtoRad(Angle(this->X,this->Y,Link->X,Link->Y));
fireball->Dir = RadianAngleDir8(WrapAngle(fireball->Angle));
}
else if(CenterLinkX() < this->X) fireball->Dir = DIR_LEFT;
else if(CenterLinkX() >= this->X + 16) fireball->Dir = DIR_RIGHT;
else if(CenterLinkX() < this->Y) fireball->Dir = DIR_UP;
else if(CenterLinkX() >= this->Y + 16) fireball->Dir = DIR_DOWN;
fireball->Step = speed;
Game->PlaySound(firingsound);
}
Waitframe();
}
}
bool attacking(){
bool slashed = false;
int swords[4] = {I_SWORD1, I_SWORD2, I_SWORD3, I_SWORD4};
for(int i; i < SizeOfArray(swords); i++){
if((GetEquipmentA() == swords[i] && Link->PressA) || (GetEquipmentB() == swords[i] && Link->PressB)) slashed = true;
}
return(slashed);
}
}
EDIT About the array, the number 4 should be the number of swords in the game and the intergers of the array should be the IDs of the items. It's set up so the default four swords trigger the firing of fireballs. You can change this though if you have custom swords.
Edited by blackbishop89, 30 July 2011 - 09:47 AM.