I tried with a new ability spawning a new summon, but nothing drops. This is going to a bit long but bear with it for a while.
Be warned that i don't have the editor (i'm using linux and it doesn't work in wine, and i'm using the linux version of DOS EE besides).


I added this new entity (with a new map key) to one of the mod i'm altering (xc_encounters with the samaritan patch) roottemplates files:
Code
				<node id="GameObjects">
					<attribute id="Alignment" value="Good NPC" type="22" />
					<attribute id="BloodSurfaceType" value="1" type="1" />
					<attribute id="DisplayName" value="Undead Source Hunter" type="28" handle="" />
					<attribute id="Equipment" value="Summon_Source_GreaterUndead" type="22" />
					<attribute id="ExplodedResourceID" value="cd1918b9-f5fe-41f8-be10-7a5285d0e001" type="22" />
					<attribute id="ExplosionFX" value="FX_GP_CorpseExplosion_Skeleton_A" type="22" />
					<attribute id="Flag" value="0" type="4" />
					<attribute id="GroupID" value="0" type="5" />
					<attribute id="HitFX" value="FX_GP_Hit_Bone_A_Medium" type="22" />
					<attribute id="Icon" value="Portrait_Undead_Skeleton_Grunt_A" type="22" />
					<attribute id="LevelName" value="" type="22" />
					<attribute id="MapKey" value="12c5957b-4e9c-4482-a1c4-bf20aae39d43" type="22" />
					<attribute id="Name" value="Summon_UndeadSourceHunter" type="23" />
					<attribute id="PhysicsTemplate" value="78b438db-e742-4301-aa71-79508187c581" type="22" />
					<attribute id="Random" value="9223372036854788929" type="24" />
					<attribute id="RunSpeed" value="3.3" type="6" />
					<attribute id="Scale" value="1" type="6" />
					<attribute id="SkillSet" value="Summon_GreaterUndead" type="22" />
					<attribute id="SoundSwitch" value="Skel_Grunt" type="22" />
					<attribute id="Speaker" value="CYS_Undead_AggroSkeleton_Undead_M" type="22" />
					<attribute id="Stats" value="Summon_Source_GreaterUndead" type="22" />
					<attribute id="Type" value="character" type="22" />
					<attribute id="VisualTemplate" value="680fc263-8144-4eb7-82c5-1ef11a8a689e" type="22" />
					<attribute id="WalkSpeed" value="1.5" type="6" />
					<children>
						<node id="AIBounds">
							<attribute id="AIType" value="2" type="1" />
							<attribute id="Height" value="2" type="6" />
							<attribute id="Radius" value="0.5" type="6" />
						</node>
						<node id="Arms">
							<attribute id="Object" value="1c6ce0db-5ce1-4280-91af-8a58901e5858" type="22" />
						</node>
						<node id="Arms">
							<attribute id="Object" value="dca9b86e-499d-4622-bcbf-92fb412a5677" type="22" />
						</node>
						<node id="Arms">
							<attribute id="Object" value="24a201fe-8eab-40bf-9493-fcb153af9c62" type="22" />
						</node>
						<node id="Arms">
							<attribute id="Object" value="906a8859-008c-4f6e-8e94-b57aaa1f9b30" type="22" />
						</node>
						<node id="Arms">
							<attribute id="Object" value="e06c069b-9e30-4601-ac82-1561d0be0662" type="22" />
						</node>
						<node id="Arms">
							<attribute id="Object" value="a49a3a1b-acb0-414a-858f-bf0fe9287112" type="22" />
						</node>
						<node id="Bodies">
							<attribute id="Object" value="a8674e5e-a3a2-4e0f-a99b-614754462a16" type="22" />
						</node>
						<node id="Bodies">
							<attribute id="Object" value="53d25c2b-b1d0-43a3-a25b-e353891dd48d" type="22" />
						</node>
						<node id="Bodies">
							<attribute id="Object" value="58442bde-4efd-4eb2-b7ab-ae91158ff478" type="22" />
						</node>
						<node id="Bodies">
							<attribute id="Object" value="716f959a-3834-4e58-b135-26239d8356aa" type="22" />
						</node>
						<node id="Bodies">
							<attribute id="Object" value="09ff47b2-bae4-4b8e-afef-dfe89dcd2ca5" type="22" />
						</node>
						<node id="Heads">
							<attribute id="Object" value="c3af157f-f902-41bb-a4ec-e2013f9727c8" type="22" />
						</node>
						<node id="Heads">
							<attribute id="Object" value="a379d764-c03a-49ba-aff5-631adf93fda0" type="22" />
						</node>
						<node id="Legs">
							<attribute id="Object" value="c5f0fb4c-12ed-4c9d-9bd7-bcf9dfa3168e" type="22" />
						</node>
						<node id="Legs">
							<attribute id="Object" value="194eb12e-2d68-4475-85aa-49183998109e" type="22" />
						</node>
						<node id="Legs">
							<attribute id="Object" value="40d705df-b460-42f3-b3de-e0c5da762cd1" type="22" />
						</node>
						<node id="Legs">
							<attribute id="Object" value="a5f50696-9072-4d39-8627-1926973730fb" type="22" />
						</node>
						<node id="Legs">
							<attribute id="Object" value="2fe2d152-5b9d-4963-a6eb-3033700b44d0" type="22" />
						</node>
						<node id="OnDeathActions">
							<children>
								<node id="Action">
									<attribute id="ActionType" value="5" type="4" />
									<children>
										<node id="Attributes">
											<attribute id="templateAfterDestruction" value="" type="22" />
											<attribute id="visualDestruction" value="d77a175e-1c38-4fcc-8744-b40fc08341dd" type="22" />
										</node>
									</children>
								</node>
							</children>
						</node>
						<node id="Scripts">
							<children>
								<node id="Script">
									<attribute id="UUID" value="5bc80992-a7f6-4da6-83e2-3d276384d8f7" type="22" />
									<children>
										<node id="Parameters">
											<children>
												<node id="Parameter">
													<attribute id="MapKey" value="HardcoreOnly" type="22" />
													<attribute id="Type" value="1" type="4" />
													<attribute id="Value" value="0" type="23" />
												</node>
												<node id="Parameter">
													<attribute id="MapKey" value="SayBlindedText" type="22" />
													<attribute id="Type" value="1" type="4" />
													<attribute id="Value" value="1" type="23" />
												</node>
											</children>
										</node>
									</children>
								</node>
								<node id="Script">
									<attribute id="UUID" value="5f6440b3-51dd-42ab-9432-f9a94e4af403" type="22" />
									<children>
										<node id="Parameters">
											<children>
												<node id="Parameter">
													<attribute id="MapKey" value="HardcoreOnly" type="22" />
													<attribute id="Type" value="1" type="4" />
													<attribute id="Value" value="0" type="23" />
												</node>
											</children>
										</node>
									</children>
								</node>
							</children>
						</node>
						<node id="Treasures">
							<attribute id="TreasureItem" value="Magic_Loot" type="22" />
						</node>
					</children>
				</node>

