Jump to content

Photo

Gleeok's Script Emporium


  • Please log in to reply
27 replies to this topic

#16 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 06 March 2008 - 01:55 AM

Section 2/3 continued:
CODE
        // =================================
        //               MAKANITO
        // =================================

            else if(this_ffc->Data == makanito){

                if(makanito_level == 1){damage = 1;}
                if(makanito_level == 2){damage = 2;}
                if(makanito_level == 3){damage = 3;}
                this_ffc->TileWidth = 2;
                this_ffc->TileHeight = 2;

                if ( (this_ffc->X < 0) || (this_ffc->X > 240) || (this_ffc->Y > 160) || (this_ffc->Y < 0)){

                    this_ffc->Data = 1;
                    this_ffc->CSet = 0;
                    this_ffc->X = 16;
                    this_ffc->Y = 16;
                    this_ffc->TileWidth = 1;
                    this_ffc->TileHeight = 1;
                }

                int tx = this_ffc->X;
                int ty = this_ffc->Y;

                enemy_number = Screen->NumNPCs();
                while(enemy_number > 0){
            
                    enemy = Screen->LoadNPC(enemy_number);

                    int en_x = enemy->X;
                    int en_y = enemy->Y;

                    if( (Screen->ComboS[ComboAt(tx+8, ty+8)] == 0) &&
                        !(enemy->Tile==0)  ){
                        
                        if((tx > en_x) && (tx < en_x+32)
                            && (ty > en_y-32) && (ty < en_y+32)){enemy->X++;
                        }
                        else{
                            if((tx < en_x) && (tx > en_x-32)
                                && (ty > en_y-32) && (ty < en_y+32)){enemy->X--;
                            }
                        }
                        if((ty > en_y) && (ty < en_y+32)
                            && (tx > en_x-32) && (tx < en_x+32)){enemy->Y++;
                        }
                        else{
                            if((ty < en_y) && (ty > en_y-32)
                                && (tx > en_x-32) && (tx < en_x+32)){enemy->Y--;
                            }
                        }
                    }
                    if(Abs( (tx+8)-en_x)<=16 && Abs( (ty+8)-en_y)<=16 && !(enemy->Tile==0)){

                        if(enemy_1_damaged_counter == 0){
                            enemy_1_damaged = enemy;  enemy_1_damaged_counter = 30; enemy_1_cset = enemy->CSet;Game->PlaySound(11);
                        }
                        else{
                            if(enemy_2_damaged_counter == 0){
                                if(enemy != enemy_1_damaged){
                                    enemy_2_damaged = enemy;  enemy_2_damaged_counter = 30; enemy_2_cset = enemy->CSet;Game->PlaySound(11);
                                }
                            }
                            else{
                                if(enemy_3_damaged_counter == 0){
                                    if(enemy != enemy_1_damaged && enemy != enemy_2_damaged){
                                        enemy_3_damaged = enemy;  enemy_3_damaged_counter = 30; enemy_3_cset = enemy->CSet;Game->PlaySound(11);
                                    }
                                }
                                else{
                                    if(enemy_4_damaged_counter == 0){
                                        if(enemy != enemy_1_damaged && enemy != enemy_2_damaged && enemy != enemy_3_damaged){
                                            enemy_4_damaged = enemy;  enemy_4_damaged_counter = 30; enemy_4_cset = enemy->CSet;Game->PlaySound(11);
                                        }    
                                    }
                                    else{
                                        enemy_number = 1;    
                                    }
                                }
                            }
                        }
                    }    
                    enemy_number--;
                }    
            }
        


Oops! Here's the item script for this one!

CODE
//========================================================
//            ITEM SCRIPT MAKANITO
// translation: deadly air
// It creates a vacuum that sucks in nearby enemies
// and can kill them instantly.
// At a high level this is probably the most powerful
// attack in the game. exp must be set accordingly.
// D0 - the CSet of the projectile
//=========================================================


