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!