ok so im looking to give each of the clans on the mud a seperate unique skill/spell/affect.
like say you are part of clan khaos then you should be affected by chaos
how would i go about starting this task?
I'd start by looking at how they're done for deities myself..
One way would just to (it's a hackish approach) add ifchecks in the is_affected function or whatever it's called. Ifcheck for clan, and return true for specific affect.
If you want to add totally generic affects with the same flexibility as affects on items, you'll need to do a lot of paperwork. Look up my "Fix room affects" snippet at mudbytes.net, which deals with adding affects to rooms (broken support for this came with stock SMAUG, the snippet fixes it but in the process ends up practically rewriting all of it from scratch. I think the snippet is built into the latest SMAUGFUSS). There you'll see most of the paperwork involved. Some of the paperwork is:
1. When saving a playerfile, you must strip the affects from the player first before writing any data. Then once the data is written, you must put the affect back on. This is so that if an imm changes the clan's affects while the player is offline, the player won't be corrupted.
2. Any time an imm changes the affects, all online players should have the changes applied to them. Otherwise, they will be corrupted.
3. The affects will need to be applied when a char enters the clan, and removed when they're outcast.
4. You'll need to make some way for the imms to actually set the affects. For this, look up do_redit and search for what happens when imms set room affects with "redit affect blah blah blah". Similarly, a way to view and remove the affects.
5. You'll need to make the MUD save the affects in the clanfile, and load them when loading the clanfile.
NOTE: If you only want to modify affectedby, resistant, immune, susceptible, then things are much easier and you can just copy the deity code like someone mentioned. My version is for if you want totally generic affects like damroll, hp, etc.