Adding to a defense script

Liu-Kang

Member
Hello hello I was wondering if two more kinds of attacks could be added to this scripts conditions? right now it's set to only play the follow up anim if normal attack hits the entity- but I would like if attack26 and attack27 could be added into the pool so only three kinds of attack types would trigger the follow up for this script-

animation in character text:
@script
    void self = getlocalvar("self");

    if(frame==0){
      changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 0, 200, 0);

      setentityvar(self, 1, NULL());
    }
    if(frame>=2 && frame<=4){
      void Hit = getentityvar(self, 1);

      if(Hit=="Balas"){
        setentityvar(self, 1, NULL());
        changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 1, 0, 1);
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
      }
    }
    if(frame==6){
      changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 1, 0, 1);
    }
@end_script

script file:
void main(){
    void self = getlocalvar("self");
    void vAniID = getentityproperty(self,"animationID");
    void atype = getlocalvar("attacktype"); // Get received attacktype

    if(vAniID == openborconstant("ANI_FREESPECIAL") && atype == openborconstant("ATK_NORMAL")){
      setentityvar(self, 1, "Balas");
    } else {
      changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 1, 0, 1);
    }
}
 
Back
Top Bottom