Welcome to the Builder Academy

Question Mob special - Backstab

More
11 Mar 2018 15:02 #7690 by JTP
Mob special - Backstab was created by JTP
Hi

I found this on circlemud.orc
Code:
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); } } 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); }


Would this work with tba ? Or what would need to be changed.

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

More
14 Mar 2018 22:46 - 14 Mar 2018 22:48 #7700 by JTP
Replied by JTP on topic Mob special - Backstab
Noone who knows these specials ?

I have implemented a few from circlemud.org and though some of them compile ok. Nothing happends when put on a mob Or item.

Iwe also put one in called coffin, that should load mobs upon opening a chest, but nothing happends.
Last edit: 14 Mar 2018 22:48 by JTP.

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

More
14 Mar 2018 22:54 #7701 by thomas
Replied by thomas on topic Mob special - Backstab
I assume you've assigned them in spec_assign.c ?

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

More
15 Mar 2018 07:09 #7702 by JTP
Replied by JTP on topic Mob special - Backstab
Yep sure have. And when i tried the coffin special, statting the obj also shows like: SpecProc: Coffin

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

More
15 Mar 2018 20:57 #7703 by thomas
Replied by thomas on topic Mob special - Backstab
Hmm.. Make sure the mob also has the SPEC bit set, or mobile_activity wont trigger github.com/tbamud/tbamud/blob/2f12752373...8a4/src/mobact.c#L43

And currently, object spec procs are only checked when a command is run. This sounds like a basis for improvement...

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

More
16 Mar 2018 20:20 #7704 by JTP
Replied by JTP on topic Mob special - Backstab
Would be awesome If it worked on objects

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

Time to create page: 0.215 seconds