HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Indirect bounty awarded

02-12-2008, 02:56 AM#1
SockSquirrelMouthwash
For this function in my map:
Collapse JASS:
private function ActionTrigger takes nothing returns nothing
   local unit target = GetSpellTargetUnit()
   local integer i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))

    call CasterCastAbility(Player(i), 'A02W', "unholyfrenzy", target, true)
    
    set target = null
endfunction
Using the CasterCastAbility function from Vex's castersystem, the function snatches a caster from a pool and gives it to Player(i) and makes it cast this modified unholyfrenzy to do damage over time to the target. Short of using some complex GetUserData or whatnot system, is there any way I can get the unit to give the player the appropriate bounty if it dies from the debuff? For a while I didn't notice this until I started seeing that I was not getting bounty rewarded whenever a unit died from the unholyfrenzy debuff. Any thoughts?
02-12-2008, 06:02 AM#2
Pyrogasm
Use your own dummy casters and make sure they survive and owned by the proper player until the unit no longer has the buff or has died.

'tis the only way; the CasterSystem won't do it for you.
02-12-2008, 03:35 PM#3
tamisrah
Actually it is possible to do this in caster system. There is a parameter called delay in 'CasterCastAbilityEx', which afaik may be used for exact that purpose.
So you would use the duration of your buff + some buffer time to make sure that your hero would get the bounty.
02-14-2008, 12:17 PM#4
zen87
use this before using CasterCastAbility
Collapse JASS:
  function CasterSetRecycleDelay takes real Delay returns nothing

where Delay is the maximum duration of your spell + 1 or +0.5
02-15-2008, 10:16 PM#5
Pyrogasm
More specifically, I would do this:
Collapse JASS:
globals
    private real DELAY = 1.00 //Or whatever
endglobals

//In your function
call CasterSetRecycleDelay(YourDuration+0.50)
call CasterCastAbility(...)
call CasterSetRecycleDelay(DELAY)