Welcome to the Builder Academy

Question Permanent effects

More
28 Sep 2021 23:58 #9941 by cunning
Replied by cunning on topic Permanent effects
We added a -1 check for INNATE. Instead of using a flag, if a perma spell gets introduced we make the duration -1 and as it checks for spell wear off, it skips those with -1.
The following user(s) said Thank You: wlessard1

Please Log in or Create an account to join the conversation.

More
02 Sep 2025 18:43 #10884 by wlessard1
Replied by wlessard1 on topic Permanent effects
I have read through this a few times and I guess I am being either my normal blind ass or I am just not getting it.
I understand the concept of AFF_XXX | AFF_INNATE even if I am not visualizing how it would work/be set as a check etc.
Not really seeing how it would be added.
BUT first, can someone at least point to the specific functions that govern the Affects system.
What causes an affect to end, what causes it to attach, and such.
Added races and have them working fine but I am trying to add for example infravision for a dwarf and make it stick between logins, copyovers and crashes in general.

Any info would be useful as to what to check.
affect_to_character and what else will take away those affects?

I am really not looking for someone to hold my hand but I need a little bit more to go on.

Please Log in or Create an account to join the conversation.

More
02 Sep 2025 21:25 #10886 by thomas
Replied by thomas on topic Permanent effects
github.com/tbamud/tbamud/blob/f6339b495e...3/src/handler.c#L108 is the aff_apply_modify() function which does the actual modification when calculating what effect an affect will have.

github.com/tbamud/tbamud/blob/f6339b495e...3/src/handler.c#L208 is the affect_modify_ar() function which sets or removes the affection flags on the character depending on the supplied bitmask.

github.com/tbamud/tbamud/blob/f6339b495e...3/src/handler.c#L230 is the affect_total() function which will reset a character to default stats, then cycle through the equipment and affections and add them again. This makes sure some sanity checks are performed as well.

github.com/tbamud/tbamud/blob/f6339b495e...3/src/handler.c#L282 is the affect_to_char() function which sets the affect on the character and then calls affect_total().

github.com/tbamud/tbamud/blob/f6339b495e...3/src/handler.c#L299 is the affect_from_char() function that will remove the affect from the character and then call affect_total().
I figure this is the place to check if the INNATE flag is set in the input, and if so, just not remove it.

github.com/tbamud/tbamud/blob/f6339b495e...3/src/handler.c#L339 is affect_join() which handles those spells that combine either effect or duration when cast twice or more on the same character.
The following user(s) said Thank You: wlessard1

Please Log in or Create an account to join the conversation.

Time to create page: 0.210 seconds