Notice the new TreasureItem loot table:


And i added this new ability to SkillData.txt - a aside, i'm also asking what is the purpose of the second entry there. I'm just copying the pattern from the XC_Encounters skeleton summon where it has that second entry with _13 suffix, but i don't know what it's for, is it some kind of level scaling?:
Code
new entry "Summon_UndeadSourceHunter"
type "SkillData"
data "SkillType" "Summon"
data "Ability" "Summon"
data "Element" "None"
data "ActionPoints" "6"
data "Cooldown" "8"
data "CooldownReduction" "30"
data "ChargeDuration" "0"
data "Lifetime" "-1"
data "SummonLevel" "-1"
data "Magic Cost" "1"
data "Template" "12c5957b-4e9c-4482-a1c4-bf20aae39d43"
data "TargetRadius" "12"
data "Icon" "Skill_Source_CreateUndeadGreater"
data "DisplayName" "Summon_UndeadSourceHunter_DisplayName"
data "DisplayNameRef" "Summon Undead Source Hunter"
data "Description" "Summon_UndeadSourceHunter_Description"
data "DescriptionRef" "Summon an skeletal source hunter that serves beyond death."
data "StatsDescription" "Summon_UndeadSourceHunter_StatsDescription"
data "StatsDescriptionRef" "<p align="left"><font color="ff9500" size=19 face="Copperplate Gothic Light">   RECOMMENDED</font><br><font color=cc7700" face="Copperplate Gothic Light">    •    Scales with level<br></font><br><br><font face="Copperplate Gothic Bold">Range: [2]</font><br><br>A ghoulish invention of a borderline heretic of the order, this spell allows the summoning of source hunters that agree to fight after death. The hunter may drop broken magic loot they wore in their ill fated last journey.<br><br>You can only have one summon at a time.</p>"
data "StatsDescriptionParams" "SummonLevel;TargetRadius;Lifetime"
data "FXScale" "100"
data "PrepareAnimationInit" "skill_summon_earth_start"
data "PrepareAnimationLoop" "skill_summon_earth_loop"
data "PrepareEffect" "FX_Skills_WitchCraft_Summon_Prepare_A;FX_Skills_WitchCraft_Generic_A_Prepare_Hands:Bip001 R Forearm:Bip001 L Forearm"
data "CastAnimation" "skill_summon_earth_cast"
data "CastTextEvent" "cast"
data "CastEffect" "FX_Skills_WitchCraft_Summon_Cast_A"
data "CastEffectTextEvent" "cast"
data "TargetCastEffect" "FX_Skills_WitchCraft_Summon_Summon_A"
data "TargetEffect" "FX_GP_Target_WitchCraft_A"

