Customcraft: Buffs and Debuffs in Script Form

*presses the reset button*

This edition has been a long time coming.  It was probably a bit brazen of me to announce that I’d be able to do a column like this every week, but… well, I suppose we all tend to aim too high the first time.  With some time freed up, and most of my focus being on RP now, it’s allowed me the time to dive back into GHI and LUA coding, so new columns will be forthcoming!  (Since it’ll give me a chance to share the items that I make to others.)

For any newcomers to the blog, Customcraft is a column dedicated to item creation tips with the WoW RP add-on, Gryphonheart Items—or GHI for short.  This edition focuses on the Buffs and Debuffs API function, which makes them useful for the ‘Scripts’ right-click function.

Most GHI users are pretty familiar with the Buff right-click function.  It’s pretty simple to set things up, and for most people that need their items to put some kind of buff—or debuff on them—the right click function meets their needs about 95% of the time.  However, if you want your item to delay putting on their respective buff/debuff, you know that you can’t do that with the Buff function.  So what do we do?  Taking out you Script function folks!  It’s time for a short lesson in coding!

Here’s some example code of the API function at work. (Which is based off of an item that I’ve been tinkering with.  Hooray for RP items!)

ApplyGHIBuff(“Feedback Protection”,”Protected from self-inflicted, fel-magic feedback.”,”Interface\\Icons\\Spell_Arcane_Arcane01″,1,”HELPFUL”,”MAGICAL”,0,1,0);

And here’s the breakdown:

ApplyGHIBuff – API function name

(NAME) “Feedback Protection” – The name of the buff/debuff.

(BUFF DESCRIPTION) “Protected from self-inflicted, fel-magic feedback.” – Used to describe what kind of effects this buff/debuff does.

(ICON) “Interface\\Icons\\Spell_Arcane_Arcane01” – File path of the icon that represents the buff/debuff.

(UNTIL CANCELED) 1 – Determines whether or not the buff/debuff can be canceled by right clicking or not.  Can only be represented through 0 or 1.  0=no and 1=yes

(FILTER) “HELPFUL” – Determines whether a buff is helpful or harmful.  HELPFUL for buffs.  HARMFUL for debuffs.

(DEBUFF TYPE) “MAGICAL” – Determines the type of buff/debuff.  (“MAGICAL”, “POISON”, “DISEASE”, “CURSE”, “PHYSICAL”)

(DURATION) 0 – Determines how long the buff will last.  Amount is determined by seconds.  Also note that if you have enabled buffs to be canceled by right clicking it, the duration will not function. It must be turned off (set to 0).

(CANCELLATION) 1 – Determines if the buff can be canceled or not.  However, it doesn’t seem to matter whether you put a 0 or 1, as GHI will enable you to right-click cancel the buff regardless.  Likely to prevent misuse of the add-on.

(STACKABILITY) 0 – Determines if the buff is stackable.  It does not determine how big you can stack your buffs.  Only whether or not you allow it to stack. Buffs will stack up to 100. 0=no 1=yes

For the record, if you want to create an item that has no duration, the best way to do it is to turn on the Until Canceled input.  It took me awhile to figure this out, so now you won’t have to take a million years like I did.

And for easy access to icon file paths (and you’ll even see what your chosen icon looks like beforehand!):

Hope you folks out there found this useful. 🙂  Until next time!


~ by compassstudies on October 20, 2009.

3 Responses to “Customcraft: Buffs and Debuffs in Script Form”

  1. How would you go about making an item affect your screen? For example, if I were to ‘use’ an item and my screen clouds over?

  2. Great article, it helped me out a lot! Mostly because I wanted to use the script option so I could perform a buff/debuff at a specific time during the items list of actions. One thing I’ll mention that I ran into that isn’t your fault at all… when copying from this page to GHI, GHI turns the opening and closing quotes into something that renders the code unusable, so I had to go through and deleted each oddly formatted quote and typed a new quote. In my case, most of the quotes looked normal but weren’t funtional, and the quote after the image location was turned into a ? mark. Hope that helps somebody!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: