Welcome to the Builder Academy

Question Spell heroes feast

More
29 Aug 2017 21:24 - 29 Aug 2017 21:28 #6850 by JTP
Spell heroes feast was created by JTP
Trying to make a spell that affects everyone in group and in same room, here is what im trying.
Atm code compiles. But noone gets the sent_to_char or gets hunger and thirst 24 or get move points.

So basicly nothing happends.

Whats seems to be wrong ?

Code:
ASPELL(heroes_feast) { struct char_data *i; for (i = character_list; i; i = i->next) { if (CAN_SEE(ch, i) && IN_ROOM(i) != NOWHERE) { send_to_char(i, "You partake of a magnificent feast!\r\n"); gain_condition(i, HUNGER, 24); gain_condition(i, THIRST, 24); GET_MOVE(i) = GET_MAX_MOVE(i); } } }
Last edit: 29 Aug 2017 21:28 by JTP.

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

More
30 Aug 2017 18:57 #6851 by thomas
Replied by thomas on topic Spell heroes feast
Whoa! character_list is EVERYONE. Mobs and players alike. Everywhere. But you'd only see the ones in the room, so...

Looping in the room is done many places in the code, and typically uses code like this:
Code:
ASPELL(heroes_feast) { struct char_data *vict; // remove this when it works: log("INFO: triggered heroes feast at level %d", level); for (vict = world[IN_ROOM(ch)].people; vict; vict = vict->next_in_room) { if (CAN_SEE(ch, vict)) { send_to_char(i, "You partake of a magnificent feast!\r\n"); gain_condition(i, HUNGER, 24); gain_condition(i, THIRST, 24); GET_MOVE(i) = GET_MAX_MOVE(i); } } }
Does this work?

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

More
30 Aug 2017 19:11 - 30 Aug 2017 19:25 #6852 by JTP
Replied by JTP on topic Spell heroes feast
changed all the i to vict...it compiles but

casting the spell consumes mana

But no move is restored or hunger or thirst :(

log didnt show up
Last edit: 30 Aug 2017 19:25 by JTP.

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

More
31 Aug 2017 14:09 #6853 by JTP
Replied by JTP on topic Spell heroes feast
Dont even get the send_to_char message :(

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

More
02 Sep 2017 13:43 #6854 by thomas
Replied by thomas on topic Spell heroes feast
So, if the log didn't show up, you're not calling this piece of code. Basically, your problem is elsewhere in the code, not in this spell.

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

More
03 Sep 2017 09:34 #6855 by JTP
Replied by JTP on topic Spell heroes feast
Here is what iwe done...what is then missing sense you say the code isnt called ?
Code:
#define SPELL_HEROES_FEAST 116 spello(SPELL_HEROES_FEAST, "heroes feast", 100, 80, 2, POS_STANDING, TAR_CHAR_ROOM, FALSE, MAG_POINTS, NULL); ASPELL(heroes_feast) { struct char_data *vict; log("INFO: triggered heroes feast at level %d", level); for (vict = world[IN_ROOM(ch)].people; vict; vict = vict->next_in_room) { if (CAN_SEE(ch, vict)) { send_to_char(vict, "You partake of a magnificent feast!\r\n"); gain_condition(vict, HUNGER, 24); gain_condition(vict, THIRST, 24); GET_MOVE(vict) = GET_MAX_MOVE(vict); } } }

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

Time to create page: 0.192 seconds