Kain2030

Troll Mode - v1.1

Sep 3rd, 2013
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.54 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.1"
  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 lastSpamEmote = 0
  160.  
  161. local phrase = {}
  162. local lastPhrase = nil
  163. local lastInsult = nil
  164. local lastCoach = nil
  165. local lastCoachKDA = nil
  166.  
  167. local lastKills = nil
  168. local lastDeaths = nil
  169. local lastAssists = nil
  170. local lastKDA = nil
  171.  
  172. function OnLoad()
  173.     Menu()
  174.     LoadMyHeroPhrases()
  175.     PrintChat(" >> Troll Mode loaded!")
  176. end
  177.  
  178. function Menu()
  179.     TrollModeConfig = scriptConfig("Troll Mode - "..version, "Troll Mode")
  180.     TrollModeConfig:addParam("sep", "----- [ Emote ] -----", SCRIPT_PARAM_INFO, "")
  181.     TrollModeConfig:addParam("info", "Joke      (Ctrl+1)",  SCRIPT_PARAM_INFO, "")
  182.     TrollModeConfig:addParam("info", "Taunt     (Ctrl+2)", SCRIPT_PARAM_INFO, "")
  183.     TrollModeConfig:addParam("info", "Dance   (Ctrl+3)", SCRIPT_PARAM_INFO, "")
  184.     TrollModeConfig:addParam("info", "Laugh   (Ctrl+4)", SCRIPT_PARAM_INFO, "")
  185.     TrollModeConfig:addParam("sep", "----- [ Emote Spam ] -----", SCRIPT_PARAM_INFO, "")
  186.     TrollModeConfig:addParam("SpamLaugh", "Spam Laugh", SCRIPT_PARAM_ONOFF, false)
  187.     TrollModeConfig:addParam("SpamJoke", "Spam Joke",  SCRIPT_PARAM_ONOFF, false)
  188.     TrollModeConfig:addParam("SpamTaunt", "Spam Taunt", SCRIPT_PARAM_ONOFF, false)
  189.     TrollModeConfig:addParam("SpamFrequency", "Spam Frequency", SCRIPT_PARAM_SLICE, 3, 1, 60, 0)
  190.     TrollModeConfig:addParam("sep", "----- [ Chat ] -----", SCRIPT_PARAM_INFO, "")
  191.     TrollModeConfig:addParam("Insult", "Random Insult  (F5)", SCRIPT_PARAM_ONKEYDOWN, false, 116) -- F5
  192.     TrollModeConfig:addParam("SpellChat", "Spell Chat", SCRIPT_PARAM_ONOFF, true)
  193.     TrollModeConfig:addParam("EnableInsults", "Enable Insults", SCRIPT_PARAM_ONOFF, true)
  194.     TrollModeConfig:addParam("PersonalCoach", "Personal Coach", SCRIPT_PARAM_ONOFF, true)
  195.     TrollModeConfig:addParam("ChatThrottle", "Spell Chat Throttle", SCRIPT_PARAM_ONOFF, false)
  196.     TrollModeConfig:addParam("ChatThrottleFrequency", "Throttle Min. Seconds", SCRIPT_PARAM_SLICE, 120, 1, 600, 0)
  197. end
  198.  
  199. function LoadMyHeroPhrases()
  200.     for i = 1, #SpellPhrases, 1 do
  201.         if myHero.charName == SpellPhrases[i].name then
  202.             table.insert(phrase, SpellPhrases[i])
  203.         end
  204.     end
  205. end
  206.  
  207. function OnTick()
  208.     if myHero.dead then return end
  209.  
  210.     if TrollModeConfig.SpellChat and phrase ~= nil then
  211.         CheckSpellPhrases()
  212.     end
  213.  
  214.     if TrollModeConfig.EnableInsults and TrollModeConfig.Insult then
  215.         Insult()
  216.     end
  217.  
  218.     if TrollModeConfig.PersonalCoach then
  219.         Coach()
  220.     end
  221.  
  222.     if TrollModeConfig.SpamLaugh or TrollModeConfig.SpamJoke or TrollModeConfig.SpamTaunt then
  223.         SpamEmote()
  224.     end
  225. end
  226.  
  227. function SpamEmote()
  228.     if (GetTickCount() - lastSpamEmote) > (TrollModeConfig.SpamFrequency * 1000) then
  229.         lastSpamEmote = GetTickCount()
  230.         myHero:MoveTo(mousePos.x, mousePos.z)
  231.  
  232.         if TrollModeConfig.SpamLaugh then SendChat("/l") end
  233.         if TrollModeConfig.SpamJoke then SendChat("/j") end
  234.         if TrollModeConfig.SpamTaunt then SendChat("/t") end
  235.     end
  236. end
  237.  
  238. function Coach()
  239.     if not lastKills or not lastDeaths or not lastAssists or not lastKDA then
  240.         lastCoach = 0
  241.         CoachSay("Have a good game!")
  242.         lastKills = 0
  243.         lastDeaths = 0
  244.         lastAssists = 0
  245.         lastKDA = 0
  246.  
  247.         return
  248.     end
  249.  
  250.     if lastCoach and GetTickCount() < (lastCoach + (30 * 1000)) then return end
  251.  
  252.     local deaths = nil
  253.     if myHero.deaths > 0 then
  254.         deaths = myHero.deaths
  255.     else
  256.         deaths = 1
  257.     end
  258.  
  259.     local kda = (myHero.kills + (myHero.assists / 2)) / deaths
  260.  
  261.     if not lastCoachKDA or (GetTickCount() > (lastCoachKDA + (60 * 1000))) then
  262.         if kda > lastKDA then
  263.             if kda > 3.0 then
  264.                 SendCoachPhrase("kda", 3)
  265.             elseif kda > 2.0 then
  266.                 SendCoachPhrase("kda", 2)
  267.             end
  268.         elseif kda < lastKDA then
  269.             if kda < .5 then
  270.                 SendCoachPhrase("kda", -3)
  271.             elseif kda < 0.8 then
  272.                 SendCoachPhrase("kda", -2)
  273.             end
  274.         end
  275.     end
  276.  
  277.     if myHero.kills > lastKills then
  278.         if myHero.kills > 8 then
  279.             SendCoachPhrase("kill", 3)
  280.         elseif myHero.kills > 4 then
  281.             SendCoachPhrase("kill", 2)
  282.         else
  283.             SendCoachPhrase("kill", 1)
  284.         end
  285.     end
  286.  
  287.     if myHero.deaths > lastDeaths then
  288.         if myHero.deaths > 8 then
  289.             SendCoachPhrase("death", 3)
  290.         elseif myHero.deaths > 4 then
  291.             SendCoachPhrase("death", 2)
  292.         else
  293.             SendCoachPhrase("death", 1)
  294.         end
  295.     end
  296.  
  297.     if myHero.assists > lastAssists then
  298.         if myHero.assists > 8 then
  299.             SendCoachPhrase("assist", 3)
  300.         elseif myHero.assists > 4 then
  301.             SendCoachPhrase("assist", 2)
  302.         else
  303.             SendCoachPhrase("assist", 1)
  304.         end
  305.     end
  306.  
  307.     lastKills = myHero.kills
  308.     lastDeaths = myHero.deaths
  309.     lastAssists = myHero.assists
  310.     lastKDA = kda
  311. end
  312.  
  313. function SendCoachPhrase(event, severity)
  314.     if #CoachPhrases == 0 then
  315.         PrintChat("Coach phrase library is empty!")
  316.         return
  317.     end
  318.  
  319.     local count = 0
  320.  
  321.     -- Find number of applicable phrases.
  322.     for i = 1, #CoachPhrases, 1 do
  323.         if CoachPhrases[i].event == event and CoachPhrases[i].severity == severity then
  324.             count = count + 1
  325.         end
  326.     end
  327.  
  328.         -- Find number of applicable phrases.
  329.     for i = 1, #CoachPhrases, 1 do
  330.         if CoachPhrases[i].event == event and CoachPhrases[i].severity == severity then
  331.             count = count + 1
  332.         end
  333.     end
  334.  
  335.     -- Send chosen phrase.
  336.     if count == 0 then return end
  337.  
  338.     local index = 1
  339.     if count > 1 then
  340.         index = math.random(1, count)
  341.     end
  342.  
  343.     local foundCount = 0
  344.     for i = 1, #CoachPhrases, 1 do
  345.         if CoachPhrases[i].event == event and CoachPhrases[i].severity == severity then
  346.             if count == 1 then
  347.                 lastCoach = GetTickCount()
  348.                 if event == "kda" then lastCoachKDA = GetTickCount() end
  349.                 CoachSay(CoachPhrases[i].chat)
  350.                 break
  351.             elseif count > 1 then
  352.                 foundCount = foundCount + 1
  353.                 if foundCount == index then
  354.                     lastCoach = GetTickCount()
  355.                     if event == "kda" then lastCoachKDA = GetTickCount() end
  356.                     CoachSay(CoachPhrases[i].chat)
  357.                     break
  358.                 end
  359.             end
  360.         end
  361.     end
  362. end
  363.  
  364. function CoachSay(chat)
  365.     PrintChat("Coach says, \""..chat.."\"")
  366. end
  367.  
  368. function UpdateCoachInfo()
  369.  
  370. end
  371.  
  372. function CheckSpellPhrases()
  373.     if TrollModeConfig.ChatThrottle and lastPhrase and GetTickCount() < (lastPhrase + (TrollModeConfig.ChatThrottleFrequency * 1000)) then return end
  374.  
  375.     if myHero:CanUseSpell(_Q) == READY then alertedQ = false end
  376.     if myHero:CanUseSpell(_W) == READY then alertedW = false end
  377.     if myHero:CanUseSpell(_E) == READY then alertedE = false end
  378.     if myHero:CanUseSpell(_R) == READY then alertedR = false end
  379.  
  380.     if myHero:CanUseSpell(_Q) == COOLDOWN and not alertedQ then
  381.         alertedQ = true
  382.         SendPhrase(_Q)
  383.     end
  384.  
  385.     if myHero:CanUseSpell(_W) == COOLDOWN and not alertedW then
  386.         alertedW = true
  387.         SendPhrase(_W)
  388.     end
  389.  
  390.     if myHero:CanUseSpell(_E) == COOLDOWN and not alertedE then
  391.         alertedE = true
  392.         SendPhrase(_E)
  393.     end
  394.  
  395.     if myHero:CanUseSpell(_R) == COOLDOWN and not alertedR then
  396.         alertedR = true
  397.         SendPhrase(_R)
  398.     end
  399. end
  400.  
  401. function Insult()
  402.     if #InsultPhrases == 0 then
  403.         PrintChat("Insult library is empty!")
  404.         return
  405.     end
  406.  
  407.     if lastInsult and GetTickCount() < (lastInsult + 1000) then return end
  408.  
  409.     local index = math.random(1, #InsultPhrases)
  410.     lastInsult = GetTickCount()
  411.     SendChatMessage(InsultPhrases[index])
  412. end
  413.  
  414. function SendPhrase(spell)
  415.     if #SpellPhrases == 0 then
  416.         PrintChat("Spell phrase library is empty!")
  417.     end
  418.  
  419.     if #phrase == 0 then
  420.         return
  421.     end
  422.  
  423.     local count = 0
  424.  
  425.     -- Find number of applicable phrases.
  426.     for i = 1, #phrase, 1 do
  427.         if phrase[i].spell == spell then
  428.             count = count + 1
  429.         end
  430.     end
  431.  
  432.     -- Send chosen phrase.
  433.     if count == 0 then return end
  434.  
  435.     local index = 1
  436.     if count > 1 then
  437.         index = math.random(1, count)
  438.     end
  439.  
  440.     local foundCount = 0
  441.     for i = 1, #phrase, 1 do
  442.         if phrase[i].spell == spell then
  443.             if count == 1 then
  444.                 lastPhrase = GetTickCount()
  445.                 SendChatMessage(phrase[i].chat)
  446.                 break
  447.             elseif count > 1 then
  448.                 foundCount = foundCount + 1
  449.                 if foundCount == index then
  450.                     lastPhrase = GetTickCount()
  451.                     SendChatMessage(phrase[i].chat)
  452.                     break
  453.                 end
  454.             end
  455.         end
  456.     end
  457. end
  458.  
  459. function SendChatMessage(chat)
  460.     SendChat("/t")
  461.     SendChat("/all "..chat)
  462. end
Advertisement
Add Comment
Please, Sign In to add comment