Jump to content

How to cast pet spells?


ronny

Recommended Posts

I want to cast spells based on a condition with lua programing ,example:

If the enemy pet HP > 500 than cast first spell

If the enemy pet HP < 500 and spell is cooldown than cast third spell else cast first spell.

Link to comment
Share on other sites

You need good wow lua API and C# knowbase

To get health: 

        int enemyHealth = PetBattles.GetHealth(PetBattles.PetFaction.Enemy, PetBattles.GetActivePet(PetBattles.PetFaction.Enemy));
        int enemyMaxHealth = PetBattles.GetMaxHealth(PetBattles.PetFaction.Enemy, PetBattles.GetActivePet(PetBattles.PetFaction.Enemy));
        int enemyMaxPercent = enemyHealth * 100 / enemyMaxHealth;

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...