How would you make an enemy buff you on death?

Right now I’m working on a mod that would be sort of a Headhunter mode of sorts if you’re familiar with Path of Exile - the main premise is that on killing a hero, you’d gain the powers of that hero for a certain amount of time.

Except, I have no idea how I’d go about having an enemy buff me on death. I saw that enemies have a slot for their dying skill in their database records and I figured I’d start there but I’ve had no luck. First I was trying to take an existing dying skill like aether conflagration and tacking on an autocast skill that would add a buff (I was using Kymon’s Blessing to test, not sure if that matters), except I don’t think any of the autocast controllers really apply to this situation. I tried “cast @ self on enemy death 100%” as the controller and it didn’t do anything, then I also tried to modify the low health controller so it triggers 100% of the time if you’re at 100% health or below (so always), but no luck there either. So next, I tried just making it so that the enemy just casts Kymon’s Blessing on death, and there was no effect there either. I’m guessing the enemy in that case just casts Kymon’s Blessing on itself right before it dies, but I’m not 100% sure.

I’m not sure how to get an enemy to cast a buff on me, I guess is the big problem here. I’ve thought about messing with the devotion controllers for this too and just making a 1-point skill that’s “kill a hero, get their stuff” but I don’t think that would work because there aren’t controllers for triggering a skill on a specific enemy’s death, plus I’d need to know what powers to apply.

So hopefully this wasn’t too much stream of consciousness. Any ideas? I’m thinking at this point I’ll probably need lua scripts for this but I have no clue how to use lua so that’d take some more research on my part.

Having an enemy cast a skill on death is tricky, sometimes it doesn’t work sometimes it does, having it cast a buff I haven’t tried, but it seems unlikely to work easily.

You can give the enemy an ‘empty’ passive, then add an auto cast on death skill onto that passive. Make that autocasted skill a debuff, but just put positive numbers instead of negative. Play around with that if you haven’t already. I’m not sure if that will work but it sounds right in my head…

It’s an idea at least. I’ll try that and see what happens.

Now that I’ve had a chance to play with this some I think I’m still confused. When you say give the enemy a blank passive with an autocast skill, I get that part but I’m not sure how to control it so that it would fire on that enemy’s death. Do devotions work on enemies the same way they work on players? So for instance if I gave an enemy a passive with autocast skill that uses the cast at 50% health controller, that skill would be used when the enemy hits half health?

This would probably be easier if there was an “on dying” controller but I don’t think that exists.

Thanks for the help though, this is definitely a fun thing to mess around with.

a) In my experience autocasts on passives don’t really work except for the on-hit and low-health passives.

b) autocast on death applies to on enemy death, not on the owner’s death.

The way I was thinking of doing it in Zenavathar’s chat was just a PBAoE like War Cry that autocasted a debuff (with positive effects, as per ASYLUM’s suggestion) 100% chance on attack (with no cooldown for the debuff), and to cast that skill when the owner of the skill dies. I have not ever seen on death fail, except for when entities spawn and die in less than a second.

OK I made a mistake, it has to be a buff or a passive on life buff. Try that instead? The skill you want casted goes on the auto cast skill.

That makes a lot of sense actually. Thanks for the suggestions. :slight_smile:

Well, drats.

I did what Ceno suggested, and it’s working, but when you do it that way you’re limited to the things a debuff skill can do - modifications to speed percentages, OA/DA, total/physical/elemental damage, resists, etc., and then stuff for hurting yourself. It doesn’t seem like a debuff is granular enough to give the specific buffs that heroes have, and in the case of heroes with auras and what-not it’s not going to do that at all.

I’m probably going in way over my head, but is it possible to create a new debuff template that would include fields for all of this stuff?

I did a buff on die effect for the usable item/buff scrolls I posted, basically all you need to use is the Skill_BuffOther.tpl and trigger it on death. This should do the trick. If it doenst it only works on friendly targets, in which case you would need lua or a skill that will spawn a new entity friendly to the player which dies instantly and casts the spell then.

That’ll do it. This is the last ditch effort but it will work… it’s just a bitch to do…

Have the enemy with a skill that spawns a pet/npc on death, then have the pet/npc cast the skill and then die a second later. Just make sure the pet/npc is invisible otherwise it will be weird.

Hm, true.

In that case, have the debuff autocast a regular positive buff (probably [noparse]cast_@enemyonattack_100%.dbr[/noparse], since the source is technically an enemy and the enemy of an enemy is you, generally).

This is absolutely 100% possible without lua, I just can’t be arsed to implement it myself…eh, maybe I should.

Note that this sort of stuff generally stops making sense in multiplayer, and you probably have a sizable chance of having buff desync and killing players. :stuck_out_tongue:

Headhunter is (AFAIK) done solo in PoE anyway and the competition involves seeing who can get the most XP in their game in the allotted time, so that’s more or less what I’m shooting for here too. I almost want to try to get stable multiplayer headhunter working now just because it’d be complete chaos though.

That also reminds me - if I wanted this true to that experience, I’d probably need to turn off all the quests/quest triggers, or at least make it so that quests give 0 XP. Headhunter races are very much a “go out unto the world and kill as much as you can” sort of thing.

A reach goal for this that I’d implement after everything else is somehow figuring out a way to give the game a time limit, so that after say 30 or 45 minutes you’re given your XP total and everything ends. A really hacky way I’ve considered doing it is making the game hardcore only and just applying a debuff at the start of the game that kills you after X number of minutes (if that can be done).

Finally had a chance to come back to this and I’ll be, having the enemy just cast a buff skill worked.

Okay, so the newest stumbling block is how to get more than one buff applied on a hero kill. So say for example the Burning affix (since that’s what I’m testing with), it has a passive stat boost and a ring of flame attack. What I’ve been trying to do is to have the enemy cast an on-death buff that gives me the passive stat boost, and then have the passive stat boost give me the ring of fire attack as an autocast. The problem with that I’m having is that the passive gets applied just fine, but the autocast never triggers no matter what controller I use. Is there some controller that would work for this, or is this now a situation where I’d have to bring in an invisible pet and do all that business?

Also another thing I want to do is for enemies that have special attacks (like Corrupted’s aether conflagration attack), I want to make those attacks trigger at random on any attack I have that I use (so possibly not just WPS skills but something that would be used regardless of the attack). Is that even doable? Is making a temporary WPS skill even doable?

So a ring of flame is just another buff, it’s not an attack. You should be able to trigger it from the stat-buff if you target the player with the ring of flame buff on-attack 100%.

As for giving a player temporary procs…not to my knowledge, no.

Cool, I’ll try that.

Maybe for the proc thing, instead of having it be an attack proc I’ll just make it so that it attaches to the stat buff as an on-hit proc instead. It’s not exactly the same but I’m fairly certain that would work.

Okay, I think I’ve pinned down where the problem is.

Right now, to make an enemy cast a buff on me when they die I have to give them a Skill_AttackRadius as a dying skill, and that skill procs the buff 100% on attack. The buff is a Skill_AttackBuff (otherwise it doesn’t seem to work) which is linked to a SkillBuff_Passive that provides the stat boost.

However, it seems like trying to link any kind of a proc to a SkillBuff_* skill doesn’t do anything. I’ve tried more or less every controller I can think of, but no luck. Oddly enough, if I use an oncastbuff controller to link the ring of fire buff to the passive, the enemy that I give the skill to is able to use the ring of fire attack just fine even though it’s not in its skill tree. When I did a debug version of the skill that’s just a Skill_BuffSelfDuration and has an onattack proc to exact same ring of fire buff, with no other changes, then it procs just fine. The problem with that though is I’m pretty sure through my testing that a Skill_AttackBuff has to link to a SkillBuff_*, which is where the problem lies. Making the stat boost a Skill_BuffSelfDuration instead makes it not do anything.

Any ideas? I’m kinda stuck again. Hopefully my description was detailed enough.

e: Oh man I think I know why this is happening and I have no idea how to fix it. A Skill_BuffSelf is a skill you cast on yourself, but a SkillBuff_ is a skill that someone else has cast on you. I’m starting to think from this that an autocast skill can only attach to the caster of the skill and not its target. Therefore, any autocast attached to a SkillBuff_ can only ever proc on the enemy I’m trying to get the skill from and not me. That would also explain why my test enemy (I’m using Kyzogg since he’s in a reliable place and can be gotten to quickly) was able to use ring of flame on himself.

e2: I was really kind of hoping that the lua scripting would give some kind of character:GrantSkill method or something but no such luck. As far as I can tell, any instance of that happening in the main game is done through conversations.

e3: Well damn, now I feel like I’m back to square one. I can give myself a stat boost on killing an enemy, but that’s it. I don’t see a way to make that grant skills in addition.

It’s easy to get caught up in that, but honestly, it’s not that cool of a mechanic or idea in my honest opinion, so I wouldn’t beat yourself up for not implementing it in Zenith.

As for how to do it; Asylum has the idea.
create a creature, make sure under the creature’s faction, it is set to Player_Faction so it is allied, and give grant it the “buffOther” skill, and set to “ally”, and make him invisible by setting his actor size to 0.01

Make the enemy spawn the creature on death via Proxies/PoolsDeathsSpawn (just duplicate one of the existing files, and change name/ pool), and make sure the enemy who would grant the buff on kill has that creature set to be summoned, which would be done by setting the PoolToSpawnOnDeath inside of his Death Parameters tab to whatever Proxy you placed the invisible creature to add the buff, then set chance to spawn 100%.

Sadly, we’re no longer in Titan Quest.