Different Attack1 for combostyle 1

  • Thread starter Thread starter zvitor
  • Start date Start date
Z

zvitor

Guest
hi guys,
my char have 2 different combo chain, to far and close enemys,
but this chains share same first attack1, range dont work at first attack of combostyle1.
...
on solution could be:
I can check if enemy are at attack range with script?
this way i can force him to change attack before start it.
 
You could use something like that to change the  animation if opponent is in range:

void atkrange(int Rx, int Rz,  void Ani)
{// attack with range check
    void self = getlocalvar("self");
    void target = findtarget(self); //Get nearest opponent
    float x = getentityproperty(self, "x");
    float z = getentityproperty(self, "z");
   

   
      float Tx = getentityproperty(target, "x");
      float Tz = getentityproperty(target, "z");
      float Disx = (Tx - x);
      float Disz = (Tz - z);

      if(Disx < 0)
{
        Disx = -Disx;
      }

      if(Disz < 0)
{
        Disz = -Disz;
      }

      if( Disx <= Rx && Disz <= Rz ) // Target within range?
      {       
        performattack(self,  openborconstant(Ani)); //Change the animation
      }
   
}

E.g.:

        anim attack1
forcedirection -1
delay 8
offset 100 150
bbox         79 51 51 94
@cmd atkrange 80 10 "Ani_Follow24"
frame data/chars/sevenx/atk11.gif
delay         6
bbox         89 56 37 92
attack 104 65 62 29 10 0 0 0 20
frame data/chars/sevenx/atk13.gif
delay  2
frame data/chars/sevenx/atk11.gif
 
Back
Top Bottom