Zombies! v1.4

By Arigateaux on Oct 09, 2010

This is a game that was written by me, and co-developed with iSean and Anthrax. It's a pretty simple game, written in the spirit of Halloween, which has already passed. I have a current game running in #Zombies on GamersVault - server -m irc.gamersvault.net -j #Zombies

NOTE
The file info for 'weapons.ini' is located here: http://www.hawkee.com/snippet/8012/

You must have this file in order to run the game properly. Just read and follow the directions in the description and you should be golden.
NOTE

BUG FIXES
8 Jan 2011

  • Fixed !buy with no suffix causing removal of weapon
  • Revamped Shop alias to only read from the weapons.ini file
  • Cash Gained added to kill message
  • Added player name to Kill Timer message

9 Jan 2011

  • Added a Score table
  • Added a Top Killer message when someone surpasses the current top killer
  • Added the rank command; Syntax: rank [cash|kills] [NAME|NUM]
  • Added a BotCheck to test for timers
  • Fixed the buy command
  • Various minor bug fixes

10 Jan 2011

  • Fixed rank command and gave it some color
  • Fixed stats
  • More minor bug fixes

12 Jan 2011

  • Changed the shop. Prices in the ini no longer factor.
  • Changed buy command to reflect shop changes.
  • Added xp and level to rank command.
  • Cash Gained and Experience Gained added to Kill message.
  • Changed the level up algorithm.
  • Fixed Rankings (again)
  • Added color aliases.
  • Various minor bug fixes.