item script Makanito{

    void run (int cset){

        int deadly_air_combo = 116;    
        ffc deadly_air = Screen->LoadFFC(6);    

        if (makanito_level == 1){

            Game->PlaySound(11);
            makanito_exp++;

            if(Link->Dir == 0) {
                deadly_air->X = Link->X - 8;
                deadly_air->Y = Link->Y - 16;
                deadly_air->Vy = -1;
                deadly_air->Vx = 0;
                deadly_air->Data = deadly_air_combo;
                deadly_air->CSet = cset;
                deadly_air->TileWidth = 2;
                deadly_air->TileHeight = 2;
            }
            if(Link->Dir == 1) {
                deadly_air->X = Link->X - 8;
                deadly_air->Y = Link->Y + 16;
                deadly_air->Vy = 1;
                deadly_air->Vx = 0;
                deadly_air->Data = deadly_air_combo;
                deadly_air->CSet = cset;
                deadly_air->TileWidth = 2;
                deadly_air->TileHeight = 2;
            }
            if(Link->Dir == 2) {
                deadly_air->X = Link->X - 16;
                deadly_air->Y = Link->Y - 8;
                deadly_air->Vx = -1;
                deadly_air->Vy = 0;
                deadly_air->Data = deadly_air_combo;
                deadly_air->CSet = cset;
                deadly_air->TileWidth = 2;
                deadly_air->TileHeight = 2;
            }
            if(Link->Dir == 3) {
                deadly_air->X = Link->X + 16;
                deadly_air->Y = Link->Y - 8;
                deadly_air->Vx = 1;
                deadly_air->Vy = 0;
                deadly_air->Data = deadly_air_combo;
                deadly_air->CSet = cset;
                deadly_air->TileWidth = 2;
                deadly_air->TileHeight = 2;
            }
        }
        else{

        if (makanito_level == 2){

            Game->PlaySound(35);
            makanito_exp++;

            if(Link->Dir == 0) {
                deadly_air->X = Link->X;
                deadly_air->Y = Link->Y - 16;
                deadly_air->Vy = -1;
                deadly_air->Vx = 0;
                deadly_air->Data = deadly_air_combo+1;
                deadly_air->CSet = cset;
            }
            if(Link->Dir == 1) {
                deadly_air->X = Link->X;
                deadly_air->Y = Link->Y + 16;
                deadly_air->Vy = 1;
                deadly_air->Vx = 0;
                deadly_air->Data = deadly_air_combo+1;
                deadly_air->CSet = cset;
            }
            if(Link->Dir == 2) {
                deadly_air->X = Link->X - 16;
                deadly_air->Y = Link->Y;
                deadly_air->Vx = -1;
                deadly_air->Vy = 0;
                deadly_air->Data = deadly_air_combo+1;
                deadly_air->CSet = cset;
            }
            if(Link->Dir == 3) {
                deadly_air->X = Link->X + 16;
                deadly_air->Y = Link->Y;
                deadly_air->Vx = 1;
                deadly_air->Vy = 0;
                deadly_air->Data = deadly_air_combo+1;
                deadly_air->CSet = cset;
            }
        }
        else{

        if (makanito_level == 3){

            Game->PlaySound(35);
            makanito_exp++;

            if(Link->Dir == 0) {
                deadly_air->X = Link->X;
                deadly_air->Y = Link->Y - 16;
                deadly_air->Vy = -1;
                deadly_air->Vx = 0;
                deadly_air->Data = deadly_air_combo+2;
                deadly_air->CSet = cset;
            }
            if(Link->Dir == 1) {
                deadly_air->X = Link->X;
                deadly_air->Y = Link->Y + 16;
                deadly_air->Vy = 1;
                deadly_air->Vx = 0;
                deadly_air->Data = deadly_air_combo+2;
                deadly_air->CSet = cset;
            }
            if(Link->Dir == 2) {
                deadly_air->X = Link->X - 16;
                deadly_air->Y = Link->Y;
                deadly_air->Vx = -1;
                deadly_air->Vy = 0;
                deadly_air->Data = deadly_air_combo+2;
                deadly_air->CSet = cset;
            }
            if(Link->Dir == 3) {
                deadly_air->X = Link->X + 16;
                deadly_air->Y = Link->Y;
                deadly_air->Vx = 1;
                deadly_air->Vy = 0;
                deadly_air->Data = deadly_air_combo+2;
                deadly_air->CSet = cset;
            }
        }
        else{

        if (makanito_level == 4){

            Game->PlaySound(35);
            makanito_exp++;

            if(Link->Dir == 0) {
                deadly_air->X = Link->X;
                deadly_air->Y = Link->Y - 16;
                deadly_air->Vy = -1;
                deadly_air->Vx = 0;
                deadly_air->Data = deadly_air_combo+3;
                deadly_air->CSet = cset;
            }
            if(Link->Dir == 1) {
                deadly_air->X = Link->X;
                deadly_air->Y = Link->Y + 16;
                deadly_air->Vy = 1;
                deadly_air->Vx = 0;
                deadly_air->Data = deadly_air_combo+3;
                deadly_air->CSet = cset;
            }
            if(Link->Dir == 2) {
                deadly_air->X = Link->X - 16;
                deadly_air->Y = Link->Y;
                deadly_air->Vx = -1;
                deadly_air->Vy = 0;
                deadly_air->Data = deadly_air_combo+3;
                deadly_air->CSet = cset;
            }
            if(Link->Dir == 3) {
                deadly_air->X = Link->X + 16;
                deadly_air->Y = Link->Y;
                deadly_air->Vx = 1;
                deadly_air->Vy = 0;
                deadly_air->Data = deadly_air_combo+3;
                deadly_air->CSet = cset;
            }
        
        
        }}}} //end of else statements
    }
}



Edited by Gleeok, 06 March 2008 - 02:07 AM.


#17 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 06 March 2008 - 02:10 AM

CODE
        //================================
        //           MANIFO
        //================================

            else if(this_ffc->Data == manifo){

                is_held1 = 0; is_held2 = 0; is_held3 = 0; is_held4 = 0;
                this_ffc->Data++;
                
            }

            else if(this_ffc->Data == manifo+1){
    
                if ((this_ffc->X < 8) || (this_ffc->X > 240) || (this_ffc->Y > 160) || (this_ffc->Y < 8)){

                    this_ffc->Data = 1;
                    this_ffc->CSet = 0;
                    wobble = 0;
                    initialize = 0;
                    this_ffc->X = 16;
                    this_ffc->Y = 16;
                }

                int tx = this_ffc->X;
                int ty = this_ffc->Y;
                int lx = Link->X;
                int ly = Link->Y;
                enemy_number = Screen->NumNPCs();

                while(enemy_number > 0){
            
                    enemy = Screen->LoadNPC(enemy_number);

                    int en_x = enemy->X;
                    int en_y = enemy->Y;


                    if (    (tx - 12 < en_x) && (tx + 12 > en_x) &&
                        (ty - 12 < en_y) && (ty + 12 > en_y) &&
                        (!(enemy->Tile==0) )){
                
                        // these are stored in global variables(oops! not anymore...bugs)

                        if(is_held1 == 0){
                            statue1 = enemy;
                            held1_x = enemy->X;
                            held1_y = enemy->Y;
                            is_held1 = 1; cast_manifo = true;
                        }
                        else{
                            if(manifo_level >=2){
                                if(is_held2 == 0){
                                    if(statue1 != enemy){
                                        statue2 = enemy;
                                        held2_x = enemy->X;
                                        held2_y = enemy->Y;
                                        is_held2 = 1; cast_manifo = true;
                                    }
                                }
                                else{
                                    if(manifo_level >=3){
                                        if(is_held3 == 0){
                                            if(statue1 != enemy && statue2 != enemy){
                                                statue3 = enemy;
                                                held3_x = enemy->X;
                                                held3_y = enemy->Y;
                                                is_held3 = 1; cast_manifo = true;
                                            }
                                        }
                                        else{
                                            if(manifo_level ==4){
                                                if(is_held4 == 0){
                                                    if(statue1 != enemy && statue2 != enemy && statue3 != enemy){
                                                        statue4 = enemy;
                                                        held4_x = enemy->X;
                                                        held4_y = enemy->Y;
                                                        is_held4 = 1; cast_manifo = true;
                                                        this_ffc->Data = 1;
                                                        this_ffc->CSet = 0;
                                                        this_ffc->X = 16;
                                                        this_ffc->Y = 16;
                                                        enemy_number = 1;
                                                    }
                                                }
                                            }
                                            else{
                                                enemy_number = 1;this_ffc->Data = 1;this_ffc->X = 16;this_ffc->Y=16;
                                            }
                                        }
                                    }
                                    else{
                                        enemy_number = 1;this_ffc->Data = 1;this_ffc->X = 16;this_ffc->Y=16;
                                    }
                                }
                            }
                            else{
                                enemy_number = 1;this_ffc->Data = 1;this_ffc->X = 16;this_ffc->Y=16;
                            }
                        }
                    }//end npc proximity check

                enemy_number--;

                }//end while npc loop
            }

ADDED EFFECTS FOR MANIFO:
You need this.
CODE
        //==================================
        //    MANIFO HOLD EFFECT
        //==================================
        
            if(cast_manifo){

                if(is_held1 == 1){

                    if(statue1->isValid()){

                        statue1->X = held1_x;
                        statue1->Y = held1_y;
                    }
                    else{
                        is_held1 = 0;
                    }
                }
                if(is_held2 == 1){

                    if(statue2->isValid()){

                        statue2->X = held2_x;
                        statue2->Y = held2_y;
                    }
                    else{
                        is_held2 = 0;
                    }
                }
                if(is_held3 == 1){

                    if(statue3->isValid()){

                        statue3->X = held3_x;
                        statue3->Y = held3_y;
                    }
                    else{
                        is_held3 = 0;
                    }
                }
                if(is_held4 == 1){

                    if(statue4->isValid()){

                        statue4->X = held4_x;
                        statue4->Y = held4_y;
                    }
                    else{
                        is_held4 = 0;
                    }
                }
                if(is_held1 == 0 && is_held2 == 0 && is_held3 == 0 && is_held4 == 0){

                    cast_manifo = false;
                }
            }


CODE

        // =================================
        //               LABADI
        // =================================

            else if(this_ffc->Data == labadi){

                this_ffc->TileWidth = 1;
                this_ffc->TileHeight = 1;

                this_ffc->X = Link->X;
                this_ffc->Y = Link->Y;
                this_ffc->Vx = 0;
                this_ffc->Vy = 0;
                this_ffc->TileWidth = 1;
                this_ffc->TileHeight = 1;

                if(life_steal == false){
            
                    int lx = Link->X;
                    int ly = Link->Y;
                    int tx = this_ffc->X;
                    int ty = this_ffc->Y;

                    enemy_number = Screen->NumNPCs();

                    if(enemy_number == 0){
                        this_ffc->Data = 1;
                        this_ffc->CSet = 0;
                        this_ffc->X = 16;
                        this_ffc->Y = 16;
                    }
                    while(enemy_number > 0){
            
                        enemy = Screen->LoadNPC(enemy_number);

                        int en_x = enemy->X;
                        int en_y = enemy->Y;

                        if(Link->Dir == 0){
                            if(en_y < ly && Abs(lx-en_x)<=8 && !(enemy->Tile==0)){
                                this_ffc->X = en_x;
                                this_ffc->Y = en_y;
                                life_steal = true;
                                enemy_number = 1;
                                drained = enemy;
                            }
                        }
                        if(Link->Dir == 1){
                            if(en_y > ly && Abs(lx-en_x)<=8 && !(enemy->Tile==0)){
                                this_ffc->X = en_x;
                                this_ffc->Y = en_y;
                                life_steal = true;
                                enemy_number = 1;
                                drained = enemy;
                            }
                        }
                        if(Link->Dir == 2){
                            if(en_x < lx && Abs(ly-en_y)<=8 && !(enemy->Tile==0)){
                                this_ffc->X = en_x;
                                this_ffc->Y = en_y;
                                life_steal = true;
                                enemy_number = 1;
                                drained = enemy;
                            }    
                        }
                        if(Link->Dir == 3){
                            if(en_x > lx && Abs(ly-en_y)<=8 && !(enemy->Tile==0)){
                                this_ffc->X = en_x;
                                this_ffc->Y = en_y;
                                life_steal = true;
                                enemy_number = 1;
                                drained = enemy;
                            }
                        }
                        enemy_number--;

                        if(enemy_number == 0 && life_steal == false){
                            this_ffc->Data = 1;
                            this_ffc->CSet = 0;
                            this_ffc->X = 16;
                            this_ffc->Y = 16;
                        }
                    }
                }
                if(life_steal){
    
                    this_ffc->X = drained->X;
                    this_ffc->Y = drained->Y;
                    life_steal = false;
                    this_ffc->Data = labadi + 1;
                    drained->HP -= labadi_level*2.0;
                    Game->PlaySound(11);
                }
            }

            else if(this_ffc->Data == labadi + 1){

    
                if ((this_ffc->X < 8) || (this_ffc->X > 240) || (this_ffc->Y > 160) || (this_ffc->Y < 8)){
                    this_ffc->Data = 1;
                    this_ffc->CSet = 0;
                    this_ffc->X = 16;
                    this_ffc->Y = 16;
                }
                life_steal = false;
    
                if(labadi_level == 1){
                    if(Link->X > this_ffc->X){this_ffc->X++;}
                    if(Link->X < this_ffc->X){this_ffc->X--;}
                    if(Link->Y > this_ffc->Y){this_ffc->Y++;}
                    if(Link->Y < this_ffc->Y){this_ffc->Y--;}
                }
                if(labadi_level == 2){
                    if(Link->X > this_ffc->X){this_ffc->X+=1.3;}
                    if(Link->X < this_ffc->X){this_ffc->X-=1.3;}
                    if(Link->Y > this_ffc->Y){this_ffc->Y+=1.3;}
                    if(Link->Y < this_ffc->Y){this_ffc->Y-=1.3;}
                }
                if(labadi_level == 3){
                    if(Link->X > this_ffc->X){this_ffc->X+=1.6;}
                    if(Link->X < this_ffc->X){this_ffc->X-=1.6;}
                    if(Link->Y > this_ffc->Y){this_ffc->Y+=1.6;}
                    if(Link->Y < this_ffc->Y){this_ffc->Y-=1.6;}
                }
                if(labadi_level >= 4){
                    if(Link->X > this_ffc->X){this_ffc->X+=2;}
                    if(Link->X < this_ffc->X){this_ffc->X-=2;}
                    if(Link->Y > this_ffc->Y){this_ffc->Y+=2;}
                    if(Link->Y < this_ffc->Y){this_ffc->Y-=2;}
                }
                if( (Abs(Link->X-this_ffc->X)<=4)&&(Abs(Link->Y-this_ffc->Y)<=4) ){

                    Game->PlaySound(36);
                    Link->HP += labadi_level*4.0;
                    this_ffc->Data = 1;
                    this_ffc->CSet = 0;
                    this_ffc->X = 16;
                    this_ffc->Y = 16;
                }
            }
    

