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 ➜ hands of wind

hands of wind

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


Posted by Ithildin   USA  (262 posts)  Bio
Date Mon 31 May 2004 06:34 PM (UTC)

Amended on Mon 31 May 2004 06:44 PM (UTC) by Ithildin

Message
ok, i added a haste spell to my mud. what this does is gives characters another attack in a round. here's my code for it in fight.c

if ( IS_AFFECTED(ch, AFF_HASTE))
	retcode = one_hit( ch, victim, dt );
	return retcode;

now, this works fine. but i also added a spell hands of wind. this spell would give them two attacks in a round and i put this code.

if ( IS_AFFECTED(ch, AFF_HANDS_OF_WIND))
	retcode = one_hit( ch, victim, dt );
	retcode = two_hit( ch, victim, dt );
	return retcode;

two_hit is copied exactly like one_hit beacuse i wanted the person with the spell to get two hits in. this doesn't seem to be working. i'm trying it on a mage with only one attack per round. when she is hasted she has her single, plus the hasted one_hit, but when she's hands of wind, she still only has her one attack per round. so the one_hit in the hands of wind if check isn't even workin.

any thoughts?
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #1 on Mon 31 May 2004 06:46 PM (UTC)
Message
i went ahead and took out the two_hit and just made it exactly like haste and it's still not working.


chance = IS_NPC(ch) ? ch->level
	   : (int) ((LEARNED(ch, gsn_fifth_attack)+(dual_bonus*3))/4);
    if ( number_percent( ) < chance )
    {
	learn_from_success( ch, gsn_fifth_attack );
	retcode = one_hit( ch, victim, dt );
	if ( retcode != rNONE || who_fighting( ch ) != victim )
	    return retcode;
    }
    else
	learn_from_failure( ch, gsn_fifth_attack );


	if ( IS_AFFECTED(ch, AFF_HASTE))
	retcode = one_hit( ch, victim, dt );
	return retcode;

	if ( IS_AFFECTED(ch, AFF_HANDS_OF_WIND))
	retcode = one_hit( ch, victim, dt );
//	retcode = one_hit( ch, victim, dt );
	return retcode;


this is where i'm at.
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #2 on Mon 31 May 2004 07:09 PM (UTC)
Message
got it to work.


if ( IS_AFFECTED(ch, AFF_HASTE))
	{
		retcode = one_hit( ch, victim, dt );
	if ( retcode != rNONE || who_fighting( ch ) != victim )
	    return retcode;
	}

	if ( IS_AFFECTED(ch, AFF_HANDS_OF_WIND))
	{
		retcode = one_hit( ch, victim, dt );
		retcode = two_hit( ch, victim, dt );
	if ( retcode != rNONE || who_fighting( ch ) != victim )
	    return retcode;
	}
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Mon 31 May 2004 08:33 PM (UTC)
Message
Yes, I was just going to say that you needed to be careful with your curlies. :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
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.


15,307 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.