All pastes #371713 Raw Edit

Pollyester

public text v1 · immutable
#371713 ·published 2007-02-25 16:07 UTC
rendered paste body
on *:text:skh*:#:/dice.skillhelp $1-
on *:text:sk*:#:/dice.skillroll $1-
on *:text:coh:#:/dice.combathelp $1-
on *:text:!c*:#:/dice.combat $2-
on *:text:co *:#:/dice.combat $2-

alias dice.combat {
  if ($1 == $null) {
    %dice.bonus = 0
  }
  if ($1 != $null) {
    %dice.bonus = $1
  }
  set %base.dice $left($calc(%dice.bonus * 2),-1)
  if (%dice.bonus >= 10) {
    set %base.dice $calc((%base.dice * 10)+10)
  }
  if (%dice.bonus < 10) {
    set %base.dice 20
  }
  if ($2 == $null) {
    set %AttackTimes 1
  }
  if ($2 != $null) {
    if (T isin $2) {
      set %cash2 [ $+ $3- $+ ]
      set %AttackTimes $right($2,-1)
    }
    if (T !isin $2) {
      set %cash2 [ $+ $2- $+ ]
      set %attacktimes 1
    }
  }
  if (%attacktimes > 20) {
    set %attacktimes 20
  }
  var %i = 0
  var %DivCount = 0
  Var %CritCount = 0
  Var %CritFailCount = 0
  var %DivFailCount = 0
  while (%i < %attacktimes) {
    set %roll $rand(1,%base.dice)
    set %ten $calc(%base.dice / 10)
    set %one $calc(%base.dice / 100)
    %one == $round(%one,0)
    if (%one == 0) { %one = 1 }

    if (%roll >= $calc(%base.dice - %one)) {
      inc %divcount
    }
    if (%roll > $calc(%base.dice - %ten) && %roll < $calc(%base.dice - %one)) {
      inc %critcount
    }
    if (%roll <= %ten >= %one) {
      inc %Critfailcount
    }
    if (%roll <= %one) { inc %DivFailCount }
    set %rolltext %rolltext $iif(%roll == %one,4,$iif(%roll > $calc(%base.dice - %ten),12,$iif(%roll == $calc(%base.dice - %one),6))) $+  $+ %roll $+ 14(7 $+ $calc(%roll + %dice.bonus) $+ 14)
    inc %i
  }
  %diceshow = %attacktimes $+ d $+ %base.dice $+ $iif(%dice.bonus > 0,+ $+ %dice.bonus)
  /msg $chan 12(14 $+ $nick $+ 12)14 Rolled: %cash2 %diceshow 14and got:10 %rolltext $+ .
  /msg $Chan 12(14 $+ $nick $+ 12)14 12Critical:14 %CritCount <> 6Divine:14 %DivCount <> 4Uh ohs:14 %critfailcount <> 3Critical  Range:14 %ten unset %rolltext
}

