Jump to content

Photo

Giant's Knife/Razor Sword Item Script?


  • Please log in to reply
18 replies to this topic

#16 Dawnlight

Dawnlight

    My name is NOT Jason!

  • Members
  • Real Name:Justin
  • Location:Chicago, IL

Posted 10 November 2008 - 10:41 PM

The one you gave to drzchulo973.

#17 Elmensajero

Elmensajero

    Doyen(ne)

  • Members
  • Real Name:John
  • Location:Raleigh, North Carolina

Posted 11 November 2008 - 12:23 AM

Since there are not any global scripts involved, you can just copy and paste one to the end of the other.

CODE
int SwingCounter;

item script RazorSwordPickup{
    void run(){
        SwingCounter = 0;
    }
}

item script RazorSwordAction{
    void run(int MaxSwings, int Remove, int M){
        SwingCounter++;
        if(SwingCounter == MaxSwings){
            Link->Item[Remove] = false;
            Screen->Message(M);
        }
    }
}

item script SFX{
    void run(int a, int b, int c){
        int x = Rand(3);
        if(x == 2) Game->PlaySound(a);
        if(x == 1) Game->PlaySound(b);
        if(x == 0) Game->PlaySound(c);
        
    }
}

Edited by Elmensajero, 11 November 2008 - 12:28 AM.


#18 Joe123

Joe123

    Retired

  • Members

Posted 11 November 2008 - 06:56 AM

Actually, no you can't.

We can only have one action script and one pickup script per item currently I'm afraid =(

CODE
int SwingCounter;

item script RazorSwordPickup{
    void run(){
        SwingCounter = 0;
    }
}

item script RazorSwordAction{
    void run(int MaxSwings, int Remove, int M, int a, int b, int c){
        SwingCounter++;
        if(SwingCounter == MaxSwings){
            Link->Item[Remove] = false;
            Screen->Message(M);
        }
        int x = Rand(3);
        if(x < 1) Game->PlaySound(a);
        else if(x < 2) Game->PlaySound(b);
        else Game->PlaySound(c);
    }
}


The sfx arguments are in order after the razor sword ones.

#19 Eddard McHorn Van-Schnuder

Eddard McHorn Van-Schnuder

    smash the bye button

  • Members
  • Real Name:Ronny Wiltersen

Posted 11 November 2008 - 07:45 AM

QUOTE(Joe123 @ Nov 9 2008, 02:45 PM) View Post

You know, I'm actually half-tempted to use this script myself.
aKttH doesn't have that many swords in it really.

Hrmm.....

Yeah, me too... as always, great work Joe!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users