PDA

View Full Version : Reviving Enemies



_L_
12-17-2007, 09:10 AM
//
// "Reviving Enemy"
// When this enemy is defeated, another enemy will be created in its place
// after several frames.
//
// d0: the number of the starting enemy. This script uses LoadNPC().
// d1: the combo ID for the FFC to change to when the enemy dies.
// d2: the number of frames to wait before creating the new enemy.
// d3: the ID of the new enemy.
// d4: whether or not the new enemy will revive as well. 0 = no.
//
ffc script RevivingEnemy {
void run(int enemy, int deaddata, int delay, int newenemy, int recursive) {
Waitframes(10);
npc nme = Screen->LoadNPC(enemy);
bool cont = true;
while(cont)
{
while(nme->isValid())
{
this->X = nme->X;
this->Y = nme->Y;
Waitframe();
}
this->Data = deaddata;
Waitframes(delay);
nme = Screen->CreateNPC(newenemy);
nme->X = this->X;
nme->Y = this->Y;
this->Data = 0;
cont = recursive > 0;
}
}
}A few serving suggestions:

* The most obvious application is the Stalfos Knight. Set d1 to a "pile of bones" combo, and set the new enemy to another Stalfos.
* Or, alternatively, a Stalfos that leaves only a skull, which changes to a Bubble some time later.