Please Log in or Create an account to join the conversation.
zusuk wrote: Someone requested this code, so I thought I'd share it. It is for a simple fly and land command.
1) Add the ACMD(do_fly) and ACMD(do_land) into act.h
2) Add the commands into the interpreter.c master command list
3) Add the following code into act.other.c
Code:/* a generic command to get rid of a fly flag */ ACMD(do_land) { bool msg = FALSE; if (affected_by_spell(ch, SPELL_FLY)) { affect_from_char(ch, SPELL_FLY); msg = TRUE; } if AFF_FLAGGED(ch, AFF_FLYING) { REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_FLYING); msg = TRUE; } if (msg) { send_to_char(ch, "You land on the ground.\r\n"); act("$n lands on the ground.", TRUE, ch, 0, 0, TO_ROOM); } else { send_to_char(ch, "You are not flying.\r\n"); } } /* The command to use your innate ability to fly */ ACMD(do_fly) { /* You would add any racial/class/skill restrictions here */ if (GET_RACE(ch) != RACE_xxx) { send_to_char(ch, "You don't have this ability.\r\n"); return; } /* alternatively you could just set the AFF_FLY on */ call_magic(ch, ch, NULL, SPELL_FLY, GET_LEVEL(ch), CAST_SPELL); }
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
tbaMUD © 2024