Drop buff

04/29/2018 19:35 yuramisu#1
Hello, i'm working on function "Dropbuff"

I want drop my recall on my heros number n°2
recall ID=925
héro number = 2
so i write

Code:
Dropbuff(925, 2)
It do nothing...

i post a function (from gwa²)

Code:
;~ Description: Stop maintaining enchantment on target.
Func DropBuff($aSkillID, $aAgentID, $aHeroNumber = 0, $aHeroID = GetHeroID($aHeroNumber))
   Local $lBuffCount = GetBuffCount($aHeroNumber, $aHeroID)
   Local $lOffset[4] = [0, 0x18, 0x2C, 0x510]
   Local $lCount = MemoryReadPtr($mBasePointer, $lOffset)
   ReDim $lOffset[5]
   $lOffset[3] = 0x508
   For $i = 0 To $lCount[1] - 1
	  $lOffset[4] = 0x24 * $i
	  $lBuffer = MemoryReadPtr($mBasePointer, $lOffset)
	  If $lBuffer[1] = $aHeroID Then
		 $lOffset[4] = 0x4 + 0x24 * $i
		 ReDim $lOffset[6]
		 For $j = 0 To $lBuffCount - 1
			$lOffset[5] = 0 + 0x10 * $j
			$lBuffAddress = MemoryReadPtr($mBasePointer, $lOffset)
			If $lBuffAddress[1] = $aSkillID And MemoryRead($lBuffAddress[0] + 12, 'long') = ConvertID($aAgentID) Then
			   Return SendPacket(0x8, $HEADER_STOP_MAINTAIN_ENCH, MemoryRead($lBuffAddress[0] + 8, 'long'))
			   ExitLoop 2
			EndIf
		 Next
	  EndIf
   Next
EndFunc   ;==>DropBuff
Thanks for your answers :)
04/29/2018 21:38 DerMoench14#2
Quote:
Originally Posted by yuramisu View Post
Hello, i'm working on function "Dropbuff"

I want drop my recall on my heros number n°2
recall ID=925
héro number = 2
so i write

Code:
Dropbuff(925, 2)
It do nothing...

i post a function (from gwa²)

Code:
;~ Description: Stop maintaining enchantment on target.
Func DropBuff($aSkillID, $aAgentID, $aHeroNumber = 0, $aHeroID = GetHeroID($aHeroNumber))
   Local $lBuffCount = GetBuffCount($aHeroNumber, $aHeroID)
   Local $lOffset[4] = [0, 0x18, 0x2C, 0x510]
   Local $lCount = MemoryReadPtr($mBasePointer, $lOffset)
   ReDim $lOffset[5]
   $lOffset[3] = 0x508
   For $i = 0 To $lCount[1] - 1
	  $lOffset[4] = 0x24 * $i
	  $lBuffer = MemoryReadPtr($mBasePointer, $lOffset)
	  If $lBuffer[1] = $aHeroID Then
		 $lOffset[4] = 0x4 + 0x24 * $i
		 ReDim $lOffset[6]
		 For $j = 0 To $lBuffCount - 1
			$lOffset[5] = 0 + 0x10 * $j
			$lBuffAddress = MemoryReadPtr($mBasePointer, $lOffset)
			If $lBuffAddress[1] = $aSkillID And MemoryRead($lBuffAddress[0] + 12, 'long') = ConvertID($aAgentID) Then
			   Return SendPacket(0x8, $HEADER_STOP_MAINTAIN_ENCH, MemoryRead($lBuffAddress[0] + 8, 'long'))
			   ExitLoop 2
			EndIf
		 Next
	  EndIf
   Next
EndFunc   ;==>DropBuff
Thanks for your answers :)
I didn't use this in a while but im pretty sure the 2nd arg is wrong.
So you should call it this way:

Example1: You have Recall on a Hero.
Code:
$aSkillID_Recall = 925
$aHeroNumber= 2
$aHeroAgentID = GetHeroID($aHeroNumber)

Dropbuff($aSkillID_Recall, $aHeroAgentID)
Example2: A Hero has Recall on you:
Code:
$aSkillID_Recall = 925
$aHeroNumber= 2
$aMyID = GetMyID()

Dropbuff(aSkillID_Recall, $aMyID, $aHeroNumber)
05/01/2018 14:10 yuramisu#3
Quote:
Originally Posted by DerMoench14 View Post
I didn't use this in a while but im pretty sure the 2nd arg is wrong.
So you should call it this way:

Example1: You have Recall on a Hero.
Code:
$aSkillID_Recall = 925
$aHeroNumber= 2
$aHeroAgentID = GetHeroID($aHeroNumber)

Dropbuff($aSkillID_Recall, $aHeroAgentID)
Example2: A Hero has Recall on you:
Code:
$aSkillID_Recall = 925
$aHeroNumber= 2
$aMyID = GetMyID()

Dropbuff(aSkillID_Recall, $aMyID, $aHeroNumber)
Hello thanks
But don"t working :/ this function do nothing
i tried functions " DropAllbuffs(), DropAllBonds() Same way

Note : i added "925" in DropAllBonds function : Case 263,244,242, 925 ; $SKILLID_Protective_Bond, $SKILLID_Life_Attunement, $SKILLID_Balthazars_Spirit $SKILLID_Recall"

Hum, DropAllbonds() works.
05/01/2018 16:40 DerMoench14#4
Quote:
Originally Posted by yuramisu View Post
Hello thanks
But don"t working :/ this function do nothing
i tried functions " DropAllbuffs(), DropAllBonds() Same way

Note : i added "925" in DropAllBonds function : Case 263,244,242, 925 ; $SKILLID_Protective_Bond, $SKILLID_Life_Attunement, $SKILLID_Balthazars_Spirit $SKILLID_Recall"

Hum, DropAllbonds() works.
Yeah you're right, i was partially wrong!
It's a bit more complicated.

Code:
DropBuff($aSkillID, $aAgentID, $aHeroNumber = 0, $aHeroID = GetHeroID($aHeroNumber))
$aSkillID is obviously, no need to explain.
aAgentID is NOT the Agent you've casted a Skill on but rather the Agent who got the Buff.
For example, if you (Agent A) cast Balthazar's Spirit on a Target (Agent B) then Agent B got the Buff (Enchantment) so you would have to call
Code:
DropBuff($aSkillID, $aAgentID_Agent_B)
but :p
Recall is different. When you cast Recall on a Target then yourself got the Buff.
So you need to call
Code:
DropBuff($aSkillID, $aMyID)
Hope that clarified these things a bit.
08/16/2019 15:30 solos#5
I would like to bring this back up to life.
I'm actually messed up with dropbuff aswell doing exactly the same as the threadstarter. I try to run the release of recall being casted on a teammate before. i tried all the above and it didn't work for me- instead nothing happens at all. i tried to debug with msgbox, but didn't get further.