on *:part:#:{ hfree $nick }
on $*:text:/^[`!@.](shop|kill|buy|stats|rank)/Si:#:{
  ;$iif($me != ZombieBot,halt)
  set %m $iif($left($1,1) = @,.msg #,.notice $nick)
  if !$ini(zombie.ini,$nick) { $NewPlayer }
  if !$hget($nick) { hmake -s $nick 10 | hload -si $nick zombie.ini $nick }

  if $regml(1) = kill { $iif($hget($nick,killtime),%m 14You must wait07 $duration($hget($nick,killtime)) 14before doing that04 $nick $+ 14.,$Kill) }
  if $regml(1) = shop { Shop $2- }
  if $regml(1) = buy { Buy $2- }
  if $regml(1) = stats { $iif($iif($ini(zombie.ini,$2),$Stats($2),%m There is no one with that name.),$Stats($nick)) }
  if $regml(1) = rank { Rank $2- }
  pSave
  flushini zombie.ini
  BotCheck $nick
}

alias BotCheck {
  hadd $nick idle $instok($hget($nick,idle),$hget($nick,idle.time),1,43)
  var %idle = $hget($nick,idle), %i = $numtok(%idle,43)
  if %i = 4 { if $calc( (%idle) / %i )) = $hget($nick,idle.time) { ban -ku3600 # $nick Timers Detected - 1 Hour Ban } }
  hdel $nick idle.time
  hinc -mc $nick idle.time
  if $numtok($hget($nick,idle),43) = 4 { hdel $nick idle }
}

alias -l pSave { hsave -i $nick zombie.ini $nick }

alias -l NewPlayer {
  if !$hget($nick) {
    hmake $nick 10
    hadd $nick weapon Chainsaw
    hadd $nick level 1
    hadd $nick xp 0
    hadd $nick cash 0
  }
}

alias -l Shop {
  var %w = $ini(weapons.ini,0)
  while %w {
    var %Weapon = $+(14,[04,%w,14]04,$chr(32),$ini(weapons.ini,%w),14:07,$chr(32),$,$bytes($calc((%w - 1) ^ 3 * 1000),b),)
    var %Weapons.List = $instok(%Weapons.List,%Weapon,1,47)
    dec %w
  }
  %m $replace(%Weapons.List,$chr(47),14 / )
}

alias -l Buy {
  if $1 !isnum { %m Please use the number associated with the weapon. | halt }
  if $hget($nick,weapon) = $ini(weapons.ini,$1) { %m You already have that weapon, $nick $+ . | halt }
  var %w = $ini(weapons.ini,$1), %price = $calc(($1 - 1) ^ 3 * 1000)
  if $hget($nick,cash) < %price {
    %m You cannot afford that yet, $nick $+ . | halt
  }
  else {
    if $1 {
      %m $nick buys a %w $+ !
      hadd $nick weapon %w
      hdec $nick cash %price
    }
  }
}

alias -l Kill {
  var %score.kills = $score(kills), %score.cash = $score(cash)
  var %zombies = $iif($r(1,$calc(3 * $ini(weapons.ini,$hget($nick,weapon)))) = 1,$v1 zombie,$v1 zombies)
  var %weapon = $hget($nick,weapon), %cash = $floor($calc(($gettok(%zombies,1,32) * $r(2,5) * $hget($nick,level)) / 1.45))
  var %xp = $floor($calc($gettok(%zombies,1,32) * 5 * ($hget($nick,level) / 2)))
  hinc $nick kills $gettok(%zombies,1,32)
  hinc $nick xp %xp
  hinc $nick cash %cash
  hadd -z $nick killtime $r(30,90)
  $Level
  %m $+(07,$nick,) $gettok($readini(weapons.ini,%weapon,kill),$r(1,$numtok($readini(weapons.ini,%weapon,kill),124)),124) :: $&
    07[14Level:04 $hget($nick,level) $+ 07] - $&
    07[10Zombies 14Killed:04 $bytes($hget($nick,kills),b) $+ 07] - $&
    07[14Cash Gained:04 $+($,$bytes(%cash,b),07,]) - $&
    07[14Experience Gained:04 $bytes(%xp,b) $+ 07] - $&
    07[14Time:04 $duration($hget($nick,killtime)) $+ 07]
  pSave
  if $Score(kills) != %score.kills { $Score(kills).new) }
  if $Score(cash) != %score.cash { $Score(cash).new }
}

alias -l Stats {
  %m $&
    07[10Zombies 14Killed:04 $bytes($readini(zombie.ini,$1,kills),b) $+ 07] - $&
    07[14Level:04 $readini(zombie.ini,$1,level) $+ 07] - $&
    07[14Experience:04 $bytes($readini(zombie.ini,$1,xp),b) $+ 07] - $&
    07[14Cash:04 $ $+ $bytes($readini(zombie.ini,$1,cash),b) $+ 07] - $&
    07[14Weapon:04 $readini(zombie.ini,$1,weapon) $+ 07]- $&
    07[14Time:04 $iif($hget($1,killtime),$duration($v1),Ready) $+ 07]
}

alias -l Level {
  var %l = $calc($hget($nick,level) + 1)
  var %c = $calc(((%l * 13) ^ 2.23 * (%l / 4)) / 2)
  if $hget($nick,xp) >= %c { hinc $nick level | %m $nick gains a level! }
}

alias Score {
  var %T = $ini(zombie.ini,0)
  .window -c @Score
  .window -h @Score
  while %T {
    var %Player = $ini(zombie.ini,%T)
    aline @score $+(%Player,=,$readini(zombie.ini,%Player,$1))
    dec %T
  }
  .filter -wwctue 2 61 @Score @Score *=*
  var %x = $gettok($line(@Score,1),1,61), %y = $fline(@Score,$+($2,=*)), %z = $gettok($line(@Score,$2),1,61)
  if $isid {
    if $prop = rank { return %y }
    if $prop = name { return %z }
    if $prop = total { return $ini(zombie.ini,0) }
    if $1 = kills {
      if $prop = timer { msg # 04Top Killer 07is currently:04 %x  | halt }
      if $prop = new { msg # 04Top Killer 07is now:04 %x  | halt }
      return %x
    }
    if $1 = cash {
      if $prop = timer { msg # 04Richest Player 07is currently:04 %x  | halt }
      if $prop = new { msg # 04Richest Player 07is now:04 %x  | halt }
      return %x
    }
  }
}

alias Rank {
  if !$regex($1,/(kills|cash|level|xp)/) { %m rank [kills|cash|level|xp] [NAME|NUM] | halt }
  if $2 !isnum || !$2 { 
    var %x = $iif($2,$2,$nick)
    %m $I($ini(zombie.ini,$ini(zombie.ini,%x))) is ranked $I($ord($score($1,%x).rank)) of $I($bytes($score().total,b)) players with $I($bytes($readini(zombie.ini,%x,$1),b) $1)
  }
  else %m $I($score($1,$2).name) is ranked $I($ord($2)) of $I($bytes($score().total,b)) players with $I($bytes($readini(zombie.ini,$score($1,$2).name,$1),b) $1)
}

alias -l C1 { return $+(14,$1-) }
alias -l C2 { return $+(04,$1-,$C1) }
alias -l C { return $+(,$hget($nick,c1),$1-) }
alias -l I { return $+(,$hget($nick,c2),$1-,$C) }

Comments

Sign in to comment.
Annihiluz   -  Jun 20, 2013

Evilmonkey we should get together again sometime, i loved working on some of the ideas in the last update with you back on GV
irc.gamereaper.net

~Anthrax

 Respond  
Annaiidziithaa   -  Aug 24, 2011

evilMonkey capture showing the problem of colors -> http://imageshack.us/f/804/capturerek.png/

Annihiluz  -  Jun 20, 2013

alias -l C1 { return $+(14,$1-) }
alias -l C2 { return $+(04,$1-,$C1) }
alias -l C { return $+(,$hget($nick,c1),$1-) }
alias -l I { return $+(,$hget($nick,c2),$1-,$C) }

on these 4 lines, simply remove the colors and it works perfectly

it should appear as follows:
alias -l C1 { return $+($1-) }
alias -l C2 { return $+($1-,$C1) }
alias -l C { return $+($hget($nick,c1),$1-) }
alias -l I { return $+($hget($nick,c2),$1-,$C) }

Sign in to comment

Annaiidziithaa   -  Aug 24, 2011

Annaiidziithaa is ranked th of players with cash
Annaiidziithaa is ranked st of players with level
evilMonkey good!, I can see the messages by putting the command that you mentioned, but you should correct the following colors that interferes and can not display the position in number, should appear so ->
Annaiidziithaa is ranked "6th" of players with 25 cash
Annaiidziithaa is ranked "1st" of players with 1 level

 Respond  
Annaiidziithaa   -  Aug 24, 2011

checking

 Respond  
Arigateaux   -  Aug 24, 2011

Try using /rank kills annaiidziithaa or /rank kills 1

First one will give the rank number of the specified player while the second example will give you the name of the selected rank number.

 Respond  
Annaiidziithaa   -  Aug 24, 2011

Rank alias, you should look at it. can not get it to work! Or give an example of how it works.

 Respond  
Annaiidziithaa   -  Aug 24, 2011

how the hell you look at the ranking? someone can give an example? I think that does not work, I get this in the status -> rank [kills | cash | level | xp] [NAME | NUMBER]

 Respond  
Spoof   -  Jan 13, 2011

It's the effort that counts. The type shouldn't matter as long as ppl use it and enjoy it.

 Respond  
Arigateaux   -  Jan 12, 2011

Another new update with lots of changes, for those who care. :)

 Respond  
Arigateaux   -  Jan 08, 2011

Fixed a few bugs.

 Respond  
Phil_FW   -  Jan 08, 2011

i know lol i was just saying though... but im sure it good for any time of year :P

 Respond  
Arigateaux   -  Jan 07, 2011

Sorry, but I just noticed your comment. When the game was posted, it was before Halloween.

 Respond  
Phil_FW   -  Dec 08, 2010

great job on this even though halloween is done already lol

 Respond  
Arigateaux   -  Oct 10, 2010

I almost did, but the only reason I didn't is because of the fact that I wanted people to be able to read it and copy/paste it rather than download it.

 Respond  
Sorasyn   -  Oct 09, 2010

Nice :) could almost been posted as a script since it requires more than just the snippet to run but sweet. Looks very well built, I like it. Cant wait to try it out.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.