Brenower

MegaCity [CONSTRUÇÃO]

Jun 7th, 2014
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.27 KB | None | 0 0
  1. -- Megacity
  2. -- Créditos:Brenower
  3. --[[Xml:<C><P /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="114" o="cbcbcb" X="271" Y="305" T="12" H="84" /><S P="0,0,0.3,0.2,0,0,0,0" L="119" o="675e4a" X="271" Y="328" T="12" H="22" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="324650" X="210" Y="302" T="12" H="91" /><S L="10" o="324650" X="333" H="91" Y="302" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="14" o="c5a365" X="271" Y="275" T="13" H="10" /><S P="0,0,0.3,0.2,0,0,0,0" L="131" o="324650" X="272" Y="260" T="12" H="10" /><S P="0,0,0.3,0.2,0,0,0,0" L="60" o="120801" X="271" Y="277" T="12" H="16" /></S><D /><O /></Z></C>]]--
  4. --[[Ainda está sendo feito, tem alguns "lixos" ainda no script e em breve vai ter sistemas melhores.]]--
  5. -- Tabelas
  6. mg={
  7.     ["coins"]=0;
  8.     ["exp"]=0;
  9.     ["level"]=1;
  10.     ["name"]="Sem Nome";
  11.     ["player"]="Brenower";
  12.     ["id"]=1;
  13.     ["h"]=0;
  14.     ["fexp"]=138;
  15.     ["en"]=0;
  16.     ["ag"]=0;
  17.     ["es"]=0;
  18.     ["lix"]=0;
  19. };
  20. predios={
  21.     ["simples"]={
  22.         ["1"]={["color"]=0x0C0C0C,["width"]=35,["height"]=110,["type"]=12;};
  23.         ["2"]={["color"]=0x324650,["width"]=40,["height"]=10,["type"]=12;};
  24.         ["3"]={["color"]=0x324650,["width"]=40,["height"]=10,["type"]=12;};
  25.         ["4"]={["color"]=0x324650,["width"]=40,["height"]=10,["type"]=12;};
  26.         ["5"]={["color"]=0x324650,["width"]=10,["height"]=130,["type"]=12;};
  27.         ["6"]={["color"]=0x324650,["width"]=10,["height"]=130,["type"]=12;};
  28.     };
  29.     ["loja"]={
  30.         ["1"]={["color"]=0x324650,["width"]=10,["height"]=91,["type"]=12;};
  31.         ["2"]={["color"]=0x324650,["width"]=131,["height"]=10,["type"]=12;};
  32.         ["3"]={["color"]=0xCBCBCB,["width"]=114,["height"]=84,["type"]=12;};
  33.         ["4"]={["color"]=0xC5A365,["width"]=14,["type"]=13;};
  34.         ["5"]={["color"]=0x675E4A,["width"]=119,["height"]=22,["type"]=12;};
  35.     };
  36.     ["loja-2"]={
  37.         ["1"]={["color"]=0xFF0000,["width"]=40,["height"]=40,["type"]=12,["angle"]=10;};
  38.         ["2"]={["color"]=0xFFFFFF,["width"]=40,["height"]=40,["type"]=12;};
  39.         ["3"]={["color"]=0xFF0000,["width"]=40,["height"]=40,["type"]=12,["angle"]=-10;};
  40.         ["4"]={["color"]=0x324650,["width"]=100,["height"]=100,["type"]=12;};
  41.         ["5"]={["color"]=0x8BC9E8,["width"]=20,["height"]=32,["type"]=12;};
  42.     }
  43. };
  44. -- Funções Extras
  45. function onBuy(id,x,y)
  46.     if id == 1 and mg.coins >= 0 then
  47.         mg.id=mg.id+1;
  48.         tfm.exec.addPhysicObject(mg.id,x,y,predios.simples["2"])
  49.         mg.id=mg.id+1;
  50.         tfm.exec.addPhysicObject(mg.id,x+21,y+60,predios.simples["5"])
  51.         mg.id=mg.id+1;
  52.         tfm.exec.addPhysicObject(mg.id,x-23,y+60,predios.simples["6"])
  53.         mg.id=mg.id+1;
  54.         tfm.exec.addPhysicObject(mg.id,x-1,y+60,predios.simples["1"]);
  55.         mg.id=mg.id+1;
  56.         tfm.exec.addPhysicObject(mg.id,x,y+40,predios.simples["2"]);
  57.         mg.id=mg.id+1;
  58.         tfm.exec.addPhysicObject(mg.id,x,y+80,predios.simples["3"]);
  59.         mg.id=mg.id+1;
  60.         tfm.exec.addPhysicObject(mg.id,x,y+120,predios.simples["4"]);
  61.         mg.h=mg.h+50;
  62.     end
  63.     if id == 2 and mg.coins >= 0 then
  64.         mg.id=mg.id+1;
  65.         tfm.exec.addPhysicObject(mg.id,x-1,y+45,predios.loja["3"])
  66.         mg.id=mg.id+1;
  67.         tfm.exec.addPhysicObject(mg.id,x-1,y+45,predios.loja["5"])
  68.         mg.id=mg.id+1;
  69.         tfm.exec.addPhysicObject(mg.id,x,y+15,predios.loja["4"])
  70.         mg.id=mg.id+1;
  71.         tfm.exec.addPhysicObject(mg.id,x,y,predios.loja["2"])
  72.         mg.id=mg.id+1;
  73.         tfm.exec.addPhysicObject(mg.id,x+61,y+42,predios.loja["1"])
  74.         mg.id=mg.id+1;
  75.         tfm.exec.addPhysicObject(mg.id,x-61,y+42,predios.loja["1"])
  76.         mg.h=mg.h+50;
  77.     end
  78.     if id == 3 and mg.coins >= 0 then
  79.         mg.id=mg.id+1;
  80.         tfm.exec.addPhysicObject(mg.id,x,y,predios["loja-2"]["4"])
  81.         mg.id=mg.id+1;
  82.         tfm.exec.addPhysicObject(mg.id,x,y-24,predios["loja-2"]["2"])
  83.         mg.id=mg.id+1;
  84.         tfm.exec.addPhysicObject(mg.id,x-33,y-27,predios["loja-2"]["1"])
  85.         mg.id=mg.id+1;
  86.         tfm.exec.addPhysicObject(mg.id,x+37,y-27,predios["loja-2"]["3"])
  87.         mg.id=mg.id+1;
  88.         tfm.exec.addPhysicObject(mg.id,x-20,y+34,predios["loja-2"]["5"])
  89.         mg.h=mg.h+100;
  90.     end
  91. end
  92. -- Funções do tfm
  93. tfm.exec.disableAutoShaman(true)
  94. tfm.exec.disableAutoNewGame(true)
  95. tfm.exec.disableAfkDeath(true)
  96. tfm.exec.newGame('<C Ca=""><P L="1600" /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="324650" X="0" Y="200" T="12" H="402" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="324650" X="1600" Y="200" T="12" H="407" /><S P="0,0,0.3,0.2,0,0,0,0" L="3000" o="324650" X="400" Y="400" T="12" H="10" /></S><D><P C="80808" Y="0" T="34" X="1" P="0,0" /><DS Y="357" X="146" /><P C="80808" Y="0" T="34" P="0,1" X="1600" /></D><O /></Z></C>');
  97. tfm.exec.setUIMapName("<ROSE>MegaCity   <g>|   <N>Moedas : <v>"..mg.coins.." <g>/<j> "..mg.h.."h  <g>|   <N>Nível : <v>"..mg.level.." <bl>/<j> "..mg.exp.." <bl>/ <vp>"..mg.fexp.."<p")
  98. onBuy(3,200,100)
  99. ui.addTextArea(1,"<b><n><font size='12'>Sua cidade precisa de uma fonte de energia!</font></b>",nil,14,26,nil,nil,0x990000,0,0.7,true)
  100. -- Loop
  101. temp={
  102.     ["m"]=0;
  103.     ["h"]=0;
  104. }
  105. function eventLoop()
  106.     temp.m=temp.m+0.5;
  107.     if temp.m > 59 then
  108.         temp.h=temp.h+1;
  109.         temp.m=0;
  110.         mg.coins = mg.coins + mg.h;
  111.     end
  112.     if temp.h > 24 then
  113.         temp.h=0;
  114.     end
  115.     local tjogo = nil;
  116.     if string.len(temp.h) < 2 then
  117.         tjogo = "0"..temp.h..":";
  118.     end
  119.     if string.len(temp.m) < 2 then
  120.         tjogo = tjogo.."0"..math.floor(temp.m);
  121.     else
  122.         tjogo = tjogo..math.floor(temp.m);
  123.     end
  124.     tfm.exec.setUIMapName("<ROSE>MegaCity   <g>|   <N>Moedas : <v>"..mg.coins.." <g>/<j> "..mg.h.."h  <g>|   <N>Nível : <v>"..mg.level.." <bl>/<j> "..mg.exp.." <bl>/ <vp>"..mg.fexp.."   <g>|   <n>"..tjogo.."<p")
  125. end
Advertisement
Add Comment
Please, Sign In to add comment