Affects to up stats while on

Posted by MasterJay on Mon 22 Aug 2005 03:35 PM — 5 posts, 17,781 views.

#0
I want to make a do_ fuction for my mud to grant a player an affect that will up their stats until the affect is gone (by death ). The do_ fuction works perfectly, minus that the stats on the victim do not go up. But how do you make an affect increase the stats for a player as long as the affect is on? (like str +2, int +3 but when the player dies, the affect is gone so the stats return to normal)

I dont need anything to take off the affect, it automatically goes away when the player dies. I just want some help to increase the victims stats while the affect is in place. Thanks in advance
USA #1
I'm not sure I understand your problem. I've never had trouble with spell effects that add e.g. 2 strength. How exactly are you creating these effects?
#2
Okay lemme back up a bit and maybe that'll help you to understand it.

What I am planning is an affect to increase a few stats while that affect is on, it will be triggered by a command and not a skill.

Its an affect like "ShockShield" or "Fireshield" that displays a message under the players name. But I want it to be when a player has that affect, that their stats increase by say 2 in str and 3 in INT. but when the affect goes away the stats return to their base. In short its a temporary stat increase.

The command works (the messages are sent to the user and victim and the victim gets the affect) but how can I make it that the victim's stats boost for as long as they have that affect on?

Maybe this is a better way to put it: I want an affect to do more then just show like " *Bob has electricity going through him" I want it to also give Bob a +2 in spd while he still has the affect of electricity going through him.

I'm not very good at explaining things, sorry If I sound repetitive.
USA #3
Why can't you use the same method that e.g. objects use? An effect that works on AF_STRENGTH or whatever it is, with a modifier of e.g. +2?

And how are you adding the effect? Is it by adding something to the list of effects, or by setting an affected_by bit?

An easy way of solving this problem would be to edit the function get_curr_str and simply have it return +2 if the player is affected_by(your_affect). It's a little less general, but hey...
#4
I added it as an affected_by bit

Heh, I spent too much thought on this way instead of that.

I did that and now it works perfectly, Thank you very much!