Postado Fevereiro 27, 2012 13 anos Este é um post popular. Author: Maxwell Denisson (MaXwEllDeN) Testado em: TFS 0.3.6 <?xml version="1.0" encoding="UTF-8"?> <mod name="Max - Halloween Thriller" version="1.0" author="MaXwEllDeN" contact="[email protected]" enabled="yes"> <config name="MaXLIB"><![CDATA[ ]]></config> <globalevent name="Thriller Dance" type="start" event="script"><![CDATA[ --[[ Thriller Dance Author: Maxwell Denisson(MaXwEllDeN) Version: 1.0 ]] local coreo = {0, 0, 2, 2, "'Cause this is thriller, thriller night", {0, 2, 3, 1}, "And no one's gonna save you from the beast about to strike", 1, 1, 2, 0, 3, 3, {0, 2, 3, 1, 2, 0, 1, 2, 3, 0, 1, 2}} local figurino = {65, 68, 18, 311, 33} function getUidsInArea(ext1, ext2) -- By MaXwEllDeN local UiDes = {} for xiz = 0, ext2.x-ext1.x do for yiz = 0, ext2.y-ext1.y do local creature = getThingFromPos({x = ext1.x+xiz, y = ext1.y+yiz, z = ext1.z, stackpos = 255}).uid if (isCreature(creature)) then table.insert(UiDes, creature) end end end return UiDes end function printTableSX(aff) -- BETA ~ By MaXwEllDeN local s = "{" for a, b in pairs(aff) do if (type(b) == "table") then value = printTableSX(b) elseif (type(b) == "string") then value = '"'.. b .. '"' else value = b end s = s .. value .. ", " end s = "{" .. s:sub(2, #s) return (#s < 3) and "{}" or (s:sub(1, #s-2) .. "}") end local config = { interval = {say = 750, walk = 500, turn = 350} } function TeamWalk(cid, direction) if isCreature(cid) then local cp = getThingPos(cid) local ext1 = {x = cp.x-1, y = cp.y-1, z = cp.z} local ext2 = {x = cp.x+1, y = cp.y+1, z = cp.z} local creatures = getUidsInArea(ext1, ext2) for _, uid in pairs(creatures) do if not(isInArray(figurino, getCreatureOutfit(uid).lookType)) and (getCreatureOutfit(uid).lookType ~= 308) then doSetCreatureOutfit(uid, {lookType = figurino[math.random(#figurino)]}, 60*60*1000) end doMoveCreature(uid, direction) end addEvent(doCoreo, 150, cid) end end function TeamTurn(cid, turns) if (isCreature(cid)) then local function Turn(direction, n) if (n == #turns) then addEvent(doCoreo, 150, cid) end local cp = getThingPos(cid) local ext1 = {x = cp.x-1, y = cp.y-1, z = cp.z} local ext2 = {x = cp.x+1, y = cp.y+1, z = cp.z} local creatures = getUidsInArea(ext1, ext2) for _, uid in pairs(creatures) do if not(isInArray(figurino, getCreatureOutfit(uid).lookType)) and (getCreatureOutfit(uid).lookType ~= 308) then doSetCreatureOutfit(uid, {lookType = figurino[math.random(#figurino)]}, 60*60*1000) end doCreatureSetLookDir(uid, direction) end end for int, dir in pairs(turns) do addEvent(Turn, int*config.interval.turn, dir, int) end end end function Saysz(cid, val) doCreatureSay(cid, val, 19) addEvent(doCoreo, 150, cid) end local function StAR() local coreo_LZ = loadstring("return ".. printTableSX(coreo))() print("OKAY") local k = "Dancer" local w = "Michael Jackson" local area = {{k, k, k}, {k, w, k}, {k, k, k} } local ip = {x = 926, y = 1012, z = 7} for x = 1, #area do for y = 1, #area[x] do local pos = {x = ip.x+x-1, y = ip.y+y-1, z = ip.z, stackpos = 253} doSummonCreature(area[x][y], pos) end end local strZN = "" function doCoreo(uid) if not(isCreature(uid)) then return false end for in1, val in pairs(coreo_LZ) do if (type(val) == "number") then addEvent(TeamWalk, config.interval.walk, uid, val) elseif (type(val) == "table") then addEvent(TeamTurn, config.interval.turn, uid, val) elseif (type(val) == "string") then Saysz(uid, val) end table.remove(coreo_LZ, in1) break end strZN = strZN .. "1" if (#strZN > #coreo) then strZN = "" coreo_LZ = loadstring("return ".. printTableSX(coreo))() doCoreo(uid) end end local ip2 = {x = ip.x+2, y = ip.y+2, z = ip.z} local mons = getUidsInArea(ip, ip2) or {} for _, v in pairs(mons) do if (getCreatureName(v) == "Michael Jackson") then doCoreo(v) break end end return true end function onStartup() addEvent(StAR, 1500) return true end ]]></globalevent> <monster name="Dancer" file="Thriller/Dancer.xml"/> <monster name="Michael Jackson" file="Thriller/Michael Jackson.xml"/> </mod> Coreográfia totalmente editável:local coreo = {0, 0, 2, 2, "'Cause this is thriller, thriller night", {0, 2, 3, 1}, "And no one's gonna save you from the beast about to strike", 1, 1, 2, 0, 3, 3, {0, 2, 3, 1, 2, 0, 1, 2, 3, 0, 1, 2}} Tabelas contém as direções que ele vira /\, >, \/, strings são as palavras que ele o Michael Jackson dirá. configuração dos intervalos em milisegundos, 1000 = 1 segundo.local config = { interval = {say = 750, walk = 500, turn = 350} } Na pasta mods do seu otserver, crie um arquivo XML com qualquer nome, e adicione o script do maxwell em local ip , dentro do script, é a posição onde você tem que por pro michael jackson aparecer... Depois, copie um monstro do seu otserver, e cole 2 vezes em mods/monster/Thriller Renomeie um de Dancer, e outro de Michael Jackson, troque também os nomes de dentro, e coloque speed 0.. Editado Abril 5, 2015 10 anos por MaXwEllDeN (veja o histórico de edições)
Postado Fevereiro 27, 2012 13 anos Rep++ muito divertido o script como falei no outro topico muito bom mesmo já entrou no forum arrasando xD
Postado Janeiro 27, 2015 10 anos desculpa reviver o topico mais a onde eu edito o local onde vai aparecer ??
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.