Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ ### Talk Like a Pirate for Halo! ###]]--
- --[[ ### by H® Shaft for Phasor v2+ ###]]--
- -- EDITED 9/26/2014 corrected small error, re-download this it will work fine
- game_started = false
- plfm = {}
- plfm[1] = "Yo ho, yo ho, a pirate's life for me,"
- plfm[2] = "We pillage plunder, we rifle and loot,"
- plfm[3] = "Drink up me hearties, yo ho!"
- plfm[4] = "We kidnap and ravage and don't give a hoot,"
- plfm[5] = "Drink up me hearties, yo ho!"
- plfm[6] = "Yo ho, yo ho, a pirate's life for me!"
- plfm[7] = "We extort and pilfer, we filch and sack,"
- plfm[8] = "Drink up me hearties, yo ho!"
- plfm[9] = "Maraud and embezzle and even highjack,"
- plfm[10] = "Drink up me hearties, yo ho!"
- plfm[11] = "We're rascals and scoundrels, we're villains and knaves,"
- plfm[12] = "Drink up me hearties, yo ho!"
- plfm[13] = "We're devils and black sheep, we're really bad eggs"
- plfm[14] = "Drink up me hearties, yo ho!"
- next_verse = 0
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(process, game, persistent)
- next_verse = 0
- game_started = true
- end
- function OnNewGame(map)
- next_verse = 0
- game_started = true
- end
- function OnPlayerJoin(player)
- if getplayer(player) and game_started then
- welcome = registertimer(6000, "piratewelcome", player)
- end
- end
- function OnPlayerLeave(player)
- if getplayer(player) and game_started then
- local insult = generateinsult(insult)
- for i=0,15 do
- if getplayer(i) and player ~= i then
- privatesay(i, "Arrrg! That " .. insult .. " has gone to swab the poop-deck! ")
- privatesay(i, "(I bet ye 10 coins he sniffs the mop!)")
- end
- end
- end
- end
- function piratewelcome(id, count, player)
- if game_started then
- if getplayer(player) then
- local newpirate = getname(player)
- local welcomemessage = generatewelcome(welcome)
- privatesay(player,"Ahoy! " .. newpirate .. "! " .. welcomemessage)
- privatesay(player, "Tis 'Talk like a Pirate Day! type ARG to announce yer presence!")
- privatesay(player, "If ye like me rum and wenches and desire to sing, type YOHO")
- end
- end
- return false
- end
- function OnServerChat(player, type, message)
- local response = nil
- if player then
- name = getname(player)
- hash = gethash(player)
- local pirate = generateadverbinsult(adverbinsult)
- local pirateinsult = generateinsult(insult)
- local obj = generateobject(object)
- if string.lower(message) == "aarrg" or string.lower(message) == "arrg" or string.lower(message) == "arrrg" or string.lower(message) == "arg" then
- response = false
- say("That " .. pirate .. " " .. name .. " says: Ye are a " .. pirateinsult .. "!")
- return response
- end
- if string.lower(message) == "lol" or string.lower(message) == "rofl" or string.lower(message) == "haha" or
- string.lower(message) == "hehe" or string.lower(message) == "jaja" then
- response = false
- say(name .. " says: AVAST! Ye tickled me " .. obj .. "!")
- return response
- end
- if string.lower(message) == "gg" then
- response = false
- say(name .. " says: Twas a fine game! Have some of me rum!")
- return response
- end
- if string.lower(message) == "yoho" then
- response = false
- if next_verse ~= 0 then
- privatesay(player, "Pirates Life for Me already playing, wait until it's complete")
- goto SKIPIT
- else
- if next_verse == 0 then
- next_verse = 1
- say(name .. " says: Yo ho me hearties! Sing me a tune!")
- sayverse = registertimer(2400, "SayVerse")
- end
- end
- ::SKIPIT::
- return response
- end
- end
- return response
- end
- function OnPlayerKill(killer, victim, mode)
- local response = false
- if mode == 4 then
- local killedmsg = generatekilltype(killslang)
- if getplayer(victim) then
- if getplayer(killer) ~= nil then
- say(getname(killer) .. " sent " .. getname(victim) .. " to " .. killedmsg .. "!")
- end
- end
- response = false
- else
- response = true
- end
- return response
- end
- function OnGameEnd(stage)
- local pirateinsult = generateinsult(insult)
- if stage == 1 then
- game_started = false
- elseif stage == 2 then
- for i=0,15 do
- if getplayer(i) then
- privatesay(i, "AARG! Ye play halo like a " .. pirateinsult .. "!")
- privatesay(i, "Yoho! yoho! a pirates life for me! Is all the rum gone?!")
- end
- end
- end
- end
- function generateinsult(insult)
- local adjectivecount = #adjective
- local adverbcount = #adverb
- local nouncount = #noun
- local rand_adjective = getrandomnumber(1, adjectivecount+1)
- local rand_adverb = getrandomnumber(1, adverbcount+1)
- local rand_noun = getrandomnumber(1, nouncount+1)
- local insult = string.format("%s, %s, %s", adjective[rand_adjective], adverb[rand_adverb], noun[rand_noun])
- if insult then
- return insult
- else
- return "villainous, clapper-flapped, slag-bucket"
- end
- end
- function generatesmallinsult(smallinsult)
- local nouncount = #noun
- local rand_noun = getrandomnumber(1, nouncount+1)
- local smallinsult = string.format("%s!", noun[rand_noun])
- if smallinsult then
- return smallinsult
- else
- return "seaman-barnacle"
- end
- end
- function generatewelcome(welcome)
- local adverbcount = #adverb
- local pronouncount = #pronoun
- local rand_adverb = getrandomnumber(1, adverbcount+1)
- local rand_pronoun = getrandomnumber(1, pronouncount+1)
- local welcome = string.format("welcome ye %s pirate! join us %s !", adverb[rand_adverb], pronoun[rand_pronoun])
- if welcome then
- return welcome
- else
- return "welcome ye weather-bitten pirate! join us Swashbucklers!"
- end
- end
- function generatekilltype(killslang)
- local killcount = #killtype
- local kill_verb = getrandomnumber(1, killcount+1)
- local kill_type = string.format("%s", killtype[kill_verb])
- if kill_type then
- return kill_type
- else
- return "swab the poop-deck"
- end
- end
- function generateadverbinsult(adverbinsult)
- local adverbcount = #adverb
- local rand_adverb = getrandomnumber(1, adverbcount+1)
- local adverbinsult = string.format("%s", adverb[rand_adverb])
- if adverbinsult then
- return adverbinsult
- else
- return "clapper-flapped"
- end
- end
- function generateobject(object)
- local objcount = #object
- local rand_obj = getrandomnumber(1, objcount+1)
- local object = string.format("%s!", object[rand_obj])
- if object then
- return object
- else
- return "mudhole"
- end
- end
- function SayVerse(id, count)
- if next_verse ~= 0 and game_started then
- for i=0,15 do
- if getplayer(i) then
- sendconsoletext(i, plfm[next_verse], 2, 0)
- end
- end
- next_verse = next_verse + 1
- end
- if next_verse ~= 0 and next_verse < 15 and game_started then
- return true
- elseif next_verse > 14 then
- next_verse = 0
- return false
- end
- end
- adjective = {"toothless", "yellow", "drunken", "ugly", "unsightly", "hideous", "repulsive", "revolting", "nasty", "clouded",
- "unpleasant", "gutless", "cowardly", "scurvy", "bamboozling", "barbarous", "blagueuring", "bloody", "bumbooing", "clinkering",
- "jibless", "gangly", "dismasted", "dowsing", "foundering", "fouled", "mangy", "gafooning", "gibbeting", "tainted", "stinking",
- "soiled", "rank", "sullied", "polluted", "befouled", "infected", "adulterated", "swinely", "hornswoggling", "inbred", "lubbering",
- "oderous", "offwardly", "scuttling", "skiffless", "slackarding", "slushy", "squallardly", "wretchous", "skanky", "cantankerous",
- "conceited", "smutty", "vile", "lousy", "grotty", "crude", "disgusting", "revolting", "wicked", "despicable", "sinister", "lazy",
- "ugly", "clumsy", "ratty", "nasty", "scrawny", "dodgy", "stingy", "prickly", "horrible", "boring", "stupid", "creepy", "annoying",
- "motherless", "scurvy", "toothless", "hairless", "in-bred", "infected", "greasy", "pimply", "brainless", "fugly", "yawling",
- "bawdy", "beslubbering", "bootless", "churlish", "cockered", "dankish", "droning", "errant", "fobbing", "goatish", "logger-headed",
- "mewling", "paunchy", "roguish", "saucy", "ruttish", "spongy", "surly", "villainous", "yeasty", "warped", "goobellied" }
- adverb = {"bat-fowling", "beef-witted", "beetle-headed", "boil-brained", "clapper-flapped", "clay-brained", "cousin-kissing",
- "crook-shanked", "dismal-dreaming", "dizzy-eyed", "dog-hearted", "dread-bolted", "eye-vexing", "elf-skinned", "fat-kidneyed",
- "rectum-suckled", "flap-mouthed", "fly-bitten", "folly-fallen", "fool-born", "full-gorged", "guts-griping", "half-faced",
- "hasty-witted", "hedge-born", "hell-hated", "idle-headed", "ill-breeding", "ill-nurtured", "knotty-pated", "milk-livered",
- "motley-minded", "plume-plucked", "pox-marked", "reeling-ripe", "rough-hewn", "rude-growing", "rump-fed", "shard-borne", "sheep-biting",
- "spur-galled", "swag-bellied", "tardy-gaited", "tickle-brained", "toad-spotted", "unchin-snouted", "weather-bitten", "puss-guzzling",
- "flea-bitten", "slow-witted", "foul-smelling", "big-mouthed", "two-faced", "fool-hardy", "toilet-licking", "big-headed",
- "scruffy-looking", "keister-spelunking", "double-chinned", "gimp-goosing", "vomit-spewing", "cross-eyed", "bow-legged", "slack-jawed" }
- noun = {"barnacle", "bladder-puss", "boar-pig", "bum-bailey", "canker-blossom", "clack-dish", "clot-pole", "death-token",
- "flap-dragon", "flax-wench", "flirt-gill", "foot-licker", "fustilarian", "giglet", "gudgeon", "haggard", "harpy", "hedge-pig",
- "horn-beast", "lewdster", "lout", "maggot-pie", "malt-worm", "measle-wump", "miscreant", "nut-hook", "pigeon-fop", "pignut",
- "scat-muncher", "varlot", "vassal", "wagtail", "boar-tit", "turd-burglar", "goat-rapist", "slag-bucket", "syphilis-siphon",
- "yeasty-wench", "scabbard-swabber", "seaman-barnacle" }
- pronoun = {"rapscallions", "ruffians", "hearties", "zeerovers", "swashbucklers", "savvy-scudds", "powder-monkeys", "plundering-picaroons",
- "nautical-whimseys", "jack-tar marooners", "leeward-loons" }
- killtype = {"the watery deep", "Davey Jones' locker", "visit the shrimp", "the hellish bottom", "feed the fish", "walk the plank",
- "a watery grave", "visit Captain Nemo", "serve on the Black Pearl", "salute Blackbeards bones", "swab the poop-deck" }
- object = {"porthole", "backstay", "bilge-pump", "bitts", "bollard", "cofferdam", "dead-eye", "forebitt", "futtock", "holystone", "jackstaff",
- "mizzenmast", "outrigger", "rostrum", "spar", "timberhead", "topsail", "whipstaff", "nauty-bits" }
- -- Start sendconsoletext overloaded by Nugget
- console = {}
- console.__index = console
- consoletimer = registertimer(100, "ConsoleTimer")
- phasor_sendconsoletext = sendconsoletext
- function sendconsoletext(player, message, time, order, align, height, func)
- if player then
- console[player] = console[player] or {}
- local temp = {}
- temp.player = player
- temp.id = nextid(player, order)
- temp.message = message or ""
- temp.time = time or 0.7
- temp.remain = temp.time
- temp.align = align or "left"
- temp.height = height or 0
- if type(func) == "function" then
- temp.func = func
- elseif type(func) == "string" then
- temp.func = _G[func]
- end
- console[player][temp.id] = temp
- setmetatable(console[player][temp.id], console)
- return console[player][temp.id]
- end
- end
- function nextid(player, order)
- if not order then
- local x = 0
- for k,v in pairs(console[player]) do
- if k > x + 1 then
- return x + 1
- end
- x = x + 1
- end
- return x + 1
- else
- local original = order
- while console[player][order] do
- order = order + 0.001
- if order == original + 0.999 then break end
- end
- return order
- end
- end
- function getmessage(player, order)
- if console[player] then
- if order then
- return console[player][order]
- end
- end
- end
- function getmessages(player)
- return console[player]
- end
- function getmessageblock(player, order)
- local temp = {}
- for k,v in opairs(console[player]) do
- if k >= order and k < order + 1 then
- table.insert(temp, console[player][k])
- end
- end
- return temp
- end
- function console:getmessage()
- return self.message
- end
- function console:append(message, reset)
- if console[self.player] then
- if console[self.player][self.id] then
- if getplayer(self.player) then
- if reset then
- if reset == true then
- console[self.player][self.id].remain = console[self.player][self.id].time
- elseif tonumber(reset) then
- console[self.player][self.id].time = tonumber(reset)
- console[self.player][self.id].remain = tonumber(reset)
- end
- end
- console[self.player][self.id].message = message or ""
- return true
- end
- end
- end
- end
- function console:shift(order)
- local temp = console[self.player][self.id]
- console[self.player][self.id] = console[self.player][order]
- console[self.player][order] = temp
- end
- function console:pause(time)
- console[self.player][self.id].pausetime = time or 5
- end
- function console:delete()
- console[self.player][self.id] = nil
- end
- function ConsoleTimer(id, count)
- for i,_ in opairs(console) do
- if tonumber(i) then
- if getplayer(i) then
- for k,v in opairs(console[i]) do
- if console[i][k].pausetime then
- console[i][k].pausetime = console[i][k].pausetime - 0.1
- if console[i][k].pausetime <= 0 then
- console[i][k].pausetime = nil
- end
- else
- if console[i][k].func then
- if not console[i][k].func(i) then
- console[i][k] = nil
- end
- end
- if console[i][k] then
- console[i][k].remain = console[i][k].remain - 0.1
- if console[i][k].remain <= 0 then
- console[i][k] = nil
- end
- end
- end
- end
- if table.len(console[i]) > 0 then
- local paused = 0
- for k,v in pairs(console[i]) do
- if console[i][k].pausetime then
- paused = paused + 1
- end
- end
- if paused < table.len(console[i]) then
- local str = ""
- for i = 0,30 do
- str = str .. " \n"
- end
- phasor_sendconsoletext(i, str)
- for k,v in opairs(console[i]) do
- if not console[i][k].pausetime then
- if console[i][k].align == "right" or console[i][k].align == "center" then
- phasor_sendconsoletext(i, consolecenter(string.sub(console[i][k].message, 1, 78)))
- else
- phasor_sendconsoletext(i, string.sub(console[i][k].message, 1, 78))
- end
- end
- end
- end
- end
- else
- console[i] = nil
- end
- end
- end
- return true
- end
- function consolecenter(text)
- if text then
- local len = string.len(text)
- for i = len + 1, 78 do
- text = " " .. text
- end
- return text
- end
- end
- function opairs(t)
- local keys = {}
- for k,v in pairs(t) do
- table.insert(keys, k)
- end
- table.sort(keys,
- function(a,b)
- if type(a) == "number" and type(b) == "number" then
- return a < b
- end
- an = string.lower(tostring(a))
- bn = string.lower(tostring(b))
- if an ~= bn then
- return an < bn
- else
- return tostring(a) < tostring(b)
- end
- end)
- local count = 1
- return function()
- if table.unpack(keys) then
- local key = keys[count]
- local value = t[key]
- count = count + 1
- return key,value
- end
- end
- end
- function table.len(t)
- local count = 0
- for k,v in pairs(t) do
- count = count + 1
- end
- return count
- end
- -- Stop sendconsoletext overloaded
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement