- Joined
- Nov 17, 2010
- Messages
- 6,830
- Solutions
- 586
- Reaction score
- 5,413
TFS 0.3.7
This has been driving me a bit crazy, and I'm trying to find a good means to figure this out.
I want to know the raw damage/healing value being sent to a creature.. and be able to alter those values before they are applied to a creature.
Here is anything dealing with creature-creature interactions.
We can throw most of these out since they are useless for what we are trying to do.
We can further get rid of some of these.
onTarget - is when you are specifically targetting a creature
onAttack - is when you are attacking a creature using a weapon of some kind.
OnCast - again focus's on single target
onAreaCombat - doesn't effect single target.. very specific use-case.
onKill/Death/PrepareDeath - all of these are after the damage has been calculated and added.
So we are left with above.
onStatsChange
- "value" is calculated after looking at resistances/immunities/armor/current creature health.(rounding down to creatures max health if the raw value will kill the creature)
- This could work, however "value" is already determined when it get's to this point.
- I haven't found a way to change the value of value and 'continue' with the damage.
- If you return false, it negates all damage. - useful.. but not for what we are doing.
I don't think onStatsChange fit's the bill.
(however if someone knows how to edit value and continue script with the edited value.. that would be awesome to know.. and might be a non-optimal work-around)
I want to see the raw values before they have been altered.
onCombat
Now.. I've never used onCombat before but it doesn't have any direct information.
From the sound of it, it appears to happen the moment that combat is initiated between two targets.
Can onCombat check/detect the values being sent from cid to target?
Or is it only detecting if combat has been initiated?
Is there a function I've overlooked?
I don't feel there is any way to find these damage values before they are calculated and sent to the recipient.
Any feedback would be great, whether it's somber news or an enlightening piece of information.
Cheers,
Xikini
This has been driving me a bit crazy, and I'm trying to find a good means to figure this out.
I want to know the raw damage/healing value being sent to a creature.. and be able to alter those values before they are applied to a creature.
Here is anything dealing with creature-creature interactions.
Code:
function onTradeRequest(cid, target, item)
function onTradeAccept(cid, target, item)
function onStatsChange(cid, attacker, type, combat, value)
function onAreaCombat(cid, ground, position, aggressive)
function onPush(cid, target)
function onTarget(cid, target)
function onFollow(cid, target)
function onCombat(cid, target)
function onAttack(cid, target)
function onCast(cid, target)
function onKill(cid, target, damage, flags)
function onDeath(cid, corpse, deathList)
function onPrepareDeath(cid, deathList)
We can throw most of these out since they are useless for what we are trying to do.
Code:
function onStatsChange(cid, attacker, type, combat, value)
function onAreaCombat(cid, ground, position, aggressive)
function onTarget(cid, target)
function onCombat(cid, target)
function onAttack(cid, target)
function onCast(cid, target)
function onKill(cid, target, damage, flags)
function onDeath(cid, corpse, deathList)
function onPrepareDeath(cid, deathList)
We can further get rid of some of these.
onTarget - is when you are specifically targetting a creature
onAttack - is when you are attacking a creature using a weapon of some kind.
OnCast - again focus's on single target
onAreaCombat - doesn't effect single target.. very specific use-case.
onKill/Death/PrepareDeath - all of these are after the damage has been calculated and added.
Code:
function onStatsChange(cid, attacker, type, combat, value)
function onCombat(cid, target)
onStatsChange
- "value" is calculated after looking at resistances/immunities/armor/current creature health.(rounding down to creatures max health if the raw value will kill the creature)
- This could work, however "value" is already determined when it get's to this point.
- I haven't found a way to change the value of value and 'continue' with the damage.
- If you return false, it negates all damage. - useful.. but not for what we are doing.
I don't think onStatsChange fit's the bill.
(however if someone knows how to edit value and continue script with the edited value.. that would be awesome to know.. and might be a non-optimal work-around)
I want to see the raw values before they have been altered.
onCombat
Now.. I've never used onCombat before but it doesn't have any direct information.
From the sound of it, it appears to happen the moment that combat is initiated between two targets.
Can onCombat check/detect the values being sent from cid to target?
Or is it only detecting if combat has been initiated?
Is there a function I've overlooked?
I don't feel there is any way to find these damage values before they are calculated and sent to the recipient.
Any feedback would be great, whether it's somber news or an enlightening piece of information.
Cheers,
Xikini