Edited by Gleeok, 06 March 2008 - 02:09 AM.


#18 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 06 March 2008 - 02:21 AM

1. HEADERS AND D[] VARIABLES.

Example header:
QUOTE

//D1 enemy HP
//D2 enemy speed
//D3 bubble speed
//D4 the combos to be used as bubble projectiles
//D5 the cset of the bubble projectiles
//D6 0=constant movement, 1=randomly stops for a short time


Some of the scripts have headers, such as above, some do not. This simply explains what you need to set it up initially. These are input on the arguments tab under ffc's. (or now items) . This example is pretty straight forward, you should be able to figure out what these do without much trouble. You might be thinking what D[4], the combos to be used as bubble projectiles, means. Simple. You just combo the sprites you want to use as projectiles and input the combo number in the box.

Some scripts don't have a header but are REALLY simple to use. for example:
CODE

ffc script E_leever_spawner{

        void run(int enemy_max){

In this script all you have to do is look at "int enemy_max" there in between void run. That's how many enemies will spawn. Try inputting 212 for D[0] and see what happens.




Better Explanation pending....


More scripts in a bit. :0

Edited by Gleeok, 09 March 2008 - 05:48 AM.


#19 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 06 March 2008 - 02:32 AM

Feel free to ask any questions and i'll answer them here.



..Also this will be the video post. Video number 1:

Custom boss of the month #1; sentinal.
http://www.youtube.c...h?v=DZbS4fFkrW4


Enjoy!

Edited by Gleeok, 18 March 2008 - 05:11 AM.


#20 Evile

Evile

    Dolphinslayer

  • Members

Posted 06 March 2008 - 01:16 PM

SPAM! UR BANNED!
icon_razz.gif

Nice stuff you have here, although I don't really understand what any of them do.

#21 Feenicks

Feenicks

    still the harpy guy

  • Members
  • Real Name:Robert
  • Location:dn ǝpᴉs ʇɥƃᴉɹ

Posted 06 March 2008 - 03:29 PM

Nice! Ultra-evil enemies and traps and normally overpowered weapons to go with them!
Someone should make an example quest to showcase these various scripts of doom and destruction.

#22 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 17 March 2008 - 08:22 PM

Some more Weapon scripts. These are copied from AGN.

http://www.armageddo...233#post1167233




Three new lv3 items:

The flamethrower candle,
The lv2 (or lv3) Wand,
The Multi_rang! (my personal favorite)icon_biggrin.gif


Everything is basically already set up. If you want to change something then change it in the code. You'll see stuff like:
"// cset" or
"// speed"
for example. change it from there.

EXEPT the wand magic item. This one is meant to be used for NON Z3 MOVEMENT, and you'll have to slightly change it for animating the magic sprite. ...or if you like request what you want and i'll change it for you.

Wand lv2 item uses one D variable, Tile. Just set D0 argument to the tile you want to use.This should be arranged as 4 tiles in your tiles page! *Up,Down,Left,Right.*

CODE


int fire3;
int wand2;



global script global_2{

    void run(){

        int attack_delay;

        while(true){

            Waitframe();

            int lx = Link->X; int ly = Link->Y;

            if(attack_delay>0)attack_delay--;
            if(Link->InputB && fire3>0){

                if(attack_delay==0){
                    attack_delay = 6;

                    lweapon laser = Screen->CreateLWeapon(WPN_FIRE);
                    
                    if(Link->Dir==0){laser->Dir=0;laser->X=lx;laser->Y=ly-16;}
                    else if(Link->Dir==1){laser->Dir=1;laser->X=lx;laser->Y=ly+16;}
                    else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly;}
                    else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly;}
                    laser->Step=2;
                    laser->Damage=2;
                    laser->CSet=8;
                    Game->PlaySound(13);
                }
            }
            else fire3=0;
        }
    }
}

