
   /* AMX Mod script.
   *
   * (c) Copyright 2003, written by For3st
   * This file is provided as is (no warranties).
   *
   * AMX DUKE NUKEM
   *[2003 / 07 / 10 -- last change]
   *
   * Changelog:
   *    v0.10 -- Initial build (beta status)
   *    v0.20 -- fixed some bugs
   *    v0.50 -- added cvar and client commands
   *
   * AMX DUKE NUKEM
   * ---------------------------
   *
   *  This  Plugin  plays Duke Nukem bigtalks at some events (e.g. kills,
   respawn, TK...). This is just a Funplugin
   *  for  those who likes Duke Nukem and don`t want to miss his comments
   at CS. I recommend not using this Plugin
   *  with  any  other  audio-  announcment  Plugin  like  Ut-  sounds or
   Knifekill Announcer.
   *
   * You will need the "Duke Nukem Audio CS Pack".
   *
   *
   *
   *
   * CVAR:
   * -----------------
   *
   *  amx_duke_nukem <flags>    --determines at which events a duke sound
   file will be played.
   *
   *
   * FLAGS:
   * -----------------
   *
   *    "a"    --plays duke sounds at kills and when you die.
   *
   *    "b"    --Anounces Knife Kills and HE kills
   *
   *    "c"    --plays duke sounds on TAing and TKing
   *
   *    "d"    --plays duke sounds at new round (respawn)
   *
   *    "e"    --plays sounds on bomb defusing and bomplanting events
   *
   *    "f"    --plays sound when you get hit with damage over 70
   *        (no speech, just a little "pain" .wav)
   *
   * CLIENT COMMANDS
   * -----------------
   *
   *    say /dkon    -- Enables Duke Nukem Plugin.
   *
   *    say /dkoff    -- Disables Duke Nukem Plugin.
   *
   */
   #include <amxmod>
   new bool:dk_talk[33]
   getrandom() {
   new rand_nummer = random_num(1,110)
   return rand_nummer
   }
   getflags() {
      new flagstring[65]
      get_cvar_string ("amx_duke_nukem",flagstring,70)
      new flagstringbits = read_flags(flagstring)
      return flagstringbits
   }
   public damage_event( victim ) {

      new damage = read_data(2)
      new weapon, hitplace
      new attacker = get_user_attacker(victim,weapon,hitplace)
      if  (((!(getflags()  &1))  &&  (!(getflags()  &2)) && (!(getflags()
   &4)))    ||    !dk_talk[attacker]    ||    !dk_talk[victim])    return
   PLUGIN_CONTINUE
   //NORMAL KILL/DEATH
      if  (get_user_health(victim)  <= 0 &&  weapon != 4 &&  weapon != 29
   &&  (get_user_team(victim)  != get_user_team(attacker)) && (getflags()
   &1)) {

      if (getrandom() >= 1 && getrandom() <= 10) {
      client_cmd(attacker,"spk dukenukem/kill/du_brokenheart.wav")
      client_cmd(victim,"spk dukenukem/death/du_fuckers.wav")
       }
      else if (getrandom() >= 11 && getrandom() <= 20) {
      client_cmd(attacker,"spk dukenukem/kill/du_gib_monster1.wav")
      client_cmd(victim,"spk dukenukem/death/du_see_secmech1.wav")
       }
      else if (getrandom() >= 21 && getrandom() <= 30) {
      client_cmd(attacker,"spk
   dukenukem/kill/du_gunsdontkillmutants.wav")
      client_cmd(victim,"spk
   dukenukem/death/du_thatsgoingtoleaveamark.wav")
       }
      else if (getrandom() >= 31 && getrandom() <= 40) {
      client_cmd(attacker,"spk dukenukem/kill/du_ilikebigguns.wav")
      client_cmd(victim,"spk dukenukem/death/du_youtalkintome1.wav")
       }
      else if (getrandom() >= 41 && getrandom() <= 50) {
      client_cmd(attacker,"spk dukenukem/kill/du_kill_femech1.wav")
      client_cmd(victim,"spk dukenukem/death/vs_death1.wav")
       }
      else if (getrandom() >= 51 && getrandom() <= 60) {
      client_cmd(attacker,"spk dukenukem/kill/du_kill_femech2.wav")
      client_cmd(victim,"spk dukenukem/death/vs_death2.wav")
       }
      else if (getrandom() >= 61 && getrandom() <= 70) {
      client_cmd(attacker,"spk dukenukem/kill/du_kill_femech3.wav")
      client_cmd(victim,"spk dukenukem/death/vs_death3.wav")
       }
      else if (getrandom() >= 71 && getrandom() <= 75) {
      client_cmd(attacker,"spk dukenukem/kill/du_kill_ratoid1.wav")
      client_cmd(victim,"spk dukenukem/death/vs_death_gib3.wav")
       }
      else if (getrandom() >= 76 && getrandom() <= 80) {
      client_cmd(attacker,"spk
   dukenukem/kill/du_mygunsbiggerthanyours.wav")
      client_cmd(victim,"spk dukenukem/death/du_fuckers.wav")
       }
      else if (getrandom() >= 81 && getrandom() <= 85) {
      client_cmd(attacker,"spk dukenukem/kill/du_nowyouseeme.wav")
      client_cmd(victim,"spk
   dukenukem/death/du_thatsgoingtoleaveamark.wav")
       }
      else if (getrandom() >= 86 && getrandom() <= 90) {
      client_cmd(attacker,"spk dukenukem/kill/du_see_femech1.wav")
      client_cmd(victim,"spk
   dukenukem/death/du_thatsgoingtoleaveamark.wav")
       }

      else if (getrandom() >= 91 && getrandom() <= 95) {
      client_cmd(attacker,"spk dukenukem/kill/du_somedowntime.wav")
      client_cmd(victim,"spk dukenukem/death/du_see_secmech1.wav")
       }
      else if (getrandom() >= 96 && getrandom() <= 100) {
      client_cmd(attacker,"spk dukenukem/kill/du_youtalkintome2.wav")
      client_cmd(victim,"spk dukenukem/death/du_youtalkintome1.wav")
       }
      else if (getrandom() >= 101 && getrandom() <= 109) {
      client_cmd(attacker,"spk
   dukenukem/kill/du_sometimesiamazemyself.wav")
      client_cmd(victim,"spk dukenukem/death/du_fuckers.wav")
      }
   //*/
      else {
      return PLUGIN_CONTINUE
      }
   }
   //HE-KILL
      else   if  (get_user_health(victim)  <=  0  &&  (weapon  ==  4)  &&
   (getflags() &2)) {
      if (getrandom() >= 1 && getrandom() <= 55) {
      client_cmd(attacker,"spk dukenukem/hdmg/du_gib_monster2.wav")
      client_cmd(victim,"spk dukenukem/death/du_youtalkintome1.wav")
       }
      else if (getrandom() >= 56 && getrandom() <= 110) {
      client_cmd(attacker,"spk dukenukem/hdmg/du_babealicious.wav")
      client_cmd(victim,"spk dukenukem/death/du_youtalkintome1.wav")
       }
   /*
      else if (getrandom() >= 61 && getrandom() <= 80) {
      client_cmd(attacker,"spk dukenukem/hdmg/du_iamtheking.wav")
       }
   */
      else {
      return PLUGIN_CONTINUE
      }
   }
   //KNIFE KILL
      else  if  (get_user_health(victim)  <=  0  &&  (weapon  ==  29)  &&
   (getflags() &2)) {
      if (getrandom() >= 1 && getrandom() <= 55) {
      client_cmd(attacker,"spk dukenukem/hdmg/du_groovy.wav")
      client_cmd(victim,"spk dukenukem/death/vs_death_gib3.wav")
       }
      else if (getrandom() >= 56 && getrandom() <= 110) {
      client_cmd(attacker,"spk dukenukem/hdmg/du_yeah.wav")
      client_cmd(victim,"spk dukenukem/death/vs_death_gib3.wav")
       }
      else {
      return PLUGIN_CONTINUE
      }
   }
   //DAMAGE ANNOUNCMENT (over 70)
      else if (damage > 70 && get_user_health(victim) >= 0 && (getflags()
   &32)) {
      if (getrandom() >= 1 && getrandom() <= 30) {
      client_cmd(victim,"dukenukem/dmg/vs_pain1.wav")
       }
      else if (getrandom() >= 31 && getrandom() <= 50) {
      client_cmd(victim,"dukenukem/dmg/vs_pain2.wav")
       }
      else if (getrandom() >= 51 && getrandom() <= 80) {
      client_cmd(victim,"dukenukem/dmg/vs_pain3.wav")
       }
      else {
      return PLUGIN_CONTINUE
      }
   }
   //TK
      else  if  (get_user_health(victim) <= 0 &&(get_user_team(victim) ==
   get_user_team(attacker)) && (getflags() &4)) {
      if (getrandom() >= 1 && getrandom() <= 80) {
      client_cmd(attacker,"spk dukenukem/TK/du_oopsdiditagain.wav")
      client_cmd(victim,"spk dukenukem/TK/du_fuckers.wav")
      }
      else {
      return PLUGIN_CONTINUE
   }
   }
   //TA
      else  if  (get_user_health(victim) >= 1 &&(get_user_team(victim) ==
   get_user_team(attacker)) && (getflags() &4)) {
      if (getrandom() >= 1 && getrandom() <= 20) {
      client_cmd(victim,"spk dukenukem/TK/du_kill_pigoid2.wav")
      }
      else if (getrandom() >= 21 && getrandom() <= 50) {
      client_cmd(victim,"spk dukenukem/TK/du_kill_monster1.wav")
      }
   }
      else {
      return PLUGIN_CONTINUE
   }
      return PLUGIN_CONTINUE
   }
   public new_round(player) {

      new roundtime = get_cvar_num("mp_roundtime") * 60
      if (roundtime != read_data(1))    return PLUGIN_CONTINUE

      if (!(getflags() &8) || !dk_talk[player]) return PLUGIN_CONTINUE
   //NEW ROUND ANNOUNCER
      if (getrandom() >= 1 && getrandom() <= 10) {
      client_cmd(player,"spk dukenukem/rspwn/du_deworm.wav")
      }
      else if (getrandom() >= 11 && getrandom() <= 20) {
      client_cmd(player,"spk dukenukem/rspwn/du_egopowerup.wav")
      }
      else if (getrandom() >= 21 && getrandom() <= 30) {
      client_cmd(player,"spk dukenukem/rspwn/du_gooddaytodie.wav")
      }
      else if (getrandom() >= 31 && getrandom() <= 40) {
      client_cmd(player,"spk dukenukem/rspwn/du_idontdowindows.wav")
      }
      else if (getrandom() >= 41 && getrandom() <= 50) {
      client_cmd(player,"spk dukenukem/rspwn/du_itsclobberingtime.wav")
      }
      else if (getrandom() >= 51 && getrandom() <= 60) {
      client_cmd(player,"spk dukenukem/rspwn/du_kickyourass.wav")
      }
      else if (getrandom() >= 61 && getrandom() <= 70) {
      client_cmd(player,"spk dukenukem/rspwn/du_respawn1.wav")
      }
      else if (getrandom() >= 71 && getrandom() <= 80) {
      client_cmd(player,"spk dukenukem/rspwn/du_respawn2.wav")
      }
      else if (getrandom() >= 81 && getrandom() <= 90) {
      client_cmd(player,"spk dukenukem/rspwn/du_respawn4.wav")
      }
      else if (getrandom() >= 91 && getrandom() <= 100) {
      client_cmd(player,"spk dukenukem/rspwn/du_sayhello.wav")
      }
      else if (getrandom() >= 101 && getrandom() <= 109) {
      client_cmd(player,"spk dukenukem/rspwn/du_whowantstodance.wav")
      }
      else {
      return PLUGIN_CONTINUE
      }
      return PLUGIN_CONTINUE
   }
   public bomb_defused(){
   //BOMB DEFUSER ANOUNCMENT (only CT)
       new ppl_ct[32], pplnum_ct
       get_players(ppl_ct,  pplnum_ct,  "ae",  "CT")  //  get all CT live
   player
       if (getflags() &16){
       client_cmd(0,"spk dukenukem/misc/du_just_in_time.wav")
       }
   }
   public bomb_planted(){
   //BOMB PLANTER ANNOUNCER (only T)
       new ppl_t[32], pplnum_t
       get_players(ppl_t,pplnum_t,"ae",  "TERRORIST") // get all terorist
   live player
       if (getflags() &16){
       client_cmd(0,"spk dukenukem/misc/du_get_the_hell_out.wav")
       }
   }
   public plugin_precache() {
      precache_sound( "dukenukem/death/du_fuckers.wav" )
      precache_sound( "dukenukem/death/du_see_secmech1.wav")
      precache_sound( "dukenukem/death/du_thatsgoingtoleaveamark.wav")
      precache_sound( "dukenukem/death/du_youtalkintome1.wav ")
      precache_sound( "dukenukem/death/vs_death1.wav")
      precache_sound( "dukenukem/death/vs_death2.wav")
      precache_sound( "dukenukem/death/vs_death3.wav")
      precache_sound( "dukenukem/death/vs_death_gib3.wav")
      precache_sound( "dukenukem/hdmg/du_gib_monster2.wav")
      precache_sound( "dukenukem/hdmg/du_babealicious.wav")
      precache_sound( "dukenukem/hdmg/du_groovy.wav")
      precache_sound( "dukenukem/hdmg/du_iamtheking.wav")
      precache_sound( "dukenukem/hdmg/du_yeah.wav")
      //precache_sound( "dukenukem/hdmg/ ")
      precache_sound( "dukenukem/dmg/vs_pain1.wav")
      precache_sound( "dukenukem/dmg/vs_pain2.wav")
      precache_sound( "dukenukem/dmg/vs_pain3.wav")
      //precache_sound( "dukenukem/dmg/")
      precache_sound( "dukenukem/kill/du_brokenheart.wav")
      precache_sound( "dukenukem/kill/du_gib_monster1.wav")
      precache_sound( "dukenukem/kill/du_gunsdontkillmutants.wav")
      precache_sound( "dukenukem/kill/du_ilikebigguns.wav")
      precache_sound( "dukenukem/kill/du_kill_femech1.wav")
      precache_sound( "dukenukem/kill/du_kill_femech2.wav")
      precache_sound( "dukenukem/kill/du_kill_femech3.wav")
      precache_sound( "dukenukem/kill/du_kill_ratoid1.wav")
      precache_sound( "dukenukem/kill/du_mygunsbiggerthanyours.wav")
      precache_sound( "dukenukem/kill/du_nowyouseeme.wav")
      precache_sound( "dukenukem/kill/du_see_femech1.wav")
      precache_sound( "dukenukem/kill/du_somedowntime.wav")
      precache_sound( "dukenukem/kill/du_sometimesiamazemyself.wav")
      precache_sound( "dukenukem/kill/du_youtalkintome2.wav")
      //precache_sound( "dukenukem/kill/ ")
      precache_sound( "dukenukem/rspwn/du_deworm.wav ")
      precache_sound( "dukenukem/rspwn/du_egopowerup.wav ")
      precache_sound( "dukenukem/rspwn/du_gooddaytodie.wav")
      precache_sound( "dukenukem/rspwn/du_idontdowindows.wav")
      precache_sound( "dukenukem/rspwn/du_itsclobberingtime.wav ")
      precache_sound( "dukenukem/rspwn/du_kickyourass.wav ")
      precache_sound( "dukenukem/rspwn/du_kill_mutant1.wav ")
      precache_sound( "dukenukem/rspwn/du_respawn1.wav" )
      precache_sound( "dukenukem/rspwn/du_respawn2.wav ")
      precache_sound( "dukenukem/rspwn/du_respawn4.wav ")
      precache_sound( "dukenukem/rspwn/du_sayhello.wav ")
      precache_sound( "dukenukem/rspwn/du_whowantstodance.wav ")
      //precache_sound( "dukenukem/rspwn/ ")

      precache_sound( "dukenukem/TK/du_kill_pigoid2.wav" )
      precache_sound( "dukenukem/TK/du_kill_monster1.wav ")
      precache_sound( "dukenukem/TK/du_fuckers.wav")
      precache_sound( "dukenukem/TK/du_oopsdiditagain.wav")
      //precache_sound( "dukenukem/TK/ ")
      //precache_sound( "dukenukem/misc/du_danceforme.wav")
      precache_sound( "dukenukem/misc/du_get_the_hell_out.wav")
      precache_sound( "dukenukem/misc/du_just_in_time.wav")
      //precache_sound( "dukenukem/misc/ ")
      return PLUGIN_CONTINUE
   }
   public client_putinserver(id){
      dk_talk[id] = true

      return PLUGIN_CONTINUE
   }
   public dukenukem_on (id) {
      if  (  !(getflags()  &1) && !(getflags() &2) && !(getflags() &4) &&
   !(getflags() &8)) {
      client_print(id,print_chat,"[AMX  DUKE NUKEM] Duke Nukem Plugin can
   not be enabled.")
      }
      else if (dk_talk[id]){
      client_print(id,print_chat,"[AMX  DUKE NUKEM] Duke Nukem Plugin has
   already been enabled.Disable it by typing /dkoff.")
      }
      else {
      client_print(id,print_chat,"[AMX  DUKE NUKEM] Duke Nukem Plugin has
   been enabled.")
      }
      dk_talk[id] = true
   }
   public dukenukem_off (id) {
      if (!dk_talk[id]){
      client_print(id,print_chat,"[AMX  DUKE NUKEM] Duke Nukem Plugin has
   already been disabled.Enable it by typing /dkon.")
      }
      else {
      client_print(id,print_chat,"[AMX  DUKE NUKEM] Duke Nukem Plugin has
   been disabled.")
      }
      dk_talk[id] = false
   }
   public plugin_init() {
      register_plugin("Amx Duke Nukem","0.50","For3st")
      register_event("Damage", "damage_event", "b", "2>10")
      register_event("RoundTime", "new_round", "bc")
      register_event("SendAudio",           "bomb_defused",          "a",
   "2&%!MRAD_BOMBDEF")
      register_event("SendAudio", "bomb_planted", "a", "2&%!MRAD_BOMBPL")
      register_clcmd("say /dkoff","dukenukem_off")
      register_clcmd("say /dkon","dukenukem_on")
      register_cvar("amx_duke_nukem","abcdef")
      return PLUGIN_CONTINUE
   }