new entry "Summon_UndeadSourceHunter_13"
type "SkillData"
using "Summon_UndeadSourceHunter"
data "Level" "13"

I added a loot to TreasureTable.txt at the end of the file:
Code
new treasuretable "Magic_Loot"
IgnoreLevelDiff 1
new subtable "-1"
object category "I_LOOT_Paw_A_Rabbit_A_Lucky",100,100,0,0,0,0,0,0
object category "I_LOOT_Claw_A_Sharp",100,100,0,0,0,0,0,0
object category "I_LOOT_Antler_A_Adult",100,100,0,0,0,0,0,0
object category "I_LOOT_Tusk_A_Large",100,100,0,0,0,0,0,0
object category "I_LOOT_Tail_A_Rat_A_Long",100,100,0,0,0,0,0,0
object category "I_LOOT_Foot_Chicken_A_Big",100,100,0,0,0,0,0,0
object category "I_LOOT_Eye_A_Creepy",100,100,0,0,0,0,0,0
object category "I_LOOT_Tooth_A_Sharp",100,100,0,0,0,0,0,0
object category "I_LOOT_Skull_Human_A_Ancient",100,100,0,0,0,0,0,0
object category "I_LOOT_Scraps_Metal_A",100,100,0,0,0,0,0,0
object category "I_LOOT_Scraps_Plate_A",100,100,0,0,0,0,0,0
object category "I_LOOT_Scraps_Scale_A",100,100,0,0,0,0,0,0

And i added new localization for the name of the summon and ability on the localization folder of the mod (which is how i know i'm summoning the right npc). I also used the samaritan mod on new game event to add the ability like it adds a bunch of others so that works.


Anyway, what doesn't work is the new loot table. In fact any loot table i add doesn't work. Is this normal? Does the game hardcode summons to erase their loot table before creating them?

Is there a workaround using the 'ondeath' triggers to spawn items? (Ideally making it so that only deaths created by enemies not pcs or henchmen create the item?=