item script flamethrower_item{
    void run(){
        fire3=3;
    }
}


item script wand_lv2{
    void run(int tile){

        int d = 2; // damage
        int c = 7; // cset
        int s = 3; // speed

        int t = Link->Dir;

        int lx = Link->X; int ly = Link->Y;

        if(wand2>=0){
        lweapon laser = Screen->CreateLWeapon(WPN_WAND);
                    
        if(Link->Dir==0){laser->Dir=0;laser->X=lx;laser->Y=ly-16;}
        else if(Link->Dir==1){laser->Dir=1;laser->X=lx;laser->Y=ly+16;}
        else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly;}
        else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly;}
        laser->Step=s;laser->Tile=tile+t;
        laser->Damage=d;
        laser->CSet=c;
        Game->PlaySound(32);
        }
        if(wand2>=0){
        lweapon laser = Screen->CreateLWeapon(WPN_WAND);
                    
        if(Link->Dir==0){laser->Dir=0;laser->X=lx+8;laser->Y=ly-16;}
        else if(Link->Dir==1){laser->Dir=1;laser->X=lx+8;laser->Y=ly+16;}
        else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly+8;}
        else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly+8;}
        laser->Step=s;laser->Tile=tile+t;
        laser->Damage=d;
        laser->CSet=c;
        Game->PlaySound(32);
        }
        if(wand2>=0){
        lweapon laser = Screen->CreateLWeapon(WPN_WAND);
                    
        if(Link->Dir==0){laser->Dir=0;laser->X=lx-8;laser->Y=ly-16;}
        else if(Link->Dir==1){laser->Dir=1;laser->X=lx-8;laser->Y=ly+16;}
        else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly-8;}
        else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly-8;}
        laser->Step=s;laser->Tile=tile+t;
        laser->Damage=d;
        laser->CSet=c;
        Game->PlaySound(32);
        }
        if(wand2>=0){
        lweapon laser = Screen->CreateLWeapon(WPN_WAND);
                    
        if(Link->Dir==0){laser->Dir=1;laser->X=lx;laser->Y=ly+16;laser->Tile=tile+1;}
        else if(Link->Dir==1){laser->Dir=0;laser->X=lx+8;laser->Y=ly-16;laser->Tile=tile;}
        else if(Link->Dir==2){laser->Dir=3;laser->X=lx+16;laser->Y=ly;laser->Tile=tile+3;}
        else{ laser->Dir=2;laser->X=lx-16;laser->Y=ly;laser->Tile=tile+2;}
        laser->Step=s;
        laser->Damage=d;
        laser->CSet=c;
        Game->PlaySound(32);
        }
    }
}


item script boomerang_multi{
    void run(){

    int s = 3; // b_rang speed
    int c = 11;

        lweapon fire1 = Screen->CreateLWeapon(WPN_BRANG);
        fire1->Step=s;
        fire1->Damage=0;
        fire1->CSet=c; // cset
        Game->PlaySound(4);


        if(Link->InputLeft && Link->InputUp){
            fire1->X = Link->X - 16;
            fire1->Y = Link->Y - 16;
            fire1->Dir=4;
        }
        else if(Link->InputRight && Link->InputUp){
            fire1->X = Link->X + 16;
            fire1->Y = Link->Y - 16;
            fire1->Dir=5;
        }
        else if(Link->InputLeft && Link->InputDown){
            fire1->X = Link->X - 16;
            fire1->Y = Link->Y + 16;
            fire1->Dir=6;
        }
        else if(Link->InputRight && Link->InputDown){
            fire1->X = Link->X + 16;
            fire1->Y = Link->Y + 16;
            fire1->Dir=7;
        }
        else{
            if(Link->Dir == 0) {
                fire1->X = Link->X;
                fire1->Y = Link->Y - 16;
                fire1->Dir=0;
            }
            if(Link->Dir == 1) {
                fire1->X = Link->X;
                fire1->Y = Link->Y + 16;
                fire1->Dir=1;
            }
            if(Link->Dir == 2) {
                fire1->X = Link->X - 16;
                fire1->Y = Link->Y;
                fire1->Dir=2;
            }
            if(Link->Dir == 3) {
                fire1->X = Link->X + 16;
                fire1->Y = Link->Y;
                fire1->Dir=3;
            }
        }
    }
}




