
========Takeover2=========

alias takeover_launch {
  /dialog -m takeover takeover
}

alias takeover_infos {
  /message Le Module de TakeOver sert à prendre le controle des channels où vous êtes ops pendant un temps illimité.
}
 {
  TakeOver SysTem : /takeover

}

dialog Takeover {
  title "Take Over System"
  size -1 -1 128 110
  option dbu
  combo 1, 3 12 60 56, drop
  button "OK", 2, 84 97 37 12, ok
  button "Exécuter", 3, 4 78 59 12
  check "Changer de Topic", 4, 75 11 54 10
  check "Changer de Nick", 5, 75 23 50 10
  icon 6, 3 28 69 30, images\icones\takeover.jpg, 0
  check "Kick on join", 8, 75 36 50 10
  check "Ban on join", 9, 75 48 50 10
  button "Stopper", 10, 67 78 54 12
  icon 7, 4 92 69 15, images\icones\take.jpg, bottom,left
}




on dialog:takeover:sclick:10 {
  /takeoveroff
}
alias takeover {
  /dialog -m takeover takeover
}
alias takeoveroff {
  /.disable #takeover
  /dialog -m takeoverlog takeoverlog
  /did -a takeoverlog 1 FIN DU TAKEOVER sur %takeoverchan
  /unset %takeoverchan

}
on 1:dialog:takeover:*:*: {
  if $devent = init {
    /opchan    
    if (%changetopic == on) {
      /did -c takeover 4
    }
    if (%changenick == on) {
      /did -c takeover 5
    }
    if (%kickonjoin == on) {
      /did -c takeover 8
    }
    if (%banonjoin == on) {
      /did -c takeover 9
    }
  }

  if $devent = sclick {
    if ($did = 4) {
      if (%changetopic == off) {
        /set %changetopic on
      }
      else  {
        /set %changetopic off
      }
    }
    if ($did = 5) {
      if (%changenick == off) {
        /set %changenick on
      }
      else  {
        /set %changenick off
      }
    }
    if ($did = 8) {
      if (%kickonjoin == off) {
        /set %kickonjoin on
        /.enable #takekick
        /.disable #takeban
        /.disable #takebankick
        if (%banonjoin == on) {
          /.disable #takekick         
          /.enable #takebankick
        }
      }
      else  {
        /set %kickonjoin off
        /.disable #takekick
        /.disable #takebankick
        /.disable #takeban
        if (%banonjoin == on) {
          /.enable #takeban

        }       
      }
    }
    if ($did = 9) {
      if (%banonjoin == off) {
        /set %banonjoin on
        /.enable #takeban
        if (%kickonjoin == on) {
          /.disable #takeban
          /.disable #takekick
          /.enable #takebankick
        }
      }
      else  {
        /set %banonjoin off
        /.disable #takeban
        /.disable #takebankick
        /.enable #takekick
        if (%kickonjoin == off) {
          /.disable #takekick
        }
      }
    }
    if ($did = 3) {
      /takeoveroff
      /set %takechan $did(takeover,1,$did(takeover,1,1).sel)
      /takeoveron %takechan
    }
    if ($did = 10) {
      /takeoveroff
    }
  } 
}
alias takeoveron {
  set %takeoverchan $1
  /did -a takeoverlog 1 TakeOver by DreamTeam
  /did -a takeoverlog 3 Test du TakeOver...
  if $me isop %takeoverchan {
    /did -a takeoverlog 4 Take Over possible... C'est partiii !
    /did -a takeoverlog 5 Consignes : ne oppez personne, ne faites rien, juste laissez faire :)
    /.enable #takeover
    if $dialog(modulesconfig) {
      /did -r modulesconfig 30
      /did -a modulesconfig 30 Activé
    }
    if (%changetopic == on) {
      /topic %takeoverchan Hacked by $me - FUCK THE SYSTEM ! Oh yeah it's a TakeOver... Sorry for you, but We are the futur and the futur is now ! Powered by [DreamTeam] 
    }
    if (%changenick == on) {
      /set %monnick $me    
      /nick %monnick $+ _TakeOverIng

    }  
    set %i $nick(%takeoverchan,0)
    :loop
    inc %ii
    if %ii > %i { unset %i | unset %ii | halt }
    set %takeovernick $nick(%takeoverchan,%ii) 
    if  (%takeovernick isop %takeoverchan )  { 
      if (%takeovernick != $me) {
        /mode %takeoverchan -o %takeovernick
        /mode %takeoverchan +b %takeovernick
        /kick %takeoverchan %takeovernick 
      }
    }
    unset %takeovernick
    goto loop
  } 
  else {

    /did -a takeoverlog 3 Impossible : oppez vous sur le channel en question avant !!!
  }
}





#takeover off
ON *:op:%takeoverchan:{
  /mode %takeoverchan -o $opnick
  /mode %takeoverchan -o $nick
  /mode %takeoverchan +b $opnick
  /mode %takeoverchan +b $nick
  /kick %takeoverchan $nick
  /kick %takeoverchan $opnick
}

ON *:serverop:%takeoverchan:{
  /mode %takeoverchan -o $opnick
  /mode %takeoverchan -o $nick
  /mode %takeoverchan +b $opnick
  /mode %takeoverchan +b $nick
  /kick %takeoverchan $nick
  /kick %takeoverchan $opnick
}


ON *:unban:%takeoverchan:{
  /mode %takeoverchan +b $bnick
  /kick # $bnick hUhUhUhUhUhU It's A Take Over
}
#takeover end
#takebankick off
ON *:join:%takeoverchan: {
  /mode %takeoverchan +b $nick
  /kick # $nick hUhUhUhUhUhU It's A Take Over
}
#takebankick end
#takekick off
ON *:join:%takeoverchan: {
  /kick # $nick hUhUhUhUhUhU It's A Take Over
}
#takekick end
#takeban off
ON *:join:%takeoverchan: {
  /mode %takeoverchan +b $nick
}
#takeban end


alias opchan {
  /set %takenumber $chan(0)
  /set %takenumber2 0
  :loop
  inc %takenumber2
  /set %takechan $chan(%takenumber2)
  /did -a takeover 1 %takechan

  if (%takenumber2 < %takenumber) {
    goto loop
  }

}

dialog Takeoverlog {
  title "TakeOver Log"
  size -1 -1 197 143
  option dbu
  text "", 1, 11 9 175 16
  button "OK", 2, 148 128 37 12, ok
  text "", 3, 11 32 175 16
  text "", 4, 10 55 175 16
  text "", 5, 11 77 175 16
}
