Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dono = "Travonrodfer#0000"
- function begin()
- bicho = 113
- bb= false
- xu = math.random(800)
- yu = math.random(300)
- id = tfm.exec.addShamanObject(bicho, 0, 0, false, 0, 0, true)
- mort={}
- tutorial = {}
- tutu = {}
- showall = {}
- mostrando = false
- namao = {}
- obje = 0
- macieira={}
- ossadeira = {}
- appleshot = 12
- ossinhos = 1
- m = 0
- osstatus = 0
- horadobanho = false
- b = 0
- fome = 200
- felicidade = 200
- higiene = 200
- sono = 200
- sonin = false
- justonetime = 0
- amizade = {}
- joint = 0
- piso = 0
- porta = 0
- broto1 = false
- broto2 = false
- broto3 = false
- broto4 = false
- flr1=0
- flr2=0
- flr3=0
- flr4=0
- end
- begin()
- function status(name)
- ui.addTextArea(0, "<R><a href=\"event:fechar\"><p align=\"right\">Fechar", name, 6, 227, 200, 176, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(1, "<p align=\"center\"><font size=\"15\" color=\"#10740b\">FOME", name, 6, 374, 200, 20, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(2, "", name, 6, 374, fome, 20, 0x10740b, 0x000000, 1, true)
- ui.addTextArea(3, "<p align=\"center\"><font size=\"15\" color=\"#74c7d6\">HIGIENE", name, 6, 312, 200, 20, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(4, "", name, 6, 312, higiene, 20, 0x74c7d6, 0x000000, 1, true)
- ui.addTextArea(5, "<p align=\"center\"><font size=\"15\" color=\"#eeff00\">FELICIDADE", name, 6, 343, 200, 20, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(6, "", name, 6, 343, felicidade, 20, 0xeeff00, 0x000000, 1, true)
- ui.addTextArea(7, "<p align=\"center\"><font size=\"15\" color=\"#ffffff\">SONO", name, 6, 281, 200, 20, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(8, "", name, 6, 281, sono, 20, 0xffffff, 0x000000, 1, true)
- ui.addTextArea(9, "<p align=\"center\"><font size=\"15\" color=\"#f565e4\">AMIZADE", name, 6, 249, 200, 20, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(10, "", name, 6, 249, amizade[name], 20, 0xf565e4, 0x000000, 1, true)
- if namao[name] == 1 then
- ui.addTextArea(12, "<PT><font size=\"15\">Maças:<font color=\"#C2C2DA\"> " .. appleshot .."", name, 8, 222, 93, 23, 0x324650, 0x000000, 0, true)
- elseif namao[name] == 2 then
- ui.addTextArea(12, "<PT><font size=\"15\">Ossos:<font color=\"#C2C2DA\"> " .. ossinhos .."", name, 8, 222, 93, 23, 0x324650, 0x000000, 0, true)
- end
- end
- function movimento()
- obje = math.random(15)
- if obje == 1 and sonin == false or obje == 2 and sonin == false or obje == 3 and sonin == false or obje == 4 and sonin == false then
- tfm.exec.moveObject(id, xua, yua, false, -30)
- elseif obje == 5 and sonin == false or obje == 6 and sonin == false or obje == 7 and sonin == false or obje == 8 and sonin == false then
- tfm.exec.moveObject(id, xua, yua, false, 30)
- elseif obje == 9 and sonin == false then
- tfm.exec.moveObject(id, xua, yua, false, 80)
- elseif obje == 10 and sonin == false then
- tfm.exec.moveObject(id, xua, yua, false, -80)
- elseif obje == 11 and sonin == false then
- tfm.exec.moveObject(id, xua, yua, false, -30, -50)
- elseif obje == 12 and sonin == false then
- tfm.exec.moveObject(id, xua, yua, false, 30, -50)
- end
- cordenada = tfm.get.room.objectList[id] or {x=0 , y=0}
- massalocal = tfm.get.room.objectList[massa] or {x=0 , y=0}
- ossalocal = tfm.get.room.objectList[ossea] or {x=0 , y=0}
- end
- function eventLoop(ct, tr)
- if tr <= 0 then
- initial()
- end
- for name in pairs(tfm.get.room.playerList) do
- osstatus = osstatus + .5
- movimento()
- if osstatus == 10 then
- fome = fome - 5
- higiene = higiene - 2
- felicidade = felicidade - 4
- if sonin == false then
- sono = sono - 3
- elseif sonin == true then
- sono = sono + 6
- end
- osstatus = 0
- elseif osstatus >= 0 and showall[name] == true then
- status(name)
- end
- if horadobanho == true then
- b = b +.5
- end
- if horadobanho == true and b < 10 then
- tfm.exec.moveObject(id, 670, 180)
- for k = 10,0,-1 do
- tfm.exec.displayParticle(14,math.random(647,760),math.random(162,200),0,math.random(1.1),0,math.random(0.22))
- end
- elseif horadobanho == true and b > 10 then
- felicidade = felicidade + 2
- higiene = 200
- horadobanho = false
- b=0
- ui.addTextArea(20, "<R><font size=\"12\"><a href=\"event:banho\"><p align=\"center\">Dar banho", nil, 670, 135, xua, yua, 0x1e1a1b, 0x000000, 1, false)
- if showall == true then
- ui.addTextArea(4, "", name, 6, 312, higiene, 20, 0x74c7d6, 0x000000, 1, true)
- end
- end
- if sono < 20 then
- felicidade = felicidade - 30
- sonin = true
- elseif sono >= 200 then
- felicidade = felicidade + 3
- sonin = false
- end
- if broto1 == true then
- flr1 = flr1 + .5
- end
- if broto2 == true then
- flr2 = flr2 + .5
- end
- if broto3 == true then
- flr3 = flr3 + .5
- end
- if broto4 == true then
- flr4 = flr4 + .5
- end
- if flr1 == 40 and broto1 == true then
- brotin = 1
- xa = 985
- ya = 292
- broto(xa, ya)
- elseif flr1 == 120 and broto1 == true then
- brotin = 1
- xa = 985
- ya = 292
- florescendo(xa, ya)
- elseif flr1 == 180 and broto1 == true then
- m = 1
- tfm.exec.addPhysicObject(11, 1015, 297, {type= 14, width=25, height=10, miceCollision=false, groundCollision=true, friction=9999})
- tfm.exec.addPhysicObject(12, 1045, 267, {type= 14, width=30, height=10, miceCollision=false, groundCollision=true, friction=9999})
- tfm.exec.addPhysicObject(13, 1028, 248, {type= 14, width=25, height=10, miceCollision=false, groundCollision=true, friction=9999})
- m11 = tfm.exec.addShamanObject(39, 1015, 282, 0, 0, 0, true)
- m12 = tfm.exec.addShamanObject(39, 1043, 260, 0, 0, 0, true)
- m13 = tfm.exec.addShamanObject(39, 1028, 237, 0, 0, 0, true)
- ui.addTextArea(21, "<R><font size=\"20\"><a href=\"event:colhe1\"><p align=\"center\">Colher", nil, 985, 172, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- flr1 = 0
- broto1 = false
- end
- if flr2 == 40 and broto2 == true then
- brotin = 2
- xa = 1150
- ya = 292
- broto(xa, ya)
- elseif flr2 == 120 and broto2 == true then
- brotin = 2
- xa = 1150
- ya = 292
- florescendo(xa, ya)
- elseif flr2 == 180 and broto2 == true then
- m = 2
- tfm.exec.addPhysicObject(21, 1175, 297, {type= 14, width=25, height=10, miceCollision=false, groundCollision=true, friction=9999})
- tfm.exec.addPhysicObject(22, 1215, 267, {type= 14, width=30, height=10, miceCollision=false, groundCollision=true, friction=9999})
- tfm.exec.addPhysicObject(23, 1194, 248, {type= 14, width=25, height=10, miceCollision=false, groundCollision=true, friction=9999})
- m21 =tfm.exec.addShamanObject(39, 1175, 282, 0, 0, 0, true)
- m22 =tfm.exec.addShamanObject(39, 1211, 260, 0, 0, 0, true)
- m23 =tfm.exec.addShamanObject(39, 1194, 237, 0, 0, 0, true)
- ui.addTextArea(22, "<R><font size=\"20\"><a href=\"event:colhe2\"><p align=\"center\">Colher", nil, 1145, 172, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- flr2 = 0
- broto2 = false
- end
- if flr3 == 40 and broto3 == true then
- brotin = 3
- xa = 1300
- ya = 292
- broto(xa, ya)
- elseif flr3 == 120 and broto3 == true then
- brotin = 3
- xa = 1300
- ya = 292
- florescendo(xa, ya)
- elseif flr3 == 180 and broto3 == true then
- m = 3
- tfm.exec.addPhysicObject(31, 1327, 297, {type= 14, width=25, height=10, miceCollision=false, groundCollision=true, friction=9999})
- tfm.exec.addPhysicObject(32, 1362, 267, {type= 14, width=30, height=10, miceCollision=false, groundCollision=true, friction=9999})
- tfm.exec.addPhysicObject(33, 1339, 248, {type= 14, width=25, height=10, miceCollision=false, groundCollision=true, friction=9999})
- m31 =tfm.exec.addShamanObject(39, 1327, 282, 0, 0, 0, true)
- m32 =tfm.exec.addShamanObject(39, 1358, 260, 0, 0, 0, true)
- m33 =tfm.exec.addShamanObject(39, 1339, 237, 0, 0, 0, true)
- ui.addTextArea(23, "<R><font size=\"20\"><a href=\"event:colhe3\"><p align=\"center\">Colher", nil, 1305, 172, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- flr3 = 0
- broto3 = false
- end
- if flr4 == 40 and broto4 == true then
- brotin = 4
- xa = 1465
- ya = 292
- broto(xa, ya)
- elseif flr4 == 120 and broto4 == true then
- brotin = 4
- xa = 1465
- ya = 292
- florescendo(xa, ya)
- elseif flr4 == 180 and broto4 == true then
- m = 4
- tfm.exec.addPhysicObject(41, 1487, 297, {type= 14, width=25, height=10, miceCollision=false, groundCollision=true, friction=9999})
- tfm.exec.addPhysicObject(42, 1525, 267, {type= 14, width=30, height=10, miceCollision=false, groundCollision=true, friction=9999})
- tfm.exec.addPhysicObject(43, 1507, 248, {type= 14, width=25, height=10, miceCollision=false, groundCollision=true, friction=9999})
- m41 =tfm.exec.addShamanObject(39, 1487, 282, 0, 0, 0, true)
- m42 =tfm.exec.addShamanObject(39, 1521, 260, 0, 0, 0, true)
- m43 =tfm.exec.addShamanObject(39, 1507, 237, 0, 0, 0, true)
- ui.addTextArea(24, "<R><font size=\"20\"><a href=\"event:colhe4\"><p align=\"center\">Colher", nil, 1465, 172, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- flr4 = 0
- broto4 = false
- end
- for name,i in pairs(tfm.get.room.playerList) do
- if i.x > (cordenada.x - 38) and i.x < (cordenada.x + 38) and i.y > (cordenada.y - 32) and i.y < (cordenada.y + 32) and not mort[name] and amizade[name] < 100 then
- mort[name] = true
- tfm.exec.killPlayer(name)
- end
- end
- for i,v in ipairs(macieira) do
- if v[2] < os.time() - 6000 then
- tfm.exec.removeObject(v[1])
- table.remove(macieira, i)
- appleshot = appleshot + 1
- end
- if massalocal.x > (cordenada.x - 50) and massalocal.x < (cordenada.x + 50) and massalocal.y > (cordenada.y - 45) and massalocal.y < (cordenada.y + 45) and sonin == false then
- tfm.exec.removeObject(v[1])
- table.remove(macieira, i)
- fome = fome + 15
- felicidade = felicidade + 2
- end
- end
- for i,v in ipairs(ossadeira) do
- if v[2] < os.time() - 50000 then
- tfm.exec.removeObject(v[1])
- table.remove(ossadeira, i)
- ossinhos = ossinhos + 1
- felicidade = felicidade - 10
- end
- if ossalocal.x > (cordenada.x - 50) and ossalocal.x < (cordenada.x + 50) and ossalocal.y > (cordenada.y - 50) and ossalocal.y < (cordenada.y + 50) and sonin == false then
- tfm.exec.removeObject(v[1])
- table.remove(ossadeira, i)
- ossinhos = ossinhos + 1
- felicidade = felicidade + 10
- elseif ossalocal.x > cordenada.x and sonin == false then
- tfm.exec.moveObject(id, xua, yua, false, 50)
- elseif ossalocal.x < cordenada.x and sonin == false then
- tfm.exec.moveObject(id, xua, yua, false, -50)
- end
- end
- if fome >= 200 then
- fome = 200
- if showall[name] then
- ui.addTextArea(2, "", name, 6, 374, fome, 20, 0x10740b, 0x000000, 1, true)
- end
- elseif fome <= 0 then
- fome = 0
- tfm.exec.removeObject(id)
- ui.addTextArea(15, "<R><font size=\"12\"><p align=\"center\">Seu pet MORREU DE FOME! Cuide melhor dos seus animais de estimação, ou nós cuidaremos de você!", nil, 322, 163, 156, yua, 0x1e1a1b, 0x000000, 1, true)
- ui.removeTextArea(2, name)
- if justonetime == 0 then
- tfm.exec.setGameTime(10)
- justonetime = 1
- end
- end
- if felicidade >= 200 then
- felicidade = 200
- if showall[name] then
- ui.addTextArea(6, "", name, 6, 343, felicidade, 20, 0xeeff00, 0x000000, 1, true)
- end
- elseif felicidade <= 0 then
- felicidade = 0
- tfm.exec.removeObject(id)
- ui.addTextArea(15, "<R><font size=\"12\"><p align=\"center\">Seu pet estava muito infeliz e fugiu para encontrar um lar, onde dessem mais atenção para ele!", nil, 322, 163, 156, yua, 0x1e1a1b, 0x000000, 1, true)
- ui.removeTextArea(6, name)
- if justonetime == 0 then
- tfm.exec.setGameTime(10)
- justonetime = 1
- end
- end
- if higiene <= 0 then
- higiene = 0
- tfm.exec.removeObject(id)
- ui.addTextArea(15, "<R><font size=\"12\"><p align=\"center\">Seu pet ficou muito sujo e acabou pegando uma infecção. Sentimos muito pela sua perda!", nil, 326, 169, 167, yua, 0x1e1a1b, 0x000000, 1, true)
- ui.removeTextArea(4, name)
- if justonetime == 0 then
- tfm.exec.setGameTime(10)
- justonetime = 1
- end
- end
- if sono >= 200 then
- sono = 200
- ui.addTextArea(13, "<R><font size=\"12\"><a href=\"event:dormir\"><p align=\"center\">Por para dormir", nil, 550, 265, xua, yua, 0x1e1a1b, 0x000000, 1, false)
- if showall[name] then
- ui.addTextArea(8, "", name, 6, 281, sono, 20, 0xffffff, 0x000000, 1, true)
- end
- end
- if amizade[name] >= 200 then
- amizade[name] = 200
- if bb == false then
- bicho = 216
- tfm.exec.removeObject(id)
- id = tfm.exec.addShamanObject(bicho, 0, 0, false, 0, 0, true)
- bb = true
- end
- if showall[name] then
- ui.addTextArea(10, "", name, 6, 249, amizade[name], 20, 0xf565e4, 0x000000, 1, true)
- end
- elseif amizade[name] <= 0 then
- ui.removeTextArea(10, name)
- end
- end
- end
- function eventTextAreaCallback(id, name, link)
- if link == "menu" then
- ui.removeTextArea(12, name)
- ui.addTextArea(0, "<R><a href=\"event:fechar\"><p align=\"right\">Fechar", name, 6, 227, 200, 176, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(1, "<p align=\"center\"><font size=\"15\" color=\"#10740b\">FOME", name, 6, 374, 200, 20, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(2, "", name, 6, 374, fome, 20, 0x10740b, 0x000000, 1, true)
- ui.addTextArea(3, "<p align=\"center\"><font size=\"15\" color=\"#74c7d6\">HIGIENE", name, 6, 312, 200, 20, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(4, "", name, 6, 312, higiene, 20, 0x74c7d6, 0x000000, 1, true)
- ui.addTextArea(5, "<p align=\"center\"><font size=\"15\" color=\"#eeff00\">FELICIDADE", name, 6, 343, 200, 20, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(6, "", name, 6, 343, felicidade, 20, 0xeeff00, 0x000000, 1, true)
- ui.addTextArea(7, "<p align=\"center\"><font size=\"15\" color=\"#ffffff\">SONO", name, 6, 281, 200, 20, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(8, "", name, 6, 281, sono, 20, 0xffffff, 0x000000, 1, true)
- ui.addTextArea(9, "<p align=\"center\"><font size=\"15\" color=\"#f565e4\">AMIZADE", name, 6, 249, 200, 20, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(10, "", name, 6, 249, amizade[name], 20, 0xf565e4, 0x000000, 1, true)
- if namao[name] == 1 then
- ui.addTextArea(12, "<PT><font size=\"15\">Maças:<font color=\"#C2C2DA\"> " .. appleshot .."", name, 8, 222, 93, 23, 0x324650, 0x000000, 0, true)
- elseif namao[name] == 2 then
- ui.addTextArea(12, "<PT><font size=\"15\">Ossos:<font color=\"#C2C2DA\"> " .. ossinhos .."", name, 8, 222, 93, 23, 0x324650, 0x000000, 0, true)
- end
- showall[name] = true
- elseif link == "fechar" then
- ui.addTextArea(12, "<b><a href=\"event:menu\"><font color=\"#820d0d\">Status<a>", name, 6, 380, x, y, 0x1e1a1b, 0x000000, 1, true)
- showall[name] = false
- for id = 0,10 do
- ui.removeTextArea(id, name)
- end
- elseif link == "help" then
- ui.addTextArea(14, "<R><font size=\"15\"><p align=\"center\">Como cuidar do meu PET?!<font size=\"10\"><N>\nLeia este manual até o fim e saiba tudo sobre como criar um pet! \n<b>aperte P, para ir prosseguindo!</b>", name, 292, 185, 215, yua, 0x1e1a1b, 0x000000, 1, true)
- tutorial[name] = true
- tutu[name] = 0
- end
- for name,i in pairs(tfm.get.room.playerList) do
- if link == "banho" and i.x > 647 and i.x < 760 and i.y > 112 and i.y < 198 and higiene < 100 and sonin == false then
- amizade[name] = amizade[name] + 1
- ui.removeTextArea(20, nil)
- horadobanho = true
- b = 0
- elseif link == "dormir" and i.x > 518 and i.x < 690 and i.y >285 and i.y < 366 and sono < 150 and sonin == false then
- for id in pairs(tfm.get.room.objectList) do
- tfm.exec.moveObject(id, 580, 350)
- end
- ui.addTextArea(13, nil)
- sonin = true
- ui.addTextArea(13, "<R><font size=\"12\"><a href=\"event:acordar\"><p align=\"center\">Acordar", nil, 580, 260, xua, yua, 0x1e1a1b, 0x000000, 1, false)
- elseif link == "acordar" and name == dono and i.x > 518 and i.x < 690 and i.y >285 and i.y < 366 and sono > 100 and sonin == true then
- sonin = false
- ui.addTextArea(13, "<R><font size=\"12\"><a href=\"event:dormir\"><p align=\"center\">Por para dormir", nil, 550, 260, xua, yua, 0x1e1a1b, 0x000000, 1, false)
- elseif link == "plant1" and i.x > 973 and i.x < 1076 and i.y > 300 and i.y < 380 and appleshot > 0 then
- appleshot = appleshot - 1
- ui.addTextArea(21, "<R><font size=\"20\"><a href=\"event:rego1\"><p align=\"center\">Regar", nil, 985, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- elseif link == "rego1" and i.x > 973 and i.x < 1076 and i.y > 300 and i.y < 380 then
- ui.removeTextArea(21, nil)
- broto1 = true
- elseif link == "plant2" and i.x > 1118 and i.x < 1240 and i.y > 300 and i.y < 380 and appleshot > 0 then
- appleshot = appleshot - 1
- ui.addTextArea(22, "<R><font size=\"20\"><a href=\"event:rego2\"><p align=\"center\">Regar", nil, 1145, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- elseif link == "rego2" and i.x > 1118 and i.x < 1240 and i.y > 300 and i.y < 380 then
- ui.removeTextArea(22, nil)
- broto2 = true
- elseif link == "plant3" and i.x > 1291 and i.x < 1397 and i.y >300 and i.y < 380 and appleshot > 0 then
- appleshot = appleshot - 1
- ui.addTextArea(23, "<R><font size=\"20\"><a href=\"event:rego3\"><p align=\"center\">Regar", name, 1305, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- elseif link == "rego3" and i.x > 1291 and i.x < 1397 and i.y >300 and i.y < 380 then
- ui.removeTextArea(23, nil)
- broto3= true
- elseif link == "plant4" and i.x > 1454 and i.x < 1557 and i.y > 300 and i.y < 380 and appleshot > 0 then
- appleshot = appleshot - 1
- ui.addTextArea(24, "<R><font size=\"20\"><a href=\"event:rego4\"><p align=\"center\">Regar", name, 1465, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- elseif link == "rego4" then
- ui.removeTextArea(24, nil)
- broto4 = true
- elseif link =="colhe1" and i.x > 973 and i.x < 1076 and i.y > 300 and i.y < 380 then
- appleshot = appleshot + 3
- brotin = 1
- tfm.exec.removeJoint(brotin + 1)
- tfm.exec.removeJoint(brotin + 5)
- tfm.exec.removeJoint(brotin + 25)
- tfm.exec.removeObject(m11)
- tfm.exec.removeObject(m12)
- tfm.exec.removeObject(m13)
- tfm.exec.removePhysicObject(11)
- tfm.exec.removePhysicObject(12)
- tfm.exec.removePhysicObject(13)
- ui.addTextArea(21, "<R><font size=\"20\"><a href=\"event:plant1\"><p align=\"center\">Plantar", nil, 985, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- elseif link =="colhe2" and i.x > 1118 and i.x < 1240 and i.y > 300 and i.y < 380 then
- appleshot = appleshot + 3
- brotin = 2
- tfm.exec.removeJoint(brotin + 1)
- tfm.exec.removeJoint(brotin + 5)
- tfm.exec.removeJoint(brotin + 25)
- tfm.exec.removeObject(m21)
- tfm.exec.removeObject(m22)
- tfm.exec.removeObject(m23)
- tfm.exec.removePhysicObject(21)
- tfm.exec.removePhysicObject(22)
- tfm.exec.removePhysicObject(23)
- ui.addTextArea(22, "<R><font size=\"20\"><a href=\"event:plant2\"><p align=\"center\">Plantar", nil, 1145, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- elseif link =="colhe3" and i.x > 1291 and i.x < 1397 and i.y >300 and i.y < 380 then
- appleshot = appleshot + 3
- brotin = 3
- tfm.exec.removeJoint(brotin + 1)
- tfm.exec.removeJoint(brotin + 5)
- tfm.exec.removeJoint(brotin + 25)
- tfm.exec.removeObject(m31)
- tfm.exec.removeObject(m32)
- tfm.exec.removeObject(m33)
- tfm.exec.removePhysicObject(31)
- tfm.exec.removePhysicObject(32)
- tfm.exec.removePhysicObject(33)
- ui.addTextArea(23, "<R><font size=\"20\"><a href=\"event:plant3\"><p align=\"center\">Plantar", nil, 1305, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- elseif link =="colhe4" and i.x > 1454 and i.x < 1557 and i.y > 300 and i.y < 380 then
- appleshot = appleshot + 3
- brotin = 4
- tfm.exec.removeJoint(brotin + 1)
- tfm.exec.removeJoint(brotin + 5)
- tfm.exec.removeJoint(brotin + 25)
- tfm.exec.removeObject(m41)
- tfm.exec.removeObject(m42)
- tfm.exec.removeObject(m43)
- tfm.exec.removePhysicObject(41)
- tfm.exec.removePhysicObject(42)
- tfm.exec.removePhysicObject(43)
- ui.addTextArea(24, "<R><font size=\"20\"><a href=\"event:plant4\"><p align=\"center\">Plantar", nil, 1465, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- end
- end
- end
- function eventKeyboard(name, key, d, x, y)
- if key == 32 and appleshot > 0 and tfm.get.room.playerList[name].isFacingRight and namao[name] == 1 then
- massa = tfm.exec.addShamanObject(39, x, y, 0, 10, 0, true)
- table.insert(macieira, {massa, os.time()})
- appleshot = appleshot - 1
- elseif key == 32 and appleshot > 0 and not tfm.get.room.playerList[name].isFacingRight and namao[name] == 1 then
- massa = tfm.exec.addShamanObject(39, x, y, 0, -10, 0, true)
- table.insert(macieira, {massa, os.time()})
- appleshot = appleshot - 1
- elseif key == 32 and ossinhos > 0 and tfm.get.room.playerList[name].isFacingRight and namao[name] == 2 then
- ossea = tfm.exec.addShamanObject(602, x + 20, y, 0, 20, 0)
- table.insert(ossadeira, {ossea, os.time()})
- ossinhos = ossinhos - 1
- elseif key == 32 and ossinhos > 0 and not tfm.get.room.playerList[name].isFacingRight and namao[name] == 2 then
- ossea = tfm.exec.addShamanObject(602, x - 20, y, 0, -20, 0)
- table.insert(ossadeira, {ossea, os.time()})
- ossinhos = ossinhos - 1
- elseif key == 188 then
- namao[name] = 1
- elseif key == 190 then
- namao[name] = 2
- elseif key == 80 and tutorial[name] then
- tutu[name] = tutu[name] + 1
- end
- if tutu[name] == 1 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Clicando aqui embaixo, em <b>status</b>, você abrirá os status do seu pet, como: <font color=\"#10740b\">fome<N>, <font color=\"#eeff00\">felicidade, <font color=\"#74c7d6\">higiene<N>, <font color=\"#ffffff\">sono<N> e a <font color=\"#f565e4\">amizade!", name, 7, 302, 173, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 2 and key == 80 and tutorial[name] then
- showall[name] = true
- status(name)
- ui.addTextArea(14, "<p align=\"center\">Perceba que eles vão abaixando. Você deve sempre manter essas barras cheias!", name, 334, 170, 132, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 3 and key == 80 and tutorial[name] then
- status(name)
- ui.addTextArea(14, "<p align=\"center\">Essa é a barra de <font color=\"#f565e4\">amizade", name, 220, 249, xua, 20, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 4 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Se sua amizade com o pet for baixa, ele irá te atacar até a morte, quando você se aproximar. <r>CUIDADO!", name, 334, 170, 161, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 5 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Caso sua amizade seja muito alta, o pet irá finalmente se sentir em casa e não te atacará mais", name, 327, 165, 146, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 6 and key == 80 and tutorial[name] then
- status(name)
- ui.addTextArea(14, "<p align=\"center\">Essa é a barra de <font color=\"#ffffff\">sono", name, 220, 281, xua, 20, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 7 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Se o sono cair muito, o pet desmaiará e assim ficará, até acordar! Caso aconteça, você perdera muita da sua amizade com ele.", name, 334, 170, 163, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 8 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Você pode por seu pet para dormir, indo em cima do sofá com o ursinho e clicando no local mostrado!", name, 325, 166, 149, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 9 and key == 80 and tutorial[name] then
- status(name)
- ui.addTextArea(14, "<p align=\"center\">Essa é a barra de <font color=\"#74c7d6\"> higiene", name, 220, 312, xua, 20, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 10 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Sendo um pet, ele correrá para todos os lados e ficará sujo. Você precisa dar banho nele frequentemente, para evitar doenças!", name, 314, 166, 171, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 11 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Para dar banho no seu pet, entre dentro da banheira e clique no local mostrado!", name, 338, 170, 123, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 12 and key == 80 and tutorial[name] then
- status(name)
- ui.addTextArea(14, "<p align=\"center\">Essa é a barra de <font color=\"#eeff00\"> felicidade", name, 220, 343, xua, 20, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 13 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Há vários jeitos de manter o seu pet feliz! Se ele tiver uma boa noite de sono, um bom banho, e comer uma comida saborosa, sua felicidade irá aumentar um pouco.", name, 309, 158, 181, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 14 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Mas caso você queira que ela aumente em um nível considerável, você deve brincar com ele!", name, 330, 166, 140, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 15 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Você possui a habilidade de lançar coisas. Agora, você está com uma maça na mão, caso aperte espaço, será isso que você vai lançar.", name, 316, 164, 168, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 16 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">aperte <R>,<N> para ir para o item anterior e <R>.<N> para o próximo item. Caso você lance um cranio, seu pet ira correr atrás para pegá-lo e isso o deixará muito feliz.", name, 312, 160, 176, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 17 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Caso você lance em um lugar, que o pet não consiga pegar a tempo, ele se sentirá incapaz e se entristecerá.", name, 331, 165, 138, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 18 and key == 80 and tutorial[name] then
- status(name)
- ui.addTextArea(14, "<p align=\"center\">Essa é a barra de <font color=\"#10740b\"> fome", name, 220, 374, xua, 20, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 19 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">A fome será um dos seus maiores problemas, uma vez que seu pet tem muito apetite! ", name, 335, 165, 129, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 20 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Seu pet adora comer maças! Aperte espaço para lançar as maças para ele. Mas jogue devagar, ele não consegue comer muito rápido!", name, 318, 161, 164, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 21 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Tome cuidado para não dar á ele todas as maças! Elas são finitas, então você deve ir lá fora plantar, para que nunca acabem e seu pet não morra de fome! <font size=\"7\">\nei, isso pode dar problema com o pessoal dos direitos dos animais!", name, 305, 152, 189, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 22 and key == 80 and tutorial[name] then
- ui.addTextArea(14, "<p align=\"center\">Caso você seja o dono da casa, poderá trancar e abrir a porta, clicando com o mouse, na entrada da casa!", name, 327, 165, 146, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 23 and key == 80 and tutorial[name] then
- status(name)
- ui.addTextArea(14, "<p align=\"center\">Você pode ver o item que está segurando e a quantidade que possui, aqui!\n<p align=\"left\"> ↓ ↓ ↓ ↓ ↓ ↓", name, 7, 138, 126, yua, 0x1e1a1b, 0x000000, 1, true)
- elseif tutu[name] == 24 and key == 80 and tutorial[name] then
- ui.removeTextArea(14, name)
- tutu[name] = 0
- tutorial[name] = false
- end
- end
- function eventMouse(name, x, y)
- if name == dono and x > (777 - 30) and x < (777 + 30) and y > (333 - 50) and y < (333 + 50) and porta == 0 then
- tfm.exec.addPhysicObject(-1, 777, 333, {type= 12, width=20, height=74, miceCollision=true, groundCollision=true, color=0x620613})
- porta = 1
- elseif name == dono and x > (777 - 30) and x < (777 + 30) and y > (333 - 50) and y < (333 + 50) and porta == 1 then
- tfm.exec.removePhysicObject(-1)
- porta = 0
- end
- end
- for name in pairs(tfm.get.room.playerList) do
- system.bindMouse(name)
- system.bindKeyboard(name, 32, true, true)
- system.bindKeyboard(name, 80, true, true)
- system.bindKeyboard(name, 188, true, true)
- system.bindKeyboard(name, 190, true, true)
- end
- function eventNewGame()
- for name in pairs(tfm.get.room.playerList) do
- mort[name] = false
- ui.addTextArea(11, "<a href=\"event:help\"><p align=\"center\"><font color=\"#820d0d\"><b>?", name, 62, 380, x, y, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(12, "<b><a href=\"event:menu\"><font color=\"#820d0d\">Status<a>", name, 6, 380, x, y, 0x1e1a1b, 0x000000, 1, true)
- ui.addTextArea(13, "<R><font size=\"12\"><a href=\"event:dormir\"><p align=\"center\">Por para dormir", nil, 550, 260, xua, yua, 0x1e1a1b, 0x000000, 1, false)
- ui.addTextArea(20, "<R><font size=\"12\"><a href=\"event:banho\"><p align=\"center\">Dar banho", name, 670, 135, xua, yua, 0x1e1a1b, 0x000000, 1, false)
- ui.addTextArea(21, "<R><font size=\"20\"><a href=\"event:plant1\"><p align=\"center\">Plantar", name, 985, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- ui.addTextArea(22, "<R><font size=\"20\"><a href=\"event:plant2\"><p align=\"center\">Plantar", name, 1145, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- ui.addTextArea(23, "<R><font size=\"20\"><a href=\"event:plant3\"><p align=\"center\">Plantar", name, 1305, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- ui.addTextArea(24, "<R><font size=\"20\"><a href=\"event:plant4\"><p align=\"center\">Plantar", name, 1465, 272, 82, 30, 0x1e1a1b, 0x000000, 1, false)
- end
- xu = math.random(800)
- yu = math.random(300)
- id = tfm.exec.addShamanObject(113, xu, yu, false, 0, 0, true)
- tfm.exec.addShamanObject(id)
- end
- function broto(xa, ya)
- tfm.exec.addPhysicObject(piso + 1, xa, ya, {type=14, miceColision=false, groundCollision=false})
- tfm.exec.addJoint(brotin+1, piso + 1, piso + 1, {type = 0, point1=''..(xa + 44)..','..(ya+47)..'', point2=''..(xa + 42)..','..(ya+71)..'', color = '0x39b841', line = 10, alpha = 1, foreground = false})
- tfm.exec.addJoint(brotin+5, piso + 1, piso + 1, {type = 0, point1='' .. (xa + 46)..','..(ya+72) .. '', point2='' .. (xa + 62)..','..(ya+31) .. '', color = '0x39b841', line = 6, alpha = 1, foreground = false})
- tfm.exec.addJoint(brotin+25, piso + 1, piso + 1, {type = 0, point1='' .. (xa + 42)..','..(ya+74) .. '', point2='' .. (xa + 33)..','..(ya+45) .. '', color = '0x39b841', line = 5, alpha = 1, foreground = false})
- end
- function florescendo(xa, ya)
- tfm.exec.addPhysicObject(piso + 1, xa, ya, {type=14, miceColision=false, groundCollision=false})
- tfm.exec.addJoint(brotin+1, piso + 1, piso + 1, {type = 0, point1=''..(xa + 42)..','..(ya+21)..'', point2=''..(xa + 30)..','..(ya+-7)..'', color = '0x39b841', line = 5, alpha = 1, foreground = false})
- tfm.exec.addJoint(brotin+5, piso + 1, piso + 1, {type = 0, point1='' .. (xa + 47)..','..(ya+1) .. '', point2='' .. (xa + 63)..','..(ya+-40) .. '', color = '0x39b841', line = 6, alpha = 1, foreground = false})
- tfm.exec.addJoint(brotin+25, piso + 1, piso + 1, {type = 0, point1='' .. (xa + 44)..','..(ya+-48) .. '', point2='' .. (xa + 44)..','..(ya+71) .. '', color = '0x39b841', line = 10, alpha = 1, foreground = false})
- end
- function eventPlayerDied(name)
- tfm.exec.respawnPlayer(name)
- mort[name] = false
- end
- function initial()
- dia = math.random(8)
- if dia == 1 or dia == 2 or dia == 3 or dia == 5 or dia == 7 or dia == 8 then
- map = ('<C><P F="' .. dia .. '" L="1600" /><Z><S><S L="130" H="10" X="96" Y="372" T="2" P="0,0,0,1.2,0,0,0,0" /><S P="0,0,0.3,0.2,180,0,0,0" L="200" H="30" c="4" Y="214" T="0" X="95" /><S H="75" L="45" X="777" c="4" Y="333" T="0" P="0,0,0.3,0.2,180,0,0,0" /><S L="600" H="30" X="461" Y="214" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="720" H="45" X="1240" Y="400" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S L="900" X="460" H="60" Y="400" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="400" H="45" X="0" Y="233" T="0" P="0,0,0.3,0.2,90,0,0,0" /><S P="0,0,0.3,0.2,-10,0,0,0" L="400" o="620613" H="100" N="" Y="-13" T="12" X="48" /><S L="300" X="777" H="47" Y="147" T="0" P="0,0,0.3,0.2,90,0,0,0" /><S L="400" o="620613" H="100" X="730" N="" Y="-13" T="12" P="0,0,0.3,0.2,10,0,0,0" /><S L="310" o="620613" H="100" X="390" N="" Y="-47" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="200" H="47" X="507" Y="29" T="0" P="0,0,0.3,0.2,90,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="2000" o="6a7495" X="800" c="4" Y="551" T="12" H="300" /><S P="0,0,,,,0,0,0" L="100" H="25" v="0001" Y="182" T="9" X="705" /><S P="0,0,0.3,0.2,0,0,0,0" L="100" X="1026" c="4" Y="372" T="5" H="12" /><S P="0,0,0.3,0.2,0,0,0,0" L="100" X="1186" c="4" Y="372" T="5" H="12" /><S P="0,0,0.3,0.2,0,0,0,0" L="100" X="1346" c="4" Y="372" T="5" H="12" /><S P="0,0,0.3,0.2,0,0,0,0" L="100" X="1506" c="4" Y="372" T="5" H="12" /><S L="40" H="10" X="666" Y="183" T="14" P="0,0,0,0.2,60,0,0,0" /><S L="40" X="744" H="10" Y="185" T="14" P="0,0,0,0.2,-60,0,0,0" /><S P="0,0,0,0.2,90,0,0,0" L="1000" H="10" c="2" Y="-99" T="14" X="1604" /><S P="0,0,2,,45,0,0,0" L="20" X="354" c="2" Y="373" T="14" H="20" /><S H="20" L="20" X="519" c="2" Y="373" T="14" P="0,0,2,,45,0,0,0" /><S P="0,0,2,,45,0,0,0" L="20" H="20" c="2" Y="373" T="14" X="689" /><S X="183" L="20" H="20" c="2" Y="373" T="14" P="0,0,2,,45,0,0,0" /><S P="0,0,0.3,0.2,180,0,0,0" L="45" H="72" c="4" Y="163" T="0" X="507" /></S><D><P C="e8ebec" Y="0" T="34" X="0" P="0,0" /><DS Y="328" X="308" /><P X="301" Y="155" T="76" P="0,0" /><P X="299" Y="153" T="121" P="0,0" /><P C="620613" Y="373" T="15" P="0,0" X="268" /><P C="dd4e58,1b1d1c,e3e3e3" Y="200" T="129" P="0,0" X="374" /><P P="0,0" Y="202" T="124" X="229" /><P C="dd4e58,1b1d1c,e3e3e3" Y="200" T="128" P="0,0" X="326" /><P C="c03323" Y="206" T="120" P="1,0" X="706" /><P C="e8e9eb,c03323" Y="200" T="119" P="0,1" X="613" /><P C="dbd4cb" Y="374" T="96" P="0,0" X="433" /><P C="620613" Y="373" T="15" X="603" P="0,0" /><P C="dd4e58,1b1d1c,e3e3e3" Y="200" T="128" X="278" P="0,1" /><P C="dd4e58,1b1d1c,e3e3e3" Y="200" T="129" X="230" P="0,0" /><P X="430" Y="200" T="28" P="0,0" /><P X="856" Y="369" T="4" P="0,0" /><P X="644" Y="346" T="26" P="0,0" /><P X="468" Y="203" T="37" P="0,0" /></D><O /></Z></C>')
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.newGame(map)
- tfm.exec.setGameTime(99999)
- ui.setMapName("Pet")
- begin()
- for name in pairs(tfm.get.room.playerList) do
- ui.removeTextArea(15, name)
- tutorial[name] = false
- tutu[name] = 0
- namao[name] = 1
- showall[name] = false
- amizade[name] = 1
- if name == dono then
- amizade[name] = 199
- end
- end
- elseif dia == 4 or dia == 6 then
- initial()
- end
- end
- initial()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement