Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ nanny problem with affect remove

nanny problem with affect remove

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Ithildin   USA  (262 posts)  Bio
Date Wed 22 Sep 2004 08:14 PM (UTC)
Message

So, I made a camp skill for players before they log out. And when they return back into the game, i want nanny to take off the affect. I did this code, but what is happening is that it's taking off the bottom spell and not the actual camp spell. if the camp is on bottom, then yea, it will take it off. what camp does is like panic, but only you have to be "camped" before you can quit. this is in nanny in comm.c. i know i'm not calling the right thing to call. paf should = the spell.


if (xIS_AFFECTED (ch, AFFX_CAMP))
        {
                paf = ch->affected;
                affect_remove(ch, paf);
        }


would it be something like:

paf = AFFX_CAMP;

i'm not really sure.
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #1 on Wed 22 Sep 2004 08:15 PM (UTC)
Message
and what panic does is create an affect that is put on the player. they can't log out until there panic has subsided. they get the panic flag when they fle from combat.

camp just puts on an affect flag so the player can log out.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #2 on Wed 22 Sep 2004 08:17 PM (UTC)
Message
Could you give me the prototypes for xIS_AFFECTED and affect_remove, as well as the type of your variables 'paf' and 'ch->affected'? Just so that I can be sure of what we're working with here.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #3 on Wed 22 Sep 2004 08:27 PM (UTC)
Message
here's a loop in db.c

in void free_char

AFFECT_DATA *paf;

for (paf = ch->affected; paf; paf = paf->next)
{
if (paf->deleted)
continue;
affect_remove (ch, paf);
}

and the only time i see ch-> affected is in those loops.

i'm guessin' i tried lookin for a loop which isn't there. i was just wanting to find that one spell and take it off. i'm note really sure on how to do that, because these are for taking more than one spell off.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Wed 22 Sep 2004 09:59 PM (UTC)
Message
You're doing two things that are quite different. The loops you're showing me are for effect structures, not bitvector entries in ch->affected_by. That's why I asked for xIS_AFFECTED, to see if it's looking at the bitvectors - if so you'll simply need to unset the flag the same way any flag is unset.

Basically you are dealing with effect structures but you want to be dealing with bitvectors.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #5 on Wed 22 Sep 2004 10:10 PM (UTC)
Message
i'm working with envy. and they set everything to a spell first. so it's not a bitvector. it's a spell to remove. i'm wanting to remove the affect of the spell.
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #6 on Wed 22 Sep 2004 10:25 PM (UTC)
Message
i figured it out. thanks though.

if (xIS_AFFECTED (ch, AFFX_CAMP))
affect_strip (ch, gsn_camp);
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


21,224 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.