Jump to content

Photo

Spawn a combo on enemy death


  • Please log in to reply
3 replies to this topic

#1 Warrior_of_Death

Warrior_of_Death

    Majora ban evasion

  • Banned

Posted 07 November 2011 - 02:26 PM

I'm using Saffith's Big Tektite script. All I wanna know is how to make a combo spawn at the tektite's place when it dies. if it matters, it uses a ghost enemy (but not ghost.zh), but for the sake of the script I just want a script that will spawn a combo (of any size but I don't think this'll be a problem), where it dies. the combo/tile will be a big explosion.

#2 Theryan

Theryan

    Burrito

  • Members

Posted 07 November 2011 - 02:58 PM

CODE

import "std.zh"

ffc script normalBossDeath
{
    void run(int boomSprite, int sfx,int num)
    {
        Waitframes(4);
        npc e = Screen->LoadNPC(num);
        Waitframe();
        if(e->isValid())
        {
            int eXend = e->TileWidth * 16;
            int eYend = e->TileHeight * 16;
            while(e->isValid())
            {
                    this->X = e->X;
                    this->Y = e->Y;
                    Waitframe();
            }
            lweapon l[80];
            if(!e->isValid())
            {
                for(int i=0;i<15;i++)
                {
                    l[i] = MakeExplosion(boomSprite, sfx, eXend, eYend, this);
                    l[i+15] = MakeExplosion(boomSprite, sfx, eXend, eYend, this);
                    l[i+30] = MakeExplosion(boomSprite, sfx, eXend, eYend, this);
                    l[i+45] = MakeExplosion(boomSprite, sfx, eXend, eYend, this);
                    l[i+65] = MakeExplosion(boomSprite, sfx, eXend, eYend, this);
                    Waitframes(10);
                }
            }
        }
    Waitframe();
    }

    lweapon MakeExplosion(int sprite, int sfx, int eXend, int eYend, ffc this)
    {
            lweapon l = Screen->CreateLWeapon(LW_SCRIPT1);
            l->UseSprite(sprite);
            l->X = this->X+Rand(eXend);
            l->Y = this->Y+Rand(eYend);
            l->DeadState = l->NumFrames*l->ASpeed;
            if(sfx > 0) Game->PlaySound(3);
    }
}

This is based off of something Joe123 wrote for me awhile ago, and it should work here.
D0 is the explosion sprite number, D1 is the explosion sound effect, and D2 is the number of the enemy on screen that will die.


#3 Warrior_of_Death

Warrior_of_Death

    Majora ban evasion

  • Banned

Posted 07 November 2011 - 04:44 PM

Wait does this use sprites or combos or tiles?

Also that "repeat explosion 3 times per second" is annoying as hell. how do I remove it?

Edited by Warrior_of_Death, 07 November 2011 - 05:25 PM.


#4 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 07 November 2011 - 05:58 PM

1. It uses weapon sprites (pick the bomb explosion sprite)
2. Change "waitframes(10)" to a higher value


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users