set ortegaversion "1.00" set ortegachan "#ortega" set messagechan "#ortega" set messagetimer "120" set statustimer "300" set stealtimer "7200" putlog "\0032<=\0034 Ortega \0032=>\0035 Loaded..." set cars { "22500 Smart Roadster" "20000 Smart City Coupe" "13000 Ford Ka" "28000 Ford Mondeo" "20000 Ford Focus" "30000 Ford Fusion" "60000 Ford Mustang" "25000 Opel Astra" "40000 Volvo XC90" "15000 Nissan Micra" "25000 Opel Speedster" "40000 BMW Z3" "40000 BMW 3-Series" "99000 Maserati Coupe" "30000 Peugeot 406" "15000 Peugeot 206" "60000 Audi A8" "25000 Mercedes A-Class" "40000 Mercedes C-Class" "25000 Renault Laguna" "22000 Chrysler PT Cruiser" "30000 Chrysler Voyager" "13000 Volkswagen Golf GTI" "10000 Volkswagen Golf" "25000 Volkswagen Passat" "5000 Fiat Panda" "60000 Porsche Cayman S" "35000 Toyota Supra" "13000 Mitsubishi Colt" "35000 Mazda RX-8" "150000 Lamborghini Gallardo" "400000 Mercedes-Benz SLR McLaren" "50000 Nissan Skyline" "35000 Mitsubishi Eclipse" "350000 Rolls Royce Phantom" "250000 Lamborghini Murcielago" "60000 Lexus LS 430" "6000 Honda Civic" "200000 Aston Martin DB9" "220000 Aston Martin Vanquish" "150000 Ferrari 360" "6000 Renault Clio" "700000 Ferrari Enzo" "1000000 Bugatti Veyron 16.4" } set carlines { "You tried to steal a car, but your foot got stuck in the door and you had to go to the hospital" "You tried to steal a car, but the alarm went off and you ran away crying" "You tried to steal a car, but while trying out a new technique you locked yourself in the trunk" "You tried to steal a car, but it was so fast you crashed into a tree after ten seconds" "You tried to steal a car, but you forgot to put the handbrake on after parking and it went into the gracht" "You tried to steal a car, but you had to pee and went to the toilet instead" } set stores { "Grocery Store" "Hair Dresser" "Liquor Store" "Butcher" "Bakery" "Snack Bar" "Pizzeria" "Ice Cream Store" "Pharmacy" "Clothes Department" "McDonalds Restaurant" "Gas Station" } set storelines { "You tried to rob a store, but you found some candy and got a cavity after eating too much instead" "You tried to rob a store, but after loading the goods into the car your buddy getaway driver drove away without you" "You tried to rob a store, but you forgot the address and got lost" "You tried to rob a store, but you went to the red light district instead to have your own money robbed" "You tried to rob a store, but you drank too much the night before and forgot where you parked your getaway vehicle" "You tried to rob a store, but an oma hit you with an umbrella and you ran away" } set extorts { "an\00312 Ice Cream Man" "the\00312 Mailman" "a\00312 Garbage Man" "a\00312 Hot Dog Guy" "an\00312 Oma" "a\00312 Whore" "a\00312 Junk" "your\00312 Mother in Law" "a\00312 Taxi Driver" "a\00312 Policeman" "a\00312 Popstar" "a\00312 Train Conductor" } set extortlines { "You tried to extort someone, but you forgot to feed your pet and ran home" "You tried to extort someone, but you overslept and were too lazy to go out" "You tried to extort someone, but the garbage man fought back and dumped you in the back of his truck" "You tried to extort someone, but you forgot your weapon" "You tried to extort someone, but a thief robbed your pockets afterwards" "You tried to extort someone, but you forgot what extort means" } set bikes { "an Oma Fiets" "a Racing Bike" "a Batavius" "a Tricycle" "a Gazelle" } set bikelines { "You tried to steal a bike, but a marokkaan beat you to it" "You tried to steal a bike, but you tripped and fell into the gracht" "You tried to steal a bike, but an oma caught you and you ran away" "You tried to steal a bike, but you were run over by lijn 12 afterwards" "You tried to steal a bike, but you forgot to lock it yourself and it got stolen" "You tried to steal a bike, but you forgot it was locked and broke the back wheel" } # General binds bind pub - !joingame ort_joingame bind pub O !rank ort_askrank bind pub O !mystats ort_mystats bind msg O !mystats ort_privmystats bind msg O !showstats ort_showstats bind pub O !groups ort_showgroups bind pub O !players ort_showplayers # Car commands bind msg O !mycars ort_mycars bind msg O !stealcar ort_stealcar bind msg O !sellcar ort_sellcar # Money commands bind msg O !givemoney ort_givemoney # Organized crime bind msg O !startoc ort_startoc bind msg O !ocinfo ort_ocinfo bind msg O !acceptoc ort_acceptoc bind msg O !octargets ort_showtargets bind msg O !performoc ort_performoc # News System bind msg O !submitnews ort_sendarticle bind bot - ort_writenews ort_writenews bind bot - ort_writespecial ort_writespecial bind bot - ort_writearticle ort_writearticle bind bot - ort_writestats ort_writestats # Gambling bind pub O !russianroul ort_russianroul bind pub O !luckyfive ort_luckyfive bind pub O !numbers ort_numbers bind pub O !nbet ort_numb bind pub O !aldi ort_aldi bind pub O !aldibet ort_aldibet bind msg O !lottery ort_numberlottery bind pub O !chancecard ort_chancecard # Riddle Command bind msg O !thespecialortegacodeyougettoreceivealotofbonuspointsandmoney ort_riddlebonus # Group Binds bind pub O !groupinfo ort_groupinfo bind msg O !mygroup ort_mygroup bind msg O !startgroup ort_startgroup bind msg O !joingroup ort_joingroup bind msg O !addmember ort_addmember bind msg O !leavegroup ort_leavegroup bind msg O !givegroupmoney ort_givegroupmoney bind msg O !givemembermoney ort_givemembermoney bind msg O !robperson ort_robperson bind msg O !takehostage ort_takehostage bind msg O !buyhostage ort_buyhostage bind msg O !releasehostage ort_releasehostage bind msg O !extorthostage ort_extorthostage bind msg O !buybribe ort_buybribe bind msg O !majorhit ort_majorhit bind msg O !showinfo ort_showinfo bind msg O !buyinfo ort_buyinfo bind msg O !killperson ort_killperson # Small crimes bind msg O !robstore ort_crimestore bind msg O !extortmoney ort_extortmoney bind msg O !stealbike ort_stealbike bind msg O !stealmoney ort_stealmoney # Prison binds bind msg O !bailout ort_bailout bind pub O !warden ort_showwarden # Protection binds bind msg O !buybodyguards ort_buybodyguards # Message Binds bind join O * ort_joinmessage bind msg O !readmessages ort_readmessages bind msg O !rm ort_readmessages bind msg O !showhandles ort_showhandles bind msg O !hand ort_nicktohand bind msg O !sendmessage ort_usermessage bind msg O !sm ort_usermessage bind bot - ort_sendmessage ort_sendmessage # Time Binds bind time - "00 04 * * *" ort_cleanortega bind time - "00 15 * * *" ort_lottery bind time - "00 17 * * *" ort_lotteryremindera bind time - "00 19 * * *" ort_lotteryreminderb bind time - "00 20 * * *" ort_dailynumberlottery bind time - "59 23 * * *" ort_dailynews bind time - "59 07 * * *" ort_newwarden bind time - "00 * * * *" ort_sendnews bind time - "30 * * * *" ort_sendnews # Bot binds bind bot - ort_getrank ort_getrank bind bot - ort_getcar ort_getcar bind bot - ort_addcar ort_addcar bind bot - ort_getprisontime ort_getprisontime bind bot - ort_checkcars ort_checkcars bind bot - ort_getcrime ort_getcrime bind bot - ort_getbike ort_getbike bind bot - ort_getbail ort_getbail bind bot - ort_getprison ort_getprison bind bot - ort_getuserpoints ort_getuserpoints bind bot - ort_newuserpoints ort_newuserpoints bind bot - ort_getusermoney ort_getusermoney bind bot - ort_newusermoney ort_newusermoney bind bot - ort_getoctargetname ort_getoctargetname bind bot - ort_getocnumber ort_getocnumber bind bot - ort_getpartnername ort_getpartnername bind bot - ort_getocstatus ort_getocstatus bind bot - ort_removeoc ort_removeoc bind bot - ort_extraoc ort_extraoc bind bot - ort_getocperformstatus ort_getocperformstatus bind bot - ort_setocstatus ort_setocstatus bind bot - ort_setocmoney ort_setocmoney bind bot - ort_getgroupmembers ort_getgroupmembers bind bot - ort_groupexists ort_groupexists bind bot - ort_getgroupleader ort_getgroupleader bind bot - ort_getnewgroupleader ort_getnewgroupleader bind bot - ort_getgroupmoney ort_getgroupmoney bind bot - ort_checkingroup ort_checkingroup bind bot - ort_changegroup ort_changegroup bind bot - ort_newgroupmoney ort_newgroupmoney bind bot - ort_getmygroup ort_getmygroup bind bot - ort_newgroup ort_newgroup bind bot - ort_countgroupmembers ort_countgroupmembers bind bot - ort_removegroup ort_removegroup bind bot - ort_changeleader ort_changeleader bind bot - ort_removeperson ort_removeperson bind bot - ort_getbodyguards ort_getbodyguards bind bot - ort_setbodyguards ort_setbodyguards bind bot - ort_getgrouprobs ort_getgrouprobs bind bot - ort_getgroupbribe ort_getgroupbribe bind bot - ort_setgroupbribe ort_setgroupbribe bind bot - ort_addgrouprob ort_addgrouprob bind bot - ort_gethostagestatus ort_gethostagestatus bind bot - ort_gethostagesituationstatus ort_gethostagesituationstatus bind bot - ort_sethostagestatus ort_sethostagestatus bind bot - ort_addhostage ort_addhostage bind bot - ort_getmajorhitstatus ort_getmajorhitstatus bind bot - ort_setmajorhitstatus ort_setmajorhitstatus bind bot - ort_getinfostatus ort_getinfostatus bind bot - ort_setinfostatus ort_setinfostatus bind bot - ort_getlotterybet ort_getlotterybet bind bot - ort_setlotterybet ort_setlotterybet bind bot - ort_remlotterybet ort_remlotterybet bind bot - ort_russianround ort_russianround bind bot - ort_numbstart ort_numbstart bind bot - ort_numbround ort_numbround bind bot - ort_nonumb ort_nonumb bind bot - ort_aldidone ort_aldidone bind bot - ort_setchancecards ort_setchancecards bind bot - ort_getchancecards ort_getchancecards # Clean System proc ort_cleanortega {min hour day month year} { set ogr [open scripts/ortega/group.ort r] set oge [open scripts/ortega/group.ort.tmp w] while {[gets $ogr templine] >= 0} { if {[lindex $templine 4] == "2"} { puts $oge "[lrange $templine 0 2] 0 0 [lindex $templine 5] 0 0 [lrange $templine 8 end]" } else { puts $oge "[lrange $templine 0 2] 0 [lrange $templine 4 5] 0 0 [lrange $templine 8 end]" } } close $ogr close $oge exec mv scripts/ortega/group.ort.tmp scripts/ortega/group.ort set oir [open scripts/ortega/inventory.ort r] set oie [open scripts/ortega/inventory.ort.tmp w] while {[gets $oir templine] >= 0} { puts $oie "[lrange $templine 0 1] 0 [lrange $templine 3 end]" } close $oir close $oie exec mv scripts/ortega/inventory.ort.tmp scripts/ortega/inventory.ort set oow [open scripts/ortega/oc.ort w] close $oow exec scripts/ortega/delinfos } # Message System proc ort_nicktohand {nick host hand arg} { if {$arg != ""} { set tohand "[nick2hand $arg]" if {$tohand != "*"} { putserv "PRIVMSG $nick :\0035$arg's handle:\00312 $tohand" } } } proc ort_usermessage {nick host hand arg} { global messagetimer messagestatus if {[info exists messagestatus($hand)]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You just sent a message. Please wait a while before sending another one." return 0 } if {[lindex $arg 1] == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !sendmessage " return 0 } set touser [lindex $arg 0] if {![matchattr $touser O]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 $touser \0035doesn't exist." return 0 } set messagestatus($hand) "1" utimer $messagetimer "unset messagestatus($hand)" set tomessage [lrange $arg 1 end] set sendmessage "\002$hand:\002 $tomessage" ort_sendmessage $touser $sendmessage putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Message to\00312 $touser \0035sent." } proc ort_sendmessage {hand message} { global botnick set senddate [date] set sendtime [time] set omafile [open scripts/ortega/$hand.mess a] puts $omafile "$senddate $sendtime - $message" close $omafile set tonick "[hand2nick $hand]" if {$tonick != "*"} { puthelp "NOTICE $tonick :You have new message(s). Use \002/msg $botnick !readmessages\002 to read them." } } proc ort_readmessages {nick host hand arg} { if {$hand == "*"} { putserv "PRIVMSG $nick :\0035Sorry, your host is not recognized, or you don't have a bot account" return 0 } set omrfile [open scripts/ortega/$hand.mess r] set mc "0" while {![eof $omrfile]} { set rl [gets $omrfile] if {$rl != ""} { incr mc putserv "PRIVMSG $nick :\002\0035Message $mc)\002 $rl" } } close $omrfile if {$mc == "0"} { putserv "PRIVMSG $nick :\0035No Messages" } set omwfile [open scripts/ortega/$hand.mess w] close $omwfile } proc ort_showhandles {nick host hand arg} { set nickslist "" set ncounter 0 foreach user [userlist] { lappend nickslist "$user" } putserv "PRIVMSG $nick :\0035$nickslist" } proc ort_joinmessage {nick host hand chan} { global messagechan botnick if {$chan == $messagechan && $hand != "*"} { set omrfile [open scripts/ortega/$hand.mess r] set mc "0" while {![eof $omrfile]} { set rl [gets $omrfile] if {$rl != ""} { incr mc } } close $omrfile if {$mc != "0"} { puthelp "NOTICE $nick :You have $mc new messages. Use \002/msg $botnick !readmessages\002 to read them." } } } # News System bind msg n !sendnews ort_sn proc ort_sn {nick host hand arg} { ort_sendnews 20 20 20 12 2005 putserv "PRIVMSG $nick :news send" } proc ort_dailynews {min hour day month year} { set tempdate [string tolower [date]] set todate "[lindex $tempdate 0]_[lindex $tempdate 1]_[lindex $tempdate 2]" exec cp scripts/ortega/news/today-news.inc scripts/ortega/news/archive/news_$todate.inc exec cp scripts/ortega/news/today-special.inc scripts/ortega/news/archive/special_$todate.inc exec cp scripts/ortega/news/today-sendin.inc scripts/ortega/news/archive/sendin_$todate.inc exec mv scripts/ortega/news/today-stats.inc scripts/ortega/news/archive/stats_$todate.inc exec mv scripts/ortega/news/today-players.inc scripts/ortega/news/archive/players_$todate.inc exec mv scripts/ortega/news/previous.inc scripts/ortega/news/archive/prev_$todate.inc set pdfw [open scripts/ortega/news/previous.inc w] puts $pdfw "$todate" close $pdfw set donews [open "|scp -P 29841 scripts/ortega/news/archive/news_$todate.inc scripts/ortega/news/archive/special_$todate.inc scripts/ortega/news/archive/sendin_$todate.inc scripts/ortega/news/archive/stats_$todate.inc scripts/ortega/news/archive/players_$todate.inc scripts/ortega/news/archive/prev_$todate.inc michiel@helena.mired.nl:/home/michiel/public_html/ortega/archive/" r] while {[gets $donews tempnews] >= 0} { putlog "$tempnews" } close $donews set doprev [open "|scp -P 29841 scripts/ortega/news/previous.inc michiel@helena.mired.nl:/home/michiel/public_html/ortega/" r] while {[gets $doprev tempnews] >= 0} { putlog "$tempnews" } close $doprev set newswfile [open scripts/ortega/news/today-news.inc w] close $newswfile set specialwfile [open scripts/ortega/news/today-special.inc w] close $specialwfile set sendinwfile [open scripts/ortega/news/today-sendin.inc w] close $sendinwfile exec cp scripts/ortega/news/copystats.inc scripts/ortega/news/today-stats.inc } proc ort_sendnews {min hour day month year} { set omr [open scripts/ortega/main.ort r] set pwf [open scripts/ortega/news/today-players.inc w] set pc "0" while {[gets $omr templine] >= 0} { incr pc set cp($pc) [lindex $templine 0] set cr($pc) [lindex $templine 2] set ct($pc) [lindex $templine 3] } set entirecount 1 set npc $pc while {$entirecount <= $pc} { set nowcount 1 set temptop $nowcount while {$nowcount < $npc} { set nextcount [expr $nowcount + 1] if {$cr($temptop) < $cr($nextcount)} { set temptop $nextcount incr nowcount } else { incr nowcount } } puts $pwf "$cp($temptop)$cr($temptop)$ct($temptop)" set cr($temptop) "0" set ncp [expr $npc - 1] incr entirecount } close $omr close $pwf set donews [open "|scp -P 29841 scripts/ortega/news/today-news.inc scripts/ortega/news/today-special.inc scripts/ortega/news/today-sendin.inc scripts/ortega/news/today-stats.inc scripts/ortega/news/today-players.inc michiel@helena.mired.nl:/home/michiel/public_html/ortega/" r] while {[gets $donews tempnews] >= 0} { putlog "$tempnews" } close $donews } proc ort_writenews {message} { set newsrfile [open scripts/ortega/news/today-news.inc r] set newswfile [open scripts/ortega/news/today-news.inc.tmp w] puts $newswfile "\[[time]\] $message

