Ok, thanks for the help with that idea Axe_Murderer. Since it would not have worked as I had hoped, I am going to instead put it on a creature's skin as an 'on hit cast uniquie power spell' property that 'absorbs' the 4 elemental damage types (heals for double whatever they caused), but my script won't fire like i had hoped. First, the creature was hit with spells and did not get healed at all, not sure what I did wrong there. Next, The physical damage i did to him with a sword that had elemental damage on it did produce the healing effect but the healed amount did not appear as a speak string, (which links to my third problem). Lastly, the green floating text which was supposed to show how much the creature healed overall did not show above his head. If you would, it would be great if anyone could look over the script and see what I messed up on.
Here are the scripts I used:
1) "toamarutprops"
#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
switch (nEvent)
{
case X2_ITEM_EVENT_ACTIVATE:
ExecuteScript("ac_"+GetTag(GetItemActivated()),
OBJECT_SELF); break;
case X2_ITEM_EVENT_EQUIP:
ExecuteScript("eq_"+GetTag(GetPCItemLastEquipped()),
OBJECT_SELF); break;
case X2_ITEM_EVENT_UNEQUIP:
ExecuteScript("ue_"+GetTag(GetPCItemLastUnequipped())
, OBJECT_SELF); break;
case X2_ITEM_EVENT_ACQUIRE:
ExecuteScript("aq_"+GetTag(GetModuleItemAcquired()),
OBJECT_SELF); break;
case X2_ITEM_EVENT_UNACQUIRE:
ExecuteScript("ua_"+GetTag(GetModuleItemLost()),
OBJECT_SELF); break;
case X2_ITEM_EVENT_SPELLCAST_AT:
ExecuteScript("sp_"+GetTag(GetModuleItemLost()),
OBJECT_SELF); break;
case X2_ITEM_EVENT_ONHITCAST:
ExecuteScript("on_"+GetTag(GetSpellCastItem()),
OBJECT_SELF); break;
}
}
....which links the item to this script:
2) "on_toamarutprops"
void main()
{
object oMarut = GetObjectByTag("ToA_Marut");
//object oTarget = oMarut;
int nFireDamage = GetDamageDealtByType(DAMAGE_TYPE_FIRE);
int nColdDamage = GetDamageDealtByType(DAMAGE_TYPE_COLD);
int nElectricDamage = GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL);
int nAcidDamage = GetDamageDealtByType(DAMAGE_TYPE_ACID);
string sFireDamage = IntToString(nFireDamage);
string sColdDamage = IntToString(nColdDamage);
string sElectricDamage = IntToString(nElectricDamage);
string sAcidDamage = IntToString(nAcidDamage);
effect eEffectFire = EffectHeal(2*nFireDamage);
effect eEffectCold = EffectHeal(2*nColdDamage);
effect eEffectElectric = EffectHeal(2*nElectricDamage);
effect eEffectAcid = EffectHeal(2*nAcidDamage);
eEffectFire = SupernaturalEffect(eEffectFire);
eEffectCold = SupernaturalEffect(eEffectCold);
eEffectElectric = SupernaturalEffect(eEffectElectric);
eEffectAcid = SupernaturalEffect(eEffectAcid);
if (GetDamageDealtByType(DAMAGE_TYPE_FIRE) > 0)
{
DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffectFire, oMarut));
DelayCommand(0.01, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_S), GetLocation(oMarut)));
FloatingTextStringOnCreature("<c € >+"+sFireDamage+"</c>", oMarut, FALSE);
}
if (GetDamageDealtByType(DAMAGE_TYPE_COLD) > 0)
{
DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffectCold, oMarut));
DelayCommand(0.01, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_S), GetLocation(oMarut)));
FloatingTextStringOnCreature("<c € >+"+sColdDamage+"</c>", oMarut, FALSE);
}
if (GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL) > 0)
{
DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffectElectric, oMarut));
DelayCommand(0.01, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_S), GetLocation(oMarut)));
FloatingTextStringOnCreature("<c € >+"+sElectricDamage+"</c>", oMarut, FALSE);
}
if (GetDamageDealtByType(DAMAGE_TYPE_ACID) > 0)
{
DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffectAcid, oMarut));
DelayCommand(0.01, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_S), GetLocation(oMarut)));
FloatingTextStringOnCreature("<c € >+"+sAcidDamage+"</c>", oMarut, FALSE);
}
}
Thanks again for the help