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.
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;
}
}
.