" while {[gets $newsrfile templine] >= 0} { puts $newswfile "$templine" } close $newsrfile close $newswfile exec mv scripts/ortega/news/today-news.inc.tmp scripts/ortega/news/today-news.inc } proc ort_writespecial {message} { set specialrfile [open scripts/ortega/news/today-special.inc r] set specialwfile [open scripts/ortega/news/today-special.inc.tmp w] puts $specialwfile "\[[time]\] $message

" while {[gets $specialrfile templine] >= 0} { puts $specialwfile "$templine" } close $specialrfile close $specialwfile exec mv scripts/ortega/news/today-special.inc.tmp scripts/ortega/news/today-special.inc } proc ort_writearticle {hand message} { set sendinrfile [open scripts/ortega/news/today-sendin.inc r] set sendinwfile [open scripts/ortega/news/today-sendin.inc.tmp w] set newmessage "[join [lrange [split $message "?"] 0 end]]" puts $sendinwfile "Submitted by $hand @ [time]:

$newmessage

" while {[gets $sendinrfile templine] >= 0} { puts $sendinwfile "$templine" } close $sendinrfile close $sendinwfile exec mv scripts/ortega/news/today-sendin.inc.tmp scripts/ortega/news/today-sendin.inc } proc ort_writestats {crime amount} { set statsrfile [open scripts/ortega/news/today-stats.inc r] set statswfile [open scripts/ortega/news/today-stats.inc.tmp w] if {$crime == "1"} { set gt "1" while {[gets $statsrfile templine] >= 0} { if {$gt == "1"} { puts $statswfile "[lrange $templine 0 1] [expr [lindex $templine 2] + 1]
" } elseif {$gt == "2"} { puts $statswfile "[lrange $templine 0 2] [expr [lindex $templine 3] + $amount]
" } else { puts $statswfile "$templine" } incr gt } } if {$crime == "2"} { set gt "1" while {[gets $statsrfile templine] >= 0} { if {$gt == "3"} { puts $statswfile "[lrange $templine 0 1] [expr [lindex $templine 2] + 1]
" } elseif {$gt == "4"} { puts $statswfile "[lrange $templine 0 2] [expr [lindex $templine 3] + $amount]
" } else { puts $statswfile "$templine" } incr gt } } if {$crime == "3"} { set gt "1" while {[gets $statsrfile templine] >= 0} { if {$gt == "5"} { puts $statswfile "[lrange $templine 0 1] [expr [lindex $templine 2] + 1]
" } elseif {$gt == "6"} { puts $statswfile "[lrange $templine 0 2] [expr [lindex $templine 3] + $amount]
" } else { puts $statswfile "$templine" } incr gt } } if {$crime == "4"} { set gt "1" while {[gets $statsrfile templine] >= 0} { if {$gt == "7"} { puts $statswfile "[lrange $templine 0 1] [expr [lindex $templine 2] + 1]
" } elseif {$gt == "8"} { puts $statswfile "[lrange $templine 0 2] [expr [lindex $templine 3] + $amount]
" } else { puts $statswfile "$templine" } incr gt } } if {$crime == "5"} { set gt "1" while {[gets $statsrfile templine] >= 0} { if {$gt == "9"} { puts $statswfile "[lrange $templine 0 1] [expr [lindex $templine 2] + 1]
" } elseif {$gt == "10"} { puts $statswfile "[lrange $templine 0 2] [expr [lindex $templine 3] + $amount]
" } else { puts $statswfile "$templine" } incr gt } } close $statsrfile close $statswfile exec mv scripts/ortega/news/today-stats.inc.tmp scripts/ortega/news/today-stats.inc } proc ort_sendarticle {nick host hand arg} { if {$arg == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !submitnews " return 0 } ort_writearticle $hand $arg putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Your article has been submitted! It will appear in the next update of The Daily Ortega." } # Ortega Main proc ort_joingame {nick host hand chan arg} { global ortegachan if {$chan == $ortegachan && ![matchattr $hand O]} { if {$hand == "*"} { return 0 } chattr $hand +O set rankname [ort_getrank 0] putchan $ortegachan "\0032<=\0034 Ortega \0032=>\0035 Welcome to Ortega, $nick! You have\00312 500,- \0035to start with at the rank of\00312 $rankname\0035!" set oma [open scripts/ortega/main.ort a] set oia [open scripts/ortega/inventory.ort a] set ocw [open scripts/ortega/$hand.cars w] set omw [open scripts/ortega/$hand.mess w] puts $oma "$hand 500 0 none" puts $oia "$hand 0 0 0 0 0" close $oma close $oia close $ocw close $omw ort_writespecial "$hand has joined the underworld that is Ortega" } } proc ort_getrank {points} { if {$points <= 9} { set rank "Koos Kansloos" } if {$points >= 10 && $points <= 19} { set rank "Angels Fan" } if {$points >= 20 && $points <= 59} { set rank "Leisure.NL Member" } if {$points >= 60 && $points <= 109} { set rank "Fonzie Wannabe" } if {$points >= 110 && $points <= 159} { set rank "#fonzie Idle Nerd" } if {$points >= 160 && $points <= 219} { set rank "Erkende Fonzie Fan" } if {$points >= 220 && $points <= 299} { set rank "Aspirant Fonzie" } if {$points >= 300 && $points <= 419} { set rank "Fonzie" } if {$points >= 420 && $points <= 599} { set rank "Teh Men" } if {$points >= 600 && $points <= 999} { set rank "Penningmeester" } if {$points >= 1000 && $points <= 1999} { set rank "Peetvader" } if {$points >= 2000} { set rank "Ortega" } return $rank } proc ort_askrank {nick host hand chan arg} { global ortegachan if {$chan == $ortegachan} { if {$arg == ""} { set omr [open scripts/ortega/main.ort r] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { set points [lindex $templine 2] set rank [ort_getrank $points] } } close $omr putchan $ortegachan "\0032<=\0034 Ortega : $nick \0032=>\0035 With\00312 $points \0035points your rank is\00312 $rank\0035!" } else { set gotrank 0 set omr [open scripts/ortega/main.ort r] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $arg} { set points [lindex $templine 2] set rank [ort_getrank $points] set gotrank 1 } } close $omr if {$gotrank == 1} { putchan $ortegachan "\0032<=\0034 Ortega : $nick \0032=>\0035 With\00312 $points \0035points $arg's rank is\00312 $rank\0035." } } } } proc ort_mystats {nick host hand chan arg} { global ortegachan if {$chan == $ortegachan} { set omr [open scripts/ortega/main.ort r] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { set usermoney [lindex $templine 1] set userpoints [lindex $templine 2] set usergroup [lindex $templine 3] } } close $omr set userrank [ort_getrank $userpoints] if {$usergroup == "none"} { set groupline "You are currently not part of a crime group." } else { set groupline "You are currently part of the\00312 $usergroup \0035crime group." } putchan $ortegachan "\0032<=\0034 Ortega : $nick \0032=>\0035 You currently have\00312 $usermoney,- \0035. With\00312 $userpoints \0035points your rank is\00312 $userrank\0035. $groupline" } } proc ort_privmystats {nick host hand arg} { set omr [open scripts/ortega/main.ort r] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { set usermoney [lindex $templine 1] set userpoints [lindex $templine 2] set usergroup [lindex $templine 3] } } close $omr set userrank [ort_getrank $userpoints] if {$usergroup == "none"} { set groupline "you are currently not part of a crime group." } else { set groupline "you are currently part of the\00312 $usergroup \0035crime group." } set hasbodyguards [ort_getbodyguards $hand] if {$hasbodyguards == "0"} { set bodyline "You are not protected by bodyguards" } else { set bodyline "You are protected by bodyguards" } putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You currently have\00312 $usermoney,- \0035. With\00312 $userpoints \0035points your rank is\00312 $userrank\0035. $bodyline and $groupline" } proc ort_showstats {nick host hand arg} { set omr [open scripts/ortega/main.ort r] set userpoints [ort_getuserpoints $hand] if {$userpoints < "2000"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you can only use this command when you have reached the highest rank in Ortega." return 0 } set targetuser [lindex $arg 0] if {$targetuser == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !showstats " return 0 } if {![matchattr $targetuser O]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, that player doesn't exist." return 0 } while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $targetuser} { set usermoney [lindex $templine 1] set userpoints [lindex $templine 2] set usergroup [lindex $templine 3] } } close $omr set userrank [ort_getrank $userpoints] if {$usergroup == "none"} { set groupline "he or she is currently not part of a crime group." } else { set groupline "he or she is currently part of the\00312 $usergroup \0035crime group." } set hasbodyguards [ort_getbodyguards $hand] if {$hasbodyguards == "0"} { set bodyline "$targetuser is not protected by bodyguards" } else { set bodyline "$targetuser is protected by bodyguards" } putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 $targetuser currently has\00312 $usermoney,- \0035. With\00312 $userpoints \0035points his or her rank is\00312 $userrank\0035. $bodyline and $groupline" } proc ort_showgroups {nick host hand chan arg} { global ortegachan if {$chan == $ortegachan} { set grouplist "" set ogr [open scripts/ortega/group.ort r] while {[gets $ogr templine] >= 0} { set cg [lindex $templine 0] set cl [lindex $templine 1] set grouplist "$grouplist\00312$cg \0035led by\00312 $cl \0035| " } close $ogr if {$grouplist == ""} { putchan $ortegachan "\0032<=\0034 Ortega : $nick \0032=>\0035 There are no groups" } else { putchan $ortegachan "\0032<=\0034 Ortega : $nick \0032=>\0035 $grouplist" } } } proc ort_showplayers {nick host hand chan arg} { global ortegachan if {$chan == $ortegachan} { set playerlist "" set omr [open scripts/ortega/main.ort r] set pc "0" while {[gets $omr templine] >= 0} { incr pc set cp($pc) [lindex $templine 0] set cr($pc) [lindex $templine 2] set ct($pc) [lindex $templine 3] } set entirecount 1 set npc $pc while {$entirecount <= $pc} { set nowcount 1 set temptop $nowcount while {$nowcount < $npc} { set nextcount [expr $nowcount + 1] if {$cr($temptop) < $cr($nextcount)} { set temptop $nextcount incr nowcount } else { incr nowcount } } set playerlist "$playerlist\0035$cp($temptop) \00312($cr($temptop)) \0035| " set cr($temptop) "0" set ncp [expr $npc - 1] incr entirecount } close $omr putchan $ortegachan "\0032<=\0034 Ortega : $nick \0032=>\0035 $playerlist" } } proc ort_getuserpoints {hand} { set omr [open scripts/ortega/main.ort r] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { set points [lindex $templine 2] } } close $omr return $points } proc ort_newuserpoints {hand points} { set omr [open scripts/ortega/main.ort r] set ome [open scripts/ortega/main.ort.tmp w] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { puts $ome "[lrange $templine 0 1] $points [lindex $templine 3]" } else { puts $ome "$templine" } } close $omr close $ome exec mv scripts/ortega/main.ort.tmp scripts/ortega/main.ort set rankname [ort_getrank $points] if {$points == 10 || $points == 20 || $points == 60 || $points == 110 || $points == 160 || $points == 2200} { ort_writespecial "Word on the street has it $hand has been promoted to the rank of $rankname." } if {$points == 300} { ort_writespecial "Word on the street has it $hand has been promoted to the rank of $rankname. He is now an official Fonzie gangster!" } if {$points == 420} { ort_writespecial "Word on the street has it $hand has been promoted to the fourth highest rank of $rankname! Congratulations!" } if {$points == 600} { ort_writespecial "Word on the street has it $hand has been promoted to the third highest rank of $rankname! Congratulations!" } if {$points == 1000} { ort_writespecial "Word on the street has it $hand has been promoted to the second highest rank of $rankname! Congratulations!" } if {$points == 2000} { ort_writespecial "The highest honors in Ortega have just been bestowed upon $hand. Now the rank of $rankname, this ubergangster will now literally rule Ortega!" } } proc ort_getusermoney {hand} { set omr [open scripts/ortega/main.ort r] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { set money [lindex $templine 1] } } close $omr return $money } proc ort_newusermoney {hand money} { set omr [open scripts/ortega/main.ort r] set ome [open scripts/ortega/main.ort.tmp w] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { puts $ome "[lindex $templine 0] $money [lrange $templine 2 end]" } else { puts $ome "$templine" } } close $omr close $ome exec mv scripts/ortega/main.ort.tmp scripts/ortega/main.ort } proc ort_getprison {points} { if {$points <= 9} { set prisonchance "5.0" } if {$points >= 10 && $points <= 19} { set prisonchance "6.0" } if {$points >= 20 && $points <= 59} { set prisonchance "7.0" } if {$points >= 60 && $points <= 109} { set prisonchance "8.0" } if {$points >= 110 && $points <= 159} { set prisonchance "9.0" } if {$points >= 160 && $points <= 219} { set prisonchance "10.0" } if {$points >= 220 && $points <= 299} { set prisonchance "10.0" } if {$points >= 300 && $points <= 419} { set prisonchance "15.0" } if {$points >= 420 && $points <= 599} { set prisonchance "25.0" } if {$points >= 600} { set prisonchance "30.0" } if {[expr rand()] < [expr 1/$prisonchance]} { set dotime 1 if {$points >= 2000} { set dotime 0 } return $dotime } else { set dotime 0 return $dotime } } proc ort_getbail {points} { if {$points <= 9} { set bail "250" } if {$points >= 10 && $points <= 19} { set bail "500" } if {$points >= 20 && $points <= 59} { set bail "1000" } if {$points >= 60 && $points <= 109} { set bail "2000" } if {$points >= 110 && $points <= 159} { set bail "4000" } if {$points >= 160 && $points <= 219} { set bail "10000" } if {$points >= 220 && $points <= 299} { set bail "25000" } if {$points >= 300 && $points <= 419} { set bail "50000" } if {$points >= 420 && $points <= 599} { set bail "100000" } if {$points >= 600 && $points <= 999} { set bail "500000" } if {$points >= 1000} { set bail "1000000" } return $bail } proc ort_newwarden {min hour day month year} { global ortegachan set wardenrfile [open scripts/ortega/warden.ort r] set templine [gets $wardenrfile] close $wardenrfile set warden [lindex $templine 0] set wardenfilemoney [lindex $templine 1] putchan $ortegachan "\0032<=\0034 Ortega : Warden \0032=>\0035 Time for a new warden! Yesterday's warden \00312($warden)\0035 has made a total of\00312 $wardenfilemoney,- \0035." set wardlist "" foreach user [userlist] { if {[matchattr $user O]} { lappend wardlist "$user" } } set wardenwinner "[lindex $wardlist [rand [llength $wardlist]]]" set wardenwfile [open scripts/ortega/warden.ort w] puts $wardenwfile "$wardenwinner 0" close $wardenwfile putchan $ortegachan "\0032<=\0034 Ortega : Warden \0032=>\0035 And the new warden is:\00312 $wardenwinner\0035! Have fun cashing in!" ort_writespecial "Yesterday's warden, $warden, made a total of $wardenfilemoney! The new warden is: $wardenwinner. Congratulations!" } proc ort_showwarden {nick host hand chan arg} { global ortegachan set wardenrfile [open scripts/ortega/warden.ort r] set templine [gets $wardenrfile] close $wardenrfile set warden [lindex $templine 0] set wardenfilemoney [lindex $templine 1] putchan $ortegachan "\0032<=\0034 Ortega : $nick \0032=>\0035 Today's warden is\00312 $warden\0035. So far he's made\00312 $wardenfilemoney,- \0035." } proc ort_bailout {nick host hand arg} { global inprison if {[info exists inprison($hand)]} { set userpoints [ort_getuserpoints $hand] set bailamount [ort_getbail $userpoints] set usermoney [ort_getusermoney $hand] if {$usermoney < $bailamount} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You don't have enough money to buy yourself out. You need atleast\00312 $bailamount,- \0035to bail yourself out, and you only have\00312 $usermoney,-\0035." } else { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You bought yourself out of prison for\00312 $bailamount,-\0035." set newusermoney [expr $usermoney - $bailamount] ort_newusermoney $hand $newusermoney unset inprison($hand) foreach prisontimers [utimers] { set whatcmd [lindex $prisontimers 1] putlog "CHECK: $whatcmd | unset inprison($hand)" if {$whatcmd == "unset inprison($hand)"} { putlog "YES IT IS: KILLING" killutimer [lindex $prisontimers 2] } } set wardenrfile [open scripts/ortega/warden.ort r] set templine [gets $wardenrfile] close $wardenrfile set warden [lindex $templine 0] set wardenfilemoney [lindex $templine 1] set wardenmoney [ort_getusermoney $warden] set newwardenmoney [expr $wardenmoney + $bailamount] ort_newusermoney $warden $newwardenmoney set newwardenfilemoney [expr $wardenfilemoney + $bailamount] set wardenwfile [open scripts/ortega/warden.ort w] puts $wardenwfile "$warden $newwardenfilemoney" close $wardenwfile } } else { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently not in prison!" } } proc ort_getcar {points} { global cars if {$points <= 9} { set carchance "10" } if {$points >= 10 && $points <= 19} { set carchance "8" } if {$points >= 20 && $points <= 59} { set carchance "6" } if {$points >= 60 && $points <= 109} { set carchance "4" } if {$points >= 110 && $points <= 159} { set carchance "3.5" } if {$points >= 160 && $points <= 219} { set carchance "3" } if {$points >= 220 && $points <= 299} { set carchance "2.5" } if {$points >= 300 && $points <= 419} { set carchance "2" } if {$points >= 420 && $points <= 599} { set carchance "1.5" } if {$points >= 600 && $points <= 999} { set carchance "1" } if {$points >= 1000} { set carchance "0.5" } if {[expr [rand 100] + 1] < [expr 100/$carchance]} { set carstuff [lindex $cars [rand [llength $cars]]] set carprice [lindex $carstuff 0] set randcar [lrange $carstuff 1 end] set randdam [rand 100] if {$points >= 1999} { set randdam [rand 5] } return "$randdam $carprice $randcar" } else { return "failed failed failed" } } bind dcc n !tr ort_tr proc ort_tr {a b c} { set i 0 while {$i < 100} { putlog "[expr ([rand 100] + 1) * 50]" incr i } } proc ort_getcrime {points} { if {$points <= 9} { set crimechance "3.0" set profit [expr ([rand 100] + 1) * 1] } if {$points >= 10 && $points <= 59} { set crimechance "2.5" set profit [expr ([rand 100] + 1) * 50] set profit [expr $profit + [rand 100]] } if {$points >= 60 && $points <= 119} { set crimechance "2.0" set profit [expr ([rand 100] + 1) * 100] set profit [expr $profit + [rand 100]] } if {$points >= 120 && $points <= 179} { set crimechance "1.5" set profit [expr ([rand 100] + 1) * 200] set profit [expr $profit + [rand 1000]] } if {$points >= 180 && $points <= 599} { set crimechance "1.0" set profit [expr ([rand 100] + 1) * 500] set profit [expr $profit + [rand 100]] } if {$points >= 600} { set crimechance "0.5" set profit [expr ([rand 100] + 1) * 1000] set profit [expr $profit + [rand 1000]] } if {[expr rand()] < [expr 1/$crimechance]} { return $profit } else { return "failed" } } proc ort_getbike {points} { if {$points <= 9} { set crimechance "3.0" set profit [expr ([rand 10] + 1) * 1] } if {$points >= 10 && $points <= 59} { set crimechance "2.5" set profit [expr ([rand 10] + 1) * 10] set profit [expr $profit + [rand 100]] } if {$points >= 60 && $points <= 119} { set crimechance "2.0" set profit [expr ([rand 10] + 1) * 50] set profit [expr $profit + [rand 100]] } if {$points >= 120 && $points <= 179} { set crimechance "1.5" set profit [expr ([rand 10] + 1) * 100] set profit [expr $profit + [rand 100]] } if {$points >= 180 && $points < 599} { set crimechance "1.0" set profit [expr ([rand 10] + 1) * 200] set profit [expr $profit + [rand 100]] } if {$points >= 600} { set crimechance "0.5" set profit [expr ([rand 100] + 1) * 250] set profit [expr $profit + [rand 100]] } if {[expr rand()] < [expr 1/$crimechance]} { return $profit } else { return "failed" } } proc ort_mycars {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } else { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Cars in your garage:" set carcounter 0 set carsworth 0 set ocr [open scripts/ortega/$hand.cars r] while {[gets $ocr templine] >= 0} { incr carcounter set carprice [lindex $templine 0] set cardamage [lindex $templine 1] set carname [lrange $templine 2 end] set carsworth [expr $carsworth + $carprice] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 $carcounter)\00312 $carname \0035|\00312 $cardamage% damage \0035|\00312 worth $carprice,-\0035" } close $ocr set maxcarinfo [ort_checkcars $hand $userpoints] set maxcars [lindex $maxcarinfo 1] if {$carcounter == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You don't have any cars!" } else { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Total cars & capacity:\00312 $carcounter\0035/\00312$maxcars \0035| Total worth:\00312 $carsworth\0035" } } } proc ort_sellcar {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } else { if {$arg == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Usage: \00312!sellcar \0035" return 0 } set carcounter 1 set soldcar 0 set ocr [open scripts/ortega/$hand.cars r] set oct [open scripts/ortega/$hand.cars.tmp w] while {[gets $ocr templine] >= 0} { if {$carcounter == $arg} { set carprice [lindex $templine 0] set cardamage [lindex $templine 1] set carname [lrange $templine 2 end] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You sold your\00312 $carname \0035with\00312 $cardamage% \0035damage for\00312 $carprice,-\0035." set soldcar 1 } else { puts $oct $templine } incr carcounter } close $ocr close $oct exec mv scripts/ortega/$hand.cars.tmp scripts/ortega/$hand.cars if {$soldcar == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Car number\00312 $arg \0035doesn't exist. Use \00312!mycars \0035to see how many cars you have." return 0 } set currentmoney [ort_getusermoney $hand] set newusermoney [expr $currentmoney + $carprice] ort_newusermoney $hand $newusermoney } } proc ort_addcar {hand carworth cardamage carname} { set oca [open scripts/ortega/$hand.cars a] puts $oca "$carworth $cardamage $carname" close $oca } proc ort_getprisontime {points} { if {$points <= 159} { set prisontime "5" } if {$points >= 160 && $points <= 419} { set prisontime "10" } if {$points >= 420 && $points <= 999} { set prisontime "15" } if {$points >= 1000 && $points <= 1699} { set prisontime "20" } if {$points >= 1700} { set prisontime "30" } return $prisontime } proc ort_checkcars {hand points} { if {$points <= 9} { set maxcars "1" } if {$points >= 10 && $points <= 19} { set maxcars "2" } if {$points >= 20 && $points <= 59} { set maxcars "3" } if {$points >= 60 && $points <= 109} { set maxcars "4" } if {$points >= 110 && $points <= 159} { set maxcars "5" } if {$points >= 160 && $points <= 219} { set maxcars "6" } if {$points >= 220 && $points <= 299} { set maxcars "7" } if {$points >= 300 && $points <= 419} { set maxcars "8" } if {$points >= 420 && $points <= 599} { set maxcars "9" } if {$points >= 600} { set maxcars "10" } set carcounter 0 set ocr [open scripts/ortega/$hand.cars r] while {[gets $ocr templine] >= 0} { incr carcounter } close $ocr if {$carcounter < $maxcars} { return "yes $maxcars" } else { return "no $maxcars" } } proc ort_stealcar {nick host hand arg} { global inprison carstatus statustimer carlines set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } else { if {[info exists carstatus($hand)]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You just (attempted to) steal a car. Take some time to make sure the cops are off your back." return 0 } else { set userrank [ort_getrank $userpoints] set carcheck [ort_checkcars $hand $userpoints] set allow [lindex $carcheck 0] set maxcars [lindex $carcheck 1] if {$allow == "no"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You can't store any more cars in your garage! With your current rank of\00312 $userrank \0035you can store\00312 $maxcars \0035cars." return 0 } set goprison [ort_getprison $userpoints] if {$goprison == "1"} { set prisontimer [ort_getprisontime $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You were caught by the cops and are now in prison for the next\00312 $prisontimer \0035minutes!" set carstatus($hand) "1" utimer $statustimer "unset carstatus($hand)" set inprison($hand) "1" timer $prisontimer "unset inprison($hand)" return 0 } else { set carstatus($hand) "1" utimer $statustimer "unset carstatus($hand)" set carinfo [ort_getcar $userpoints] set cardamage [lindex $carinfo 0] set carprice [lindex $carinfo 1] set carname [lrange $carinfo 2 end] if {$carname == "failed"} { set randcarline [lindex $carlines [rand [llength $carlines]]] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 $randcarline." return 0 } set cardamcount [expr 100 - $cardamage] set carprofit [expr ($carprice / 100) * $cardamcount] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You succesfully stole a\00312 $carname \0035with\00312 $cardamage% \0035damage! It's worth\00312 $carprofit,-\0035." set newuserpoints [expr $userpoints + 1] ort_newuserpoints $hand $newuserpoints ort_addcar $hand $carprofit $cardamage $carname ort_writestats 1 $carprofit } } } } proc ort_crimestore {nick host hand arg} { global inprison crimestatus statustimer stores storelines set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } else { if {[info exists crimestatus($hand)]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You just commited a crime. Take some time to make sure the cops are off your back." return 0 } else { set goprison [ort_getprison $userpoints] if {$goprison == "1"} { set prisontimer [ort_getprisontime $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You were caught by the cops and are now in prison for the next\00312 $prisontimer \0035minutes!" set crimestatus($hand) "1" utimer $statustimer "unset crimestatus($hand)" set inprison($hand) "1" timer $prisontimer "unset inprison($hand)" return 0 } else { set crimestatus($hand) "1" utimer $statustimer "unset crimestatus($hand)" set crimeprofit [ort_getcrime $userpoints] if {$crimeprofit == "failed"} { set randstoreline [lindex $storelines [rand [llength $storelines]]] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 $randstoreline." return 0 } set randstore [lindex $stores [rand [llength $stores]]] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You succesfully robbed a\00312 $randstore\0035! You made\00312 $crimeprofit,- \0035out of it." set newuserpoints [expr $userpoints + 1] ort_newuserpoints $hand $newuserpoints set currentmoney [ort_getusermoney $hand] set newusermoney [expr $currentmoney + $crimeprofit] ort_newusermoney $hand $newusermoney ort_writestats 2 $crimeprofit } } } } proc ort_extortmoney {nick host hand arg} { global inprison crimestatus statustimer extorts extortlines set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } else { if {[info exists crimestatus($hand)]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You just commited a crime. Take some time to make sure the cops are off your back." return 0 } else { set goprison [ort_getprison $userpoints] if {$goprison == "1"} { set prisontimer [ort_getprisontime $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You were caught by the cops and are now in prison for the next\00312 $prisontimer \0035minutes!" set crimestatus($hand) "1" utimer $statustimer "unset crimestatus($hand)" set inprison($hand) "1" timer $prisontimer "unset inprison($hand)" return 0 } else { set crimestatus($hand) "1" utimer $statustimer "unset crimestatus($hand)" set crimeprofit [ort_getcrime $userpoints] if {$crimeprofit == "failed"} { set randextortline [lindex $extortlines [rand [llength $extortlines]]] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 $randextortline." return 0 } set randextort [lindex $extorts [rand [llength $extorts]]] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You succesfully extorted $randextort\0035! You made\00312 $crimeprofit,- \0035with it." set newuserpoints [expr $userpoints + 1] ort_newuserpoints $hand $newuserpoints set currentmoney [ort_getusermoney $hand] set newusermoney [expr $currentmoney + $crimeprofit] ort_newusermoney $hand $newusermoney ort_writestats 3 $crimeprofit } } } } proc ort_stealbike {nick host hand arg} { global inprison bikestatus statustimer bikes bikelines set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } else { if {[info exists bikestatus($hand)]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You just stole a bike. Take some time to make sure the cops are off your back." return 0 } else { set goprison [ort_getprison $userpoints] if {$goprison == "1"} { set prisontimer [ort_getprisontime $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You were caught by the cops and are now in prison for the next\00312 $prisontimer \0035minutes!" set bikestatus($hand) "1" utimer $statustimer "unset bikestatus($hand)" set inprison($hand) "1" timer $prisontimer "unset inprison($hand)" return 0 } else { set bikestatus($hand) "1" utimer $statustimer "unset bikestatus($hand)" set crimeprofit [ort_getbike $userpoints] if {$crimeprofit == "failed"} { set randbikeline [lindex $bikelines [rand [llength $bikelines]]] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 $randbikeline." return 0 } set randbike [lindex $bikes [rand [llength $bikes]]] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You succesfully stole\00312 $randbike\0035! You made\00312 $crimeprofit,- \0035out of it." set newuserpoints [expr $userpoints + 1] ort_newuserpoints $hand $newuserpoints set currentmoney [ort_getusermoney $hand] set newusermoney [expr $currentmoney + $crimeprofit] ort_newusermoney $hand $newusermoney ort_writestats 4 $crimeprofit } } } } proc ort_stealmoney {nick host hand arg} { global inprison stealstatus stealtimer set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set targetname [lindex $arg 0] if {![matchattr $targetname O]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 $targetname \0035doesn't exist." return 0 } if {$targetname == $hand} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you can't steal from yourself." return 0 } if {[info exists stealstatus($hand)]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You just robbed someone. Take some time to make sure the cops are off your back." return 0 } else { set goprison [ort_getprison $userpoints] if {$goprison == "1"} { set prisontimer [ort_getprisontime $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You were caught by the cops and are now in prison for the next\00312 $prisontimer \0035minutes!" set stealstatus($hand) "1" utimer $stealtimer "unset stealstatus($hand)" set inprison($hand) "1" timer $prisontimer "unset inprison($hand)" return 0 } else { set stealstatus($hand) "1" utimer $stealtimer "unset stealstatus($hand)" set targetmoney [ort_getusermoney $targetname] if {$targetmoney < "200000"} { set stealpercent [expr [rand 10] + 1] } else { set stealpercent [expr [rand 5] + 1] } set stealtempmoney [expr $targetmoney / 100] set stealmoney [expr $stealtempmoney * $stealpercent] set newtargetmoney [expr $targetmoney - $stealmoney] ort_newusermoney $targetname $newtargetmoney set usermoney [ort_getusermoney $hand] set newusermoney [expr $usermoney + $stealmoney] ort_newusermoney $hand $newusermoney set newuserpoints [expr $userpoints + 1] ort_newuserpoints $hand $newuserpoints putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You have stolen\00312 $stealmoney,-\0035 from\00312 $targetname\0035!" set stealmessage "\002$hand \002has just stolen\002 $stealmoney,-\002 from you." ort_sendmessage $targetname $stealmessage ort_writestats 5 $stealmoney } } } proc ort_givemoney {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set usermoney [ort_getusermoney $hand] set touser [string tolower [lindex $arg 0]] set tomoney [lindex $arg 1] if {$tomoney == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !givemoney " return 0 } if {$touser == $hand} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You can't give yourself money." return 0 } if {$tomoney > $usermoney} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you don't have that much money. You currently have\00312 $usermoney\0035." return 0 } if {$tomoney < "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You can't give someone a negative amount. Use an amount of 1 or higher." return 0 } if {![matchattr $touser O]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, the name you specified doesn't exist." return 0 } set tomoney [expr round($tomoney)] set tocurrentmoney [ort_getusermoney $touser] set newtomoney [expr $tocurrentmoney + $tomoney] ort_newusermoney $touser $newtomoney set newusermoney [expr $usermoney - $tomoney] ort_newusermoney $hand $newusermoney putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 The amount you specified \00312($tomoney)\0035 has been given to\00312 $touser\0035. You have\00312 $newusermoney \0035left." set givemessage "\002$hand \002has given you\002 $tomoney,-\002" ort_sendmessage $touser $givemessage } proc ort_getoctargetname {targetnumber} { if {$targetnumber == "1"} { set ocname "a Local Bank" } if {$targetnumber == "2"} { set ocname "a Computer Store" } if {$targetnumber == "3"} { set ocname "a Jewellery" } if {$targetnumber == "4"} { set ocname "a nearby Mansion" } return $ocname } proc ort_getocnumber {hand} { set oor [open scripts/ortega/oc.ort r] while {[gets $oor templine] >= 0} { if {[lindex $templine 0] == $hand} { set ocnumber [lindex $templine 4] } } close $oor return $ocnumber } proc ort_getpartnername {hand} { set oor [open scripts/ortega/oc.ort r] while {[gets $oor templine] >= 0} { if {[lindex $templine 0] == $hand} { set partnername [lindex $templine 1] } } close $oor return $partnername } proc ort_getocstatus {hand} { set oor [open scripts/ortega/oc.ort r] set handstatus 0 while {[gets $oor templine] >= 0} { if {[lindex $templine 0] == $hand || [lindex $templine 1] == $hand} { set handstatus 1 } } if {![matchattr $hand O]} { set handstatus 1 } close $oor return $handstatus } proc ort_removeoc {hand} { set oor [open scripts/ortega/oc.ort r] set oow [open scripts/ortega/oc.ort.tmp w] while {[gets $oor templine] >= 0} { if {[lindex $templine 0] == $hand || [lindex $templine 1] == $hand} { if {[lindex $templine 5] == "0"} { } else { puts $oow $templine } } else { puts $oow $templine } } close $oor close $oow exec mv scripts/ortega/oc.ort.tmp scripts/ortega/oc.ort } proc ort_extraoc {hand} { set oor [open scripts/ortega/oc.ort r] set oow [open scripts/ortega/oc.ort.tmp w] while {[gets $oor templine] >= 0} { if {[lindex $templine 0] == $hand || [lindex $templine 1] == $hand} { if {[lindex $templine 5] != "0"} { } else { puts $oow $templine } } else { puts $oow $templine } } close $oor close $oow exec mv scripts/ortega/oc.ort.tmp scripts/ortega/oc.ort } proc ort_getocperformstatus {hand} { set oor [open scripts/ortega/oc.ort r] set handstatus 0 while {[gets $oor templine] >= 0} { if {[lindex $templine 0] == $hand} { if {[lindex $templine 5] != "0"} { set handstatus 1 } } } close $oor return $handstatus } proc ort_setocstatus {leader partner leaderstatus partnerstatus targetnumber robmoney} { set ooa [open scripts/ortega/oc.ort a] puts $ooa "$leader $partner $leaderstatus $partnerstatus $targetnumber $robmoney" close $ooa } proc ort_setocmoney {hand robmoney} { set oor [open scripts/ortega/oc.ort r] set ooe [open scripts/ortega/oc.ort.tmp w] while {[gets $oor templine] >= 0} { if {[lindex $templine 0] == $hand} { puts $ooe "[lrange $templine 0 4] $robmoney" } else { puts $ooe "$templine" } } close $oor close $ooe exec mv scripts/ortega/oc.ort.tmp scripts/ortega/oc.ort } proc ort_showtargets {nick host hand arg} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Organized Crime Targets:\0034 1)\00312 a Local Bank\0034 2)\00312 a Computer Store\0034 3)\00312 a Jewelerry\0034 4)\00312 a nearby Mansion." } proc ort_acceptoc {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } else { set myocstatus [ort_getocstatus $hand] if {$myocstatus == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently not participating in an organized crime. To start one, use\00312 !startoc\0035. It's adviced to talk to your future partner before starting one." return 0 } else { set oorf [open scripts/ortega/oc.ort r] while {[gets $oorf templine] >= 0} { if {[lindex $templine 1] == $hand} { if {[lindex $templine 3] == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You already accepted the heist!" close $oorf return 0 } } if {[lindex $templine 0] == $hand} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are the leader of the heist; you can't accept anything." close $oorf return 0 } } close $oorf set usermoney [ort_getusermoney $hand] if {$usermoney < "50000"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You do not have the required 50.000 to accept this OC." return 0 } set newusermoney [expr $usermoney - 50000] ort_newusermoney $hand $newusermoney set oor [open scripts/ortega/oc.ort r] set oow [open scripts/ortega/oc.ort.tmp w] while {[gets $oor templine] >= 0} { if {[lindex $templine 1] == $hand} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You accepted the heist" puts $oow "[lrange $templine 0 2] 1 [lrange $templine 4 5]" } else { puts $oow $templine } } close $oor close $oow exec mv scripts/ortega/oc.ort.tmp scripts/ortega/oc.ort } } } proc ort_ocinfo {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } else { set myocstatus [ort_getocstatus $hand] if {$myocstatus == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently not participating in an organized crime. To start one, use\00312 !startoc\0035. It's adviced to talk to your future partner before starting one." return 0 } else { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Your current organized crime:" set robbed "0" set oor [open scripts/ortega/oc.ort r] while {[gets $oor templine] >= 0} { if {[lindex $templine 0] == $hand} { if {[lindex $templine 5] != "0"} { set robbed "1" set partner [lindex $templine 1] set octarget [ort_getoctargetname [lindex $templine 4]] set robmoney [lindex $templine 5] set myrobmoney [expr $robmoney / 2] } if {$robbed == "0"} { set partner [lindex $templine 1] set partnerstatus [lindex $templine 3] if {$partnerstatus == "0"} { set accepted "Your partner\00312 $partner \0035has not yet accepted the heist." } else { set accepted "Your partner\00312 $partner \0035has accepted this heist, use\00312 !performoc \0035to execute the plan." } set octarget [ort_getoctargetname [lindex $templine 4]] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Together with your partner\00312 $partner \0035you plan to rob\00312 $octarget\0035. $accepted" } } if {[lindex $templine 1] == $hand} { if {[lindex $templine 5] != "0"} { set robbed "1" set partner [lindex $templine 0] set octarget [ort_getoctargetname [lindex $templine 4]] set robmoney [lindex $templine 5] set myrobmoney [expr $robmoney / 2] } if {$robbed == "0"} { set leader [lindex $templine 0] set yourstatus [lindex $templine 3] if {$yourstatus == "0"} { set accepted "You have not yet accepted the heist. Use\00312 !acceptoc \0035to do or\00312 !declineoc \0035to decline the offer." } else { set accepted "You have accepted this heist; your partner (and leader)\00312 $leader \0035can execute the plan whenever he wants." } set octarget [ort_getoctargetname [lindex $templine 4]] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Together with your leader\00312 $leader \0035you plan to rob\00312 $octarget\0035. $accepted" } } } if {$robbed == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Together with your partner\00312 $partner \0035you have robbed\00312 $octarget\0035. In total you made\00312 $robmoney\0035; of which you got 50% \00312($myrobmoney)\0035. Congratulations!" } close $oor } } } proc ort_startoc {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } else { set myocstatus [ort_getocstatus $hand] if {$myocstatus == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are already busy with or just performed an organized crime. Take some time before pulling another heist." return 0 } else { if {[lindex $arg 1] == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Usage: \00312!startoc \0035. Use\00312 !octargets \0035to see what targets you can choose from." return 0 } set ocnumber [lindex $arg 0] if {$ocnumber < 1 || $ocnumber > 4} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 That target does not exist. Use\00312 !octargets \0035to see what targets you can choose from." return 0 } set ocpartner [string tolower [lindex $arg 1]] set partnerbusy [ort_getocstatus $ocpartner] if {$partnerbusy == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Either\00312 $ocpartner \0035doesn't exist or is too busy right now to be reached." return 0 } set partnerstatus [ort_getocstatus $hand] if {$partnerstatus == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Your partner cannot perform an organized crime at the moment." return 0 } set usermoney [ort_getusermoney $hand] if {$usermoney < "50000"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You do not have the required 50.000 to start this OC." return 0 } ort_setocstatus $hand $ocpartner 1 0 $ocnumber 0 set newusermoney [expr $usermoney - 50000] ort_newusermoney $hand $newusermoney set targetname [ort_getoctargetname $ocnumber] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You started a plan to rob\00312 $targetname\0035. Please remind\00312 $ocpartner \0035that he has to accept the heist before you can execute the plan." set ocmessage "\002$hand \002has started a plan to rob\002 $targetname\002. Use \002!ocinfo\002 to see more information about the heist. You can accept the plan by using \002!acceptoc\002." ort_sendmessage $ocpartner $ocmessage } } } proc ort_performoc {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] set myocstatus [ort_getocstatus $hand] if {$myocstatus == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently not participating in an organized crime or aren't the leader of it. To check this, use\00312 !ocinfo\0035. To start one, use\00312 !startoc\0035. It's adviced to talk to your future partner before starting one." return 0 } else { set oor [open scripts/ortega/oc.ort r] while {[gets $oor templine] >= 0} { if {[lindex $templine 0] == $hand} { set partner [lindex $templine 1] set partnerstatus [lindex $templine 3] if {$partnerstatus == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Your partner\00312 $partner \0035has not yet acepted the heist." close $oor return 0 } } } close $oor set myperformstatus [ort_getocperformstatus $hand] if {$myperformstatus == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You have already executed your organized crime. Use\00312 !ocinfo \0035to see the details." return 0 } if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set ocnumber [ort_getocnumber $hand] set targetname [ort_getoctargetname $ocnumber] set partnername [ort_getpartnername $hand] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You and\00312 $partnername \0035are now executing the plan to rob\00312 $targetname\0035." set partnerpoints [ort_getuserpoints $partnername] set combinedpoints [expr $userpoints + $partnerpoints] if {$combinedpoints < "600"} { set moneydivide "10000" } else { set moneydivide "40000" } set moneypercent [expr [rand 100] + 1] set finalmoney [expr $moneydivide * $moneypercent] set halfmoney [expr $finalmoney / 2] set currentmoney [ort_getusermoney $hand] set newusermoney [expr $currentmoney + $halfmoney] ort_newusermoney $hand $newusermoney set partnermoney [ort_getusermoney $partnername] set newusermoney [expr $partnermoney + $halfmoney] ort_newusermoney $partnername $newusermoney set i "1" while {$i <= 5} { set newuserpoints [expr $userpoints + $i] ort_newuserpoints $hand $newuserpoints incr i } set partnerpoints [ort_getuserpoints $partnername] set p "1" while {$p <= 5} { set newpartnerpoints [expr $partnerpoints + $p] ort_newuserpoints $partnername $newpartnerpoints incr p } ort_setocmoney $hand $finalmoney putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You and your partner successfully robbed\00312 $targetname \0035and made a total of\00312 $finalmoney\0035! That makes your share (50%)\00312 $halfmoney\0035. Congratulations!" ort_writenews "Gangsters have just robbed $targetname! Word on the street has it that $hand and $partnername were behind the hit. Together they stole an estimated $finalmoney,-." set ocmessage "You and your partner successfully robbed\002 $targetname \002and made a total of\002 $finalmoney\002! That makes your share (50%)\002 $halfmoney\002. Congratulations!" ort_sendmessage $partnername $ocmessage } } proc ort_getgroupmembers {group} { set omr [open scripts/ortega/main.ort r] set members "" while {[gets $omr templine] >= 0} { if {[lindex $templine 3] == $group} { set members "$members [lindex $templine 0]" } } close $omr return $members } proc ort_countgroupmembers {group} { set omr [open scripts/ortega/main.ort r] set membercount "0" while {[gets $omr templine] >= 0} { if {[lindex $templine 3] == $group} { incr membercount } } close $omr return $membercount } proc ort_groupexists {group} { set ogr [open scripts/ortega/group.ort r] set exists "0" while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set exists "1" } } close $ogr return $exists } proc ort_getgroupleader {group} { set ogr [open scripts/ortega/group.ort r] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set leader [lindex $templine 1] } } close $ogr return $leader } proc ort_getnewgroupleader {group leader} { set omr [open scripts/ortega/main.ort r] set goleader "0" while {[gets $omr templine] >= 0 && $goleader == "0"} { if {[lindex $templine 3] == $group && [lindex $templine 0] != $leader} { set newgroupleader "[lindex $templine 0]" set goleader "1" } } close $omr return $newgroupleader } proc ort_getgroupmoney {group} { set ogr [open scripts/ortega/group.ort r] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set money [lindex $templine 2] } } close $ogr return $money } proc ort_getgroupstatus {group} { set ogr [open scripts/ortega/group.ort r] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set hits [lindex $templine 3] set hostage [lindex $templine 4] set bribe [lindex $templine 5] set major [lindex $templine 6] set info [lindex $templine 7] } } return "$hits $hostage $bribe $major $info" } proc ort_checkingroup {hand} { set omr [open scripts/ortega/main.ort r] set ingroup "0" while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { if {[lindex $templine 3] != "none"} { set ingroup "1" } } } close $omr return $ingroup } proc ort_getmygroup {hand} { set omr [open scripts/ortega/main.ort r] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { set mygroup [lindex $templine 3] } } close $omr return $mygroup } proc ort_newgroupmoney {group newmoney} { set ogr [open scripts/ortega/group.ort r] set oge [open scripts/ortega/group.ort.tmp w] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { puts $oge "[lrange $templine 0 1] $newmoney [lrange $templine 3 end]" } else { puts $oge "$templine" } } close $ogr close $oge exec mv scripts/ortega/group.ort.tmp scripts/ortega/group.ort } proc ort_changegroup {hand group} { set omr [open scripts/ortega/main.ort r] set ome [open scripts/ortega/main.ort.tmp w] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { puts $ome "[lrange $templine 0 2] $group" } else { puts $ome "$templine" } } close $omr close $ome exec mv scripts/ortega/main.ort.tmp scripts/ortega/main.ort } proc ort_newgroup {group leader} { set oga [open scripts/ortega/group.ort a] puts $oga "$group $leader 0 4 2 0 2 0 0 0" close $oga } proc ort_removegroup {group} { set ogr [open scripts/ortega/group.ort r] set oge [open scripts/ortega/group.ort.tmp w] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { } else { puts $oge "$templine" } } close $ogr close $oge exec mv scripts/ortega/group.ort.tmp scripts/ortega/group.ort } proc ort_changeleader {group newleader} { set ogr [open scripts/ortega/group.ort r] set oge [open scripts/ortega/group.ort.tmp w] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { puts $oge "[lindex $templine 0] $newleader [lrange $templine 2 end]" } else { puts $oge "$templine" } } close $ogr close $oge exec mv scripts/ortega/group.ort.tmp scripts/ortega/group.ort } proc ort_removeperson {hand} { set omr [open scripts/ortega/main.ort r] set omw [open scripts/ortega/main.ort.tmp w] while {[gets $omr templine] >= 0} { if {[lindex $templine 0] == $hand} { } else { puts $omw $templine } } close $omr close $omw exec mv scripts/ortega/main.ort.tmp scripts/ortega/main.ort set oir [open scripts/ortega/inventory.ort r] set oiw [open scripts/ortega/inventory.ort.tmp w] while {[gets $oir templine] >= 0} { if {[lindex $templine 0] == $hand} { } else { puts $oiw $templine } } close $oir close $oiw exec mv scripts/ortega/inventory.ort.tmp scripts/ortega/inventory.ort set otr [open scripts/ortega/tojoin.ort r] set otw [open scripts/ortega/tojoin.ort.tmp w] while {[gets $otr templine] >= 0} { if {[lindex $templine 0] == $hand} { } else { puts $otw $templine } } close $otr close $otw exec mv scripts/ortega/tojoin.ort.tmp scripts/ortega/tojoin.ort exec rm scripts/ortega/$hand.mess exec rm scripts/ortega/$hand.cars chattr $hand -O } proc ort_groupinfo {nick host hand chan arg} { global ortegachan set group [lindex $arg 0] if {$group == ""} { putchan $ortegachan "\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !groupinfo " return 0 } set groupexists [ort_groupexists $group] if {$groupexists == "0"} { putchan $ortegachan "\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, that group doesn't exist." return 0 } set groupmembers [ort_getgroupmembers $group] set groupleader [ort_getgroupleader $group] putchan $ortegachan "\0032<=\0034 Ortega : $nick \0032=>\0035 Group\00312 $group \0035consists of the following members:\00312$groupmembers\0035. It's leader is\00312 $groupleader\0035." } proc ort_mygroup {nick host hand arg} { set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 you are currently not part of any group." return 0 } set groupmembers [ort_getgroupmembers $group] set groupleader [ort_getgroupleader $group] set groupmoney [ort_getgroupmoney $group] set groupstatus [ort_getgroupstatus $group] set robbed [lindex $groupstatus 0] set hostage [lindex $groupstatus 1] if {$hostage == "0"} { set hostagetext "Your group hasn't had a hostage today." } elseif {$hostage == "1"} { set hostagetext "Your group is currently has a hostage." } else { set hostagetext "Your group has already taken a hostage today." } set bribe [lindex $groupstatus 2] if {$bribe == "0"} { set bribetext "doesn't have a police bribe against a major hit" } else { set bribetext "has a police bribe against a major hit" } set major [lindex $groupstatus 3] set info [lindex $groupstatus 4] if {$info == "0"} { set infotext "hasn't retrieved any group information from the AIVD yet" } else { set infotext "has already retrieved information from the AIVD" } putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently part of group\00312 $group\0035. It consists of the following members:\00312$groupmembers\0035. It's leader is\00312 $groupleader \0035and the group account has\00312 $groupmoney,- \0035. Today, your group has robbed\00312 $robbed \0035people, major hitted\00312 $major \0035groups, $bribetext and $infotext. $hostagetext" } proc ort_startgroup {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [string tolower [lindex $arg 0]] if {$userpoints < "50"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you need at least 50 points to start or join a group. You currently have\00312 $userpoints \0035points." return 0 } set ingroup [ort_checkingroup $hand] if {$ingroup == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are already in a group. You can leave it by using\00312 !leavegroup \0035." return 0 } if {$group == "" || $group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !startgroup " return 0 } set groupexists [ort_groupexists $group] if {$groupexists == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, that group already exists." return 0 } ort_changegroup $hand $group ort_newgroup $group $hand putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 A new group has been started with the name\00312 $group\0035. You can now ask people to join your group and start doing business." ort_writespecial "Word on the street has it a new crime group by the name of $group and led by $hand has been formed!" } proc ort_joingroup {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [lindex $arg 0] if {$userpoints < "50"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you need at least 50 points to join or start a group. You currently have\00312 $userpoints \0035points." return 0 } set ingroup [ort_checkingroup $hand] if {$ingroup == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are already in a group. You can leave it by using\00312 !leavegroup \0035." return 0 } if {$group == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !joingroup " return 0 } set groupexists [ort_groupexists $group] if {$groupexists == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, that group doesn't exist." return 0 } set changewaiting "0" set tjr [open scripts/ortega/tojoin.ort r] while {[gets $tjr templine] >= 0} { if {[lindex $templine 0] == $hand} { set changewaiting "1" } } if {$changewaiting == "1"} { set tjr [open scripts/ortega/tojoin.ort r] set tjw [open scripts/ortega/tojoin.ort.tmp w] while {[gets $tjr templine] >= 0} { if {[lindex $templine 0] == $hand} { } else { puts $tjw "$templine" } } close $tjr close $tjw exec mv scripts/ortega/tojoin.ort.tmp scripts/ortega/tojoin.ort } set tja [open scripts/ortega/tojoin.ort a] puts $tja "$hand $group" close $tja putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are now waiting to join\00312 $group\0035." set groupleader [ort_getgroupleader $group] set joinmessage "\002$hand \002is waiting to join your group. Use\002 !addmember $hand \002to accept the request." ort_sendmessage $groupleader $joinmessage } proc ort_addmember {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set member [lindex $arg 0] set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 you are currently not part of any group." return 0 } set groupleader [ort_getgroupleader $group] if {$groupleader != $hand} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not the leader of\00312 $group\0035." return 0 } if {$member == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !addmember " return 0 } set ingroup [ort_checkingroup $member] if {$ingroup == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 $member \0035is already part of a group." return 0 } if {![matchattr $member O]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 $member \0035doesn't exist." return 0 } set dojoin "0" set tjr [open scripts/ortega/tojoin.ort r] while {[gets $tjr templine] >= 0} { if {[lindex $templine 0] == $member && [lindex $templine 1] == $group} { set dojoin "1" } } close $tjr if {$dojoin == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 $member \0035 is not waiting to join\00312 $group\0035. Make sure he or she has used\00312 !joingroup $group\0035." return 0 } set tjr [open scripts/ortega/tojoin.ort r] set tjw [open scripts/ortega/tojoin.ort.tmp w] while {[gets $tjr templine] >= 0} { if {[lindex $templine 0] == $member} { } else { puts $tjw "$templine" } } close $tjr close $tjw exec mv scripts/ortega/tojoin.ort.tmp scripts/ortega/tojoin.ort ort_changegroup $member $group putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\00312 $member \0035is now part of\00312 $group\0035." set addmessage "You have been added as a member of the crime group\002 $group \002led by\002 $hand\002." ort_sendmessage $member $addmessage } proc ort_leavegroup {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set leadergone "0" set groupleader [ort_getgroupleader $group] set membercount [ort_countgroupmembers $group] if {$membercount == "1"} { set currentgroupmoney [ort_getgroupmoney $group] set currentmoney [ort_getusermoney $hand] set newusermoney [expr $currentmoney + $currentgroupmoney] ort_newusermoney $hand $newusermoney ort_changegroup $hand none ort_removegroup $group set hgroup [ort_gethostagesituationstatus $group] if {$hgroup != ""} { ort_sethostagestatus $hgroup 0 } putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You have now left\00312 $group \0035and since you were the only member, the group has also been removed." ort_writespecial "Word on the street has it that crime group $group led by $hand no longer exists! Any hostage situation that may have been running will have ended!" } else { set newleader [lindex $arg 0] if {$groupleader == $hand} { if {[lindex $arg 0] == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Since you are the leader you have to specify someone else to take your place. Use\00312 !leavegroup " return 0 } if {![matchattr $newleader O]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 $newleader \0035doesn't exist." return 0 } set newingroup [ort_getmygroup $newleader] if {$group != $newingroup} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 $newleader \0035is not part of\00312 $group\0035." return 0 } if {$newleader == $hand} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You can't be the new leader since you're leaving the group." return 0 } ort_changegroup $hand none ort_changeleader $group $newleader putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You have left\00312 $group \0035and\00312 $newleader \0035is the new leader." } else { ort_changegroup $hand none putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You have left\00312 $group\0035." } } } proc ort_givegroupmoney {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set tomoney [lindex $arg 0] if {$tomoney == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !givegroupmoney \0035" return 0 } set currentmoney [ort_getusermoney $hand] if {$tomoney > $currentmoney} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you don't have enough money. You currently have\00312 $currentmoney,- \0035." return 0 } set tomoney [expr round($tomoney)] set newusermoney [expr $currentmoney - $tomoney] ort_newusermoney $hand $newusermoney set currentgroupmoney [ort_getgroupmoney $group] set newgroupmoney [expr $currentgroupmoney + $tomoney] ort_newgroupmoney $group $newgroupmoney putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You successfully put\00312 $tomoney \0035in the group account. You now have\00312 $newusermoney,- \0035left." } proc ort_givemembermoney {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set groupleader [ort_getgroupleader $group] if {$groupleader != $hand} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you need to be the group leader to give members money." return 0 } set hostagestatus [ort_gethostagestatus $group] if {$hostagestatus != "2"} { set hostagestatus [ort_gethostagestatus $group] if {$hostagestatus == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are currently in a hostage situation and cannot get any money from the group account." return 0 } } set tomember [lindex $arg 0] set tomoney [lindex $arg 1] if {$tomoney == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !givemembermoney \0035" return 0 } set membergroup [ort_getmygroup $tomember] if {$group != $membergroup} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 $tomember \0035is not part of\00312 $group\0035." return 0 } set groupmoney [ort_getgroupmoney $group] if {$tomoney > $groupmoney} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, the\00312 $group \0035account doesn't have enough money. The group currently has\00312 $groupmoney,- \0035." return 0 } set tomoney [expr round($tomoney)] set newgroupmoney [expr $groupmoney - $tomoney] ort_newgroupmoney $group $newgroupmoney set membermoney [ort_getusermoney $tomember] set newmembermoney [expr $membermoney + $tomoney] ort_newusermoney $tomember $newmembermoney putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You successfully gave\00312 $tomoney \0035to\00312 $tomember\0035. The group now has\00312 $newgroupmoney,- \0035left." } proc ort_addgrouprob {group} { set ogr [open scripts/ortega/group.ort r] set oge [open scripts/ortega/group.ort.tmp w] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set grouprobs [lindex $templine 3] incr grouprobs puts $oge "[lrange $templine 0 2] $grouprobs [lrange $templine 4 end]" } else { puts $oge "$templine" } } close $ogr close $oge exec mv scripts/ortega/group.ort.tmp scripts/ortega/group.ort } proc ort_buybodyguards {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set usermoney [ort_getusermoney $hand] set hasbodyguards [ort_getbodyguards $hand] if {$hasbodyguards == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are already protected by bodyguards" return 0 } if {$usermoney < "5000000"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you don't have enough money to buy bodyguards. You currently have\00312 $usermoney,- \0035." return 0 } ort_setbodyguards $hand 1 set newusermoney [expr $usermoney - 5000000] ort_newusermoney $hand $newusermoney putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You just bought bodyguard protection for\00312 5000000,- \0035." } proc ort_getbodyguards {hand} { set oir [open scripts/ortega/inventory.ort r] set bodyguards "0" while {[gets $oir templine] >= 0} { if {[lindex $templine 0] == $hand} { if {[lindex $templine 1] == "1"} { set bodyguards "1" } } } close $oir return $bodyguards } proc ort_setbodyguards {hand setting} { set oir [open scripts/ortega/inventory.ort r] set oie [open scripts/ortega/inventory.ort.tmp w] while {[gets $oir templine] >= 0} { if {[lindex $templine 0] == $hand} { puts $oie "[lindex $templine 0] $setting [lrange $templine 2 end]" } else { puts $oie "$templine" } } close $oir close $oie exec mv scripts/ortega/inventory.ort.tmp scripts/ortega/inventory.ort } proc ort_getgrouprobs {group} { set ogr [open scripts/ortega/group.ort r] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set grouphits [lindex $templine 3] } } close $ogr return $grouphits } proc ort_getgroupbribe {group} { set ogr [open scripts/ortega/group.ort r] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set groupbribe [lindex $templine 5] } } close $ogr return $groupbribe } proc ort_setgroupbribe {group bribe} { set ogr [open scripts/ortega/group.ort r] set oge [open scripts/ortega/group.ort.tmp w] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { puts $oge "[lrange $templine 0 4] $bribe [lrange $templine 6 end]" } else { puts $oge "$templine" } } close $ogr close $oge exec mv scripts/ortega/group.ort.tmp scripts/ortega/group.ort } proc ort_robperson {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set robperson [lindex $arg 0] if {$robperson == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !robperson " return 0 } set grouphits [ort_getgrouprobs $group] if {$grouphits == "4"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, your group already hit four people today, stay low for a while." return 0 } if {![matchattr $robperson O]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 $robperson \0035doesn't exist." return 0 } set groupleader [ort_getgroupleader $group] if {$robperson == $hand || $robperson == $groupleader} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you can't hit yourself or the group leader." return 0 } set hasbodyguards [ort_getbodyguards $robperson] if {$hasbodyguards == "1"} { set bodyguardsdie [rand 3] if {$bodyguardsdie > "0"} { ort_addgrouprob $group putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You tried to rob\00312 $robperson\0035, but encountered bodyguards. He and his bodyguards got away safely." ort_writenews "It appears that $group has tried to rob $robperson! Both he and his bodyguards got away safely." set hitmessage "You have been hit by crime group\002 $group\002, performed by\002 $hand\002! You were protected by bodyguards and you all got away safely. You are still protected by bodyguards." ort_sendmessage $robperson $hitmessage return 0 } ort_addgrouprob $group ort_setbodyguards $robperson 0 putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You tried to rob\00312 $robperson\0035, but encountered bodyguards. He got away safely, but his bodyguards died." ort_writenews "It appears that $group has tried to rob $robperson! He got away safely, but his defending bodyguards died in the attack." set hitmessage "You have been robbed by crime group\002 $group\002, performed by\002 $hand\002! You were protected by bodyguards and you got away safely. You are no longer protected by bodyguards since they were all killed in the attack." ort_sendmessage $robperson $hitmessage return 0 } set robmoney [ort_getusermoney $robperson] set userpoints [ort_getuserpoints $hand] if {$userpoints < "200"} { set percentnumber "10" } else { set percentnumber "25" } set moneypercent [expr int(rand() * $percentnumber)] incr moneypercent set moneydivide [expr $robmoney / 100] set moneyfinal [expr $moneydivide * $moneypercent] set newrobmoney [expr $robmoney - $moneyfinal] ort_newusermoney $robperson $newrobmoney set groupmoney [ort_getgroupmoney $group] set newgroupmoney [expr $groupmoney + $moneyfinal] ort_newgroupmoney $group $newgroupmoney ort_addgrouprob $group putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You successfully robbed\00312 $robperson \0035and got\00312 $moneyfinal \0035from him. The group account now has\00312 $newgroupmoney,- \0035." ort_writenews "It appears that $robperson has been robbed by crime group $group! After roughing him up, they managed to get away with $moneyfinal,- ." set hitmessage "You have been robbed by crime group\002 $group\002, performed by\002 $hand\002! They took\002 $moneyfinal,- \002from you; you now have\002 $newrobmoney,- \002left." ort_sendmessage $robperson $hitmessage } proc ort_gethostagestatus {group} { set ogr [open scripts/ortega/group.ort r] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set hostagestatus [lindex $templine 4] } } close $ogr return $hostagestatus } proc ort_gethostagegroup {group} { set ohr [open scripts/ortega/hostage.ort r] set groupstatus "0" while {[gets $ohr templine] >= 0} { if {[lindex $templine 0] == $group} { set groupstatus "1" } } close $ohr return $groupstatus } proc ort_gethostagesituationstatus {group} { set ohr [open scripts/ortega/hostage.ort r] set ohw [open scripts/ortega/hostage.ort.tmp w] set hostagegroup "" while {[gets $ohr templine] >= 0} { if {[lindex $templine 1] == $group} { set hostagegroup [lindex $templine 0] } elseif {[lindex $templine 0] == $group} { } else { puts $ohw $templine } } close $ohr close $ohw exec mv scripts/ortega/hostage.ort.tmp scripts/ortega/hostage.ort return $hostagegroup } proc ort_gettargetgrouphostagestatus {group groupt} { set ohr [open scripts/ortega/hostage.ort r] set hostagestatus "0" while {[gets $ohr templine] >= 0} { if {[lindex $templine 0] == $groupt && [lindex $templine 1] == $group} { if {[lindex $templine 2] != "0"} { set hostagestatus "2" } else { set hostagestatus "1" } } } close $ohr return $hostagestatus } proc ort_gethostagemoney {group targetgroup} { set ohr [open scripts/ortega/hostage.ort r] set hostagestatus "0" while {[gets $ohr templine] >= 0} { if {[lindex $templine 0] == $group && [lindex $templine 1] == $targetgroup} { set hostagemoney [lindex $templine 2] } } close $ohr return $hostagemoney } proc ort_sethostagestatus {group hostagestatus} { set ogr [open scripts/ortega/group.ort r] set oge [open scripts/ortega/group.ort.tmp w] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { puts $oge "[lrange $templine 0 3] $hostagestatus [lrange $templine 5 end]" } else { puts $oge "$templine" } } close $ogr close $oge exec mv scripts/ortega/group.ort.tmp scripts/ortega/group.ort } proc ort_updatehostageoffer {group groupoffer offer} { set ohr [open scripts/ortega/hostage.ort r] set ohe [open scripts/ortega/hostage.ort.tmp w] while {[gets $ohr templine] >= 0} { if {[lindex $templine 0] == $group && [lindex $templine 1] == $groupoffer} { puts $ohe "[lrange $templine 0 1] $offer" } else { puts $ohe "$templine" } } close $ohr close $ohe exec mv scripts/ortega/hostage.ort.tmp scripts/ortega/hostage.ort } proc ort_addhostage {group targetgroup} { set oha [open scripts/ortega/hostage.ort a] puts $oha "$group $targetgroup 0" close $oha } proc ort_removehostage {group targetgroup} { set ohr [open scripts/ortega/hostage.ort r] set ohe [open scripts/ortega/hostage.ort.tmp w] while {[gets $ohr templine] >= 0} { if {[lindex $templine 0] == $group && [lindex $templine 1] == $targetgroup} { } else { puts $ohe "$templine" } } close $ohr close $ohe exec mv scripts/ortega/hostage.ort.tmp scripts/ortega/hostage.ort } proc ort_getmajorhitstatus {group} { set ogr [open scripts/ortega/group.ort r] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set majorhitstatus [lindex $templine 6] } } close $ogr return $majorhitstatus } proc ort_setmajorhitstatus {group} { set ogr [open scripts/ortega/group.ort r] set oge [open scripts/ortega/group.ort.tmp w] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set cm [lindex $templine 6] set nm [expr $cm + 1] puts $oge "[lrange $templine 0 5] $nm [lrange $templine 7 end]" } else { puts $oge "$templine" } } close $ogr close $oge exec mv scripts/ortega/group.ort.tmp scripts/ortega/group.ort } proc ort_getinfostatus {group} { set ogr [open scripts/ortega/group.ort r] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { set majorhitstatus [lindex $templine 7] } } close $ogr return $majorhitstatus } proc ort_setinfostatus {group} { set ogr [open scripts/ortega/group.ort r] set oge [open scripts/ortega/group.ort.tmp w] while {[gets $ogr templine] >= 0} { if {[lindex $templine 0] == $group} { puts $oge "[lrange $templine 0 6] 1 [lrange $templine 8 end]" } else { puts $oge "$templine" } } close $ogr close $oge exec mv scripts/ortega/group.ort.tmp scripts/ortega/group.ort } proc ort_takehostage {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set targetgroup [lindex $arg 0] if {$targetgroup == "" || $group == $targetgroup} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !takehostage " return 0 } set hostagestatus [ort_gethostagestatus $group] if {$hostagestatus != "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you already have a hostage or just recently had one." return 0 } set groupexists [ort_groupexists $targetgroup] if {$groupexists == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, that group doesn't exist." return 0 } ort_sethostagestatus $group 1 ort_addhostage $group $targetgroup putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Your group\00312 ($group) \0035has now taken a hostage. The members of\00312 $targetgroup \0035will be informed of the situation. When they make an offer you can either accept it or ignore it and extract the information from the hostage anyway." ort_writenews "Group $group have taken a hostage and demand money for his release or they will kill him after trying to get information out of him about the location of one of the $targetgroup!" set targetgroupleader [ort_getgroupleader $targetgroup] set hostagemessage "A hostage has been taken by\002 $group \002who they are going to extort for the location of one of your groups vaults. You can offer money by using\002 !buyhostage \002to buy the hostage out for money." ort_sendmessage $targetgroupleader $hostagemessage } proc ort_buyhostage {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set groupoffer [lindex $arg 0] set moneyoffer [lindex $arg 1] if {$moneyoffer == "" || $group == $groupoffer} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !buyhostage " return 0 } set groupmoney [ort_getgroupmoney $group] if {$moneyoffer > $groupmoney} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, your group account doesn't have enough money. Your group currently has\00312 $groupmoney\0035." return 0 } set hostagestatus [ort_gettargetgrouphostagestatus $group $groupoffer] if {$hostagestatus == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently not involved in a hostage situation (with them)." return 0 } if {$hostagestatus == "1"} { ort_updatehostageoffer $groupoffer $group $moneyoffer putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You have made an offer of\00312 $moneyoffer \0035to buy out the hostage that\00312 $groupoffer \0035has taken. If they do not accept it, you can use this command again to make a higher offer." } else { ort_updatehostageoffer $groupoffer $group $moneyoffer putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Your offer to buy out the hostage that\00312 $groupoffer \0035 has taken has been changed to\00312 $moneyoffer\0035." } ort_writenews "Group $group has offered $moneyoffer,- in exchange for a hostage that $groupoffer has taken!" set targetgroupleader [ort_getgroupleader $groupoffer] set hostagemessage "\002$group \002has offered\002 $moneyoffer \002in exchange for the hostage your group has taken. You can accept it by using\002 !releasehostage \002, ask them for more money or extort the hostage anyway with\002 !extorthostage\002." ort_sendmessage $targetgroupleader $hostagemessage } proc ort_releasehostage {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set targetgroup [lindex $arg 0] if {$targetgroup == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !releasehostage " return 0 } set groupexists [ort_groupexists $targetgroup] if {$groupexists == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, that group doesn't exist." return 0 } set hostagestatus [ort_gethostagestatus $group] if {$hostagestatus != "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are currently not in a hostage situation." return 0 } set targethostagestatus [ort_gettargetgrouphostagestatus $targetgroup $group] if {$targethostagestatus == "0" || $targethostagestatus == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you currently don't have a hostage to extort\00312 $targetgroup\0035 or they haven't made an offer." return 0 } set hostagemoney [ort_gethostagemoney $group $targetgroup] set groupmoney [ort_getgroupmoney $group] set targetgroupmoney [ort_getgroupmoney $targetgroup] set newgroupmoney [expr $groupmoney + $hostagemoney] ort_newgroupmoney $group $newgroupmoney set newtargetgroupmoney [expr $targetgroupmoney - $hostagemoney] ort_newgroupmoney $targetgroup $newtargetgroupmoney ort_sethostagestatus $group 2 ort_removehostage $group $targetgroup putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You have successfully traded the hostage for\00312 $hostagemoney \0035with\00312 $targetgroup\0035." ort_writenews "Group $group has accepted an offer of $hostagemoney,- that $targetgroup made to free a hostage!" set targetgroupleader [ort_getgroupleader $targetgroup] set hostagemessage "\002$group \002has accepted your offer of\002 $hostagemoney \002in exchange for the hostage." ort_sendmessage $targetgroupleader $hostagemessage } proc ort_extorthostage {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set targetgroup [lindex $arg 0] if {$targetgroup == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !extorthostage " return 0 } set groupexists [ort_groupexists $targetgroup] if {$groupexists == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, that group doesn't exist." return 0 } set hostagestatus [ort_gethostagestatus $group] if {$hostagestatus != "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are currently not in a hostage situation." return 0 } set doestell [expr [rand 10] + 1] if {$doestell <= "2"} { ort_sethostagestatus $group 2 ort_removehostage $group $targetgroup putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 The hostage didn't reveal anything and is now dead!" ort_writenews "Group $group has tried to extort a hostage! Word on the street has it the hostage didn't reveal anything." set targetgroupleader [ort_getgroupleader $targetgroup] set hostagemessage "\002$group \002has not accepted your groups offer (if your group made any) and extorted the hostage. Luckily the hostage didn't cooperate and died before he told anything." ort_sendmessage $targetgroupleader $hostagemessage return 0 } set moneymulti "25" set moneypercent [expr int(rand() * $moneymulti)] incr moneypercent set targetgroupmoney [ort_getgroupmoney $targetgroup] set moneydivide [expr $targetgroupmoney / 100] set vaultmoney [expr $moneydivide * $moneypercent] set groupmoney [ort_getgroupmoney $group] set newgroupmoney [expr $groupmoney + $vaultmoney] ort_newgroupmoney $group $newgroupmoney set newtargetgroupmoney [expr $targetgroupmoney - $vaultmoney] ort_newgroupmoney $targetgroup $newtargetgroupmoney ort_sethostagestatus $group 2 ort_removehostage $group $targetgroup putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 The hostage has told you the location of a vault from\00312 $targetgroup\0035. Inside you found a total of\00312 $vaultmoney,- \0035!" ort_writenews "Group $group has extorted and killed a hostage! They found the location of a vault from $targetgroup and got away with $vaultmoney,- ." set targetgroupleader [ort_getgroupleader $targetgroup] set hostagemessage "\002$group \002has not accepted your groups offer (if your group made any) and extorted the hostage. They got \002 $vaultmoney,- \002out of one of your groups vaults." ort_sendmessage $targetgroupleader $hostagemessage } proc ort_buybribe {nick host hand arg} { set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set hasbribe [ort_getgroupbribe $group] if {$hasbribe == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Your group already has a police bribe in case of a major mob hit." return 0 } set groupmoney [ort_getgroupmoney $group] if {$groupmoney < "4000000"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, your group account doesn't have enough money. Your group currently has\00312 $groupmoney\0035." return 0 } set newgroupmoney [expr $groupmoney - 4000000] ort_newgroupmoney $group $newgroupmoney ort_setgroupbribe $group 1 putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Your group has bought a police bribe in case of a major mob hit." } proc ort_majorhit {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set majorhitstatus [ort_getmajorhitstatus $group] if {$majorhitstatus == "2"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you have already hitted two groups today, stay low for a while." return 0 } set targetgroup [lindex $arg 0] if {$targetgroup == "" || [string tolower $targetgroup] == [string tolower $group]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !majorhit " return 0 } set groupexists [ort_groupexists $targetgroup] if {$groupexists == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, that group doesn't exist." return 0 } set groupmoney [ort_getgroupmoney $group] if {$groupmoney < "1500000"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, your group account doesn't have enough money. Your group currently has\00312 $groupmoney\0035." return 0 } set newgroupmoney [expr $groupmoney - 1500000] ort_newgroupmoney $group $newgroupmoney set hasbribe [ort_getgroupbribe $targetgroup] if {$hasbribe == "1"} { set groupmoneynow [ort_getgroupmoney $group] set groupcent [expr [rand 50] + 1] set tempgroupmoney [expr $groupmoneynow / 100] set totalgroupmoney [expr $tempgroupmoney * $groupcent] set newgroupmoney [expr $groupmoneynow - $totalgroupmoney] ort_newgroupmoney $group $newgroupmoney set totalusermoney "0" set omr [open scripts/ortega/main.ort r] set ome [open scripts/ortega/main.ort.tmp w] while {[gets $omr templine] >= 0} { if {[lindex $templine 3] == $group} { set currentuser [lindex $templine 0] set hasbodyguards [ort_getbodyguards $currentuser] if {$hasbodyguards == "0"} { set tempusermoney [lindex $templine 1] set tempcent [expr [rand 25] + 1] set tempmoney [expr $tempusermoney / 100] set newtempmoney [expr $tempmoney * $tempcent] set tempnewmoney [expr $tempusermoney - $newtempmoney] set totalusermoney [expr $totalusermoney + $newtempmoney] puts $ome "[lindex $templine 0] $tempnewmoney [lrange $templine 2 end]" } else { puts $ome $templine } } else { puts $ome $templine } } close $omr close $ome exec mv scripts/ortega/main.ort.tmp scripts/ortega/main.ort set totalmoney [expr $totalgroupmoney + $totalusermoney] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Your group has tried to rob\00312 $targetgroup\0035! Unfortunatly, you we're caught by the police who you had to give \00312 $totalmoney,- \0035(\00312 $totalgroupmoney,- \0035from the group account and\00312 $totalusermoney,- \0035from all the members combined) to keep your freedom." ort_writenews "There has been an attempt at a MAJOR MOB HIT! Group $group has tried to rob $targetgroup, but got caught and had to give the police $totalmoney,- to keep their freedom." set targetgroupleader [ort_getgroupleader $targetgroup] set majorhitmessage "\002$group \002has tried to perform a major hit upon your groups base. Since your gruop had a bribe, they failed and were caught by the police! They had to give the police\002 $totalmoney,- \002(\002 $totalgroupmoney,- \002from the group account and\002 $totalusermoney,- \002from all the members combined) to buy keep freedom." ort_sendmessage $targetgroupleader $majorhitmessage ort_setgroupbribe $targetgroup 0 ort_setmajorhitstatus $group return 0 } set hitgroupmoney [ort_getgroupmoney $targetgroup] set groupcent [expr [rand 50] + 1] set tempgroupmoney [expr $hitgroupmoney / 100] set totalgroupmoney [expr $tempgroupmoney * $groupcent] set newhitgroupmoney [expr $hitgroupmoney - $totalgroupmoney] ort_newgroupmoney $targetgroup $newhitgroupmoney set totalusermoney "0" set omr [open scripts/ortega/main.ort r] set ome [open scripts/ortega/main.ort.tmp w] while {[gets $omr templine] >= 0} { if {[lindex $templine 3] == $targetgroup} { set currentuser [lindex $templine 0] set hasbodyguards [ort_getbodyguards $currentuser] if {$hasbodyguards == "0"} { set tempusermoney [lindex $templine 1] set tempcent [expr [rand 25] + 1] set tempmoney [expr $tempusermoney / 100] set newtempmoney [expr $tempmoney * $tempcent] set tempnewmoney [expr $tempusermoney - $newtempmoney] set totalusermoney [expr $totalusermoney + $newtempmoney] puts $ome "[lindex $templine 0] $tempnewmoney [lrange $templine 2 end]" } else { puts $ome $templine } } else { puts $ome $templine } } close $omr close $ome exec mv scripts/ortega/main.ort.tmp scripts/ortega/main.ort set totalmoney [expr $totalgroupmoney + $totalusermoney] set groupmoneynow [ort_getgroupmoney $group] set newgroupmoneynow [expr $groupmoneynow + $totalmoney] ort_newgroupmoney $group $newgroupmoneynow putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Your group has hit\00312 $targetgroup\0035! You got away with a total of\00312 $totalmoney,- \0035(\00312 $totalgroupmoney,- \0035from the group account and\00312 $totalusermoney,- \0035from all the members combined)." ort_writenews "There has been a major mob hit! Group $group has hit $targetgroup and got away with $totalmoney,- ." set targetgroupleader [ort_getgroupleader $targetgroup] set majorhitmessage "\002$group \002has performed a major hit upon your groups base. They got away with\002 $totalmoney,- \002(\002 $totalgroupmoney,- \002from the group account and\002 $totalusermoney,- \002from all the members combined)." ort_sendmessage $targetgroupleader $majorhitmessage ort_setmajorhitstatus $group } proc ort_showinfo {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set infostatus [ort_getinfostatus $group] if {$infostatus == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, your group has not yet bribed the AIVD today, use\00312 !buyinfo \0035to gather information about a group." return 0 } set oir [open scripts/ortega/$group.info r] set infoline [gets $oir] close $oir putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 $infoline" } proc ort_buyinfo {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set targetgroup [lindex $arg 0] if {$targetgroup == "" || [string tolower $targetgroup] == [string tolower $group]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !buyinfo " return 0 } set infostatus [ort_getinfostatus $group] if {$infostatus == "1"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, your group has already bribed the AIVD today, use\00312 !showinfo \0035to see your information." return 0 } set groupexists [ort_groupexists $targetgroup] if {$groupexists == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, that group doesn't exist." return 0 } set groupmoney [ort_getgroupmoney $group] if {$groupmoney < "1000000"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, your group account doesn't have enough money. Your group currently has\00312 $groupmoney\0035." return 0 } set newgroupmoney [expr $groupmoney - 1000000] ort_newgroupmoney $group $newgroupmoney set targetgroupmoney [ort_getgroupmoney $targetgroup] set memberlist "" set omr [open scripts/ortega/main.ort r] while {[gets $omr templine] >= 0} { if {[lindex $templine 3] == $targetgroup} { set tempusername [lindex $templine 0] set tempusermoney [lindex $templine 1] set memberlist "$memberlist \00312$tempusername \0035with\00312 $tempusermoney,- \0035|" } } close $omr putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Information gathered. The group you specified \00312($targetgroup) \0035has a total of\00312 $targetgroupmoney,- \0035in their group account. In their personal accounts, the members have:$memberlist" set oiw [open scripts/ortega/$group.info w] puts $oiw "Information on\00312 $targetgroup \0035has been gathered today by\00312 $nick\0035. The information is: The group has a total of\00312 $targetgroupmoney,- \0035in their group account. In their personal accounts, the members have:$memberlist" close $oiw ort_setinfostatus $group } proc ort_killperson {nick host hand arg} { global inprison set userpoints [ort_getuserpoints $hand] if {$userpoints < 300} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you're not far enough in the game to kill someone." return 0 } if {[info exists inprison($hand)]} { set bailmoney [ort_getbail $userpoints] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You are currently in prison. Type !bailout to bail yourself out for\00312 $bailmoney\0035." return 0 } set group [ort_getmygroup $hand] if {$group == "none"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you are not part of any group." return 0 } set killperson [lindex $arg 0] if {$killperson == "" || $killperson == $hand} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !killperson " return 0 } if {![matchattr $killperson O]} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry,\00312 $killperson \0035doesn't exist." return 0 } set killpoints [ort_getuserpoints $killperson] if {$killpoints < "300"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you can't hit\00312 $killperson \0035because he or she hasn't come far enough in the game yet." return 0 } set minpoints [expr $userpoints - 50] set pluspoints [expr $userpoints + 50] set go "0" if {$killpoints > $minpoints && $killpoints < $pluspoints} { set go "1" } if {$go == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you can only hit people within a 50 point radius." return 0 } set groupmoney [ort_getgroupmoney $group] if {$groupmoney < "25000000"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, your group account doesn't have enough money. Your group currently has\00312 $groupmoney\0035." return 0 } set newgroupmoney [expr $groupmoney - 25000000] ort_newgroupmoney $group $newgroupmoney set killchance [rand 2] if {$killchance == "1"} { set remgroup [ort_getmygroup $killperson] if {$remgroup != "none"} { set groupleader [ort_getgroupleader $remgroup] if {$groupleader == $killperson} { set membercount [ort_countgroupmembers $remgroup] if {$membercount == "1"} { ort_removegroup $remgroup } else { set newleader [ort_getnewgroupleader $remgroup $killperson] ort_changeleader $remgroup $newleader } } } set hgroup [ort_gethostagesituationstatus $remgroup] if {$hgroup != ""} { ort_sethostagestatus $hgroup 0 } set ocstatus [ort_getocstatus $killperson] if {$ocstatus == "1"} { ort_removeoc $killperson } ort_removeperson $killperson set wardenrfile [open scripts/ortega/warden.ort r] set templine [gets $wardenrfile] close $wardenrfile set waswarden "0" if {[lindex $templine 0] == $killperson} { set wardenwfile [open scripts/ortega/warden.ort w] puts $wardenwfile "$hand 0" close $wardenwfile set waswarden "1" } if {$waswarden == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You succeeded in having\00312 $killperson \0035assasinated!" } else { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You succeeded in having\00312 $killperson \0035assasinated! Because he was the daily warden, you have now become warden for the rest of the day." } ort_writenews "$killperson has been assasinated by $group!" ort_writespecial "$killperson has been removed from the game after being assasinated by $group!" } else { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You tried to have\00312 $killperson \0035assasinated but the attempt failed!" set killmessage "Crime group\002 $group \002tried to have you assasinated, but failed!" ort_sendmessage $killperson $killmessage ort_writenews "$group tried to have $killperson assasinated but the attempt failed!" } } proc ort_lottery {min hour day month year} { global ortegachan set moneydivide "20000" set moneypercent [expr [rand 100] + 1] set lotterymoney [expr $moneydivide * $moneypercent] putchan $ortegachan "\0032<=\0034 Daily Lottery : \002Prize Money\002 \0032=>\0035 Today, everyone in the game is eligible to win\00312 $lotterymoney,- \0035!" set partlist "" foreach user [userlist] { if {[matchattr $user O]} { set temppoints [ort_getuserpoints $user] if {$temppoints > 100} { lappend partlist "$user" } } } if {$partlist == ""} { putchan $ortegachan "\0032<=\0034 Daily Lottery \0032=>\0035 No one has reached a 100 points yet, so no lottery!" return 0 } set lotterywinner "[lindex $partlist [rand [llength $partlist]]]" putchan $ortegachan "\0032<=\0034 Daily Lottery : \002Winner\002 \0032=>\0035 And the winner is ...\00312 $lotterywinner\0035! Congratulations!" set currentwinnermoney [ort_getusermoney $lotterywinner] set newwinnermoney [expr $currentwinnermoney + $lotterymoney] ort_newusermoney $lotterywinner $newwinnermoney ort_writespecial "The Daily Lottery was won by $lotterywinner! Congratulations, you have won $lotterymoney,- !" } proc ort_lotteryremindera {min hour day month year} { global ortegachan putchan $ortegachan "\0032<=\0034 Daily Number Lottery : \002Reminder\002 \0032=>\0035 The next number lottery draw is in three hours, so if you haven't placed any lottery bets yet, do so now!" } proc ort_lotteryreminderb {min hour day month year} { global ortegachan putchan $ortegachan "\0032<=\0034 Daily Number Lottery : \002Reminder\002 \0032=>\0035 The next number lottery draw is in an hour, so if you haven't placed any lottery bets yet, do so now!" } proc ort_getlotterybet {hand} { set olr [open scripts/ortega/lottery.ort r] set bettimes "0" set betnumbers "" while {[gets $olr templine] >= 0} { if {[lindex $templine 0] == $hand} { incr bettimes set betnumbers "$betnumbers [lindex $templine 1]" } } close $olr return "$bettimes $betnumbers" } proc ort_setlotterybet {hand currentbet} { set ola [open scripts/ortega/lottery.ort a] puts $ola "$hand $currentbet" close $ola } proc ort_remlotterybet {hand currentbet} { set olr [open scripts/ortega/lottery.ort r] set olw [open scripts/ortega/lottery.ort.tmp w] set removed "0" while {[gets $olr templine] >= 0} { if {[lindex $templine 0] == $hand && [lindex $templine 1] == $currentbet && $removed == "0"} { set removed "1" } else { puts $olw "$templine" } } close $olr close $olw exec mv scripts/ortega/lottery.ort.tmp scripts/ortega/lottery.ort return $removed } proc ort_numberlottery {nick host hand arg} { set currentbet [lindex $arg 0] set newbet [lindex $arg 1] if {$currentbet == "show"} { set alreadybet [ort_getlotterybet $hand] set times [lindex $alreadybet 0] set numbers [lrange $alreadybet 1 end] putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You've placed\00312 $times \0035bet(s) on the number(s)\00312 $numbers" return 0 } if {$currentbet < 1 || $currentbet > 100} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Syntax:\00312 !lottery " return 0 } set alreadybet [ort_getlotterybet $hand] set times [lindex $alreadybet 0] set numbers [lrange $alreadybet 1 end] if {$times == "4" && $newbet == ""} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you've already placed bets on four numbers \00312($numbers)\0035. To replace a number, use\00312 !lottery " return 0 } else { if {$newbet == ""} { ort_setlotterybet $hand $currentbet putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You placed a lottery bet on\00312 $currentbet\0035." } else { set removed [ort_remlotterybet $hand $currentbet] if {$removed == "0"} { putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 Sorry, you don't have a bet on the\00312 $currentbet\0035." return 0 } ort_setlotterybet $hand $newbet putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You changed your lottery bet of\00312 $currentbet \0035to\00312 $newbet\0035." } } } proc ort_dailynumberlottery {min hour day month year} { global ortegachan set olmr [open scripts/ortega/lotterymoney.ort r] set lotterymoney [gets $olmr] close $olmr set winnumber [expr [rand 100] + 1] set winners "0" set olr [open scripts/ortega/lottery.ort r] while {[gets $olr templine] >= 0} { if {[lindex $templine 1] == $winnumber} { incr winners set lotwinner($winners) [lindex $templine 0] } } close $olr if {$winners == "0"} { set newlotterymoney [expr $lotterymoney + 1000000] putchan $ortegachan "\0032<=\0034 Daily Number Lottery \0032=>\0035 Today's number is\00312 $winnumber \0035with an attached prize money of\00312 $lotterymoney,- \0035! And today..." putchan $ortegachan "\0032<=\0034 Daily Number Lottery \0032=>\0035 ...there are no winners! Tomorrow's prize money will be\00312 $newlotterymoney\0035!" } else { if {$winners > "1"} { putchan $ortegachan "\0032<=\0034 Daily Number Lottery \0032=>\0035 Today's number is\00312 $winnumber \0035with an attached prize money of\00312 $lotterymoney,- \0035! And today..." putchan $ortegachan "\0032<=\0034 Daily Number Lottery \0032=>\0035 ...there are multiple winners!" set nwinners "0" set winnerlist "" while {$nwinners < $winners} { incr nwinners set currentwinner $lotwinner($nwinners) set winnerlist "$winnerlist$currentwinner " set usermoney [ort_getusermoney $currentwinner] set newusermoney [expr $usermoney + $lotterymoney] ort_newusermoney $currentwinner $newusermoney } putchan $ortegachan "\0032<=\0034 Daily Number Lottery \0032=>\0035 The winners are:\00312 $winnerlist\0035! Congratulations! Tomorrow's prize money will be\00312 2000000,-\0035." set newlotterymoney "2000000" ort_writespecial "The Number Lottery was won by multiple people: $winnerlist! Congratulations, you have all won a whopping $lotterymoney,- !" } else { set usermoney [ort_getusermoney $lotwinner(1)] set newusermoney [expr $usermoney + $lotterymoney] ort_newusermoney $lotwinner(1) $newusermoney putchan $ortegachan "\0032<=\0034 Daily Number Lottery \0032=>\0035 Today's number is\00312 $winnumber \0035with an attached prize money of\00312 $lotterymoney,- \0035! And today..." putchan $ortegachan "\0032<=\0034 Daily Number Lottery \0032=>\0035 ...there is a winner!" putchan $ortegachan "\0032<=\0034 Daily Number Lottery \0032=>\0035 The winner is\00312 $lotwinner(1)\0035! Congratulations! Tomorrow's prize money will be\00312 2000000,-\0035." set newlotterymoney "2000000" ort_writespecial "The Number Lottery was won by $lotwinner(1)! Congratulations, you have won a whopping $lotterymoney,- !" } } set olmw [open scripts/ortega/lotterymoney.ort w] puts $olmw $newlotterymoney close $olmw set olw [open scripts/ortega/lottery.ort w] close $olw } # Gambling proc ort_russianroul {nick host hand chan arg} { global ortegachan russjoin russbusy russamount russplayers russmoney russround playerjoined russcounter if {$chan == $ortegachan} { if {[info exists russjoin]} { if {[info exists russbusy]} { return 0 } else { if {[info exists playerjoined($hand)]} { return 0 } set usermoney [ort_getusermoney $hand] if {$russamount > $usermoney} { putchan $ortegachan "\0032<=\0034 Russian Roulette : $nick \0032=>\0035 You don't have that much money to play for. You currently have\00312 $usermoney,- \0035." return 0 } incr russcounter set russplayers($russcounter) "$hand" set playerjoined($hand) "1" set newusermoney [expr $usermoney - $russamount] ort_newusermoney $hand $newusermoney set russmoney [expr $russmoney + $russamount] putchan $ortegachan "\0032<=\0034 Russian Roulette : $nick \0032=>\0035 You have joined the game" if {$russcounter == "6"} { putchan $ortegachan "\0032<=\0034 Russian Roulette \0032=>\0035 The maximum of 6 players has been reached. The game will now begin..." set russbusy "1" ort_russianround } } } else { set russamount [lindex $arg 0] if {$russamount == "" || $russamount < "1"} { putchan $ortegachan "\0032<=\0034 Russian Roulette : $nick \0032=>\0035 Syntax:\00312 !russianroul " return 0 } set usermoney [ort_getusermoney $hand] if {$russamount > $usermoney} { putchan $ortegachan "\0032<=\0034 Russian Roulette : $nick \0032=>\0035 You don't have that much money to play for. You currently have\00312 $usermoney,- \0035." return 0 } set russjoin "1" set russround "1" set russcounter "1" set russplayers($russcounter) "$hand" set playerjoined($hand) "1" set newusermoney [expr $usermoney - $russamount] ort_newusermoney $hand $newusermoney set russmoney "$russamount" putchan $ortegachan "\0032<=\0034 Russian Roulette : $nick \0032=>\0035 You have started and joined the game. Players can join for another minute." utimer 59 "set russbusy 1" utimer 60 ort_russianround } } } proc ort_russianround {} { global ortegachan russjoin russbusy russamount russplayers russcounter russmoney russround playerjoined russpls if {$russcounter == "1"} { putchan $ortegachan "\0032<=\0034 Russian Roulette \0032=>\0035 You can't play on your own." set usermoney [ort_getusermoney $russplayers(1)] set newusermoney [expr $usermoney + $russamount] ort_newusermoney $russplayers(1) $newusermoney unset russplayers unset playerjoined unset russjoin unset russbusy unset russamount unset russcounter unset russmoney unset russround return 0 } if {$russround == "1"} { putchan $ortegachan "\0032<=\0034 Russian Roulette \0032=>\0035 Game started. You will be playing for\00312 $russmoney,- \0035!" set russpls "$russcounter" } putchan $ortegachan "\0032<=\0034 Russian Roulette Round $russround \0032=>\0035 The following player is out of the game..." set russnumb [expr [rand $russcounter] + 1] putchan $ortegachan "\0032<=\0034 Russian Roulette Round $russround \0032=>\0035 ... $russplayers($russnumb)!" set newplayers "1" set ora [open scripts/ortega/russ.ort a] while {$newplayers <= $russcounter} { if {$newplayers != $russnumb} { puts $ora "$russplayers($newplayers)" } incr newplayers } close $ora unset russplayers set newcounter "1" set orr [open scripts/ortega/russ.ort r] while {[gets $orr templine] >= 0} { set russplayers($newcounter) "$templine" incr newcounter } close $orr set orw [open scripts/ortega/russ.ort w] close $orw set russcounter [expr $russcounter - 1] incr russround if {$russpls == $russround} { putchan $ortegachan "\0032<=\0034 Russian Roulette \0032=>\0035 Game over! The winner is ... (obviously) ... $russplayers(1)" set russwinner "$russplayers(1)" set usermoney [ort_getusermoney $russwinner] set newusermoney [expr $usermoney + $russmoney] ort_newusermoney $russwinner $newusermoney unset russplayers unset playerjoined unset russjoin unset russbusy unset russamount unset russcounter unset russmoney unset russround return 0 } utimer 20 ort_russianround } proc ort_luckyfive {nick host hand chan arg} { global ortegachan set luckynumber [lindex $arg 0] set luckyamount [lindex $arg 1] if {$luckyamount == "" || $luckynumber < "1" || $luckynumber > "5"} { putchan $ortegachan "\0032<=\0034 Lucky Five : $nick \0032=>\0035 Syntax:\00312 !luckyfive " return 0 } set usermoney [ort_getusermoney $hand] if {$luckyamount > $usermoney || $luckyamount < "100" || $luckyamount > 400000} { putchan $ortegachan "\0032<=\0034 Lucky Five : $nick \0032=>\0035 Either you're below the minimum bid of 100, above the maximum bid of 400000 or you don't have enough money. You currently have\00312 $usermoney,- \0035." return 0 } set luckyrand [expr [rand 5] +1] if {$luckynumber == $luckyrand} { set luckymoney [expr $luckyamount * 5] set newusermoney [expr $usermoney + $luckymoney] ort_newusermoney $hand $newusermoney putchan $ortegachan "\0032<=\0034 Lucky Five : $nick \0032=>\0035 Congratulations! You guessed the right number \00312($luckynumber)\0035! You won\00312 $luckymoney,- \0035." } else { set newusermoney [expr $usermoney - $luckyamount] ort_newusermoney $hand $newusermoney putchan $ortegachan "\0032<=\0034 Lucky Five : $nick \0032=>\0035 Too bad! You lost. The number drawn was\00312 $luckyrand\0035." } } proc ort_numbers {nick host hand chan arg} { global ortegachan numbjoin numbbusy numbplayers numbmoney numbplayerjoined numbcounter numbnicks if {$chan == $ortegachan} { if {[info exists numbjoin]} { if {[info exists numbbusy]} { return 0 } else { if {[info exists numbplayerjoined($hand)]} { return 0 } set usermoney [ort_getusermoney $hand] if {$usermoney < "1"} { putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 Sorry, you need to have more then\00312 0,-\0035 to play Numbers." return 0 } if {$numbjoin != "1"} { return 0 } incr numbcounter set numbplayers($numbcounter) "$hand" set numbnicks($numbcounter) "$nick" set numbplayerjoined($hand) "1" putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 You have joined the game" if {$numbcounter == "2"} { putchan $ortegachan "\0032<=\0034 Numbers \0032=>\0035 The maximum of 2 players has been reached. The game will begin soon." set numbjoin "0" } if {$numbjoin != "1"} { return 0 } } } else { set usermoney [ort_getusermoney $hand] if {$usermoney < "1"} { putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 Sorry, you need to have more then\00312 0,-\0035 to play Numbers." return 0 } set numbjoin "1" set numbcounter "1" set numbplayers($numbcounter) "$hand" set numbnicks($numbcounter) "$nick" set numbplayerjoined($hand) "1" putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 You have started and joined the game. Players can join for another minute." utimer 19 "set numbbusy 1" utimer 20 ort_numbstart } } } proc ort_numbstart {} { global ortegachan numbjoin numbbusy numbplayers numbcounter numbmoney numbplayerjoined playernumbs numbnicks if {$numbcounter == "1"} { putchan $ortegachan "\0032<=\0034 Numbers \0032=>\0035 You can't play on your own." unset numbplayers unset numbplayerjoined unset numbnicks unset numbjoin unset numbbusy unset numbcounter return 0 } putchan $ortegachan "\0032<=\0034 Numbers \0032=>\0035 Game started. You will now receive your personal random number..." set newplayers "1" while {$newplayers <= $numbcounter} { set tempnumb [expr [rand 100] + 1] puthelp "NOTICE $numbnicks($newplayers) :Your number is\002 $tempnumb\002!" set playernumbs($newplayers) "$tempnumb" incr newplayers } utimer 10 ort_numbround } proc ort_numbround {} { global ortegachan numbjoin numbbusy numbplayers numbcounter numbmoney currentnumbplayer numbgo cnb numbnicks set startplayer [expr [rand $numbcounter] + 1] set cnb "0" set numbmoney "0" putchan $ortegachan "\0032<=\0034 Numbers \0032=>\0035 Betting has begun. The first to put up a bet is\00312 $numbnicks($startplayer)\0035. Use\00312 !nbet \0035to control the game." set currentnumbplayer "$startplayer" set numbgo "1" utimer 30 ort_nonumb } proc ort_nonumb {} { global ortegachan numbjoin numbbusy numbplayers numbcounter numbmoney currentnumbplayer numbgo cnb playernumbs numbplayerjoined numbnicks putchan $ortegachan "\0032<=\0034 Numbers \0032=>\00312 $numbplayers($currentnumbplayer) \0035didn't respond quickly enough! Your numbers were:" if {$currentnumbplayer == "1"} { set nw "2" } else { set nw "1" } putchan $ortegachan "\0032<=\0034 Numbers \0032=>\00312 $numbplayers(1): $playernumbs(1) \0035|\00312 $numbplayers(2): $playernumbs(2)" set usermoney [ort_getusermoney $numbplayers($nw)] set newusermoney [expr $usermoney + $numbmoney] ort_newusermoney $numbplayers($nw) $newusermoney putchan $ortegachan "\0032<=\0034 Numbers \0032=>\0035 The winner is\00312 $numbplayers($nw)\0035! You won\00312 $numbmoney,- \0035!" unset numbplayers unset numbplayerjoined unset numbnicks unset numbjoin unset numbbusy unset numbcounter unset numbmoney unset numbgo unset cnb unset playernumbs } proc ort_numb {nick host hand chan arg} { global ortegachan numbjoin numbbusy numbplayers numbcounter numbmoney currentnumbplayer numbgo cnb playernumbs numbplayerjoined numbnicks if {$hand == $numbplayers($currentnumbplayer) && $numbgo == "1"} { foreach j [utimers] { if {[lindex $j 1] == "ort_nonumb"} { killutimer [lindex $j 2] } } set action "[lindex $arg 0]" if {$action == "raise"} { set usermoney [ort_getusermoney $numbplayers($currentnumbplayer)] set amount [lindex $arg 1] set camount [expr $amount + $cnb] if {$amount < "1" || $camount > $usermoney} { putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 Sorry, you can't place negative bets or you don't have enough money to raise the bet. You currently have\00312 $usermoney\0035,-" return 0 } if {$currentnumbplayer == "1"} { set onp "2" } else { set onp "1" } set othermoney [ort_getusermoney $numbplayers($onp)] if {$amount > $othermoney} { putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 Sorry, the other player doesn't have that much money. You can only raise the bet by\00312 $othermoney,- \0035." return 0 } set newusermoney [expr $usermoney - $cnb] ort_newusermoney $hand $newusermoney set numbmoney [expr $numbmoney + $cnb] set cnb "$amount" set numbmoney [expr $numbmoney + $amount] set usermoney [ort_getusermoney $numbplayers($currentnumbplayer)] set newusermoney [expr $usermoney - $amount] ort_newusermoney $hand $newusermoney if {$currentnumbplayer == "1"} { set nnp "2" } else { set nnp "1" } set currentnumbplayer $nnp putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 You have raised the bet with\00312 $cnb,- \0035bringing the total to\00312 $numbmoney,- \0035!\00312 $numbnicks($nnp) \0035may now take action." utimer 30 ort_nonumb return 0 } if {$action == "pass"} { if {$cnb == "0"} { putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 Sorry, you can't pass yet, the bet is still at\00312 0,- \0035!" return 0 } putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 You have passed. Your numbers were:" putchan $ortegachan "\0032<=\0034 Numbers \0032=>\00312 $numbplayers(1): $playernumbs(1) \0035|\00312 $numbplayers(2): $playernumbs(2)" if {$currentnumbplayer == "1"} { set nw "2" } else { set nw "1" } set usermoney [ort_getusermoney $numbplayers($nw)] set newusermoney [expr $usermoney + $numbmoney] ort_newusermoney $numbplayers($nw) $newusermoney putchan $ortegachan "\0032<=\0034 Numbers \0032=>\0035 The winner is\00312 $numbplayers($nw)\0035! You won\00312 $numbmoney,- \0035!" unset numbplayers unset numbplayerjoined unset numbnicks unset numbjoin unset numbbusy unset numbcounter unset numbmoney unset numbgo unset cnb unset playernumbs return 0 } if {$action == "call"} { if {$cnb == "0"} { putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 Sorry, you can't call yet, the bet is still at\00312 0,- \0035!" return 0 } set usermoney [ort_getusermoney $numbplayers($currentnumbplayer)] set numbmoney [expr $numbmoney + $cnb] set newusermoney [expr $usermoney - $cnb] putchan $ortegachan "\0032<=\0034 Numbers : $nick \0032=>\0035 You have called the bet. Your numbers were:" putchan $ortegachan "\0032<=\0034 Numbers \0032=>\00312 $numbplayers(1): $playernumbs(1) \0035|\00312 $numbplayers(2): $playernumbs(2)" if {$playernumbs(1) == $playernumbs(2)} { putchan $ortegachan "\0032<=\0034 Numbers \0032=>\0035 It's a draw! You will both get your money back." set pp [expr $numbmoney / 2] set usermoney [ort_getusermoney $numbplayers(1)] set othermoney [ort_getusermoney $numbplayers(2)] set newusermoney [expr $usermoney + $pp] set newothermoney [expr $othermoney + $pp] ort_newusermoney $numbplayers(1) $newusermoney ort_newusermoney $numbplayers(2) $newothermoney unset numbplayers unset numbplayerjoined unset numbnicks unset numbjoin unset numbbusy unset numbcounter unset numbmoney unset numbgo unset cnb unset playernumbs return 0 } if {$playernumbs(1) < $playernumbs(2)} { set nw "2" } else { set nw "1" } set usermoney [ort_getusermoney $numbplayers($nw)] set newusermoney [expr $usermoney + $numbmoney] ort_newusermoney $numbplayers($nw) $newusermoney putchan $ortegachan "\0032<=\0034 Numbers \0032=>\0035 The winner is\00312 $numbplayers($nw)\0035! You won\00312 $numbmoney,- \0035!" unset numbplayers unset numbplayerjoined unset numbnicks unset numbjoin unset numbbusy unset numbcounter unset numbmoney unset numbgo unset cnb unset playernumbs return 0 } } } proc ort_aldi {nick host hand chan arg} { global ortegachan aldibusy aldimoney aldibet aldiuser aldibets if {[info exists aldibusy]} { return 0 } else { set aldibusy "1" } set aldibet "0" set aldiuser $hand set aldibets "1" set randmoney [rand 2] if {$randmoney == "0"} { set maxmoney "100" } else { set maxmoney "1000" } set percent [expr [rand 1000] + 1] set aldimoney [expr $maxmoney * $percent] putchan $ortegachan "\0032<=\0034 Aldi Auction \0032=>\0035 You started the Aldi Auction game! The first bid in the game is\00312 $aldibet \0035from\00312 $aldiuser\0035." set randtimer [rand 31] set alditimer [expr 30 + $randtimer] utimer $alditimer ort_aldidone } proc ort_aldibet {nick host hand chan arg} { global ortegachan aldibusy aldibet aldiuser aldibets if {[info exists aldibusy]} { if {$hand != $aldiuser} { set newbet [lindex $arg 0] if {$newbet != ""} { if {$newbet < "1" || $newbet > "1000000"} { putchan $ortegachan "\0032<=\0034 Aldi Auction : $nick \0032=>\0035 Your bet was NOT counted because you can't place negative bets or above the maximum bid of\00312 1000000,- \0035." return 0 } if {$newbet <= $aldibet} { putchan $ortegachan "\0032<=\0034 Aldi Auction : $nick \0032=>\0035 Your bet was NOT counted because you were below the current bid of\00312 $aldibet,- \0035." return 0 } set usermoney [ort_getusermoney $hand] if {$usermoney < $newbet} { putchan $ortegachan "\0032<=\0034 Aldi Auction : $nick \0032=>\0035 Sorry, you don't enough money. You currently have\00312 $usermoney,- \0035." return 0 } set aldibet $newbet set aldiuser $hand putchan $ortegachan "\0032<=\0034 Aldi Auction : $nick \0032=>\0035 The current bid is\00312 $aldibet,- \0035by\00312 $hand\0035." incr aldibets } } } } proc ort_aldidone {} { global ortegachan aldibusy aldimoney aldibet aldiuser aldibets if {$aldibets < "5"} { putchan $ortegachan "\0032<=\0034 Aldi Auction \0032=>\0035 The minimum amount of bets (4) was not reached. Try getting others to play with you or make a smaller starting bid." unset aldibusy unset aldimoney unset aldibet unset aldiuser unset aldibets return 0 } set usermoney [ort_getusermoney $aldiuser] set newusermoney [expr $usermoney - $aldibet] set anewusermoney [expr $newusermoney + $aldimoney] ort_newusermoney $aldiuser $anewusermoney putchan $ortegachan "\0032<=\0034 Aldi Auction : Auction Closed \0032=>\0035 The auction has been closed. The last bid of\00312 $aldibet,- \0035was made by\00312 $aldiuser\0035. And the item you played for was worth..." if {$aldibet >= $aldimoney} { putchan $ortegachan "\0032<=\0034 Aldi Auction : Item Worth \0032=> \0035...\00312 $aldimoney,- \0035. Too bad!" } else { putchan $ortegachan "\0032<=\0034 Aldi Auction : Item Worth \0032=> \0035...\00312 $aldimoney,- \0035. Congratulations!" } unset aldibusy unset aldimoney unset aldibet unset aldiuser unset aldibets } proc ort_getchancecards {hand} { set oir [open scripts/ortega/inventory.ort r] set bodyguards "0" while {[gets $oir templine] >= 0} { if {[lindex $templine 0] == $hand} { set bodyguards [lindex $templine 2] } } close $oir return $bodyguards } proc ort_setchancecards {hand setting} { set oir [open scripts/ortega/inventory.ort r] set oie [open scripts/ortega/inventory.ort.tmp w] while {[gets $oir templine] >= 0} { if {[lindex $templine 0] == $hand} { puts $oie "[lrange $templine 0 1] $setting [lrange $templine 3 end]" } else { puts $oie "$templine" } } close $oir close $oie exec mv scripts/ortega/inventory.ort.tmp scripts/ortega/inventory.ort } proc ort_chancecard {nick host hand chan arg} { global ortegachan inprison set usercards [ort_getchancecards $hand] if {$usercards == "2"} { putchan $ortegachan "\0032<=\0034 Chance Cards : $nick \0032=>\0035 Sorry, you've already used two chance cards today." return 0 } set checkpoints [ort_getuserpoints $hand] if {$checkpoints < 100} { putchan $ortegachan "\0032<=\0034 Chance Cards : $nick \0032=>\0035 Sorry, you need at least a 100 points to use chance cards." return 0 } set newcards [expr $usercards + 1] putchan $ortegachan "\0032<=\0034 Chance Cards : $nick \0032=>\0035 Your chance card:" set card [rand 7] if {$card == "0"} { set prisontime [expr [rand 60] + 1] set inprison($hand) "1" timer $prisontime "unset inprison($hand)" putchan $ortegachan "\0032<=\0034 Chance Cards : $nick \0032=>\00312 In Prison For Free Card\0035! You're in prison for the next\00312 $prisontime\0035 minutes!" ort_setchancecards $hand $newcards ort_writespecial "$hand used a chance card and got an In Prison For Free Card and will have to spend the next $prisontime minutes in prison!" return 0 } if {$card == "1"} { set userpoints [ort_getuserpoints $hand] set randpoints [expr [rand 2] + 1] set newuserpoints [expr $userpoints + $randpoints] ort_newuserpoints $hand $newuserpoints putchan $ortegachan "\0032<=\0034 Chance Cards : $nick \0032=>\00312 Free Points Card\0035! You got\00312 $randpoints \0035free point(s)!" ort_setchancecards $hand $newcards ort_writespecial "$hand used a chance card and got a Free Points Card containing $randpoints free point(s)!" return 0 } if {$card == "2"} { set usermoney [ort_getusermoney $hand] set randmoney [expr [rand 400000] + 1] set newusermoney [expr $usermoney + $randmoney] ort_newusermoney $hand $newusermoney putchan $ortegachan "\0032<=\0034 Chance Cards : $nick \0032=>\00312 Free Money Card\0035!\00312 $randmoney,- \0035has been added to your account!" ort_setchancecards $hand $newcards ort_writespecial "$hand used a chance card and got a Free Money Card containing $randmoney,- !" return 0 } if {$card == "3"} { set usermoney [ort_getusermoney $hand] set percent [expr [rand 10] + 1] set randtempmoney [expr $usermoney / 100] set lostmoney [expr $randtempmoney * $percent] set newusermoney [expr $usermoney - $lostmoney] ort_newusermoney $hand $newusermoney putchan $ortegachan "\0032<=\0034 Chance Cards : $nick \0032=>\00312 Taxes Card\0035!\00312 $lostmoney,- \0035has been removed from your account!" ort_setchancecards $hand $newcards ort_writespecial "$hand used a chance card and got a Taxes Card for which he had to give $lostmoney,- !" return 0 } if {$card == "4"} { ort_extraoc $hand putchan $ortegachan "\0032<=\0034 Chance Cards : $nick \0032=>\00312 Free OC Card\0035! If you've already performed and OC today, you (and your partner) can now do another one!" ort_setchancecards $hand $newcards ort_writespecial "$hand used a chance card and got a Free OC Card!" } if {$card == "5"} { ort_setbodyguards $hand 1 putchan $ortegachan "\0032<=\0034 Chance Cards : $nick \0032=>\00312 Free Bodyguards Card\0035! If you didn't have any bodyguards, you do now!" ort_setchancecards $hand $newcards ort_writespecial "$hand used a chance card and got a Free Bodyguards Card!" } if {$card == "6"} { putchan $ortegachan "\0032<=\0034 Chance Cards : $nick \0032=>\00312 Free Chance Card\0035! You've got another free chance card for use today!" set newcards [expr $usercards - 1] ort_setchancecards $hand $newcards ort_writespecial "$hand used a chance card and got a Free Chance Card!" return 0 } } proc ort_riddlebonus {nick host hand arg} { set orr [open scripts/ortega/riddle.ort r] set hasgotten "0" while {[gets $orr templine] >= 0} { if {[lindex $templine 0] == $hand} { set hasgotten "1" } } close $orr if {$hasgotten == "0"} { set usermoney [ort_getusermoney $hand] set newusermoney [expr $usermoney + 20000000] ort_newusermoney $hand $newusermoney set userpoints [ort_getuserpoints $hand] set newuserpoints [expr $userpoints + 200] ort_newuserpoints $hand $newuserpoints set ora [open scripts/ortega/riddle.ort a] puts $ora $hand close $ora putserv "PRIVMSG $nick :\0032<=\0034 Ortega : $nick \0032=>\0035 You have now collected your bonus points!" } }