
####animationscript function main#####
# data/chars/leo/leo.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==2)
    {


    if(frame == 1){

      void self = getlocalvar("self"); //Get calling entity

      int iPIndex = getentityproperty(self,"playerindex");



      int x = getglobalvar("x"+iPIndex);

      int z = getglobalvar("z"+iPIndex);



      if(x!=NULL() && z!=NULL()){

        changeentityproperty(self,"position", x, z, 0);

        setglobalvar("x"+iPIndex, NULL());

        setglobalvar("z"+iPIndex, NULL());

      }

    }

        return;
    }
    if(animhandle==15)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav", "jo.wav");
        }
        return;
    }
    if(animhandle==22)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav", "jo.wav");
        }
        return;
    }
    if(animhandle==23)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==24)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==26)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==27)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==30)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }

}

####animationscript function main#####
# data/chars/raph/raph.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==45)
    {


    if(frame == 1){

      void self = getlocalvar("self"); //Get calling entity

      int iPIndex = getentityproperty(self,"playerindex");



      int x = getglobalvar("x"+iPIndex);

      int z = getglobalvar("z"+iPIndex);



      if(x!=NULL() && z!=NULL()){

        changeentityproperty(self,"position", x, z, 0);

        setglobalvar("x"+iPIndex, NULL());

        setglobalvar("z"+iPIndex, NULL());

      }

    }

        return;
    }
    if(animhandle==60)
    {
        if(frame==2)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav", "jo.wav");
        }
        return;
    }
    if(animhandle==67)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==68)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==69)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==71)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==72)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==75)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }

}

####animationscript function main#####
# data/chars/mike/mike.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==90)
    {


    if(frame == 1){

      void self = getlocalvar("self"); //Get calling entity

      int iPIndex = getentityproperty(self,"playerindex");



      int x = getglobalvar("x"+iPIndex);

      int z = getglobalvar("z"+iPIndex);



      if(x!=NULL() && z!=NULL()){

        changeentityproperty(self,"position", x, z, 0);

        setglobalvar("x"+iPIndex, NULL());

        setglobalvar("z"+iPIndex, NULL());

      }

    }

        return;
    }
    if(animhandle==105)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav", "jo.wav");
        }
        return;
    }
    if(animhandle==112)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==113)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==114)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==116)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==117)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==120)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }

}

####animationscript function main#####
# data/chars/don/don.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==135)
    {


    if(frame == 1){

      void self = getlocalvar("self"); //Get calling entity

      int iPIndex = getentityproperty(self,"playerindex");



      int x = getglobalvar("x"+iPIndex);

      int z = getglobalvar("z"+iPIndex);



      if(x!=NULL() && z!=NULL()){

        changeentityproperty(self,"position", x, z, 0);

        setglobalvar("x"+iPIndex, NULL());

        setglobalvar("z"+iPIndex, NULL());

      }

    }

        return;
    }
    if(animhandle==150)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav", "jo.wav");
        }
        return;
    }
    if(animhandle==151)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "jo.wav");
        }
        return;
    }
    if(animhandle==157)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==158)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==159)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==161)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==162)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }
    if(animhandle==165)
    {
        if(frame==0)
        {
            randSound("jo.wav", "ja.wav", "fuf.wav");
        }
        return;
    }

}

####animationscript function main#####
# data/chars/rodney/rodney.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==439)
    {
        if(frame==0)
        {
            randSound("rodney1.wav", "rodney2.wav", "rodney1.wav");
        }
        return;
    }
    if(animhandle==440)
    {
        if(frame==0)
        {
            randSound("rodney1.wav", "rodney2.wav", "rodney1.wav");
        }
        return;
    }
    if(animhandle==441)
    {
        if(frame==0)
        {
            randSound("rodney1.wav", "rodney2.wav", "rodney1.wav");
        }
        return;
    }

}

####animationscript function main#####
# data/chars/misc/delay.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==531)
    {


    void self = getlocalvar("self");

    int  Health = getentityproperty(self, "health");



    if(frame==1){

      changeentityproperty(self, "health", Health-5);

      if (Health <= 0){

        killentity(self);

      }

    }

        return;
    }

}

####animationscript function main#####
# data/chars/misc/victory1.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==533)
    {
        if(frame==1)
        {
            DeControl(0, 1);
        }
        if(frame==1)
        {
            MovePlayer(0, 0, 0, 0);
        }
        if(frame==2)
        {
            DirPlayer(0, 1);
        }
        if(frame==2)
        {
            AnimPlayer(0, "ANI_FOLLOW1");
        }
        if(frame==3)
        {
            jumptobranch("Akhir", 1);
        }
        return;
    }

}

####animationscript function main#####
# data/chars/misc/victory2.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==534)
    {
        if(frame==1)
        {
            DeControl(1, 1);
        }
        if(frame==1)
        {
            MovePlayer(1, 0, 0, 0);
        }
        if(frame==2)
        {
            DirPlayer(1, 1);
        }
        if(frame==2)
        {
            AnimPlayer(1, "ANI_FOLLOW1");
        }
        if(frame==3)
        {
            jumptobranch("Akhir", 1);
        }
        return;
    }

}

####animationscript function main#####
# data/chars/misc/1spawn.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==535)
    {


    void self = getlocalvar("self");

    int x = getentityproperty(self,"x"); //Get character's x coordinate

    int z = getentityproperty(self,"z"); //Get character's z coordinate

    int a = getentityproperty(self,"a"); //Get character's a coordinate

    int P1 = getplayerproperty(0, "entity");



    changeentityproperty(P1, "position", x, z, a);

    killentity(self); //Suicide!

        return;
    }

}

####animationscript function main#####
# data/chars/misc/respawn.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animhandle = getlocalvar("animhandle");
    if(animhandle==536)
    {


    void self = getlocalvar("self");

    int x = getentityproperty(self,"x");

    int a = getentityproperty(self,"a");



    setindexedvar(0, x);

    setindexedvar(1, a);

    killentity(self);

        return;
    }

}
