public static void Main() { var dm = NWGameObject.OBJECT_SELF; var amount = NWNXEvents.OnDMGiveXP_GetAmount(); var target = NWNXEvents.OnDMGiveXP_GetTarget(); var targetName = _.GetName(target); string log = $"Amount = {amount}, target = {targetName}"; WriteLog(dm, "Give XP", log); }
private static string ProcessEventAndBuildDetails(int eventID) { string details = string.Empty; NWObject target; int amount; switch (eventID) { case 1: // Spawn Creature string areaName = NWNXEvents.OnDMSpawnObject_GetArea().Name; NWCreature creature = NWNXEvents.OnDMSpawnObject_GetObject().Object; int objectTypeID = NWNXEvents.OnDMSpawnObject_GetObjectType(); float x = NWNXEvents.OnDMSpawnObject_GetPositionX(); float y = NWNXEvents.OnDMSpawnObject_GetPositionY(); float z = NWNXEvents.OnDMSpawnObject_GetPositionZ(); creature.SetLocalInt("DM_SPAWNED", _.TRUE); details = areaName + "," + creature.Name + "," + objectTypeID + "," + x + "," + y + "," + z; break; case 22: // Give XP amount = NWNXEvents.OnDMGiveXP_GetAmount(); target = NWNXEvents.OnDMGiveXP_GetTarget(); details = amount + "," + target.Name; break; case 23: // Give Level amount = NWNXEvents.OnDMGiveLevels_GetAmount(); target = NWNXEvents.OnDMGiveLevels_GetTarget(); details = amount + "," + target.Name; break; case 24: // Give Gold amount = NWNXEvents.OnDMGiveGold_GetAmount(); target = NWNXEvents.OnDMGiveGold_GetTarget(); details = amount + "," + target.Name; break; } return(details); }