daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Sep 13th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on *:load: {
  2.   write rpg.txt
  3. }
  4.  
  5. on *:connect:{
  6.   hload -i rpg.ini
  7. }
  8. on *:TEXT:.register:*: {
  9.   else {
  10.     inc %rpgreg 1
  11.     notice $nick Your name is now registered!
  12.     hmake $nick
  13.     hadd $nick cash 500
  14.     hadd $nick atk 5
  15.     hadd $nick def 5
  16.     hadd $nick atk_mod 0
  17.     hadd $nick def_mod 0
  18.     hadd $nick points 0
  19.     hadd $nick level 1
  20.     hadd $nick health 100
  21.     hsave -i $nick rpg.ini $hget($nick,name)
  22.     write rpg.text %rpgreg
  23.     write rpg.txt $nick $2
  24.     msg %channel Welcome to RPG, $2
  25.     notice $nick Type .help for a list of commands.
  26.   }
  27. }
  28. on *:text:.buy*:%channel: {
  29.   if !$hget($nick) {
  30.     notice $nick .register
  31.   }
  32.   elseif $hget($nick,jail) {
  33.     msg $chan You can't do that while in jail, $nick!
  34.   }
  35.   else {
  36.     if !$2 {
  37.       notice $nick Shops: Armor;  Weapon
  38.       halt
  39.     }
  40.     elseif $2 = armor {
  41.       notice $nick Armors: Bulletproof Vest [bpvest] 200 - Sheild [sheild] 500
  42.     }
  43.     elseif $2 = weapon {
  44.       notice $nick Weapons: Machette [machette] 250 - Glock [glock] 500 - Bat [bat] 100 - Chainsaw [chainsaw] 750
  45.     }
  46.   }
  47.   elseif $2 !isnum {
  48.     notice $nick .buy <amount> <item>
  49.     halt
  50.   }
  51.   ;########### ARMORS ###########
  52.  
  53.   if $2 isnum && $3 == bpvest {
  54.     var %cash $calc($2 * 200)
  55.     if $hget($nick,cash) >= %cash {
  56.       hadd $nick cash $calc($hget($nick,cash) - %cash)
  57.       hadd $nick bp_vest $calc($hget($nick,bp_vest) + $2)
  58.       hadd $nick def_mod $calc($hget($nick,def_mod) + (2 * $2))
  59.       hadd $nick atk_mod $calc($hget($nick,atk_mod) + (1 * $2))
  60.       msg $chan $nick buys $2 Bulletproof Vest.
  61.     }
  62.   }
  63.   elseif $2 isnum && $3 == sheild {
  64.     var %cash $calc($2 * 500)
  65.     if $hget($nick,cash) >= %cash {
  66.       hadd $nick cash $calc($hget($nick,chas) - %cash)
  67.       hadd $nick sheild  $calc($hget($nick,sheild) + $2)
  68.       hadd $nick def_mod $calc($hget($nick,def_mod) + (4 * $2))
  69.       hadd $nick atk_mod $calc($hget($nick,atk_mod) + (1 * $2))
  70.       msg $chan $nick buys $2 Sheild.
  71.     }
  72.   }
  73.  
  74.   ;########### WEAPONS ###########
  75.  
  76.   elseif $2 isnum && $3 == machette {
  77.     var %cash $calc($2 * 250)
  78.     if $hget($nick,cash) >= %cash {
  79.       hadd $nick cash $calc($hget($nick,cash) - %cash)
  80.       hadd $nick machette $calc($hget($nick,machette) + $2)
  81.       hadd $nick def_mod $calc($hget($nick,def_mod) + (1 * $2))
  82.       hadd $nick atk_mod $calc($hget($nick,atk_mod) + (3 * $2))
  83.       msg $chan $nick buys $2 Machette.
  84.     }
  85.   }
  86.   elseif $2 isnum && $3 == glock {
  87.     var %cash $calc($2 * 500)
  88.     if $hget($nick,cash) >= %cash {
  89.       hadd $nick cash $calc($hget($nick,cash) - %cash)
  90.       hadd $nick glock $calc($hget($nick,glock) + $2)
  91.       hadd $nick def_mod $calc($hget($nick,def_mod) + (2 * $2))
  92.       hadd $nick atk_mod $calc($hget($nick,atk_mod) + (4 * $2))
  93.       msg $chan $nick buys $2 Glock.
  94.     }
  95.   }
  96.   elseif $2 isnum && $3 == bat {
  97.     var %cash $calc($2 * 100)
  98.     if $hget($nick,cash) >= %cash {
  99.       hadd $nick cash $calc($hget($nick,cash) - %cash)
  100.       hadd $nick bat $calc($hget($nick,bat) + $2)
  101.       hadd $nick def_mod $calc($hget($nick,def_mod) + (1 * $2))
  102.       hadd $nick atk_mod $calc($hget($nick,atk_mod) + (2 * $2))
  103.       msg $chan $nick buys $2 bat
  104.     }
  105.   }
  106.   elseif $2 isnum && $3 == chainsaw {
  107.     var %cash $calc($2 * 750)
  108.     if $hget($nick,cash) >= %cash {
  109.       hadd $nick cash $calc($hget($nick,cash) - %cash)
  110.       hadd $nick chainsaw $calc($hget($nick,chainsaw) + $2)
  111.       hadd $nick def_mod $calc($hget($nick,def_mod) + (1 * $2))
  112.       hadd $nick atk_mod $calc($hget($nick,atk_mod) + (6 * $2))
  113.       msg $chan $nick buys $2 chainsaw.
  114.     }
  115.   }
  116.   elseif $2 isnum && $3 == admin_hammer {
  117.     var %cash $calc($2 * 99999)
  118.     if $hget($nick,cash) >= %cash {
  119.       hadd $nick cash $calc($hget($nick,cash) - %cash)
  120.       hadd $nick admin_hammer $calc($hget($nick,admin_hammer) + $2)
  121.       hadd $nick def_mod $calc($hget($nick,def_mod) + (9999 * $2))
  122.       hadd $nick atk_mod $calc($hget($nick,atk_mod) + (9999 * $2))
  123.       msg $chan $nick buys $2 admin_hammer.
  124.     }
  125.   }
  126. }
  127. on *:text:.attack*:%channel:{
  128.   if !$hget($nick) {
  129.     .notice $nick .register
  130.     halt
  131.   }
  132.   elseif $hget($nick,jail) {
  133.     .notice $nick You cannot do that while in jail.
  134.   }
  135.   elseif $hget($nick,attack) {
  136.   }
  137.   elseif !$2 {
  138.     notice $nick .attack <nick>
  139.   }
  140.   elseif ($hget($2,protect) == on) {
  141.     notice $nick $2 is protected! He cannot be attacked!
  142.   }
  143.   elseif ($hget($nick,protect) == on) {
  144.     notice $nick You cannot attack while protected! <.protect off>
  145.   }
  146.   elseif ($2 == $nick) {
  147.     notice $nick You cannot attack yourself!
  148.   }
  149.   elseif ($hget($nick,cash) <= 0) {
  150.     hadd $nick cash 0
  151.   }
  152.   elseif ($hget($nick,health) <= 0) {
  153.     hadd $nick health 0
  154.   }
  155.   elseif ($hget($nick,health) == 0) {
  156.     notice $nick You cannot attack while dead!
  157.   }
  158.   elseif ($hget($2,health) == 0) {
  159.     notice $nick $2 is dead! You cannot attack him!
  160.   }
  161.   else {
  162.     var %atk.calc $calc($hget($nick,atk) + $hget($nick,atk_mod) + ($hget($nick,level) * 1.5) + $rand(1,9))
  163.     var %def.calc $calc($hget($2,def) + $hget($2,def_mod) + ($hget($2,level) * 1.5) + $rand(1,9))
  164.     hadd -z $nick attack 5
  165.     if %atk.calc > %def.calc {
  166.       var %h $calc(%atk.calc - %def.calc)
  167.       if (%h <= 0) {
  168.         var %h $calc((%atk.calc - %def.calc) + $rand(1,5)
  169.       }
  170.       var %a $floor($calc($hget($2,cash) / $rand(5,10)))
  171.       if (%a <= 0) {
  172.         var %c $calc(%a - %a - %a)
  173.       }
  174.       hadd $2 cash $calc($hget($2,cash) - %a)
  175.       hadd $2 health $calc($hget($2,health) - %h)
  176.       hadd $nick cash $calc($hget($2,cash) + %a)
  177.       msg $chan $hget($nick,name) defeats $hget($2,name) in battle, stealing $ $+ %a $+ . Dealing %h damage!
  178.     }
  179.     else {
  180.       var %g $calc(%def.calc - %atk.calc)
  181.       var %c $floor($calc($hget($nick,cash) / $rand(5,10)))
  182.       if (%c <= 0) {
  183.         var %c $calc(%c - %c - %c)
  184.       }
  185.       elseif (%g <= 0) {
  186.         var %g $calc((%def.calc - %atk.calc) + $rand(1,5)
  187.       }
  188.       hadd $nick cash $calc($hget($nick,cash) - %c)
  189.       hadd $2 cash $calc($hget($2,cash) + %c)
  190.       hadd $nick health $calc($hget($nick,health) - %g)
  191.       msg $chan $hget($2,name) defeats $hget($nick,name) in battle, stealing $ $+ %c $+ . Dealing %g damage!
  192.     }
  193.   }
  194. }
  195. on *:TEXT:.protect*:%channel: {
  196.   if !$2 {
  197.     notice $nick .protect <on/off>
  198.   }
  199.   else {
  200.     if ($nick isop %channel) {
  201.       if ($2 == on) {
  202.         hadd $nick protect on
  203.         msg $chan $nick protects himself!
  204.       }
  205.       elseif ($2 == off) {
  206.         hadd $nick protect off
  207.         msg $chan $nick unprotects himself!
  208.       }
  209.     }
  210.   }
  211. }
  212. on *:text:.stats*:%channel:{
  213.   if !$hget($nick) {
  214.     notice $nick .register
  215.     halt
  216.   }
  217.   elseif ($2 == $null) {
  218.     notice $nick [Level: $+($hget($nick,level),]) [Cash: $+($chr(36),$bytes($hget($nick,cash),b),]) $&
  219.       [Attack: $+($hget($nick,atk),]) [Defense: $+($hget($nick,def),]) [Points: $+($hget($nick,points),]) $&
  220.       [Attack Bonus: $+($hget($nick,atk_mod),]) [Defense Bonus: $+($hget($nick,def_mod),]) [Health: $+($hget($nick,health),])
  221.   }
  222.   else {
  223.     notice $nick [Level: $+($hget($2,level),]) [Cash: $+($chr(36),$bytes($hget($2,cash),b),]) $&
  224.       [Attack: $+($hget($2,atk),]) [Defense: $+($hget($2,def),]) [Points: $+($hget($2,points),]) $&
  225.       [Attack Bonus: $+($hget($2,atk_mod),]) [Defense Bonus: $+($hget($2,def_mod),]) [Health: $+($hget($2,health),])
  226.   }
  227. }
  228. on *:TEXT:.give*:%channel: {
  229.   if ($nick == $readini(mine.ini,rpg,admins)) {
  230.     hadd $2 $3 $4
  231.     msg $chan $nick gives $2 $3 $4!
  232.   }
  233. }
  234. on *:TEXT:.heal:%channel: {
  235.   if ($hget($nick,healing) == $null) {
  236.     if ($hget($nick,health) <= 0) {
  237.       hadd $nick health 100
  238.       hadd -z $nick healing 600
  239.       msg $chan $nick restores their health to 100!
  240.     }
  241.     else {
  242.       notice $nick you can't heal if you still have health!
  243.     }
  244.   }
  245.   else {
  246.     notice $nick You can only heal once every 10 minutes!
  247.   }
  248. }
  249.  
  250. on *:TEXT:.system reset:%channel: {
  251.   if ($nick == $readini(mine.ini,rpg,admins)) {
  252.     set %logs 1
  253.     hfree -w *
  254.     msg %channel 4System Reset by $nick
  255.     write -l $+ %logs resets.txt $date $time by $nick
  256.     inc %logs 1
  257.   }
  258. }
  259. on *:TEXT:.logs*:%channel: {
  260.   if ($2 == resets) {
  261.     var %ab 1
  262.     while (%ab <= %logs) {
  263.       msg $chan $read(resets.txt, %ab)
  264.       inc %ab 1
  265.     }
  266.   }
  267.   elseif ($2 == saves) {
  268.     var %ac 1
  269.     while (%ac <= %saves) {
  270.       msg $chan $read(saves.txt, %ac)
  271.       inc %ac 1
  272.     }
  273.   }
  274. }
  275. on *:TEXT:.admin*:%channel: {
  276.   if ($nick == RipIt) {
  277.     writeini mine.ini rpg admins $2
  278.     msg $chan $2 has been given admin powers by $nick $+ !
  279.   }
  280. }
  281. on *:TEXT:.help*:%channel: {
  282.   if !$2 {
  283.     notice $nick .help <.register,.attack,.buy,.stats>
  284.   }
  285.   elseif ($2 == .register) {
  286.     notice $nick <.register>  
  287.   }
  288.   elseif ($2 == .attack) {
  289.     notice $nick <.attack <nick>> attacks <nick>
  290.   }
  291.   elseif ($2 == .buy) {
  292.     notice $nick <.buy <item>> Type .buy <weapon/armor> to find out the selections.
  293.   }
  294.   elseif ($2 == .stats) {
  295.     notice $nick <.stats <nick>> Type .stats to figure out your own stats, or type .stats <nick> to find out <nicks> stats!
  296.   }
  297. }
  298. on *:TEXT:.save:%channel: {
  299.   if ($readini(mine.ini,rpg,admins) == $nick) {
  300.     set %save 1
  301.     hsave -i rpg.ini
  302.     msg %channel 4System Saved by $nick
  303.     write -l $+ %save saves.txt $date $time by $nick
  304.     inc %saves 1
  305.   }
  306. }
  307. ;############## Spam Stoppper #############
  308. on *:TEXT:*:#cookies: {
  309.   inc -u3 $+(%,flood.,$nick)
  310.   if ($($+(%,flood.,$nick),2) > 5) {
  311.     if ($readini(mine.ini,$nick,spam) == $null) {
  312.       writeini mine.ini $nick spam 1
  313.       notice $nick This is your spam warning!
  314.     }
  315.     elseif ($readini(mine.ini,$nick,spam) == 1) {
  316.       writeini mine.ini $nick spam 2
  317.       kick $chan $nick Spam
  318.     }
  319.     elseif ($readini(mine.ini,$nick,spam) > 1 && $readini(mine.ini,$nick,spam) < 3) {
  320.       writeini mine.ini $nick spam 3
  321.       kick $chan $nick Spam! Ban Length - 5 Minutes
  322.       mode $chan +b $nick
  323.       timer $+ $nick 1 300 mode $chan -b $nick
  324.     }
  325.     elseif ($readini(mine.ini,$nick,spam) => 3) {
  326.       kick $chan $nick Spamming! Ban Length - Permanent
  327.       mode $chan +b $nick
  328.     }
  329.   }
  330. }
  331. ;################## Mod Controls ##################
  332. on *:Text:*:%channel: {
  333.   if ($nick isop %channel) {
  334.     if ($1 == !kb) { mode $active +b $address($2,2) || kick $active $2 }
  335.     elseif ($1 == !unban) { mode $active -b $address($2,2) }  
  336.     elseif ($1 == !tkb) { ban -u $+ $3 $chan $2 || kick $chan $2 $4- }
  337.     elseif ($1 == !whois) { whois $2 }
  338.     elseif ($1 == !aop) { cs aop $chan $2 $3 || /k $3 }
  339.     elseif ($1 == !sop) { cs sop $chan $2 $3 || kick # $3 }
  340.     elseif ($1 == !hop) { cs hop $chan $2 $3 || /k $3 }
  341.     elseif ($1 == !vop) { cs vop $chan $2 $3 || kick # $3 }
  342.     elseif ($1 == !op) { mode $chan +o $2 }
  343.     elseif ($1 == !deop) { mode $chan +o $2 }
  344.     elseif ($1 == !ban) { mode $active +b $address($$2,2) }
  345.     elseif ($1 == !calc) { timercalc 1 1 msg $active $calc($2-) }
  346.   }
  347. }
RAW Paste Data
Top