Welcome to the Builder Academy

Question Want to make your players squirm?

More
28 Jul 2016 15:28 #6118 by Barnes
I realize you can probably do all of this just as well with the Trig function, but I have not jumped into that yet. Anyway, here is a mean little spec proc you can change however you want and use if you like. It randomly picks a piece of eq from a player that it is fighting and steals a piece of eq. Also, it has the mob, and icy one in this case, break a chunk of ice off and stab you in the back. New to coding so any comments or feedback is appreciated. I guess the one question I do have is when the acts are performed and the mob name starts the string, it is not capitalized. How does mud code handle making that fix? Thanks!


Code:
SPECIAL(ice_zombie) { struct char_data *vict; int dam = 0; int j = 0; int r_num = 0; struct obj_data *obj = NULL; char buf[MAX_INPUT_LENGTH]; if (cmd || GET_POS(ch) != POS_FIGHTING) return (FALSE); for (vict = world[IN_ROOM(ch)].people; vict; vict = vict->next_in_room) if (FIGHTING(vict) == ch && !rand_number(0, 4)) break; if (vict == NULL && IN_ROOM(FIGHTING(ch)) == IN_ROOM(ch)) vict = FIGHTING(ch); if (vict == NULL) return (TRUE); switch (rand_number(0, 10)) { case 4: send_to_char(vict, "\r\n"); act("\t[F035]$n shouts to the sky, \x1B[1;37m'kali ma sha ti dae!'\tn", TRUE, ch, 0, vict, TO_ROOM); send_to_char(vict, "\r\n"); dam = (rand_number(400, 500)); damage(ch, vict, dam, 8); j = rand_number(0, NUM_WEARS); if (GET_EQ(vict, j)){ obj = vict->equipment[j]; unequip_char(vict,j); obj_to_room(obj, IN_ROOM(ch)); obj_from_room(obj); obj_to_char(obj, ch); send_to_char(vict, "\r\n"); act("$N\tn is \t[F015]frozen\tn in place by $n's \t[F015]chill\tn long enough for $m to steal $p!!!!\r\n", TRUE, ch, obj, vict, TO_CHAR); act("You are \t[F015]frozen\tn in place by $n's \t[F015]chill\tn long enough for $m to steal $p!!!!\r\n", TRUE, ch, obj, vict, TO_VICT); act("$N\tn is \t[F015]frozen\tn in place by $n's \t[F015]chill\tn long enough for $m to steal $p!!!!\r\n", TRUE, ch, obj, vict, TO_NOTVICT); sprintf(buf, "wear all"); command_interpreter(ch,buf); sprintf(buf,"shout Hahahahah!!!!!"); command_interpreter(ch,buf);} break; case 5: if (GET_EQ(ch, WEAR_WIELD) == FALSE) { send_to_char(vict, "\r\n"); act("\t[F035]$n breaks a craggy shard of ice from $s body and wields it!!\tn", TRUE, ch, 0, vict, TO_ROOM); send_to_char(vict, "\r\n"); r_num = 4742; obj = read_object(r_num, REAL); obj_to_char(obj, ch); sprintf(buf, "wear all"); command_interpreter(ch,buf); sprintf(buf,"shout Protectors of Undercroft, Arise!!!!!"); command_interpreter(ch,buf); equip_char(ch, obj, WEAR_WIELD); hit(ch, vict, SKILL_BACKSTAB); send_to_char(ch, "\r\n"); unequip_char(ch, WEAR_WIELD); extract_obj(obj); } } return (TRUE); }

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

Time to create page: 0.174 seconds