const int SLM_COMBO = 416; //Slime combo
const int SLM_SOUND = 62; //Sound when the slime shoots a smaller slime
const int SLM_ZOL = 178; //ID of the Zol to spawn
const int SLM_BIGSHADOW = 421; //Combo for big shadows.
const int SLM_SHADOW = 420; //Combo for small shadows.
const int SLM_EXPLODE = 63; //Sound when slime explodes.
ffc script slime
{
void run()
{
eweapon wpn;
eweapon wpn2;
eweapon wpn3;
npc ghost;
int frame = 0;
//Swap to invisible combo temporarily
this->Data = 0;
ghost=GhostInitWait(this,1,false,SLM_COMBO);
while(true)
{
frame ++;
if(frame%120 == 0)
{
wpn = FireAimedEWeapon(EW_SCRIPT1 ,CenterX(this),CenterY(this),0,50,4,false,SLM_BALL,false,SLM_SOUND,2);
SetEWeaponMovement(wpn,EWM_THROW,Rand2(25,60)/10);
SetEWeaponDeathEffect(wpn,EWD_VANISH,0);
wpn2 = FireAimedEWeapon(EW_SCRIPT1,CenterX(this),CenterY(this),DegtoRad(45),50,4,false,SLM_BALL,false,0,2);
SetEWeaponMovement(wpn2,EWM_THROW,Rand2(25,60)/10);
SetEWeaponDeathEffect(wpn2,EWD_VANISH,0);
wpn3 = FireAimedEWeapon(EW_SCRIPT1,CenterX(this),CenterY(this),DegtoRad(360-45),50,4,false,SLM_BALL,false,0,2);
SetEWeaponMovement(wpn3,EWM_THROW,Rand2(25,60)/10);
SetEWeaponDeathEffect(wpn3,EWD_VANISH,0);
}
SlimWaitFrame(this,ghost,1);
}
}
void SlimWaitFrame(ffc this, npc ghost, int numframes)
{
eweapon wpn;
if(GotHit(this))
{
wpn = FireAimedEWeapon(EW_SCRIPT1,CenterX(this),CenterY(this),0,50,4,false,SLM_BALL,false,SLM_SOUND,2);
SetEWeaponMovement(wpn,EWM_THROW,Rand2(25,60)/10);
SetEWeaponDeathEffect(wpn,EWD_SPAWN_NPC,SLM_ZOL);
if(ghost->HP<1000)
{
// Randomly placed harmless explosions
lweapon explosion;
this->CSet=this->Misc[GHI_BASE_CSET];
ghost->Y=176;
this->Vx=0;
this->Vy=0;
for(int i=0; i<10; i++)
{
explosion=Screen->CreateLWeapon(LW_BOMBBLAST);
explosion->X=Rand2(this->X, this->X+16*this->TileWidth);
explosion->Y=Rand2(this->Y, this->Y+32);
explosion->CollDetection=false;
Waitframes(30);
GhostWaitframeF(this,ghost,true,false);
}
// Kill NPC and clear combos
Game->PlaySound(SLM_EXPLODE);
ghost->HP=-1000;
this->Data=0;
Quit();
}
}
GhostWaitframeN(this,ghost,true,false);
}
}
I get a whole whack of errors, saying that various functions aren't declared. (IsWater, IsPit, Round, CenterX, CenterY as a few examples) Now, if memory serves, there's something in here that's absolute in my script. I did add the flags bit to the fire EWeapon thing, though I don't think I did it right. Anyways, any help is greatly appreciated. With the added shadows, I decided to fix it up and once that's done, I'll release it for public use.