What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Buff check in a CC

BennyLava

New Member
Joined
Dec 14, 2010
Messages
26
Reaction score
0
im prety new to custom classes, been reading over a few to try and learn how they are made but i havnt gotten to far yet.

i was wondering if anyone could help me put into a cc a check for a buff, potion of treasure finding, and a command to use a potion if the buff is not there
 
On a more serious note, you could accomplish the same task via a plugin which are much simpler to write than a CC. If you need a model to get you started, the Time Until Level plugin is small and clean. It would make a good starting point.

Unfortunately, we don't have the "How to write a Plugin/CC" part of the Wiki done yet. So, your best progress would be made by studying the work of others.

cheers,
chinajade
 
StxyWoW.Me.HasAura("Buff Name Here")

Lua.DoString("UseItemByName(\"Potion Name"\)");
 
im prety new to custom classes, been reading over a few to try and learn how they are made but i havnt gotten to far yet.

i was wondering if anyone could help me put into a cc a check for a buff, potion of treasure finding, and a command to use a potion if the buff is not there

You should probably leave a specific potion like that to a plugin if your making a CC. Heres one quick and dirty for you. You can do what ever you want with it. Its untested but should work.

Code:
using System;

using Styx;
using Styx.WoWInternals;
using Styx.Plugins.PluginClass;
using Styx.WoWInternals.WoWObjects;

namespace PotionPlugin
{
    public class PotionDrinker : HBPlugin
    {
        // Stop Config Here

        //Fill this line in with the buff name
        public string buffname { get { return "Enter Buff Name Here"; } }

        //Fill this line in with the potion name
        public string potionname { get { return "Enter Potion Name"; } }


        public override string Name { get { return "Potion Plugin"; } }
        public override string Author { get { return "Your Name"; } }
        public override Version Version { get { return new Version(1, 0); } }
        public override bool WantButton { get { return false; } }

        public override void Pulse()
        {
            if (!StyxWoW.Me.HasAura(buffname))
            {
                if (!StyxWoW.Me.IsMoving && !StyxWoW.Me.IsCasting)
                {
                    Lua.DoString("UseItemByName(\"" + potionname + "\")");
                }
            }
        }
    }
}
 
Thx guys for the help, the plug-in above is about what i had thrwon together using the shell of another plugin called buff u and the cod sujestion you posted above this. =)
 
Help. My Daeth Knight drink Potion of treasur finding every cool time.

Sorry, Bad English.
 
Back
Top