BoxBoy writes, "For my MUD I have tried to add a spec_proc for each of the original class, this would be thief, warrior, mage, cleric." For my MUD I have tried to add a spec_proc for each of the original class, this would be thief, warrior, mage, cleric. Obviously the mage and cleric can be obtained through copying the magic_user spec_proc, but the warrior and thief, are a little bit harder. A word of warning with the backstab mob, apperantly some people say that this doesn't actually do anything, whereas on my MUD we do have MOB's which run around either nicking peoples gold, or maybe just sticking their big shinny knives in thier back. Oh well. I have included mob versions of some of my skills, aswell as the spec_proc that uses. Someone mentioned to me that Dibrova did something similiar to this, and appearently my code looks similar, So also as well as given me any credit, also give Vedic of Dibrova credit.(I believe it was Vedic, if not contact me) at the top of spec_procs.c, after the list of local functions, add, /******************************* * Mob Skills * *******************************/ void do_mob_bash(struct char_data *ch, struct char_data *vict) { int hit_roll = 0, to_hit = 0; hit_roll = number (1,100) + GET_STR(ch); to_hit = (100 - (int) (100*GET_LEVEL(ch)/250)); if (GET_LEVEL(vict) >= LVL_IMMORT) hit_roll = 0; if (hit_roll < to_hit) { GET_POS(ch) = POS_SITTING; damage(ch, vict, 0, SKILL_BASH); } else { GET_POS(vict) = POS_SITTING; damage(ch, vict, GET_LEVEL(ch), SKILL_BASH); WAIT_STATE(vict, PULSE_VIOLENCE * 2); WAIT_STATE(ch, PULSE_VIOLENCE * 3); } } void do_mob_disarm(struct char_data *ch, struct char_data *vict) { int hit_roll = 0, to_hit = 0; struct obj_data *weap; hit_roll = number (1,100) + GET_DEX(ch); to_hit = (100 - (int) (100*GET_LEVEL(ch)/250)); if (GET_LEVEL(vict) >= LVL_IMMORT) hit_roll = 0; if (!(weap = GET_EQ(FIGHTING(ch), WEAR_WIELD))) { send_to_char("Nope, sorry\r\n", ch); return; } if (hit_roll < to_hit) { if(GET_EQ(vict, WEAR_DUALWIELD)){/* Disarm */ act("&3You disarm $p from $N's off hand!&0", FALSE, ch, weap, FIGHTING(ch), TO_CHAR); act("&3$n disarms $p from your off hand!&0", FALSE, ch, weap, FIGHTING(ch), TO_VICT); act("&3$n disarms $p from $N's pff hand!&0", FALSE, ch, weap, FIGHTING(ch), TO_NOTVICT); obj_to_room(unequip_char(FIGHTING(ch), WEAR_DUALWIELD), vict->in_room); } else if(GET_EQ(vict, WEAR_WIELD)){ act("&3You disarm $p from $N's hand!&0", FALSE, ch, weap, FIGHTING(ch), TO_CHAR); act("&3$n disarms $p from your hand!&0", FALSE, ch, weap, FIGHTING(ch), TO_VICT); act("&3$n disarms $p from $N's hand!&0", FALSE, ch, weap, FIGHTING(ch), TO_NOTVICT); obj_to_room(unequip_char(FIGHTING(ch), WEAR_WIELD), vict->in_room); } else { act("&3You fail to disarm $N&0", FALSE, ch, weap, FIGHTING(ch), TO_CHAR); act("&3$n fails to disarm you&0", FALSE, ch, weap, FIGHTING(ch), TO_VICT); act("&3$n fails to disarm $N&0", FALSE, ch, weap, FIGHTING(ch), TO_NOTVICT); } } WAIT_STATE(ch, PULSE_VIOLENCE); } void do_mob_kick(struct char_data *ch, struct char_data *vict) { int hit_roll = 0, to_hit = 0; hit_roll = number (1,100) + GET_STR(ch); to_hit = (100 - (int) (100*GET_LEVEL(ch)/250)); if (GET_LEVEL(vict) >= LVL_IMMORT) hit_roll = 0; if (hit_roll < to_hit) { damage(ch, vict, 0, SKILL_KICK); } else { damage(ch, vict, GET_LEVEL(ch) / 2, SKILL_KICK); WAIT_STATE(vict, PULSE_VIOLENCE * 2); WAIT_STATE(ch, PULSE_VIOLENCE * 3); } } void do_mob_headbutt(struct char_data *ch, struct char_data *vict) { int hit_roll = 0, to_hit = 0; hit_roll = number (1,100) + GET_STR(ch); to_hit = (100 - (int) (100*GET_LEVEL(ch)/250)); if (GET_LEVEL(vict) >= LVL_IMMORT) hit_roll = 0; if (hit_roll < to_hit) { damage(ch, vict, 0, SKILL_HEADBUTT); } else { damage(ch, vict, GET_LEVEL(ch) / 2, SKILL_HEADBUTT); WAIT_STATE(vict, PULSE_VIOLENCE * 2); WAIT_STATE(ch, PULSE_VIOLENCE * 3); } } void do_mob_bearhug(struct char_data *ch, struct char_data *vict) { int hit_roll = 0, to_hit = 0; hit_roll = number (1,100) + GET_STR(ch); to_hit = (100 - (int) (100*GET_LEVEL(ch)/250)); if (GET_LEVEL(vict) >= LVL_IMMORT) hit_roll = 0; if (hit_roll < to_hit) { damage(ch, vict, 0, SKILL_BEARHUG); } else { damage(ch, vict, GET_LEVEL(ch) / 2, SKILL_BEARHUG); WAIT_STATE(vict, PULSE_VIOLENCE * 2); WAIT_STATE(ch, PULSE_VIOLENCE * 3); } } void do_mob_backstab(struct char_data *ch, struct char_data *vict) { int hit_roll = 0, to_hit = 0; hit_roll = number (1,100) + GET_STR(ch); to_hit = (100 - (int) (100*GET_LEVEL(ch)/250)); if (GET_LEVEL(vict) >= LVL_IMMORT) hit_roll = 0; if (FIGHTING(ch)){ act("$N just tried to backstab you during combat!", FALSE, vict, 0, ch, TO_CHAR); act("$e notices you. You cannot backstab in combat!", FALSE, vict, 0, ch, TO_VICT); act("$N attempts to backstab $n during combat!", FALSE, vict, 0, ch, TO_NOTVICT); } if (MOB_FLAGGED(vict, MOB_AWARE) && AWAKE(vict)) { act("You notice $N lunging at you!", FALSE, vict, 0, ch, TO_CHAR); act("$e notices you lunging at $m!", FALSE, vict, 0, ch, TO_VICT); act("$n notices $N lunging at $m!", FALSE, vict, 0, ch, TO_NOTVICT); hit(vict, ch, TYPE_UNDEFINED); return; } if (hit_roll < to_hit) { damage(ch, vict, 0, SKILL_BACKSTAB); } else { hit(ch, vict, SKILL_BACKSTAB); WAIT_STATE(vict, PULSE_VIOLENCE * 2); WAIT_STATE(ch, PULSE_VIOLENCE * 3); } } and then at the end of the file add, SPECIAL(warrior_class) { struct char_data *vict; int att_type = 0, hit_roll = 0, to_hit = 0 ; if (cmd || !AWAKE(ch)) return FALSE; /* if two people are fighting in a room */ if (FIGHTING(ch) && (FIGHTING(ch)->in_room == ch->in_room)) { vict = FIGHTING(ch); if (number(1, 5) == 5) { act("$n foams at the mouth and growls in anger.", 1, ch, 0, 0, TO_ROOM); } if (GET_POS(ch) == POS_FIGHTING) { att_type = number(1,40); hit_roll = number (1,100) + GET_STR(ch); to_hit = (100 - (int) (100*GET_LEVEL(ch)/250)); if (GET_LEVEL(vict) >= LVL_IMMORT) hit_roll = 0; switch(att_type) { case 1: case 2: case 3: case 4: do_mob_kick(ch, vict); break; case 5: case 6: case 7: do_mob_bash(ch, vict); break; case 8: case 9: case 10: do_mob_headbutt(ch, vict); break; case 11: case 12: case 13: do_mob_bearhug(ch, vict); break; case 14: do_mob_disarm(ch, vict); break; case 15: case 16: case 17: case 18: case 19: case 20: break; default: break; } } } return FALSE; } SPECIAL(thief_class) { struct char_data *cons; if (cmd) return (FALSE); if (GET_POS(ch) != POS_STANDING) return (FALSE); for (cons = world[ch->in_room].people; cons; cons = cons->next_in_room) if (!IS_NPC(cons) && (GET_LEVEL(cons) < LVL_IMMORT) && (!number(0, 4))) { if(number(1,50) > 25){ do_mob_backstab(ch, cons); } else{ npc_steal(ch, cons); } return (TRUE); } return (FALSE); } And That's my thief_class and warrior_class specs for Circle. If you like them, please feel free to use them. The warrior_class works everytime, but unfourtunatly something is not always happy with the thief proc. I will probably re-write it and post it in. But Until then, tis Bye Bye from BoxBoy << FTP Uploads 2000//0/9/ | Reply | View as text | Threaded | Spirit World [by Ortluk] >>
|
|
|
Another way by Blaize (garath@fl.freei.net) on Monday, October 16th @ 11:50:11 AM http://mud.kohinoor.net |
I just converted my skills so that both mobs and players can use the same skill...its really not that hard. This way switched imms can use them too. Also, the spec procs can be integrated into mob act, so all you have to do is set a mobs class and the proc is automatically added. |
[ Reply to this comment ] |
|
Re: Another way by Boruki (baez@as-if.com) on Saturday, April 14th @ 10:53:19 AM http:// |
It was done this way to stop having mobs bashing level 10 players, or disarming level 20 players. Also these are no longer used, MOB_MAGE_CASTER MOB_CLERIC_CASTER and MOB_FIGHTER flags replace three of these, but the thief one has stayed in place. Still, I like the suggestion :P BoruKi |
[ Reply to this comment ] |