- Joined
- Jul 25, 2007
- Messages
- 382
- Reaction score
- 38
Aqua Teen Hunger Force
I was filling in random filler script and I typed "rise chicken, rise".. so I had to make this real fast. It's just for some laughs really.
I was filling in random filler script and I typed "rise chicken, rise".. so I had to make this real fast. It's just for some laughs really.
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
local function length(t)
local count = 0
for key in pairs(t) do
count = count + 1
end
return count
end
local function selectText(list, size)
local selection = math.ceil(math.random(1, size))
return list[selection]
end
npcHandler:setMessage(MESSAGE_GREET, "I am Sofa King, chicken rise." )
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talk = {
"Rise chicken, chicken rise.",
"Chicken rise.",
"Chicken rise, chicken rise."
}
if msg then
selfSay(selectText(talk, length(talk)))
end
if msgcontains(msg, "chicken") then
doSummonCreature("Chicken", getCreaturePosition(cid))
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Sofa King" script="data/npc/scripts/chicken.lua" walkinterval="1900" floorchange="0">
<health now="100" max="100"/>
<look type="154" head="94" body="94" legs="1" feet="94" addons="3"/>
</npc>