Kain2030

Troll Mode - v1.0

Aug 17th, 2013
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.77 KB | None | 0 0
  1. --[[
  2. Troll Mode
  3. by Kain
  4. Copyright 2013
  5.  
  6.  
  7.         \|||/      
  8.          (o o)      
  9. ,----ooO--(_)-------.
  10. | Please            |
  11. |   don't feed the  |
  12. |     TROLL's !     |
  13. '--------------Ooo--'
  14.         |__|__|      
  15.          || ||      
  16.         ooO Ooo  
  17.  
  18. --]]
  19.  
  20. if myHero == nil then myHero = GetMyHero() end
  21.  
  22. local version = "1.0"
  23.  
  24. local InsultPhrases = {
  25.     -- Add new insults below.
  26.     "All your base are belong to us!",
  27.     "Hey, you have something on your chin... 3rd one down...",
  28.     "Your birth certificate is an apology from the condom factory.",
  29.     "Shut up, you'll never be the man your mother is!",
  30.     "You must be the arithmetic man; you add trouble, subtract pleasure, divide attention, and multiply ignorance.",
  31.     "You must have been born on a highway cuz that is where most accidents happen.",
  32.     "It looks like your face caught on fire and someone tried to put it out with a fork.",
  33.     "Your mom is a heifer!",
  34.     "You're so ugly Hello Kitty said goodbye to you.",
  35.     "The beetles will feed on your eyes. The worms will crawl through your lungs. The rain will fall on your rotting skin... until nothing is left of your but bones.",
  36.     "You play like a girl.",
  37.     "You're so ugly that when your mama dropped you off at school she got a fine for littering.",
  38.     "You so stupid, you think a black hole is a racial insult.",
  39.     "There are some things money can't buy. In your case, it'd be a life.",
  40.     "Jesus loves you, but he's the only one who does.",
  41.     "First time with that champion?",
  42.     "If you were twice as smart, you'd still be stupid.",
  43.     "Your momma so fat she has to wear two watches because she covers two time zones.",
  44.     "Do you still love nature... despite what it did to you?",
  45.     "You have a face like a granny being made to eat a turd at gunpoint.",
  46.     "You are a thoroughly uncouth and uncharismatic gentleman. GOOD DAY SIR!",
  47.     "You fight like a cow.",
  48.     "I hear when you were a child your mother wanted to hire somebody to take care of you, but the mafia wanted too much.",
  49.     "Why don’t you shut up and give that hole in your face a chance to heal.",
  50.     "We all sprang from apes, but you didn't spring far enough.",
  51.     "You think you're strong. You only smell strong.",
  52.     "Out of 100,000 sperm, you were the fastest?",
  53.     "You didn't fall out of the stupid tree. You got drug through dumbass forest.",
  54.     "You're so ugly, when you popped out the doctor said awe what a treasure and your mom said yeah lets bury it.",
  55.     "Why don't you slip into something more comfortable? Like a coma.",
  56.     "You couldn't hit water if you fell out of a boat.",
  57.     "Your mom must have a really loud bark!",
  58.     "Your Mother is so dumb, she got hit by a cup and said she got mugged.",
  59.     "Yo momma so fat, she had to be baptized in Sea World.",
  60.     "Your mom's so ugly she made Chuck Norris have a heart attack.",
  61.     "If you said what you thought, you'd be speechless.",
  62.     "You're so fat you need cheat codes to play Wii Fit.",
  63.     "If you really want to know about mistakes you should ask your parents.",
  64.     "You so dumb, you thought a quarterback was a refund.",
  65.     "The only thing that goes erect when I'm near you is my middle finger.",
  66.     "Yo momma's like mayonnaise; she spreads easy.",
  67.     "Your mother was an hamster, and your father smelt of elderberries!",
  68.     "Your wife said she liked seafood. So I gave her crabs.",
  69.     "You have a face only a mother could love.",
  70.     "I refuse to have a battle of wits with an unarmed man.",
  71.     "Yo momma's so fat, she's got more chins thin a chinese phone book.",
  72.     "The only positive thing about you is your HIV status.",
  73.     "With a face like yours, I wish I was blind."
  74. }
  75.  
  76. local SpellPhrases = {
  77.     -- Add new phrases below.
  78.     {name="Annie", spell = _R, chat="KATTIBERS!!!"},
  79.     {name="Blitzcrank", spell = _Q, chat="YOINK!"},
  80.     {name="Blitzcrank", spell = _R, chat="QUIET!!"},
  81.     {name="Caitlyn", spell = _R, chat="BOOM, HEADSHOT!!"},
  82.     {name="Corki", spell = _R, chat="BOOM, HEADSHOT!!"},
  83.     {name="Chogath", spell = _R, chat="NOM NOM NOM"},
  84.     {name="Darius", spell = _R, chat="GET DUNKED, SON!"},
  85.     {name="Draven", spell = _R, chat="This whole thing is Draven me crazy!"},
  86.     {name="DrMundo", spell = _R, chat="MUNDO GO WHERE HE PLEASES"},
  87.     {name="Garen", spell = _R, chat="DEMACIA!!!"},
  88.     {name="Irelia", spell = _R, chat="That's totally Ireliavent."},
  89.     {name="Karthus", spell = _R, chat="KABOOM!!!"},
  90.     {name="Katarina", spell = _R, chat="SPIN 2 WIN!!!"},
  91.     {name="Lux", spell = _R, chat="I'M FIRIN' MY LAZAR!!!"},
  92.     {name="Lux", spell = _R, chat="This lux like it's gonna get ugly..."},
  93.     {name="MasterYi", spell = _Q, chat="Like a ninja..."},
  94.     {name="Nidalee", spell = _Q, chat="Javelin to the face!"},
  95.     {name="Pantheon", spell = _R, chat="This is SPARTA!!!"},
  96.     {name="Skarner", spell = _R, chat="Illegal parking!"},
  97.     {name="Singed", spell = _E, chat="How about an acid bath... muahahaha!"},
  98.     {name="Singed", spell = _R, chat="Oh, did I singe your eyebrows?"},
  99.     {name="Sona", spell = _R, chat="Dance, Dance, Baby Tonight!"},
  100.     {name="Twitch", spell = _R, chat="You guys make me Twitch with anger..."},
  101.     {name="Thresh", spell = _Q, chat="Get over here!"},
  102.     {name="Tryndamere", spell = _R, chat="I'M TRYNDAQUEER! AHAHAHHA"},
  103.     {name="Vladimir", spell = _W, chat="TROLOLOLOLOL"},
  104.     {name="Vladimir", spell = _R, chat="You Vlad, bro?"},
  105.     {name="Zed", spell = _W, chat="That's what she Zed!"},
  106.     {name="Zilean", spell = _W, chat="Time flies like arrow, fruit flies like banana."},
  107.     {name="Ziggs", spell = _R, chat="Mega Bomb!"},
  108.  
  109.     -- Example of how to add new champions or phrases.
  110.     -- The format is crucial. The script will break with formatting mistakes.
  111.     {name="Example", spell = _Q, chat="Phrase 1"},
  112.     {name="Example", spell = _Q, chat="Phrase 2"},
  113.     {name="Example", spell = _Q, chat="Phrase 3"},
  114.     {name="Example", spell = _W, chat="Phrase 4"},
  115.     {name="Example", spell = _W, chat="Phrase 5"},
  116.     {name="Example", spell = _R, chat="Phrase 6"}
  117. }
  118.  
  119. local CoachPhrases = {
  120.     -- Add new coach phrases below.
  121.     -- In the case of kda, a positive severity means good, and a negative severity means bad.
  122.     {event="kill",   severity=1,  chat="Good job."},
  123.     {event="death",  severity=1,  chat="Shake it off."},
  124.     {event="kill",   severity=1,  chat="Nice."},
  125.     {event="death",  severity=1,  chat="Try again."},
  126.     {event="kill",   severity=2,  chat="A little streak here?"},
  127.     {event="death",  severity=2,  chat="You are better than this."},
  128.     {event="kill",   severity=3,  chat="Farm their ass!"},
  129.     {event="death",  severity=3,  chat="C'mon, get more kills!"},
  130.     {event="kill",   severity=3,  chat="Farm their ass!"},
  131.     {event="kill",   severity=3,  chat="Killing spree!"},
  132.     {event="kill",   severity=3,  chat="You're doing great!"},
  133.     {event="kill",   severity=3,  chat="You going pro yet?"},
  134.     {event="death",  severity=3,  chat="You quitting yet?"},
  135.     {event="death",  severity=3,  chat="Embarassing."},
  136.     {event="death",  severity=3,  chat="Seriously?"},
  137.     {event="death",  severity=3,  chat="Cry me a river."},
  138.     {event="assist", severity=2,  chat="Nice assist."},
  139.     {event="assist", severity=3,  chat="Great supporting!"},
  140.     {event="kda",    severity=1,  chat="You're off to a good start."},
  141.     {event="kda",    severity=-1, chat="Not the best start."},
  142.     {event="kda",    severity=2,  chat="Good work."},
  143.     {event="kda",    severity=2,  chat="Doing well!"},
  144.     {event="kda",    severity=-2, chat="Eh, you need to spend more time practicing."},
  145.     {event="kda",    severity=-2, chat="Fail."},
  146.     {event="kda",    severity=3,  chat="You're pwning those nubs."},
  147.     {event="kda",    severity=3,  chat="Smashing job."},
  148.     {event="kda",    severity=3,  chat="Killer instincts!"},
  149.     {event="kda",    severity=-3, chat="Baddy, you need to just surrender already."},
  150.     {event="kda",    severity=-3, chat="Just save yourself some trouble and uninstall LoL."},
  151.     {event="kda",    severity=-3, chat="Time to get in more bot games."}
  152. }
  153.  
  154. alertedQ = false
  155. alertedW = false
  156. alertedE = false
  157. alertedR = false
  158.  
  159. local phrase = {}
  160. local lastPhrase = nil
  161. local lastInsult = nil
  162. local lastCoach = nil
  163. local lastCoachKDA = nil
  164.  
  165. local lastKills = nil
  166. local lastDeaths = nil
  167. local lastAssists = nil
  168. local lastKDA = nil
  169.  
  170. function OnLoad()
  171.     Menu()
  172.     LoadMyHeroPhrases()
  173.     PrintChat(" >> Troll Mode loaded!")
  174. end
  175.  
  176. function Menu()
  177.     TrollModeConfig = scriptConfig("Troll Mode - "..version, "Troll Mode")
  178.     TrollModeConfig:addParam("Insult", "Random Insult  (F5)", SCRIPT_PARAM_ONKEYDOWN, false, 116) -- F5
  179.     TrollModeConfig:addParam("Laugh", "Laugh          (F6)", SCRIPT_PARAM_ONKEYDOWN, false, 117) -- F6
  180.     TrollModeConfig:addParam("Dance", "Dance          (F7)", SCRIPT_PARAM_ONKEYDOWN, false, 118) -- F7
  181.     TrollModeConfig:addParam("Taunt", "Taunt          (F8)", SCRIPT_PARAM_ONKEYDOWN, false, 119) -- F8
  182.     TrollModeConfig:addParam("Joke", "Joke           (F10)", SCRIPT_PARAM_ONKEYDOWN, false, 121) -- F10
  183.     TrollModeConfig:addParam("SpellChat", "Spell Chat", SCRIPT_PARAM_ONOFF, true)
  184.     TrollModeConfig:addParam("EnableInsults", "Enable Insults", SCRIPT_PARAM_ONOFF, true)
  185.     TrollModeConfig:addParam("PersonalCoach", "Personal Coach", SCRIPT_PARAM_ONOFF, true)
  186.     TrollModeConfig:addParam("ChatThrottle", "Spell Chat Throttle", SCRIPT_PARAM_ONOFF, false)
  187.     TrollModeConfig:addParam("ChatThrottleFrequency", "Throttle Min. Seconds", SCRIPT_PARAM_SLICE, 120, 1, 600, 0)
  188. end
  189.  
  190. function LoadMyHeroPhrases()
  191.     for i = 1, #SpellPhrases, 1 do
  192.         if myHero.charName == SpellPhrases[i].name then
  193.             table.insert(phrase, SpellPhrases[i])
  194.         end
  195.     end
  196. end
  197.  
  198. function OnTick()
  199.     if myHero.dead then return end
  200.  
  201.     if TrollModeConfig.SpellChat and phrase ~= nil then
  202.         CheckSpellPhrases()
  203.     end
  204.  
  205.     if TrollModeConfig.EnableInsults and TrollModeConfig.Insult then
  206.         Insult()
  207.     end
  208.  
  209.     if TrollModeConfig.PersonalCoach then
  210.         Coach()
  211.     end
  212.  
  213.     if TrollModeConfig.Dance then SendChat("/dance") end
  214.     if TrollModeConfig.Taunt then SendChat("/t") end
  215.     if TrollModeConfig.Laugh then SendChat("/l") end
  216.     if TrollModeConfig.Joke then SendChat("/j") end
  217. end
  218.  
  219. function Coach()
  220.     if not lastKills or not lastDeaths or not lastAssists or not lastKDA then
  221.         lastCoach = 0
  222.         CoachSay("Have a good game!")
  223.         lastKills = 0
  224.         lastDeaths = 0
  225.         lastAssists = 0
  226.         lastKDA = 0
  227.  
  228.         return
  229.     end
  230.  
  231.     if lastCoach and GetTickCount() < (lastCoach + (30 * 1000)) then return end
  232.  
  233.     local deaths = nil
  234.     if myHero.deaths > 0 then
  235.         deaths = myHero.deaths
  236.     else
  237.         deaths = 1
  238.     end
  239.  
  240.     local kda = (myHero.kills + (myHero.assists / 2)) / deaths
  241.  
  242.     if not lastCoachKDA or (GetTickCount() > (lastCoachKDA + (60 * 1000))) then
  243.         if kda > lastKDA then
  244.             if kda > 3.0 then
  245.                 SendCoachPhrase("kda", 3)
  246.             elseif kda > 2.0 then
  247.                 SendCoachPhrase("kda", 2)
  248.             end
  249.         elseif kda < lastKDA then
  250.             if kda < .5 then
  251.                 SendCoachPhrase("kda", -3)
  252.             elseif kda < 0.8 then
  253.                 SendCoachPhrase("kda", -2)
  254.             end
  255.         end
  256.     end
  257.  
  258.     if myHero.kills > lastKills then
  259.         if myHero.kills > 8 then
  260.             SendCoachPhrase("kill", 3)
  261.         elseif myHero.kills > 4 then
  262.             SendCoachPhrase("kill", 2)
  263.         else
  264.             SendCoachPhrase("kill", 1)
  265.         end
  266.     end
  267.  
  268.     if myHero.deaths > lastDeaths then
  269.         if myHero.deaths > 8 then
  270.             SendCoachPhrase("death", 3)
  271.         elseif myHero.deaths > 4 then
  272.             SendCoachPhrase("death", 2)
  273.         else
  274.             SendCoachPhrase("death", 1)
  275.         end
  276.     end
  277.  
  278.     if myHero.assists > lastAssists then
  279.         if myHero.assists > 8 then
  280.             SendCoachPhrase("assist", 3)
  281.         elseif myHero.assists > 4 then
  282.             SendCoachPhrase("assist", 2)
  283.         else
  284.             SendCoachPhrase("assist", 1)
  285.         end
  286.     end
  287.  
  288.     lastKills = myHero.kills
  289.     lastDeaths = myHero.deaths
  290.     lastAssists = myHero.assists
  291.     lastKDA = kda
  292. end
  293.  
  294. function SendCoachPhrase(event, severity)
  295.     if #CoachPhrases == 0 then
  296.         PrintChat("Coach phrase library is empty!")
  297.         return
  298.     end
  299.  
  300.     local count = 0
  301.  
  302.     -- Find number of applicable phrases.
  303.     for i = 1, #CoachPhrases, 1 do
  304.         if CoachPhrases[i].event == event and CoachPhrases[i].severity == severity then
  305.             count = count + 1
  306.         end
  307.     end
  308.  
  309.         -- Find number of applicable phrases.
  310.     for i = 1, #CoachPhrases, 1 do
  311.         if CoachPhrases[i].event == event and CoachPhrases[i].severity == severity then
  312.             count = count + 1
  313.         end
  314.     end
  315.  
  316.     -- Send chosen phrase.
  317.     if count == 0 then return end
  318.  
  319.     local index = 1
  320.     if count > 1 then
  321.         index = math.random(1, count)
  322.     end
  323.  
  324.     local foundCount = 0
  325.     for i = 1, #CoachPhrases, 1 do
  326.         if CoachPhrases[i].event == event and CoachPhrases[i].severity == severity then
  327.             if count == 1 then
  328.                 lastCoach = GetTickCount()
  329.                 if event == "kda" then lastCoachKDA = GetTickCount() end
  330.                 CoachSay(CoachPhrases[i].chat)
  331.                 break
  332.             elseif count > 1 then
  333.                 foundCount = foundCount + 1
  334.                 if foundCount == index then
  335.                     lastCoach = GetTickCount()
  336.                     if event == "kda" then lastCoachKDA = GetTickCount() end
  337.                     CoachSay(CoachPhrases[i].chat)
  338.                     break
  339.                 end
  340.             end
  341.         end
  342.     end
  343. end
  344.  
  345. function CoachSay(chat)
  346.     PrintChat("Coach says, \""..chat.."\"")
  347. end
  348.  
  349. function UpdateCoachInfo()
  350.  
  351. end
  352.  
  353. function CheckSpellPhrases()
  354.     if TrollModeConfig.ChatThrottle and lastPhrase and GetTickCount() < (lastPhrase + (TrollModeConfig.ChatThrottleFrequency * 1000)) then return end
  355.  
  356.     if myHero:CanUseSpell(_Q) == READY then alertedQ = false end
  357.     if myHero:CanUseSpell(_W) == READY then alertedW = false end
  358.     if myHero:CanUseSpell(_E) == READY then alertedE = false end
  359.     if myHero:CanUseSpell(_R) == READY then alertedR = false end
  360.  
  361.     if myHero:CanUseSpell(_Q) == COOLDOWN and not alertedQ then
  362.         alertedQ = true
  363.         SendPhrase(_Q)
  364.     end
  365.  
  366.     if myHero:CanUseSpell(_W) == COOLDOWN and not alertedW then
  367.         alertedW = true
  368.         SendPhrase(_W)
  369.     end
  370.  
  371.     if myHero:CanUseSpell(_E) == COOLDOWN and not alertedE then
  372.         alertedE = true
  373.         SendPhrase(_E)
  374.     end
  375.  
  376.     if myHero:CanUseSpell(_R) == COOLDOWN and not alertedR then
  377.         alertedR = true
  378.         SendPhrase(_R)
  379.     end
  380. end
  381.  
  382. function Insult()
  383.     if #InsultPhrases == 0 then
  384.         PrintChat("Insult library is empty!")
  385.         return
  386.     end
  387.  
  388.     if lastInsult and GetTickCount() < (lastInsult + 1000) then return end
  389.  
  390.     local index = math.random(1, #InsultPhrases)
  391.     lastInsult = GetTickCount()
  392.     SendChatMessage(InsultPhrases[index])
  393. end
  394.  
  395. function SendPhrase(spell)
  396.     if #SpellPhrases == 0 then
  397.         PrintChat("Spell phrase library is empty!")
  398.     end
  399.  
  400.     if #phrase == 0 then
  401.         return
  402.     end
  403.  
  404.     local count = 0
  405.  
  406.     -- Find number of applicable phrases.
  407.     for i = 1, #phrase, 1 do
  408.         if phrase[i].spell == spell then
  409.             count = count + 1
  410.         end
  411.     end
  412.  
  413.     -- Send chosen phrase.
  414.     if count == 0 then return end
  415.  
  416.     local index = 1
  417.     if count > 1 then
  418.         index = math.random(1, count)
  419.     end
  420.  
  421.     local foundCount = 0
  422.     for i = 1, #phrase, 1 do
  423.         if phrase[i].spell == spell then
  424.             if count == 1 then
  425.                 lastPhrase = GetTickCount()
  426.                 SendChatMessage(phrase[i].chat)
  427.                 break
  428.             elseif count > 1 then
  429.                 foundCount = foundCount + 1
  430.                 if foundCount == index then
  431.                     lastPhrase = GetTickCount()
  432.                     SendChatMessage(phrase[i].chat)
  433.                     break
  434.                 end
  435.             end
  436.         end
  437.     end
  438. end
  439.  
  440. function SendChatMessage(chat)
  441.     SendChat("/t")
  442.     SendChat("/all "..chat)
  443. end
Advertisement
Add Comment
Please, Sign In to add comment