alias dice.skillroll {
  set %CritFail_Message 4Uh oh!14
  set %Fail_Message 7Failure!14
  set %Success_Message 6Success14
  set %Crit_Message 10CRITICAL!14
  set %Divine_Message 12DIVINE!14
  set %fpvar cr

  set %dice.fp 50

  if ($left($2,2) == %fpvar) {

    if ($right($2,2) isnum) {

      set %dice.fp $right($2,-2)

    }

  }

  if ($left($1,2) == sk) {

    set %dice.skillroll.strleft $1

    if ($right($1,1) == f) {

      set %dice.skillroll.strleft $left($1,-1)

      set %dice.skillroll.feat 1

    }

    set %dice.skillroll.strleft $right(%dice.skillroll.strleft,-2)

    if (%dice.skillroll.strleft == $null) set %dice.skillroll.strleft -1

    if (%dice.skillroll.strleft isnum) {

      if (%dice.skillroll.strleft > 20) goto error

      set %dice.rolled $rand(1,100)

      set %dice.value.tweak $iif(%dice.skillroll.strleft == -1,-25,%dice.skillroll.strleft)

      if (%dice.skillroll.feat == 1)  inc %dice.value.tweak 10
      if (%dice.skillroll.strleft == 20) inc %dice.value.tweak 5

      set %dice.value $calc(%dice.rolled + %dice.value.tweak)

      if (%dice.rolled >= 90) {

        set %dice.value.input %Crit_Message

      }

      if (%dice.value >= 130) set %dice.value.input %Divine_Message

      if (%dice.skillroll.strleft < 20) {

        if (%dice.value < %dice.fp) {

          set %dice.value.input %Fail_Message

        }

        if (%dice.rolled == 1) set %dice.value.input %CritFail_Message

        if (%dice.rolled <= 10) {

          if (%dice.rolled > 1)  set %dice.value.input %CritFail_Message

        }

        if (%dice.value < 0) set %dice.value.input %CritFail_Message

        if (%dice.value >= %dice.fp) {

          if (%dice.value < 90) {

            set %dice.value.input %Success_Message

          }

        }

      }

      if (%dice.skillroll.strleft == 20) {

        if (%dice.value < %dice.fp) {

          set %dice.value.input %Fail_Message

        }

        if (%dice.value <= 10) {
          if (%dice.value > 5) set %dice.value.input %Fail_Message
        }

        if (%dice.value <= 5) set %dice.value.input %CritFail_Message

        if (%dice.rolled <= 1)  set %dice.value.input %CritFail_Message

        if (%dice.value >= %dice.fp) {

          if (%dice.value < 90) {

            set %dice.value.input %Success_Message

          }

        }

      }

      set %cash2 $2-

      if ($left($2,2) == %fpvar) set %cash2 $3-

      set %dice.skillroll.value 1d100 $+ $iif(%dice.value.tweak >= 0,+) $+  %dice.value.tweak

      if (%cash2 != $null) set %cash2 12( $+ %cash2 $+ 12)14

      /msg $chan 12(14 $+ $nick $+ 12)14 Rolled: %cash2 %dice.skillroll.value 14and got: %dice.rolled $+ ( $+ %dice.value $+ ) %dice.value.input Difficulty: %dice.fp

      goto end

    }

  }

  goto end

  :error

  /msg $chan  12(14A mistake occured. type: skh for Help12)

  :end

  unset %dice.*

  unset %cash1

  unset %cash2

}



alias dice.skillhelp {

  /msg $chan 12(14Skill Roller12)14 The Skill Dice Roller is used with  SK. Using it without any options will roll with having NO skills(thus the -25 difficulty malus). You can add your skill level(0 to 20) to have it calculate your skill. Note that 0 will have it 1d100+0 thus having no skill bonus. Adding the option 'f' will define that the skill benefies from a Feat, giving you an automatic +10 to the skill roll bonus. All of these  options are set as a single word, ex: sk2

  /msg $chan 12(14Skill Roller12)14 You may also also add an optional FP(Then number required for success) by adding as a second word: diff followed with the value. An example roll for a skill check with a skill of ten and feat would be: sk10f diff80.

  /msg $chan 12(14Skill Roller12)14 There is also the possibility to add a personal comment to the roll. "sk20f Fireball" will have the dice write that it is fr a 'Fireball'

  /msg $chan 12(14Skill Roller12)14 By default, Diff is set to 50,   Skillcheck is set to NoSkill(-25) and Feats are turned OFF. The script was   written by Pascat, and colored and hosted by Aimee, owner of Fluffy.

  /msg $chan 12(14Skill Roller12)14 Reminder - This is NOT for   Combat, Just for Skill Checks.
}
alias dice.combathelp {

  /msg $chan 14(7Combat Dice14)14 !C (num) 14or Co (num)  14to roll., example !C 10 - 12Rolled: 1d30+10 and got:14(31).14  The dice will add the % to the D.  Add T(num) for more dice, Example !c 10 T2.12 5d30+10 and got: 14(13) 14(23).14 Please Check the !forum for more info.
}