How to tell how someone died

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Post Reply
Message
Author
Castler
Thalore
Posts: 153
Joined: Mon Mar 25, 2013 10:09 pm

How to tell how someone died

#1 Post by Castler »

I'm trying to trigger special effects based on how a monster was killed (so a main-hand attack triggers one effect, an off-hand attack triggers a different effects, talents and DoTs a third effect, etc.).

It looks like I could make up a last_damage_source field and set it as appropriate in preUseTalent, attackTarget, timedEffects, etc., then check it in die or on_die. But I don't know if I'm missing anything or if there's a cleaner solution.

Ideas or suggestions?

Thanks.
Qi Daozei (QDZ) - an Oriental-themed fantasy game for T-Engine. ToME Tips - auto-generated spoilers for ToME.

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: How to tell how someone died

#2 Post by lukep »

A different solution would be to put in in Combat.lua (and elsewhere). You would just add checks for "if target.dead then" at the appropriate points.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: How to tell how someone died

#3 Post by darkgod »

Your solution sounds about right, since it's your own module you do control everything so should work.
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply