Combat can be tricky. GETHIT happens when the player actually gets hit with a damage.
It is not the trigger used to calculate the damage...
MAGE DAMAGE - do all your calculations inside the SpellEffect Trigger.
PHP Code:
ON=@SpellEffect
REF1=<SERV.UID.<SRC.UID>> // Caster
REF2=<SERV.UID.<UID>> // Target
// also here in this trigger <ARGN1> is the spell no.
// Here we know the caster the target and the spellno
// do your calculations here get a total, local.DamageTotal
// then carry the damage value across to the GetHit Trigger, for example as a CTAG
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.damageTotal>>
MELEE DAMAGE - do all your calculations inside the HIT Trigger.
PHP Code:
ON=@HIT
REF1=<SERV.UID.<UID>> // Attacker
REF2=<SERV.UID.<SRC.UID>> // Victim
REF3=<SERV.UID.<ARGO.UID>> // Weapon 0 if Fists
// here in this trigger <ARGO> is the weapon
// Here we know the attacker target and weapon
// do your calculations here get a total, local.DamageTotal
// then carry the damage value across to the GetHit Trigger, for example :
REF2.CTAG.A_Melee_Damaged_Me_For=<EVAL <LOCAL.damageTotal>>
Then now you have the damage tagged to the person whom is getting Hit !!
PHP Code:
ON=@GETHIT
REF1=<SERV.UID.<UID>> // Person getting HIT
IF <REF1.CTAG0.A_Melee_Damaged_Me_For>
ARGN1=<EVAL <REF1.CTAG.A_Melee_Damaged_Me_For>>
ARGN2=dam_god // This is the damage type you can have dam_fire etc also look into it
ARGN3=0 ( I cant remeber what this is )
ELIF <REF1.CTAG0.A_Mage_Damaged_Me_For>
ARGN1=<EVAL <REF1.CTAG.A_Mage_Damaged_Me_For>>
ARGN2=dam_god // This is the damage type you can have dam_fire etc also look into it
ARGN3=0 ( I cant remeber what this is )
ELSE
// This should never happen.
ENDIF
Ok so briefly now :
1. Do all your damage calculations in HIT and SPELLEFECT
2. Transfer these damages one way or another to the GETHIT Trigger
3. In the GETHIT Trigger set ARGN1 asthe damage
4. ARGN2 as the damage type
5. Set ARGN3 as 0 (I dont remeber why i did this but i have a feeling it was parry or resist)
6. NOTE:dam_fire, or dam_cold, will get resisted by resfire rescold etc but dam_god wont get resisted.
Ooops I forgot to say and its important... Remeber to remove the tags after you pass the damage !!
PHP Code:
ARGN1=<EVAL <REF1.CTAG.A_Mage_Damaged_Me_For>>
REF1.CTAG.A_Mage_Damaged_Me_For=