timglide
Member
- Joined
- Jan 22, 2012
- Messages
- 128
- Reaction score
- 20
I'm just double checking that there isn't a built-in way to cancel buffs. I want to make my code work in different locales without needing to know actual buff names, only ids.
I've determined that you can run
I'm pretty sure the (object) cast is necessary to invoke the version that calls string.Format() because the version of Lua.DoString() that accepts two strings is documented as below:
Anyway, I'm assuming that only works if the name of the buff is in the language of the WoW client.
So the real question: is WoWAura.Name in the locale of the WoW client or in English. As I only have an English client I obviously cannot test this.
If WoWAura.Name is only in English, then is
which returns the name of the spell, localized?
-------
Edit: Ok, shame on me for not searching, but I had already written some code based on the above. Finding a strictly-lua approach (http://www.thebuddyforum.com/honorb...thought-i-would-share-cancel-buff-script.html) I suppose that one would be better since it strictly checks the id, whereas mine uses the id to get the name, but buffs with different ids can have the same name, i.e. noggenfogger.
I've determined that you can run
Code:
Lua.DoString("CancelUnitBuff(\"player\", \"{0}\")", (object)"Buff name");
Code:
// Parameters:
// szLua:
// The lua.
//
// szLuaFile:
// The lua file.
Anyway, I'm assuming that only works if the name of the buff is in the language of the WoW client.
So the real question: is WoWAura.Name in the locale of the WoW client or in English. As I only have an English client I obviously cannot test this.
If WoWAura.Name is only in English, then is
Code:
Lua.GetReturnVal<string>("return GetSpellInfo(" + buffId + ")", 0)
-------
Edit: Ok, shame on me for not searching, but I had already written some code based on the above. Finding a strictly-lua approach (http://www.thebuddyforum.com/honorb...thought-i-would-share-cancel-buff-script.html) I suppose that one would be better since it strictly checks the id, whereas mine uses the id to get the name, but buffs with different ids can have the same name, i.e. noggenfogger.
Last edited:






