Interesting mod idea.
Since you're proficient in C#: Defs are simply classes, which get their fields filled using reflection. The values in these fields are in the XML files. Every Def is an instance, and there's one instance of the Def per Type of Def (e.g. there's one ThingDef named Beer). If you change the Beer ThingDef, you change it for all Things which share the single Beer ThingDef.
To create your mod, you'll need to find a way to lift along with the "raid was defeated" functionality. There's no clear cut "raid defeated" thing, but I'd wager LordToil_PanicFlee comes pretty close, with the caveat that it doesn't apply to mechanoids. Its UpdateAllDuties() method gets triggered when a human raid is defeated.
You can use Harmony to lift along with that method. Try a Postfix on the aforementioned method with a Log.Message as a start.
QuoteI really just need someone to give me a solid explanation of how the defs and dlls interact and work with each other.
Since you're proficient in C#: Defs are simply classes, which get their fields filled using reflection. The values in these fields are in the XML files. Every Def is an instance, and there's one instance of the Def per Type of Def (e.g. there's one ThingDef named Beer). If you change the Beer ThingDef, you change it for all Things which share the single Beer ThingDef.
To create your mod, you'll need to find a way to lift along with the "raid was defeated" functionality. There's no clear cut "raid defeated" thing, but I'd wager LordToil_PanicFlee comes pretty close, with the caveat that it doesn't apply to mechanoids. Its UpdateAllDuties() method gets triggered when a human raid is defeated.
You can use Harmony to lift along with that method. Try a Postfix on the aforementioned method with a Log.Message as a start.