Welcome to the Builder Academy

Question Why is it the snake that falls asleep :)

More
22 Apr 2016 21:38 - 24 Apr 2016 15:52 #5788 by JTP
Last edit: 24 Apr 2016 15:52 by JTP.

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

More
24 Apr 2016 15:27 #5792 by thomas
You must make a choice here - either you let the snake use the sleep spell, or you code your own. You're close to have made your own, by the way.
Code:
call_magic(ch, FIGHTING(ch), 0, SPELL_SLEEP, GET_LEVEL(ch), CAST_SPELL); + GET_POS(FIGHTING(ch)) = POS_SLEEPING; stop_fighting(FIGHTING(ch)); stop_fighting(ch); - GET_POS(ch) = POS_SLEEPING;

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

More
24 Apr 2016 16:57 #5794 by JTP
Ok atleast the snake didnt fall asleep now. But the character doesnt sleep either.

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

More
30 Sep 2016 17:13 #6187 by JTP
Hmm trying to get this to Work..But it says the char goes to sleep, the char is affected by sleep. But isnt in POS_SLEEPING.


Casting 'sleep' spell Works just fine, so whats up ?

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

More
30 Sep 2016 20:52 #6188 by thomas
My bad - github.com/tbamud/tbamud/blob/2f12752373...8a4/src/fight.c#L151 stop_fighting() will reset the opponent to standing position.

I suggest doing something in this vein:
Code:
struct *char_data fighting = FIGHTING(ch); // at top of function ... call_magic(ch, FIGHTING(ch), 0, SPELL_SLEEP, GET_LEVEL(ch), CAST_SPELL); stop_fighting(FIGHTING(ch)); stop_fighting(ch); GET_POS(fighting) = POS_SLEEPING;

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

More
30 Sep 2016 21:17 #6189 by JTP
That seems to Work...thanks alot

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

Time to create page: 0.225 seconds