Welcome to the Builder Academy

Question Spec Proc on Object/not firing question (new to coding)

More
11 Jun 2016 15:58 #6001 by thomas
The spell system doesn't work that way. But as in the movies, we can cheat when making a game.

For example, in dg_cast, we load a "proxy" when there's no caster: github.com/tbamud/tbamud/blob/2f12752373...4/src/dg_misc.c#L127

You might want to go down that route, too.

This works because a player won't be able to make a distinction between the object (the one with the spec proc) and a mob with the same name.

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

More
17 Jun 2016 01:58 - 17 Jun 2016 17:55 #6017 by Barnes
So here is the almost finished version. What I did was create a mob with the same name as the object, and have it cast on the victim wand style, so there is no word uttering spam.
Code:
SPECIAL(spectral) { struct obj_data *find_obj_by_vnum(int vnum); struct obj_data *obj; obj = ch->equipment[WEAR_NECK_1]; struct char_data *vict = FIGHTING(ch); int num; struct char_data *mob; int being_worn = (TRUE); if (obj) {if (obj_index[obj->item_number].vnum == 34707) {being_worn = (TRUE);}} if (cmd || GET_POS(ch) != POS_FIGHTING || !FIGHTING(ch) || !being_worn) return (FALSE); switch (rand_number(0, 3)) { mob = read_mobile(num, REAL); case 0: act("\r\n\t[f330]$p begins to \t[F555]pulse\tn and \t[F550]vibrate\tn!!!\tn\r\n",TRUE,ch,obj,0,TO_CHAR); act("\r\n$p begins to \t[F555]pulse\tn and \t[F550]vibrate\tn!!!!!\r\n",TRUE,ch,obj,0,TO_ROOM); num = 3657; mob = read_mobile(num, REAL); char_to_room(mob, IN_ROOM(ch)); set_fighting(mob, vict); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); extract_char(mob); return (TRUE); break; case 1: act("\r\n\t[f330]$p begins to \t[F555]pulse\tn and \t[F550]vibrate\tn!!!\tn\r\n",TRUE,ch,obj,0,TO_CHAR); act("\r\n$p begins to \t[F555]pulse\tn and \t[F550]vibrate\tn!!!!!\r\n",TRUE,ch,obj,0,TO_ROOM); num = 3657; mob = read_mobile(num, REAL); char_to_room(mob, IN_ROOM(ch)); set_fighting(mob, vict); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, ch, NULL, 28, 30, CAST_WAND); extract_char(mob); return (TRUE); break; case 2: act("\r\n\t[f330]$p begins to \t[F555]pulse\tn and \t[F550]vibrate\tn!!!\tn\r\n",TRUE,ch,obj,0,TO_CHAR); act("\r\n$p begins to \t[F555]pulse\tn and \t[F550]vibrate\tn!!!!!\r\n",TRUE,ch,obj,0,TO_ROOM); num = 3657; mob = read_mobile(num, REAL); char_to_room(mob, IN_ROOM(ch)); set_fighting(mob, vict); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, ch, NULL, 28, 30, CAST_WAND); call_magic(mob, ch, NULL, 28, 30, CAST_WAND); extract_char(mob); return (TRUE); break; case 3: act("\r\n\t[f330]$p begins to \t[F555]pulse\tn and \t[F550]vibrate\tn!!!\tn\r\n",TRUE,ch,obj,0,TO_CHAR); act("\r\n$p begins to \t[F555]pulse\tn and \t[F550]vibrate\tn!!!!!\r\n",TRUE,ch,obj,0,TO_ROOM); num = 3657; mob = read_mobile(num, REAL); char_to_room(mob, IN_ROOM(ch)); set_fighting(mob, vict); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, vict, NULL, 26, 30, CAST_WAND); call_magic(mob, ch, NULL, 28, 30, CAST_WAND); call_magic(mob, ch, NULL, 28, 30, CAST_WAND); call_magic(mob, ch, NULL, 28, 30, CAST_WAND); extract_char(mob); return (TRUE); break; default: return (FALSE);} }

And here is an example of how it looks in combat:



Attachment procshot.pdf not found

Attachments:
Last edit: 17 Jun 2016 17:55 by Barnes. Reason: To show a combat snip.

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

Time to create page: 0.205 seconds