Oh, and one more cool thing: The Multirang will shoot whatever type boomerangs you currently have! So if you have fire boomerangs for example, Now you have LOTS of fire boomerangs. icon_smile.gif


..Screenshots:

IPB Image
Practice your accuracy by trying to stun multiple enemies!

IPB Image
I think sweet fiery vengance speaks for itself. icon_odd.gif

IPB Image
Maybe too powerful??? Hmm...OK got it, simply make the item use magic in the item editor. peice of cake.



Also edited an above post with some explanation.


Would it be easier for you guys to know what these do if there was a youtube video that had them in it? If so, then who want's to volunteer?


#23 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 02 June 2008 - 09:53 PM

Instead of explaining any more of this nonsense I'll just let you guys look through the quest file yourselves. icon_wink.gif

http://www.mediafire.com/?y90x4wmmox5 Uses b798 !

Unpassworded

L: Teleport.
R: Run , Dash
L+R+Start: Mana shield
L+R+A: Enchant sword
L+R+B: Protect shield

Use cheats to acces Dmaps 1,3, and 5. All the bosses are in there somewhere. Weapon scripts about 70% compatable with Zodiac weapons also.


..Also theres a bug with the CSet flashing in this build...Normally it looks good.


Enjoy!

#24 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 02 June 2008 - 10:20 PM

gleeok... has anyone ever told you how awesome you are?

#25 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 28 July 2008 - 08:12 AM

OK, round three!

I'm just gonna give a breif (very) explanation on these, as they're more for the scripters. So if you have a specific question about anything just go ahead and ask it.



Refills life exactly like the pond fairy....but no fairy.

CODE

void Refill(){
    int hp = Link->MaxHP-Link->HP;
    for(int i;i<hp;i++){
        Link->HP++;
        Game->PlaySound(SFX_REFILL);
        Waitframe();
    }
}





Makes if quick and easy to use FFCs.
CODE

void spawn(int data, int x, int y, int spawned_ffc){
    ffc F = Screen->LoadFFC(spawned_ffc);
    F->Data = data;
    F->X = x; F->Y = y;
}





...and move it around with a few numbers.

CODE

void Move_FFC(int vel_x, int vel_y, int acc_x, int acc_y, int ffc_num){
    ffc F = Screen->LoadFFC(ffc_num);
    F->Vx = vel_x; F->Vy = vel_y;
    F->Ax = acc_x; F->Ay = acc_y;
}





Self expanitory;
CODE

void Homing(int speed, int ffc_num, int target_x, int target_y){
    ffc F=Screen->LoadFFC(ffc_num);
    int dx = target_x - F->X;
    int dy = target_x - F->Y;
    float norm = Sqrt(dx*dx+dy*dy);
    if(norm > 0){
        F->Vx = dx/norm*speed;
        F->Vy = dy/norm*speed;
    }
}





Returns an unused ffc, that is, data = 0 or 1.
CODE

int getFFC(int min, int max){
    ffc F;int i=min-1;
    while(i++ < max){
        F=Screen->LoadFFC(i);
        if(F->Data<=1){return i;i=max;}
        else if(i==max)return 0;
    }
}





Collision checking between any amount of FFCs!!! yep. I know, sweet ass.
CODE

bool checkFFC_Collision(int this_ffc, int min, int max){
    ffc F;ffc this=Screen->LoadFFC(this_ffc);int i=min-1;
    while(i++ < max){
        if(this_ffc != i){
            F=Screen->LoadFFC(i);
            if(F->Data>100){
                if(Abs(this->X-F->X)<9 && Abs(this->Y-F->Y)<9)

                    return true;
                
            }
            else if(i==max)return false;
        }
    }
}





