HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What's what wrong with UnitRemoveBuffBJ(...)?

08-19-2008, 01:13 PM#1
Vestras
It doesn't seem to work.

Collapse JASS:
function RemoveCondition takes unit whichUnit, string whichBuff returns nothing
call BJDebugMsg("remove")
 if IsUnitInGroup(whichUnit,ConditionUnits)==true then
  if whichBuff==CONDITION_STRING_TYPE_BLIND then
     call UnitRemoveBuffBJ(CONDITION_TYPE_BLIND,whichUnit)
     call GroupRemoveUnit(ConditionUnits,whichUnit)
  elseif whichBuff==CONDITION_STRING_TYPE_BURN then
     call UnitRemoveBuffBJ(CONDITION_TYPE_BURN,whichUnit)
     call GroupRemoveUnit(ConditionUnits,whichUnit)
  elseif whichBuff==CONDITION_STRING_TYPE_DIZZY then
     call UnitRemoveBuffBJ(CONDITION_TYPE_DIZZY,whichUnit)
     call GroupRemoveUnit(ConditionUnits,whichUnit)
  elseif whichBuff==CONDITION_STRING_TYPE_SILENCE then
     call UnitRemoveBuffBJ(CONDITION_TYPE_SILENCE,whichUnit)
     call GroupRemoveUnit(ConditionUnits,whichUnit)
     call BJDebugMsg("silence")
  else
     call BJDebugMsg("|cffff0000Condition System|r: You have specified a wrongly spelled buff string, or a buff which isn't existing.")
  endif
 else
     call BJDebugMsg("|cffff0000Condition System|r: The specified unit which you want to remove a condition from doesn't have any conditions.")
 endif
endfunction

The debug messages show, but the buff ain't removed.
08-19-2008, 01:19 PM#2
Rising_Dusk
You're likely not specifying the correct integer for whatever buff you're dealing with. Make sure these "CONDITION_TYPE_SILENCE" things refer to the buff ability id. (ie. 'B000', etc.)
08-19-2008, 01:19 PM#3
Vestras
Collapse JASS:
// The buff globals;
globals
           constant integer CONDITION_BUFF_TYPE_BLIND       = 'B000'
           constant integer CONDITION_BUFF_TYPE_BURN        = 'B003'
           constant integer CONDITION_BUFF_TYPE_DIZZY       = 'B002'
           constant integer CONDITION_BUFF_TYPE_SILENCE     = 'B001'
endglobals

They are.

EDIT: Fuck, I just figured out what I did wrong... hehe... hehe...
08-19-2008, 07:06 PM#4
Themerion
Collapse JASS:
// Don't use UnitRemoveBuffBJ
// Use UnitRemoveAbility directly

function UnitRemoveBuffBJ takes integer buffcode, unit whichUnit returns boolean
    return UnitRemoveAbility(whichUnit, buffcode)
endfunction