public void SetDamageEventData(DamageData data) { string sFunc = "SetEventData"; NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Base); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Sonic); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Positive); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Negative); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Fire); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Electrical); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Divine); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Cold); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Acid); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Magical); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Slash); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Pierce); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Bludgeoning); NWNX_CallFunction(NWNX_Damage, sFunc); }
/// <summary> /// Deal damage to target - permits multiple damage types and checks enhancement bonus for overcoming DR /// </summary> /// <param name="data"></param> /// <param name="oTarget"></param> /// <param name="oSource"></param> public static void DealDamage(DamageData data, NWObject oTarget, NWObject oSource) { string sFunc = "DealDamage"; NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Power); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Sonic); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Positive); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Negative); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Fire); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Electrical); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Divine); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Cold); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Acid); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Magical); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Slash); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Pierce); NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.Bludgeoning); NWNX_PushArgumentObject(NWNX_Damage, sFunc, oTarget); NWNX_PushArgumentObject(NWNX_Damage, sFunc, oSource); NWNX_CallFunction(NWNX_Damage, sFunc); }
public DamageData GetDamageEventData() { string sFunc = "GetEventData"; DamageData data = new DamageData(); NWNX_CallFunction(NWNX_Damage, sFunc); data.Damager = (NWNX_GetReturnValueObject(NWNX_Damage, sFunc)); data.Bludgeoning = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Pierce = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Slash = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Magical = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Acid = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Cold = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Divine = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Electrical = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Fire = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Negative = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Positive = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Sonic = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); data.Base = NWNX_GetReturnValueInt(NWNX_Damage, sFunc); return(data); }