All pastes #430345 Raw Edit

r3d

public text v1 · immutable
·published 2007-04-08 22:35 UTC
rendered paste body
on $*:TEXT:/^[!](dm|duel) */Si:#:{
  if (!%duel.active) {
    if (!%duel.1) { 
      set %duel.1 $nick 
      msg $chan 4  $+ %duel.1  7has set up a Duel. Type 1!duel or !dm 7to challenge him. 
      set %duel.chan $chan  
      set -u10 %duel 1 
      timerDUEL 1 10 duel-check 
    }
    elseif ((%duel.1 != $null || $nick) && (%duel == 1)) { 
      if (%thechecker == 0) {
        set %duel.2 $nick 
        set %thechecker 1 
        msg $chan 2  $+  %duel.2  7has challenged 4 $+ %duel.1 
        msg $chan 2Commands are !whip !gaxe !defend !eat !tele !dds !barrage !2hd !gmaul !tb
      }
    }
    else {
      .notice $nick There is already an active Duel. Wait till this Duel has ended before starting another one.
    }
  } 
}

on *:TEXT:!endduel*:#:{
  if (%duel.active != $null) {
    if ($nick == %owner || %duel.1 || %duel.2) {
      .msg $chan 7Duel ended by 4 $+ $nick
      unset %duel*
      unset %damage
      set %thechecker 0
      set %teleblocked1 0
      set %teleblocked2 0
      set %gmaulspec1 0
      set %gmaulspec2 0
      set %ddsspec1 0
      set %ddsspec2 0
      .timers off
      halt
    }
    else {
      .notice $nick Only %owner or those taking part in the Duel are allowed to use this command
    }
  }
  else {
    .notice $nick There are no active Duels
  }
}

on *:TEXT:!whip*:#:{
  if (%duel.active == 1) {
    if ($nick == %duel.turn) {
      whip
    }
    elseif (($nick == %duel.1 || %duel.2) && ($nick != %duel.turn)) .notice $nick It is not your turn yet.
  }
  elseif (%duel.active == $null) .notice $nick This is a Duel only command. There are no active Duels right now. Type !duel to start a Duel.
}

on *:TEXT:!gmaul*:#: {
  if (%duel.active == 1) {
    if ($nick == %duel.turn) {
      gmaul
    }
  }
}

on *:TEXT:!dds*:#: {
  if (%duel.active == 1) {
    if ($nick == %duel.turn) {
      dds
    }
  }
}

on *:TEXT:!gaxe*:#: {
  if (%duel.active == 1) {
    if ($nick == %duel.turn) {
      gaxe
    }
  }
}

on *:TEXT:!tb*:#: {
  if (%duel.active == 1) {
    if ($nick == %duel.turn) {
      teleblock
    }
  }
}

on *:TEXT:!barrage*:#: {
  if (%duel.active == 1) {
    if ($nick == %duel.turn) {
      barrage
    }
  }
}

on *:TEXT:!2hd*:#: {
  if (%duel.active == 1) {
    if ($nick == %duel.turn) {
      2hand
    }
  }
}

on *:TEXT:!eat*:#:{
  if (%duel.active == 1) {
    if ($nick == %duel.turn) {
      eat
    }
  }
}

on *:TEXT:!tele*:#:{
  if (%duel.active == 1) {
    if ($nick == %duel.turn) {
      tele
    }
    elseif (($nick == %duel.1 || %duel.2) && ($nick != %duel.turn)) .notice $nick It is not your turn yet.
  }
}

on *:TEXT:!defend*:#:{
  if (%duel.active == 1) {
    if ($nick != %duel.turn) {
      defend
    }
  }
  elseif (%duel.active == $null) .notice $nick This is a Duel only command. There are no active Duels right now. Type !duel to start a Duel.
}

alias duel-check {
  if (%duel.1 && %duel.2 != $null) {
    .msg %duel.chan 7Setting up duel. Duel will startnow
    .timerSTART 1 1.5 startduel
  }
  elseif (%duel.2 == $null) { .msg %duel.chan 7No one has dared to take up 4 $+ %duel.1 $+ 's 7challenge. Duel cancelled. | unset %duel* }
}

alias hp-check {
  if (%duel.2.hp <= 0) {
    .msg %duel.chan 4 $+ %duel.1 7has defeated 2 $+ %duel.2 7in battle.
    unset %duel*
    unset %block*
    unset %damage
    set %thechecker 0
    set %teleblocked2 0
    set %teleblocked1 0
    set %gmaulspec1 0
    set %gmaulspec2 0
    set %ddsspec1 0
    set %ddsspec2 0
    halt
  }
  if (%duel.1.hp <= 0) {
    .msg %duel.chan 2 $+ %duel.2 7has defeated 4 $+ %duel.1 7in battle.
    unset %duel*
    unset %block*
    unset %damage
    set %thechecker 0
    set %teleblocked2 0
    set %teleblocked1 0
    set %gmaulspec2 0
    set %gmaulspec1 0
    set %ddsspec1 0
    set %ddsspec2 0
    halt
  }
}

alias startduel {
  set %duel.1.hp 99
  set %duel.2.hp 99
  set %duel.active 1
  .msg %duel.chan 7Duel start! 4 $+ %duel.1 7will face off with 2 $+ %duel.2 $+ .
  set %duel.turn %duel.1
  .msg %duel.chan 7OK 4 $+ %duel.1 7will start first against 2 $+ %duel.2 $+ .
}

alias hit {
  if (%duel.turn == %duel.1) {
    dec %duel.2.hp %damage
    .msg %duel.chan 4 $+ %duel.1 7hits 2 $+ %duel.2 7for %damage damage. 2 $+ %duel.2 7has %duel.2.hp hitpoints left.
    hp-check
    set %duel.turn %duel.2
    .msg %duel.chan 7It is now 2 $+ %duel.2 $+ 's 7turn.
  }
  elseif (%duel.turn == %duel.2) {
    dec %duel.1.hp %damage
    .msg %duel.chan 2 $+ %duel.2 7hits 4 $+ %duel.1 7for %damage damage. 4 $+ %duel.1 7has %duel.1.hp hitpoints left.
    hp-check
    set %duel.turn %duel.1
    .msg %duel.chan 7It is now 2 $+ %duel.1 $+ 's 7turn.
  }
  unset %damage
}

alias whip {
  if (%duel.turn == %duel.1) {
    msg %duel.chan 4 $+ %duel.1 7swings at 2 $+ %duel.2 7with his sxc whip...
    set %damage $rand(0,45)
    timerattack 1 2 hit
    if (%duel.2.hp <= 0) set %duel.2.hp 0
  }
  elseif (%duel.turn == %duel.2) {
    .msg %duel.chan 2 $+ %duel.2 7swings at 4 $+ %duel.1 7with his sxc whip...
    set %damage $rand(0,45)
    .timerattack 1 2 hit
    if (%duel.2.hp <= 0) set %duel.2.hp 0
  }
}

alias gmaul {
  if (%duel.turn == %duel.1) {
    if (%gmaulspec1 <= 1) {
      set %spec1 $rand(0,29)
      set %spec2 $rand(0,29)
      inc %gmaulspec1 1
      .msg %duel.chan 4 $+ %duel.1  7swings at 2 $+ %duel.2  7with his g-g-granite maul for a 4 $+ %spec1 %spec2  7spec!
      set %damage $calc(%spec1 + %spec2)
      .timerattack 1 2 hit
    }
    else {
      .msg %duel.chan 4 $+ %duel.1  7swings at 2 $+ %duel.2  7with his g-g-granite maul but has no specs! so its just a 4 %damage  7hit!
      set %damage $rand(0,25)
      .timerattack 1 2 hit
    }
  }
  elseif (%duel.turn == %duel.2) {
    if (%gmaulspec2 <= 1) {
      set %spec1 $rand(0,29)
      set %spec2 $rand(0,29)
      inc %gmaulspec2 1
      .msg %duel.chan 4 $+ %duel.2  7swings at 2 $+ %duel.1  7with his g-g-granite maul for a 4 $+ %spec1 %spec2  7spec!
      set %damage $calc(%spec1 + %spec2)
      .timerattack 1 2 hit
    }
    else {
      .msg %duel.chan 4 $+ %duel.2  7swings at 2 $+ %duel.1  7with his g-g-granite maul but has no specs! so its just a 4 %damage  7hit!
      set %damage $rand(0,25)
      .timerattack 1 2 hit
    }
  }
}

alias dds {
  if (%duel.turn == %duel.1) {
    if (%ddsspec1 <= 4) {
      set %spec1 $rand(0,32)
      set %spec2 $rand(0,32)
      inc %ddsspec1 1
      .msg %duel.chan 4 $+ %duel.1  7swipes at 2 $+ %duel.2  7with his BLOODY sharp dds for a 4 $+ %spec1 %spec2  7spec!
      set %damage $calc(%spec1 + %spec2)
      .timerattack 1 2 hit
    }
    else {
      .msg %duel.chan 4 $+ %duel.1  7can only poke at 2 $+ %duel.2  7with 0 spec for 4 %damage  7damage!
      set %damage $rand(0,25)
      .timerattack 1 2 hit
    }
  }
  elseif (%duel.turn == %duel.2) {
    if (%ddsspec2 <= 4) {
      set %spec1 $rand(0,32)
      set %spec2 $rand(0,32)
      .msg %duel.chan 4 $+ %duel.2  7swipes at 2 $+ %duel.1  7with his BLOODY sharp dds for a 4 $+ %spec1 %spec2  7spec!
      set %damage $calc(%spec1 + %spec2)
      .timerattack 1 2 hit
    }
    else {
      .msg %duel.chan 4 $+ %duel.2  7can only poke at 2 $+ %duel.1  7with 0 spec for 4 %damage  7damage!
      set %damage $rand(0,25)
      .timerattack 1 2 hit
    }
  }
}

alias gaxe {
  if (%duel.turn == %duel.1) {
    .msg %duel.chan 4 $+ %duel.1 7swipes at 2 $+ %duel.2 7with his massive axe...
    set %damage $rand(0,60)
    .timerattack 1 2 hit
  }
  elseif (%duel.turn == %duel.2) {
    .msg %duel.chan 2 $+ %duel.2 7swipes at 4 $+ %duel.1 7with his massive axe...
    set %damage $rand(0,60)
    .timerattack 1 2 hit
  }
}

alias 2hand {
  if (%duel.turn == %duel.1) {
    .msg %duel.chan 4 $+ %duel.1 7swipes at 2 $+ %duel.2 7with his massive 2hander!...
    set %damage $rand(10,37)
    .timerattack 1 2 hit
  }
  elseif (%duel.turn == %duel.2) {
    .msg %duel.chan 2 $+ %duel.2 7swipes at 4 $+ %duel.1 7with his massive 2hander!...
    set %damage $rand(10,37)
    .timerattack 1 2 hit
  }
}

alias barrage {
  if (%duel.turn == %duel.1) {
    .msg %duel.chan 4 $+ %duel.1 7Casts BARRAGE on 2 $+ %duel.2 7with his 1337 mage skillz...
    set %damage $rand(0,35)
    .timerattack 1 1 hit
  }
  elseif (%duel.turn == %duel.2) {
    .msg %duel.chan 2 $+ %duel.2 7Casts BARRAGE on 4 $+ %duel.1 7with his 1337 mage skillz...
    set %damage $rand(0,35)
    .timerattack 1 1 hit
  }
}

alias eat {
  if (%duel.turn == %duel.1) {
    msg %duel.chan 4 $+ %duel.1 7grabs out a shark and heals himself
    inc %duel.1.hp 20
    if (%duel.1.hp > 50) set %duel.1.hp 50
    set %duel.turn %duel.2
    msg %duel.chan 7It is now 2 $+ %duel.2 $+ 's 7turn.
  }
  elseif (%duel.turn == %duel.2) {
    msg %duel.chan 2 $+ %duel.2 7grabs out a shark and heals himself
    inc %duel.2.hp 20
    if (%duel.2.hp > 50) set %duel.2.hp 50
    set %duel.turn %duel.1
    msg %duel.chan 7It is now 2 $+ %duel.1 $+ 's 7turn.
  }
} 

alias tele {
  if (%duel.turn == %duel.1) {
    if (%teleblocked1 = 1) {
      msg $chan 7lol no noob ur tbed 
      set %duel.turn %duel.2 
      msg %duel.chan 7It is now 2 $+ %duel.2 $+ 's 7turn.  
    }
    else {
      msg %duel.chan 4 $+ %duel.1 7shits himself and teles the fuckouta there
      set %duel.turn %duel.2
      msg %duel.chan 4 $+ %duel.2 7has unofically defeated 2 $+ %duel.1 7in battle.
      unset %duel*
      unset %block*
      unset %damage
      set %thechecker 0
      halt
    }
  }
  elseif (%duel.turn == %duel.2) {
    if (%teleblocked2 = 1) {
      msg $chan 7lol no noob ur tbed
      set %duel.turn %duel.2   
      msg %duel.chan 7It is now 2 $+ %duel.2 $+ 's 7turn.
    }
    else {
      msg %duel.chan 4 $+ %duel.2 7shits himself and teles the fuckouta there
      set %duel.turn %duel.1
      msg %duel.chan 4 $+ %duel.1 7has unofically defeated 2 $+ %duel.2 7in battle.
      unset %duel*
      unset %block*
      unset %damage
      set %thechecker 0
      halt
    }
  } 
}

alias teleblock {
  if (%duel.turn == %duel.1) {
    if (%teleblocked2 = 1) {
      msg %duel.chan 4 $+ %duel.1 7erm dumars hes alredy tbed
      set %duel.turn %duel.2
      msg %duel.chan 7It is now 2 $+ %duel.2 $+ 's 7turn.
    }
    else {
      msg %duel.chan 4 $+ %duel.1 7whips out his spellbook and teleblocks the fuckin noob %duel.2 
      set %teleblocked2 1
      set %duel.turn %duel.2
      msg %duel.chan 7It is now 2 $+ %duel.2 $+ 's 7turn.
      halt
    }
  }
  elseif (%duel.turn == %duel.2) {
    if (%teleblocked1 = 1) {
      msg %duel.chan 4 $+ %duel.1 7erm dumars hes alredy tbed
      set %duel.turn %duel.1
      msg %duel.chan 7It is now 2 $+ %duel.1 $+ 's 7turn.
    }
    else {
      msg %duel.chan 4 $+ %duel.2 7whips out his spellbook and teleblocks the fuckin noob %duel.1
      set %teleblocked1 1
      set %duel.turn %duel.1
      msg %duel.chan 7It is now 2 $+ %duel.1 $+ 's 7turn.
      halt
    }
  } 
}

alias defend {
  timerattack off
  if (%duel.turn == %duel.1) {
    set %block $rand(1,10)
    if (%block <= 7) {
      .msg %duel.chan 2 $+ %duel.2 7successfully blocks 4 $+ %duel.1 $+ 's 7attack. 
      set %duel.turn %duel.2
      .msg %duel.chan 7It is now 2 $+ %duel.2 $+ 's 7turn.
    }
    elseif (%block > 7) {
      set %block.damage $floor($calc(%damage/2))
      dec %duel.2.hp %block.damage
      .msg %duel.chan 2 $+ %duel.2 7manages to block 4 $+ %duel.1 $+ 's 7attack. But the force of the blow does %block.damage damage to 2 $+ %duel.2 $+ . %duel.2 7has %duel.2.hp hitpoints left.
      hp-check
      set %duel.turn %duel.2
      .msg %duel.chan 7It is now 2 $+ %duel.2 $+ 's 7turn.
    }
    if (%duel.turn == %duel.2) {
      set %block $rand(1,10)
      if (%block <= 7) {
        .msg %duel.chan 4 $+ %duel.1 7successfully blocks 2 $+ %duel.2 $+ 's 7attack. 
        set %duel.turn %duel.1
        .msg %duel.chan 7It is now 4 $+ %duel.1 $+ 's 7turn.
      }
      elseif (%block > 7) {
        set %block.damage $floor($calc(%damage/2))
        dec %duel.1.hp %block.damage
        .msg %duel.chan 4 $+ %duel.1 7manages to block 2 $+ %duel.2 $+ 's 7attack. But the force of the blow does %block.damage damage to 4 $+ %duel.1 $+. %duel.1 7has %duel.1.hp hitpoints left.
        hp-check
        set %duel.turn %duel.1
        .msg %duel.chan 7It is now 4 $+ %duel.1 $+ 's 7turn.
      }
    }
  }
  unset %damage
  unset %block*
}