All pastes #1766474 Raw Edit

!fight

public text v1 · immutable
#1766474 ·published 2010-01-26 13:13 UTC
rendered paste body
on $*:text:/^[!@.](fight)/Si:#RsRPG: {
  if ($hget(Players,$+(LoggedIn.,$nick)) == Yes) {
    if ($+(!,%,$nick,.fight)) {
      var %i $int($rand(3,15))
      msg $chan $logo($remove($1,!,@,.) fights and kills a $read(npc.txt)
      .notice $nick You may use $1 again in $duration($calc(%i * 60))
      hinc -m Stats $+($nick,.usedfight)
      set $+(%,$nick,.fight) 1
      .timer $+ $+($nick,.fight) $calc(%i * 60) 1 unset $+(%,$nick,.fight)
    }
    elseif ($+(%,$nick,.fight) {
      .notice $nick You can't use this yet. Please wait $duration($timer($+($nick,.chop)).secs) before you do $1 again.
    }
  }
  elseif (!$hget(Players,$+(LoggedIn.,$nick))) || ($hget(Players,$+(LoggedIn.,$nick)) == No) {
    .notice $nick You are not logged in.
  }
}
; This is just a basic version.
; If it works (no errors hopefully),
; then it can be modified into an advanced script.
; Some modifications that would be nice are:
;
; - player randomly wins/loses a fight.
; - If fight is lost, lose 100gp.
; - If fight is won, win a random amount of gp.


The above script requires "npc.txt"  The information contained in npc.txt is listed below:
Man
Goblin
Dwarf
Guard
Paladin
Hobgoblin
Scorpion
Spider
Monkey
Fleshcrawler
Minotaur
Chicken