Welcome to the Builder Academy

Question flying bug - down to 1 little issue, then we have a snippet.Still need help pls

More
03 May 2013 15:02 - 03 May 2013 15:04 #2082 by Papaya Pete
Replied by Papaya Pete on topic flying bug
Fly and Land Snippet

Check out the link, as it contains a snippet that was shared here for adding a do_fly and do_land command. Hope this helps.
Last edit: 03 May 2013 15:04 by Papaya Pete.

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

More
03 May 2013 15:10 - 03 May 2013 15:10 #2083 by JTP
Replied by JTP on topic flying bug
link on snippets site is for a skill, i need it to be a spell like stock tbamud has it, its a spell in stock.

I tryed changing a skill do_fly to a ASPELL(spell_fly)

Code:
ASPELL(spell_fly) { int percent, prob; if (IS_NPC(ch) || !GET_SKILL(ch, SPELL_FLY)) { send_to_char(ch, "You have no idea how.\r\n"); return; } if (GET_POS(ch) == POS_FLYING) { act("$n seems to be more down to earth.", TRUE, ch, 0, 0, TO_ROOM); act("You stop to fly, the earth seems to be closer to your feet.", TRUE, ch, 0, 0, TO_CHAR); GET_POS(ch) = POS_STANDING; return; } if (GET_MANA(ch) < (GET_LEVEL(ch)) || GET_MOVE(ch) < (GET_LEVEL(ch))) { act("You don't have the energy required to fly.", TRUE, ch, 0, 0, TO_CHAR); return; } percent = number(1, 101); /* 101% is a complete failure */ prob = GET_SKILL(ch, SKILL_FLY) / 2 + GET_INT(ch) * 2; if (percent > prob) { act("$n leeps into the air but quickly hit the ground, $e failed to fly.", TRUE, ch, 0, 0, TO_ROOM); act("You leep into the air but unfortunately hit the ground as you fail to fly.", TRUE, ch, 0, 0, TO_CHAR); GET_MANA(ch) -= (GET_LEVEL(ch)); GET_MOVE(ch) -= (GET_LEVEL(ch)); return; } else { GET_MANA(ch) -= (GET_LEVEL(ch)); GET_MOVE(ch) -= (GET_LEVEL(ch)); act("$n slowly raises towards the sky as $e starts to fly.", TRUE, ch, 0, 0, TO_ROOM); act("You slowly raise towards the sky as you start to fly.", TRUE, ch, 0, 0, TO_CHAR); GET_POS(ch) = POS_FLYING; return; } }
.
Last edit: 03 May 2013 15:10 by JTP.

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

More
03 May 2013 15:11 - 03 May 2013 15:39 #2084 by JTP
Replied by JTP on topic flying bug
It compiles fine, it just doesnt do anything

I neeed a fancy way to have code do
GET_POS(ch) = POS_FLYING; if people are AFF_FLYING, and POS_STANDING, when spell runs out


With stock code people still walk and stand with fly on.

In score im standing even when im flying, if i look in room then the char with fly on is still standing. But that part i found out how to do, i think..It just wont work until i can set GET_POS(ch) = POS_FLYING; <--is defined in structs.h
Last edit: 03 May 2013 15:39 by JTP.

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

More
03 May 2013 17:20 #2090 by rudeboyrave
Replied by rudeboyrave on topic flying bug
are you able to cast the spell? do your act messages show when you perform the spell in-game?

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

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

More
03 May 2013 17:32 - 03 May 2013 17:42 #2091 by JTP
Replied by JTP on topic flying bug
Yes spell works, AFF_FLY sets properly and shows in stat character.
And removes it self when it runs out, and i can move in water areas.

I just need the final touch, like:
I need people to be set to:
GET_POS(ch) = POS_FLYING;

So i can see:
$n flies %s

and when people look in the room they see:
jtp is flying here. instead of jtp is standing here.
Code:
/* for score */ case POS_FLYING: strcat(buf, "You are flying.\r\n"); break; /* fly move */ if (GET_POS(ch) == POS_FLYING) { sprintf(buf2, "$n flies away to the %s.", dirs[dir]); act(buf2, TRUE, ch, 0, 0, TO_ROOM);
.

From stat:
AFF: FLY
SPL: ( 25hr) fly sets FLY,
Last edit: 03 May 2013 17:42 by JTP.

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

More
03 May 2013 17:50 #2092 by rudeboyrave
Replied by rudeboyrave on topic flying bug
if you added pos_fly to structs.h make sure you ticked #define NUM_POSITIONS up by one.

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

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

Time to create page: 0.237 seconds