Returns the nearest enemy to x,y.
CODE

int nearest_enemy(int x, int y){
    int d;int p=9999;int e;
    int e_num = Screen->NumNPCs();
    for(int i = e_num; i>0; i--){
        npc enemy = Screen->LoadNPC(i);
        if(enemy->X>-4){
            int ex = enemy->X;int ey = enemy->Y;
            d = Distance(x,y,ex,ey);
            if(p>d){p=d;e=i;}
        }
    }
    return e;
}






Increments 10 degrees towards target when called, where firing_degree is the base number to modify and lx,ly is the target x,y, and tx,ty is the origin x,y. fun stuff. icon_smile.gif
CODE

int Degree_Buster(int lx, int ly, int tx, int ty, int firing_degree){

    int atan = ArcTan(lx-tx,ly-ty)*(180/PI);
    while(atan<0)atan+=360;
    while(firing_degree<0)firing_degree+=360;
    while(firing_degree>360)firing_degree-=360;
    if(Abs(firing_degree-atan)>180){
        if(atan>firing_degree)return (firing_degree-10);
        else return (firing_degree+10);
    }
    else if(Abs(firing_degree-atan)>10){
        if(atan>firing_degree)return (firing_degree+10);
        else return (firing_degree-10);
    }
    else return atan;
}






oohboyoohboyooboy what's this??! Well this my freinds will take any drawtile....and....MAKEITSOLID! OMG SERESLY???

Yeah, it's not set up for zelda based games ( I have it just where I want it for my quest though) , but I can modify it so it's "smoother" so to speak. Tester input is required before I tweak it however.
CODE

void PsuedoSolid_Tile(int x, int y, int tile, int width, int height){

    int w = width*16;    int center_x = x+((w/2)-8);
    int h = height*16;    int center_y = y+((h/2)-8);
    int lx = Link->X;    int ly = Link->Y;
    lweapon lw_sprite;    eweapon ew_sprite;


    Screen->DrawTile(2,x,y,tile,width,height,11,1,0,0,0,0,true,128);


    if(ly<y && ly>y-14 && lx>x-12 && lx<x+w-2){
        if(ly>4){
            Link->Y--;
            if(ly>y-12)Link->Y--;
        }
        else{
            Game->PlaySound(19);
            Link->HP--;
        }
        Link->InputDown=false;

    }

    else if(ly>y+h-5 && ly<y+h && lx>x-12 && lx<x+w-2){
        if(lx<x+w-4 && lx>x+(w/2)){
            Link->X++;
            Link->InputLeft=false;
        }
        if(ly<155){
            Link->Y++;
            if(ly<y+h-2)Link->Y++;
        }
        else{
            Game->PlaySound(19);
            Link->HP--;
        }
        Link->InputUp=false;

    }

    if(lx<x && lx>x-14 && ly>y-12 && ly<y+h-2){
        if(lx>4){
            Link->X--;
            if(lx>x-12)Link->X--;
        }
        else{
            Game->PlaySound(19);
            Link->HP--;
        }
        Link->InputRight=false;

    }
    else if(lx>x+w-5 && lx<x+w && ly>y-12 && ly<y+h-2){
        if(lx<x+w-2)Link->X++;
        if(lx<236){
            Link->X++;
            if(lx<x+w-2)Link->X++;
        }
        else{
            Game->PlaySound(19);
            Link->HP--;
        }
        Link->InputLeft=false;

    }


    if(lx<x+w-4 && lx>x+4 && ly<y+h-4 && ly>y-4){ // Player is inside the tile!
        if(ly<155 && ly>4){
            if(ly<center_y)Link->Y--;
            else Link->Y++;
        }
        if(lx<236 && lx>4){
            if(lx<center_x)Link->X--;
            else Link->X++;
        }
        Link->HP--;
        Game->PlaySound(19);
    }
}



Enjoy!

#26 lucas92

lucas92

    Defender

  • Members

Posted 28 July 2008 - 11:01 AM

Wow, awesome concepts scripts! It will definitively be useful for a lot of scripts. icon_smile.gif

#27 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 27 November 2008 - 03:10 AM

HOLY ****!!!

#28 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 01 December 2008 - 10:20 PM

QUOTE(drzchulo973 @ Nov 27 2008, 02:10 AM) View Post

HOLY ****!!!

Umm... Was that necessary? This topic is a little old.

Yes, these are nice scripts though. I don't think I'll have any use for them unfortunately...


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users