08-03-2010, 12:11 AM
Who ever can figure this out I will give them 100g !
I have been trying to figure this out successfully for months now and it has still eluded me. I am working on a better more cohesive, user friendly combat system but I am missing an element of code that wold be extremely useful and make things much easier for that common combatant.
What I am trying to figure out is how to remove a buff, but with code not the little do hickey that comes with GHI.
Pilus (The creator of GHI) did give us part of the code with this
from here http://pilus.info/cms/phpbb/viewtopic.php?p=2828#p2828
The thing is, that removes buffs from their index number, not their name. So it removes buffs from which order they are in not by name. You can't always guarantee which order any one persons buffs will be in so this is not that useful. What I am looking for is code that will remove a buff by name, so if it is, say the second or thrid buff down the line it will remove it, and not the ones before it.
Also, I would want it to remove a portion of a stack of buffs. For example, you have a buff called HP and it is stacked 45 times I want to be able to remove 10 of those HP buffs.
I did ask Pilus about this and he gave me this bit of code but I have never got it to work.
Here are some resources that should help.
http://pilus.info
http://wowprogramming.com
http://www.wowpedia.org/Portal:Interface_customization
I am leaving for a week on vacation so I will be back next Tue. and can reward any one who figures this out then.
I have been trying to figure this out successfully for months now and it has still eluded me. I am working on a better more cohesive, user friendly combat system but I am missing an element of code that wold be extremely useful and make things much easier for that common combatant.
What I am trying to figure out is how to remove a buff, but with code not the little do hickey that comes with GHI.
Pilus (The creator of GHI) did give us part of the code with this
Code:
RemoveGHIBuff
Remove a buff on yourself
Input: index,filter
# index (number): buff index to remove
# filter (string): "HELPFUL" for buffs and "HARMFUL" for debuffs
The thing is, that removes buffs from their index number, not their name. So it removes buffs from which order they are in not by name. You can't always guarantee which order any one persons buffs will be in so this is not that useful. What I am looking for is code that will remove a buff by name, so if it is, say the second or thrid buff down the line it will remove it, and not the ones before it.
Also, I would want it to remove a portion of a stack of buffs. For example, you have a buff called HP and it is stacked 45 times I want to be able to remove 10 of those HP buffs.
I did ask Pilus about this and he gave me this bit of code but I have never got it to work.
Code:
found = false;
for i = 1,#(GHI_BuffList) do
if type(GHI_BuffList[i])=="table" then
if GHI_BuffList[i].name == "con" then
k = GHI_BuffList[i].index
found = true;
end
end
end
if found == true then
local a = GHI_BuffList[k].amount;
if a > 4 then
a = GHI_BuffList[k].amount - 4
else
RemoveGHIBuff(k, "HELPFUL")
end
end
Here are some resources that should help.
http://pilus.info
http://wowprogramming.com
http://www.wowpedia.org/Portal:Interface_customization
I am leaving for a week on vacation so I will be back next Tue. and can reward any one who figures this out then.