Advertisement
Guest User

crippling critical (bleeding attack example)

a guest
Oct 27th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.57 KB | None | 0 0
  1.       /* duelist crippling critical: light armor and free hand: 1d4 str dam, 1d4 dex dam,
  2.        * 4 penalty to saves, 4 penalty to AC, 2d4 bleed damage and 2d4 drain moves */
  3.       if (HAS_FEAT(ch, FEAT_CRIPPLING_CRITICAL) && HAS_FREE_HAND(ch) &&
  4.           compute_gear_armor_type(ch) <= ARMOR_TYPE_LIGHT) {
  5.         struct mud_event_data *pMudEvent = NULL;
  6.         struct affected_type af;
  7.        
  8.         /* has event?  then we increment the events svariable */
  9.         if ((pMudEvent = char_has_mud_event(victim, eCRIPPLING_CRITICAL))) {
  10.           int crippling_critical_var = 0;
  11.           char buf[10] = {'\0'};
  12.          
  13.           crippling_critical_var = atoi((char *) pMudEvent->sVariables);
  14.           crippling_critical_var++;
  15.           sprintf(buf, "%d", crippling_critical_var);
  16.           if (pMudEvent->sVariables) /* need to free memory if we changing it */
  17.             free(pMudEvent->sVariables);
  18.           pMudEvent->sVariables = strdup(buf);
  19.          
  20.         } else { /* no event, so make one */
  21.           pMudEvent = new_mud_event(eCRIPPLING_CRITICAL, victim, strdup("1"));
  22.           /* create and attach new event, apply the first effect */
  23.           attach_mud_event(pMudEvent, 60 * PASSES_PER_SEC);
  24.         }
  25.        
  26.         /* dummy check */
  27.         if (!pMudEvent)
  28.           ;
  29.         else { /* decide on the effect to drop */
  30.           act("\tRYou strike $N with a crippling critical!\tn", FALSE, ch, NULL, victim, TO_CHAR);
  31.           act("\tr$n strikes you with a crippling critical!\tn", FALSE, ch, NULL, victim, TO_VICT);
  32.           act("\tr$n strikes $N with a crippling critical!\tn", FALSE, ch, NULL, victim, TO_NOTVICT);
  33.           switch (atoi((char *) pMudEvent->sVariables)) {
  34.             case 1: /* 1d4 strength damage */
  35.               new_affect(&af);
  36.               af.spell = SKILL_CRIPPLING_CRITICAL;
  37.               af.location = APPLY_STR;
  38.               af.modifier = -dice(1, 4);
  39.               af.duration = MAX(1, (int) (event_time(pMudEvent->pEvent) / 60));
  40.               SET_BIT_AR(af.bitvector, AFF_CRIPPLING_CRITICAL);
  41.               affect_join(victim, &af, 1, FALSE, FALSE, FALSE);
  42.               break;
  43.             case 2: /* 1d4 dexterity damage */
  44.               new_affect(&af);
  45.               af.spell = SKILL_CRIPPLING_CRITICAL;
  46.               af.location = APPLY_DEX;
  47.               af.modifier = -dice(1, 4);
  48.               af.duration = MAX(1, (int) (event_time(pMudEvent->pEvent) / 60));
  49.               SET_BIT_AR(af.bitvector, AFF_CRIPPLING_CRITICAL);
  50.               affect_join(victim, &af, 1, FALSE, FALSE, FALSE);
  51.               break;
  52.             case 3: /* -4 penalty to fortitude saves */
  53.               new_affect(&af);
  54.               af.spell = SKILL_CRIPPLING_CRITICAL;
  55.               af.location = APPLY_SAVING_FORT;
  56.               af.modifier = -4;
  57.               af.duration = MAX(1, (int) (event_time(pMudEvent->pEvent) / 60));
  58.               SET_BIT_AR(af.bitvector, AFF_CRIPPLING_CRITICAL);
  59.               affect_join(victim, &af, 1, FALSE, FALSE, FALSE);
  60.               break;
  61.             case 4: /* -4 penalty to reflex saves */
  62.               new_affect(&af);
  63.               af.spell = SKILL_CRIPPLING_CRITICAL;
  64.               af.location = APPLY_SAVING_REFL;
  65.               af.modifier = -4;
  66.               af.duration = MAX(1, (int) (event_time(pMudEvent->pEvent) / 60));
  67.               SET_BIT_AR(af.bitvector, AFF_CRIPPLING_CRITICAL);
  68.               affect_join(victim, &af, 1, FALSE, FALSE, FALSE);
  69.               break;
  70.             case 5: /* -4 penalty to will saves */
  71.               new_affect(&af);
  72.               af.spell = SKILL_CRIPPLING_CRITICAL;
  73.               af.location = APPLY_SAVING_WILL;
  74.               af.modifier = -4;
  75.               af.duration = MAX(1, (int) (event_time(pMudEvent->pEvent) / 60));
  76.               SET_BIT_AR(af.bitvector, AFF_CRIPPLING_CRITICAL);
  77.               affect_join(victim, &af, 1, FALSE, FALSE, FALSE);
  78.               break;
  79.             case 6: /* -4 penalty to AC */
  80.               new_affect(&af);
  81.               af.spell = SKILL_CRIPPLING_CRITICAL;
  82.               af.location = APPLY_AC_NEW;
  83.               af.modifier = -4;
  84.               af.duration = MAX(1, (int) (event_time(pMudEvent->pEvent) / 60));
  85.               SET_BIT_AR(af.bitvector, AFF_CRIPPLING_CRITICAL);
  86.               affect_join(victim, &af, 1, FALSE, FALSE, FALSE);
  87.               break;
  88.             default: /* 2d4 bleed damage and 2d4 moves drain */
  89.               GET_MOVE(victim) -= dice(2, 4);
  90.               dam += dice(2, 4);
  91.               break;
  92.           }          
  93.         }        
  94.       } /* end crippling critical */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement