All pastes #831777 Raw Edit

Miscellany

public text v1 · immutable
#831777 ·published 2007-12-25 10:54 UTC
rendered paste body
on *:TEXT:!Tournament*:#DM-tournaments: {
  if (%Dm.tournament == on) { 
    notice $nick there is already a tournaments running please wait.
  }
  if ($2- == $null) { 
    if (%dm.tournament == on) {
      halt
    }   
    Notice $nick Please type this: !tournament "people to join" "stake" 
  }

  if ($2 != 4 && $2 != 8 && $2 != 16) { 
    notice Nick please use 4 ,8 or 16 people to join!   
    HALT
  }
  if (%dmid. [ $+ [ $nick ] ] == 1) { 
    if (%dmnick. [ $+ [ $nick ] ] == 1) {
      Set %dm.tournament On
      Set %tournament.starter $nick     
      Msg $chan %tournament.starter started a tournament, Type !join-tournament to join it!
      Set %dm.tournament. [ $+ [ %dm.tournament.starter ] ] 0
      set %DM.tournament.stake $3 
      set %dm.tournament.people $2
    }
    else { 
      notice $nick %c1 $+ You need to register first. Type %c5 $+ `dm-register $+ %c1 first and follow the instructions. 
    } 
  }  
  else { 
    notice $nick %c1 $+ You need to identify first! Type $+ %c3 !id(entify) yourpass $+ %c1 in my PM. 
  } 
}

on *:text:!stoptournament*:#dm-tournaments: {
  if ($nick == supamagier || $nick == cnb6) {
    /timers off
    unset %dm.tournament.*   
  }
  Else {
    notice $nick access denied, you are not allowed to use that command. 
    HALT
  }

  on *:TEXT:!join-tournament*:#dm-tournaments: {

    If (%DM.tournamentwins. [ $+ [ $nick ] ] == $null) { .set %dm.tournamentwins. [ $+ [ $nick ] ] 0 }
    if (%dmid. [ $+ [ $nick ] ] == 1) { 
      if (%dmnick. [ $+ [ $nick ] ] == 1) {
        inc %DM.tournament.price %dm.tournament.stake
        Inc %dm.tournament. [ $+ [ %tournament.starter ] ] 1 
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 1) {
          Set %dm.tournament.player.1 %tournaments.starter
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 2) {
          Set %dm.tournament.player.2 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 3) {
          Set %dm.tournament.player.3 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 4) {
          Set %dm.tournament.player.4 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 5) {
          Set %dm.tournament.player.5 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 6) {
          Set %dm.tournament.player.6 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 7) {
          Set %dm.tournament.player.7 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 8) {
          Set %dm.tournament.player.8 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 9) {
          Set %dm.tournament.player.9 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 10) {
          Set %dm.tournament.player.10 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 11) {
          Set %dm.tournament.player.11 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 12) {
          Set %dm.tournament.player.12 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 13) {
          Set %dm.tournament.player.13 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 14) {
          Set %dm.tournament.player.14 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 15) {
          Set %dm.tournament.player.15 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == 16) {
          Set %dm.tournament.player.16 $nick
        }
        if (%dm.tournament. [ $+ [ %tournament.starter ] ] == %dm.tournament.people) {
          msg $chan Tournaments is starting! have fun.
          fight1
        }
      } 
      else { 
        notice $nick %c1 $+ You need to register first. Type %c5 $+ `dm-register $+ %c1 first and follow the instructions. 
      } 
    }
    else { 
      notice $nick %c1 $+ You need to identify first! Type $+ %c3 !id(entify) yourpass $+ %c1 in my PM. 
    } 
  }




  ;######################## ATTACK - MELEE ################################
  on $*:text:/^[?!@`.](at(t)?(ack)?|hit)/Si:#Dm-tournaments: {
    if (%dm.tournament == ON) {
      if ($nick == %dm.player1) {
        timerturnswitch off
        timerstopdm off
        if (%dmfreeze. [ $+ [ $nick ] ] >= 0 ) {
          msg %dm.chan %c1 $+ %dm.player1 $+ %c1 Tries to attack but he can't reach $+ %c2 %dm.player2 $+ %c1 $+ ; $+ %c2 %dm.player2 $+ %c1 gets the turn.
          notice $nick %c1 $+ Please wait $+ %c3 %dmfreeze. [ $+ [ $nick ] ] $+ %c1 more turns.
          set %dm.player1 %dm.player2
          set %dm.player2 $nick
          dec %dmfreeze. [ $+ [ $nick ] ]
          halt
        }
        if (!%dmweapon. [ $+ [ $nick ] ] || piece isin %dmweapon. [ $+ [ $nick ] ])  { 
          set %dm.hit $rand(0,5) 
          set %dmweapused his fist.
        }
        else { 
          var %dm.equipitem = $read(dmshopitems.txt, w, * $+ $replace(%dmweapon. [ $+ [ $nick ] ],$chr(32),_) $+ *)
          if ($gettok(%dm.equipitem,3,64) != melee && Piece of air !isin %dmweapon. [ $+ [ $nick ] ]) {
            notice $nick %c1 $+ You can't use this command with a $+ %c4 %dmweapon. [ $+ [ $nick ] ] $+ %c1 $+ . Use %c3 $+ !shoot $+ %c1 $+ , $+ %c3 !cast $+ %c1 or %c3 $+ !use $+ %c1 instead.
            halt
          }
          set %dm.max $gettok($read(dmshopitems.txt, w, * $+ $replace(%dmweapon. [ $+ [ %dm.player1 ] ],$chr(32),_) $+ *),4,64)
          set %dm.hit $rand(0, %dm.max)
          set %dmweapused a $+ %c5 %dmweapon. [ $+ [ %dm.player1 ] ] $+ %c1 $+ .
          if (home isin %dmweapon. [ $+ [ %dm.player1 ] ] && $r(1,5) == 2) {
            timer 1 1 notice $nick %c1 $+ You broke your $+ %c3 %dmweapon. [ $+ [ %dm.player1 ] ] $+ %c1 $+ , meaning you lost it.
            unset %dmweapon. [ $+ [ %dm.player1 ] ]
          }
        } 
        health.check
        set %dm.player1 %dm.player2
        set %dm.player2 $nick
        timerturnswitch 1 120 turngone
      }
      elseif ($nick == %dm.player2) { 
        notice $nick %c1 $+ Its not your turn! 
      }
      else { 
        notice $nick %c1 $+ You are not fighting in this Tournament. 
      }
    }
    else {
      notice $nick %c1 $+ There is no tournament running! Type $+ %c6 !tournament $+ %c1 to start one.
    }
  }

  ;######################## ATTACK - RANGE ################################
  on $*:text:/^[@`.?!](s(h)?((o)?o)?t)/Si:#DM-tournaments: {
    if (%dm.tournament == ON) {
      if ($nick == %dm.player1) {
        timerturnswitch off
        timerstopdm off
        if (%dmfreeze. [ $+ [ $nick ] ] >= 0 ) {
          msg %dm.chan %c1 $+ %dm.player1 $+ %c1 Tries to attack but he can't reach $+ %c2 %dm.player2 $+ %c1 $+ ; $+ %c2 %dm.player2 $+ %c1 gets the turn.
          notice $nick %c1 $+ Please wait $+ %c3 %dmfreeze. [ $+ [ $nick ] ] $+ %c1 more turns.
          set %dm.player1 %dm.player2
          set %dm.player2 $nick
          dec %dmfreeze. [ $+ [ $nick ] ]
          halt
        }
        if (!%dmweapon. [ $+ [ $nick ] ] || piece isin %dmweapon. [ $+ [ $nick ] ] || !%dmarrow. [ $+ [ $nick ] ])  { 
          set %dm.hit $rand(0,5) 
          if (!%dmarrow. [ $+ [ $nick ] ] && %dmweapon. [ $+ [ $nick ] ]) { set %dmweapused a $+ %c5 %dmweapon. [ $+ [ $nick ] ] $+ %c1 with the $+ %c5 basic arrows $+ %c1 $+ . }
          else { set %dmweapused his fist. } 
        }
        else { 
          var %dm.equipitem = $read(dmshopitems.txt, w, * $+ $replace(%dmweapon. [ $+ [ $nick ] ],$chr(32),_) $+ *)
          if ($gettok(%dm.equipitem,3,64) != range && Piece of air !isin %dmweapon. [ $+ [ $nick ] ]) {
            notice $nick %c1 $+ You can't use this command with a $+ %c4 %dmweapon. [ $+ [ $nick ] ] $+ %c1 $+ . Use %c3 $+ !attack $+ %c1 $+ , $+ %c3 !cast $+ %c1 or %c3 $+ !use $+ %c1 instead.
            halt
          }
          set %dm.max $gettok($read(dmshopitems.txt, w, * $+ $replace(%dmarrow. [ $+ [ %dm.player1 ] ],$chr(32),_) $+ *),5,64)
          set %dm.hit $rand(0, %dm.max)
          set %dm.poison $gettok($read(dmshopitems.txt, w, * $+ $replace(%dmarrow. [ $+ [ %dm.player1 ] ],$chr(32),_) $+ *),6,64)
          if (%dm.poison == P) .set %dm.poisondmg 10
          if (%dm.poison == P+) .set %dm.poisondmg 20
          if (%dm.poison == P++) .set %dm.poisondmg 40
          if (!%dmpoisoned. [ $+ [ %dm.player2 ] ] && %dm.poisondmg && $r(1,5) == 2) {
            set %addpoison 1
          }
          dec %dmarrow.amount. [ $+ [ $nick ] ] %arrows.shot
          set %dmweapused a $+ %c5 %dmweapon. [ $+ [ $nick ] ] $+ %c1 with $+ %c5 $gettok(%dmarrow. [ $+ [ $nick ] ],1,64) $+ s $+ %c1 $+ .
          if (%dmarrow.amount. [ $+ [ $nick ] ] <= 0) {
            unset %dmarrow. [ $+ [ $nick ] ]
          }
          else {
            set %dmweapused %dmweapused $chr(32) | timer 1 1 notice %dm.player1 %c1 $+ You now have $+ %c3 %dmarrow.amount. [ $+ [ %dm.player1 ] ] $+ %c5 $gettok(%dmarrow. [ $+ [ %dm.player1 ] ],1,64) $+ s $+ %c1 left.
          }
          set %arrows.shot $gettok($read(dmshopitems.txt, w, * $+ $replace(%dmweapon. [ $+ [ %dm.player1 ] ],$chr(32),_) $+ *),4,64)
          if (%arrows.shot == 3) {
            set %dm.hit2 $rand(0, %dm.max)
            set %dm.hit3 $rand(0, %dm.max)
          }
        } 
        health.check
        set %dm.player1 %dm.player2
        set %dm.player2 $nick
        timerturnswitch 1 120 turngone
      }
      elseif ($nick == %dm.player2) { 
        notice $nick %c1 $+ Its not your turn! 
      }
      else { 
        notice $nick %c1 $+ You are not fighting in this tournament. 
      }
    }
    else {
      notice $nick %c1 $+ There is no tournament running! Type $+ %c6 !DM $+ %c1 to start one.
    }
  }


  ;######################## ATTACK - MAGE #################################
  on $*:text:/^[?!@`.](cast|spell)/Si:#DM-tournaments: {
    if (%dm.tournament == ON) {
      if ($nick == %dm.player1) {
        timerturnswitch off
        timerstopdm off
        if (%dmfreeze. [ $+ [ $nick ] ] >= 0 ) {
          msg %dm.chan %c1 $+ %dm.player1 $+ %c1 Tries to attack but he can't reach $+ %c2 %dm.player2 $+ %c1 $+ ; $+ %c2 %dm.player2 $+ %c1 gets the turn.
          notice $nick %c1 $+ Please wait $+ %c3 %dmfreeze. [ $+ [ $nick ] ] $+ %c1 more turns.
          set %dm.player1 %dm.player2
          set %dm.player2 $nick
          dec %dmfreeze. [ $+ [ $nick ] ]
          halt
        }
        set %dmspellname $read(dmshopitems.txt, w, $replace($2-,$chr(32),_) $+ *)
        set %dmspell2 $gettok(%dmspellname,1,64)
        set %dmspell $replace(%dmspell2,_,$chr(32))
        if (!%dmspell) {
          notice $nick %c1 $+ There's no such spell as %c4 $+ " $+ $2- $+ " $+ %c1 $+ .
          halt
        }
        if (!%dmweapon. [ $+ [ $nick ] ] || piece isin %dmweapon. [ $+ [ $nick ] ] || !$2)  { 
          set %dm.hit $calc($rand(0,10) + $rand(
          set %dmweapused the basic spell.
        }
        else { 
          set %dm.weaponuse $read(dmshopitems.txt, w, * $+ $replace(%dmweapon. [ $+ [ $nick ] ],$chr(32),_) $+ *)
          if ($gettok(%dm.weaponuse,3,64) != mage && Piece of air !isin %dmweapon. [ $+ [ $nick ] ]) {
            notice $nick %c1 $+ You can't use this command with a $+ %c4 %dmweapon. [ $+ [ $nick ] ] $+ %c1 $+ . Use %c3 $+ !shoot $+ %c1 $+ , $+ %c3 !attack $+ %c1 or %c3 $+ !use $+ %c1 instead.
            halt
          }
          set %reqstaff $gettok(%dmspellname,4,64)
          set %reqstaff $replace(%reqstaff,_,$chr(32))
          if (%reqstaff == Newbie magic staff && %dmweapon. [ $+ [ $nick ] ] != Newbie magic staff && %dmweapon. [ $+ [ $nick ] ] != Beginner magic staff && %dmweapon. [ $+ [ $nick ] ] != Magic staff && %dmweapon. [ $+ [ $nick ] ] != Advanced magic staff && %dmweapon. [ $+ [ $nick ] ] != Ultimate magic staff && %dmweapon. [ $+ [ $nick ] ] != Two duel handed magic wands) {
            notice $nick %c1 $+ You need a $+ %c5 Newbie magic staff $+ %c2 or higher $+ %c1 equipped, $+ %c1 to use $+ %c6 %dmspell $+ s $+ %c1 $+ .
            halt
          }
          elseif (%reqstaff == Beginner magic staff && %dmweapon. [ $+ [ $nick ] ] != Beginner magic staff && %dmweapon. [ $+ [ $nick ] ] != Magic staff && %dmweapon. [ $+ [ $nick ] ] != Advanced magic staff && %dmweapon. [ $+ [ $nick ] ] != Ultimate magic staff && %dmweapon. [ $+ [ $nick ] ] != Two duel handed magic wands) {
            notice $nick %c1 $+ You need a $+ %c5 Beginner magic staff $+ %c2 or higher $+ %c1 equipped, $+ %c1 to use $+ %c6 %dmspell $+ s $+ %c1 $+ .
            halt
          }
          elseif (%reqstaff == Magic staff && %dmweapon. [ $+ [ $nick ] ] != Magic staff && %dmweapon. [ $+ [ $nick ] ] != Advanced magic staff && %dmweapon. [ $+ [ $nick ] ] != Ultimate magic staff && %dmweapon. [ $+ [ $nick ] ] != Two duel handed magic wands) {
            notice $nick %c1 $+ You need a $+ %c5 Magic staff $+ %c2 or higher $+ %c1 equipped, $+ %c1 to use $+ %c6 %dmspell $+ s $+ %c1 $+ .
            halt
          }
          elseif (%reqstaff == Advanced magic staff && %dmweapon. [ $+ [ $nick ] ] != Advanced magic staff && %dmweapon. [ $+ [ $nick ] ] != Ultimate magic staff && %dmweapon. [ $+ [ $nick ] ] != Two duel handed magic wands) {
            notice $nick %c1 $+ You need an $+ %c5 Advanced magic staff $+ %c2 or higher $+ %c1 equipped, $+ %c1 to use $+ %c6 %dmspell $+ s $+ %c1 $+ .
            halt
          }
          if ($gettok(%dmspellname,3,64) == aspell) {
            set %dm.max $gettok(%dmspellname,5,64)
            if (%dmweapon. [ $+ [ $nick ] ] == Newbie magic staff) .set %dm.max $calc(%dm.max * 0.8)
            if (%dmweapon. [ $+ [ $nick ] ] == Beginner magic staff) .set %dm.max $calc(%dm.max * 0.9)
            if (%dmweapon. [ $+ [ $nick ] ] == Advanced magic staff) .set %dm.max $calc(%dm.max * 1.1)
            if (%dmweapon. [ $+ [ $nick ] ] == Ultimate magic staff) .set %dm.max $calc(%dm.max * 1.2)
            if (%dmweapon. [ $+ [ $nick ] ] == Two duel handed magic wands) .set %dm.max $calc(%dm.max * 1.5)
            set %dm.hit $rand(5, %dm.max) 
            set %dmweapused %c3 $+ %dmspell $+ %c1 with a $+ %c5 %dmweapon. [ $+ [ %dm.player1 ] ] $+ %c1 $+ .
            if ($gettok(%dmspellname,6,64) == freeze) {
              set %dmfreeze. [ $+ [ %dm.player2 ] ] 2
              if (%dmclass. [ $+ [ %dm.player2 ] ] != melee) .set %dmfreeze. [ $+ [ %dm.player2 ] ] 0
              set %dmweapused %dmweapused  | msg %dm.chan %c2 $+ %dm.player2 $+ %c1 has been frozen, meaning he can't use $+ %c3 melee attacks $+ %c1 for $+ %c5 2 $+ %c1 turns.
            }
            health.check
          }
          elseif ($gettok(%dmspellname,3,64) == hspell) {
            set %dm.heal $calc(%dm.starthealth. [ $+ [ %dm.player1 ] ] / 100 * $gettok(%dmspellname,5,64))
            inc %dmhealth. [ $+ [ %dm.player1 ] ] %dm.heal
            if (%dmhealth. [ $+ [ %dm.player1 ] ] > %dm.starthealth. [ $+ [ %dm.player1 ] ]) {
              set %dm.heal $calc(%dm.starthealth. [ $+ [ %dm.player1 ] ] - %dmhealth. [ $+ [ %dm.player1 ] ])
              set %dmhealth. [ $+ [ %dm.player1 ] ] %dm.starthealth. [ $+ [ %dm.player1 ] ]
            }
            msg %dm.chan %c2 $+ %dm.player1 $+ %c1 casts $+ %c5 %dmspell $+ %c1 healing him with $+ %c4 %dm.heal $+ %c1 hitpoints. He now has $+ %c4 %dmhealth. [ $+ [ %dm.player1 ] ] $+ %c1 hitpoints.  
          }
          elseif ($gettok(%dmspellname,3,64) == tspell) {
            set %dmfreeze. [ $+ [ %dm.player2 ] ] 4
            if (%dmclass. [ $+ [ %dm.player2 ] ] != melee) .set %dmfreeze. [ $+ [ %dm.player2 ] ] 2
            msg %dm.chan %c2 $+ %dm.player1 $+ %c5 teleports away $+ %c1 $+ , meaning $+ %c2 %dm.player2 $+ %c1 can't use $+ %c3 melee attacks $+ %c1 for $+ %c5 4 $+ %c1 $+ , and $+ %c3 ranged/magic attacks $+ %c1 for $+ %c5 2 $+ %c1 turns. 
          }

          writeini dminv.ini $nick %dmspell2 $calc($readini(dminv.ini,$nick,%dmspell2) - 1)
          set %dmweapused %dmweapused  | timer 1 1 notice %dm.player1 %c1 $+ You have $+ %c3 $readini(dminv.ini,$nick,%dmspell2) $+ %c4 %dmspell $+ s $+ %c1 left. 
          if ($readini(dminv.ini,$nick,%dmspell2) <= 0) .remini dminv.ini $nick %dmspell2 
        } 
        set %dm.player1 %dm.player2
        set %dm.player2 $nick
        timerturnswitch 1 120 turngone
      }
      elseif ($nick == %dm.player2) { 
        notice $nick %c1 $+ Its not your turn! 
      }
      else { 
        notice $nick %c1 $+ You are not fighting in this tournament. 
      }
    }
    else {
      notice $nick %c1 $+ There is no tournament running! Type $+ %c6 !DM $+ %c1 to start one.
    }
  }





  alias -l turngone {
    if (%dm.tournament == ON) {  
      msg %dm.chan %c2 $+ %dm.player1 $+ %c1 hasn't attacked or used a potion/spell within $+ %c3 1 minute $+ %c1 $+ ; $+ %c2 %dm.player2 $+ 's $+ %c1 turn.
      timerstopdm 1 60 turngone2 
      var %dm.player3 = %dm.player1
      set %dm.player1 %dm.player2
      set %dm.player2 %dm.player3
    }
  }
  alias -l turngone2 {
    if (%DM.tournament == ON) { 
      msg %dm.chan %c2 $+ %dm.player1 $+ %c1 nor $+ %c2 %dm.player2 $+ %c1 has attacked or used a potion/spell within $+ %c3 2 minutes $+ %c1 $+ ; deathmatch halted.
      enddm
    }
  }

  alias -l health.check {
    if (%DM.tournament == ON) {
      if (%dmpoisoned. [ $+ [ %dm.player1 ] ]) {
        if (%dmpoisoned. [ $+ [ %dm.player1 ] ] > %dmhealth. [ $+ [ %dm.player1 ] ]) { 
          set %dmpoisoned. [ $+ [ %dm.player1 ] ] %dmhealth. [ $+ [ %dm.player1 ] ]
          var %dm.player3 = %dm.player1
          set %dm.player1 %dm.player2
          set %dm.player2 %dm.player3 
          msg %dm.chan %c2 $+ %dm.player2 $+ %c1 gets $+ %c6 %dmpoisoned. [ $+ [ %dm.player1 ] ] $+ %c1 damage from poison. He now has $+ %c4 %dmhealth. [ $+ [ %dm.player2 ] ] $+ %c1 hitpoints left.
          msg %dm.chan %c2 $+ %dm.player2 $+ %c1 has died because of poison! $+ %c2 %dm.player1 $+ %c1 gets $+ %c3 $calc(%dmlvl. [ $+ [ %dm.player1 ] ] * 15) $+ %c1 bonus expoints for this fight! 
          :playerdied
        }
        else {
          dec %dmhealth. [ $+ [ %dm.player1 ] ] %dmpoisoned. [ $+ [ %dm.player1 ] ]
          msg %dm.chan %c2 $+ %dm.player1 $+ %c1 gets $+ %c6 %dmpoisoned. [ $+ [ %dm.player1 ] ] $+ %c1 damage from poison. He now has $+ %c4 %dmhealth. [ $+ [ %dm.player1 ] ] $+ %c1 hitpoints left.
        }
      }
      if (%dm.hit > %dmhealth. [ $+ [ %dm.player2 ] ]) { 
        set %dm.hit %dmhealth. [ $+ [ %dm.player2 ] ] 
      }
      msg %dm.chan %c2 $+ %dm.player1 $+ %c1 has hit $+ %c3 %dm.hit $+ %c1 on $+ %c2 %dm.player2 $+ %c1 using %dmweapused
      if (%addpoison) {
        msg %dm.chan %c2 $+ %dm.player2 $+ %c1 is poisoned with $+ %c6 %dm.poisondmg $+ %c1 poison damage each turn!
        set %dmpoisoned. [ $+ [ %dm.player2 ] ] %dm.poisondmg
        unset %addpoison
      }
      dec %dmhealth. [ $+ [ %dm.player2 ] ] %dm.hit
      if  (%dmhealth. [ $+ [ %dm.player2 ] ] <= 0) { 
        msg %dm.chan %c2 $+ %dm.player2 $+ %c1 has been defeated! $+ %c2 %dm.player1 $+ %c1 gets $+ %c3 $calc(%dmlvl. [ $+ [ %dm.player1 ] ] * 15) $+ %c1 bonus expoints for this fight! 
        :playerdied
        set %dm.tournament.winner. [ $+ [ %fight ] ] %dm.player1 
        inc %dmloses. [ $+ [ %dm.player2 ] ] 
        nextround
      }
      msg %dm.chan %c2 $+ %dm.player2 $+ %c1 has $+ %c4 %dmhealth. [ $+ [ %dm.player2 ] ] $+ %c1 hitpoints left! 
      notice %dm.player1 %c1 $+ You gained $+ %c6 %dm.hit $+ %c1 XP.
      inc %dm.xp. [ $+ [ %dm.player1 ] ] %dm.hit
      xp.check 
    }
  }


  alias -l nextround {
    if (%dm.tournament.people == 8 && %fight != 4) {
      set %nextalias $+(fight,$calc(%fight + 1))
%nextalias
    }
    if (%dm.tournament.people == 8 && %fight != 6) {
      set %nextalias $+(fight,$calc(%fight + 1),semi) 
%nextalias
    }
    if (%dm.tournament.people == 8 && %fight == 6) {
      fight7.final
    }
    if (%dm.tournament.people == 8 && %fight == 7) {
      msg $chan %dm.tournament.winner.7 has won the Tournament! therefor he gets %dm.tournament.price!
      inc %dm.tournament.wins. [ $+ [ %dm.tournament.winner.7 ] ]
      inc %dM.money. [ $+ [ %dm.tournament.winner.7 ] ]
    }
    if (%dm.tournament.people == 4 && %fight == 1) {
      fight2
    }
    if (%dm.tournament.people == 4 && %fight == 2) {
      fight3.final
    }
    if (%dm.tournament.people == 4 && %fight == 3) {
      msg $chan %dm.tournament.winner.3 has won the Tournament! therefor he gets %dm.tournament.price!
      inc %dm.tournament.wins. [ $+ [ %dm.tournament.winner.3 ] ]
      inc %dM.money. [ $+ [ %dm.tournament.winner.3 ] ]
    }
    if (%dm.tournament.people == 16 && %fight != 8) {
 set %nextalias $+(fight,$calc(%fight + 1))
%nextalias   
}
    if (%dm.tournament.people == 16 && %fight != 14) {
     set %nextalias $+(fight,$calc(%fight + 1),kwart) 
%nextalias
    }
    if (%dm.tournament.people == 16 && %fight == 14) {
      fight15.final
    }
    if (%dm.tournament.people == 16 && %fight == 15) {
      msg $chan %dm.tournament.winner.3 has won the Tournament! therefor he gets %dm.tournament.price!
      inc %dm.tournament.wins. [ $+ [ %dm.tournament.winner.15 ] ]
      inc %dM.money. [ $+ [ %dm.tournament.winner.15 ] ]
    }






    alias -l fight1 {
      set %Dm.player1 %dm.tournament.player1
      set %dm.player2 %dm.tournament.player2
      msg $chan now fighting in the first battle of this tournament: %dm.tournament.player1 VS. %dm.tournament.player2    
      set %fight 1
    }
    alias -l fight2 {
      set %Dm.player1 %dm.tournament.player3
      set %dm.player2 %dm.tournament.player4
      msg $chan The 2 people that will now compeet are %dm.tournament.player3 and %dm.tournament.player4
      set %fight 2
    }
    alias -l fight3 {
      set %Dm.player1 %dm.tournament.player5
      set %dm.player2 %dm.tournament.player6
      msg $chan this is already the third fight of this tournament, %dm.tournament.player5 and %dm.tournament.player6 will compeet
      set %fight 3
    }
    alias -l fight4 {
      set %Dm.player1 %dm.tournament.player7
      set %dm.player2 %dm.tournament.player8
      msg $chan Now compeeting are %dm.tournament.player7 and %dm.tournament.player8   
      set %fight 4
    }
    alias -l fight5 {
      set %Dm.player1 %dm.tournament.player9
      set %dm.player2 %dm.tournament.player10
      msg $chan the fight were gonna see now is: %dm.tournament.player9 vs. %dm.tournament.player10   
      set %fight 5
    }
    alias -l fight6 {
      set %Dm.player1 %dm.tournament.player11
      set %dm.player2 %dm.tournament.player12
      msg $chan next fight is between: %dm.tournament.player11 and %dm.tournament.player12   
      set %fight 6
    }
    alias -l fight7 {
      set %Dm.player1 %dm.tournament.player13
      set %dm.player2 %dm.tournament.player14
      msg $chan what a fantastic fight is this gonna be! %dm.tournament.player13 vs. %dm.tournament.player14   
      set %fight 7
    }
    alias -l fight8 {
      set %Dm.player1 %dm.tournament.player15
      set %dm.player2 %dm.tournament.player16
      msg $chan this is our last fight before the next round! %dm.tournament.player15 vs %dm.tournament.player16   
      set %fight 8
    }
    alias fight5.semi {
      set %dm.player1 %dm.tournament.winner.1
      set %DM.player2 %dm.tournament.winner.2
      msg $chan its now the semi finals! %dm.player1 vs. dm.player2    
      set %fight 5 
    }
    alias fight6.semi {
      set %dm.player1 %dm.tournament.winner.3
      set %DM.player2 %dm.tournament.winner.4
      msg $chan  they have come so far! %dm.player1 vs. %dm.player2   
      set %fight 6 
    }
    alias fight7.final {
      set %dm.player1 %dm.tournament.winner.5
      set %DM.player2 %dm.tournament.winner.6
      msg $chan This is the one and only final! %dm.player1 vs. %dm.player2   
      set %fight 7 
    }
    alias fight3.final {
      set %dm.player1 %dm.tournament.winner.1
      set %DM.player2 %dm.tournament.winner.2
      msg $chan This is the one and only final! %dm.player1 vs. %dm.player2  
      set %fight 3
    }
    alias -l fight9.kwart {
      set %DM.player1 %dm.tournament.winner.1
      set %DM.player2 %dm.tournament.winner.2
      msg $chan now fighting: %dm.player1 vs. %dm.player2
      set %fight 9  
    }
    alias -l fight10.kwart {
      set %DM.player1 %dm.tournament.winner.3
      set %DM.player2 %dm.tournament.winner.4
      msg $chan now fighting: %dm.player1 vs. %dm.player2
      set %fight 10  
    }
    alias -l fight11.kwart {
      set %DM.player1 %dm.tournament.winner.5
      set %DM.player2 %dm.tournament.winner.6
      msg $chan now fighting: %dm.player1 vs. %dm.player2
      set %fight 11  
    }
    alias -l fight12.kwart {
      set %DM.player1 %dm.tournament.winner.7
      set %DM.player2 %dm.tournament.winner.8
      msg $chan now fighting: %dm.player1 vs. %dm.player2
      set %fight 12 
    }
    alias -l fight13.semi {
      set %DM.player1 %dm.tournament.winner.9
      set %DM.player2 %dm.tournament.winner.10
      msg $chan now fighting: %dm.player1 vs. %dm.player2
      set %fight 13  
    }
    alias -l fight14.semi {
      set %DM.player1 %dm.tournament.winner.11
      set %DM.player2 %dm.tournament.winner.12
      msg $chan The almost last but not the least: %dm.player1 vs. %dm.player2
      set %fight 14 
    }
    alias -l fight15.final {
      set %DM.player1 %dm.tournament.winner.13
      set %DM.player2 %dm.tournament.winner.14
      msg $chan This is the one and only final! %dm.player1 vs. %dm.player2
      set %fight 15
    }