Nie tylko o Tibii i OTS...
A wiedz tak skrypt nie mój ale działa w 100%bo sam go testowałem na devland pod 8.0 mysle ze sie przyda komus skryp pochodz z
http://forum.tibia.org.pl/showthread.php?t=214057
Po niemal całym dniu pracy mam wam do zaprezentowania Arenę, która występuje w Svargrond. Do stworzenia jej skłoniło mnie coraz więcej pytań o podobnego typu areny/komnaty.
Zacznijmy wiec.
W Movements.xml dodajemy:
<!-- Arena Svargrond by Szuwar --> <movevent event="AddItem" tileitem="1" actionid="3001" script="stone.lua" /> -- 1 komnata <movevent event="AddItem" tileitem="1" actionid="3002" script="stone.lua" /> -- 2 komnata <movevent event="AddItem" tileitem="1" actionid="3003" script="stone.lua" /> -- 3 komnata <movevent event="AddItem" tileitem="1" actionid="3004" script="stone.lua" /> -- 4 komnata <movevent event="AddItem" tileitem="1" actionid="3005" script="stone.lua" /> -- 5 komnata <movevent event="AddItem" tileitem="1" actionid="3006" script="stone.lua" /> -- 6 komnata <movevent event="AddItem" tileitem="1" actionid="3007" script="stone.lua" /> -- 7 komnata <movevent event="AddItem" tileitem="1" actionid="3008" script="stone.lua" /> -- 8 komnata <movevent event="AddItem" tileitem="1" actionid="3009" script="stone.lua" /> -- 9 komnata <movevent event="AddItem" tileitem="1" actionid="3010" script="stone.lua" /> -- 10 komnata <movevent event="StepIn" actionid="2004" script="stone.lua" /> -- wejscie <movevent event="StepIn" actionid="2005" script="stone.lua" /> -- 1 komnata <movevent event="StepIn" actionid="2006" script="stone.lua" /> -- 2 komnata <movevent event="StepIn" actionid="2007" script="stone.lua" /> -- 3 komnata <movevent event="StepIn" actionid="2008" script="stone.lua" /> -- 4 komnata <movevent event="StepIn" actionid="2009" script="stone.lua" /> -- 5 komnata <movevent event="StepIn" actionid="2010" script="stone.lua" /> -- 6 komnata <movevent event="StepIn" actionid="2011" script="stone.lua" /> -- 7 komnata <movevent event="StepIn" actionid="2012" script="stone.lua" /> -- 8 komnata <movevent event="StepIn" actionid="2013" script="stone.lua" /> -- 9 komnata <movevent event="StepIn" actionid="2014" script="stone.lua" /> -- 10 komnata <!-- End Arena Svargrond -->
Zacznę od razu, co, od czego bo potem braknie mi kolorowo
Sekcja czerwona odpowiada za 'sprawdzanie czy ubiłeś stworka'. Jak wiec się pewnie domyślacie należy do wszystkich tile w komnacie (komentarz obok linii) przypisać odpowiednie ActionId (komnata 1 - 3001, komnata 2 - 3002 itd.). No to teraz niebieska sekcja... są to actionid 'teleportów'. W apostrofie, bo tak naprawdę to actionid ziemi pod teleportem. Czyli, pod teleportem (w nim nic nie ustawiamy, on tylko żeby wyglądał jest), który ma służyć za wejście, dajemy actionid 2004. Potem w komnacie numer 1 dajemy pod teleport actionid 2005 itd.
Jeśli uważasz ze to jest trudne to poczekaj na skrypt...
W ./data/movements/scripts tworzymy plik stone.lua (jakby ktoś pytał, czemu stone a nie arena, to poprostu służy głównie do usuwaniu kamieni, dopiero w ver 0.2 połączyłem wszystkie skrypty w jedno.)
Do stone.lua dodajemy taki kod:
-- Svargrond Arena by Szuwar -- Thanks to Noxitu for help local stone1pos = {x=56,y=23,z=8,stackpos=1} local stone2pos = {x=68,y=23,z=8,stackpos=1} local stone3pos = {x=82,y=23,z=8,stackpos=1} local stone4pos = {x=56,y=34,z=8,stackpos=1} local stone5pos = {x=68,y=34,z=8,stackpos=1} local stone6pos = {x=82,y=34,z=8,stackpos=1} local stone7pos = {x=56,y=45,z=8,stackpos=1} local stone8pos = {x=68,y=45,z=8,stackpos=1} local stone9pos = {x=82,y=45,z=8,stackpos=1} local stone10pos = {x=68,y=57,z=8,stackpos=1} function onStepIn(cid, item, pos) local function doCheckLvl(cid, storage) if getPlayerStorageValue(cid, storage) == 1 then -- Greenhorn monsters = {"Frostfur", "Bloodpaw", "Bovinus", "Achad", "The Hairy One", "Colerian The Barbarian", "Axeitus Headbanger", "Rocky", "Cursed Gladiator", "Orcus The Cruel"} elseif getPlayerStorageValue(cid, storage) == 2 then -- Scrapper monsters = {"Avalanche", "Kreebosh the Exile", "The Dark Dancer", "The Hag", "Slim", "Grimgor Guteater", "Drasilla", "Spirit of Earth", "Spirit of Water", "Spirit of Fire"} elseif getPlayerStorageValue(cid, storage) == 3 then -- Warlord monsters = {"Webster", "Darakan the Executioner", "Norgle Glacierbeard", "The Pit Lord", "Svoren the Mad", "The Masked Marauder", "Gnorre Chyllson", "Fallen Mooh'tah Master Ghar", "Deathbringer", "The Obliverator"} end end local function doChange(cid, pos, creature, tpos) local stone = getThingfromPos(pos) doSetItemActionId(stone.uid,6000) doTeleportThing(cid,tpos) doSendMagicEffect(pos,10) local pos = getThingPos(stone.uid) monster = doSummonCreature(creature, pos) doSendAnimatedText(tpos,"Fight!",198) end local function doCheckStone(stonepos) local stone = getThingfromPos(stonepos) if stone.actionid ~= 6000 and stone.itemid == 1304 then return 0 elseif stone.actionid == 6000 or stone.itemid ~= 1304 then return 1 end end local function roomBusy(cid, pos) pos.x = pos.x + 1 doTeleportThing(cid, pos) doPlayerSendTextMessage(cid, 22, "Stand in the line!") end doCheckLvl(cid, 5029) if item.actionid == 2004 and doCheckStone(stone1pos) == 0 then local npos = {x=61,y=31,z=8} doChange(cid, stone1pos, monsters[1], npos) elseif item.actionid == 2005 and doCheckStone(stone2pos) == 0 then local npos = {x=75,y=31,z=8} doChange(cid, stone2pos, monsters[2], npos) doCreateItem(1304,1,stone1pos) elseif item.actionid == 2006 and doCheckStone(stone3pos) == 0 then local npos = {x=87,y=31,z=8} doChange(cid, stone3pos, monsters[3], npos) doCreateItem(1304,1,stone2pos) elseif item.actionid == 2007 and doCheckStone(stone4pos) == 0 then local npos = {x=61,y=42,z=8} doChange(cid, stone4pos, monsters[4], npos) doCreateItem(1304,1,stone3pos) elseif item.actionid == 2008 and doCheckStone(stone5pos) == 0 then local npos = {x=75,y=42,z=8} doChange(cid, stone5pos, monsters[5], npos) doCreateItem(1304,1,stone4pos) elseif item.actionid == 2009 and doCheckStone(stone6pos) == 0 then local npos = {x=87,y=42,z=8} doChange(cid, stone6pos, monsters[6], npos) doCreateItem(1304,1,stone5pos) elseif item.actionid == 2010 and doCheckStone(stone7pos) == 0 then local npos = {x=61,y=54,z=8} doChange(cid, stone7pos, monsters[7], npos) doCreateItem(1304,1,stone6pos) elseif item.actionid == 2011 and doCheckStone(stone8pos) == 0 then local npos = {x=75,y=54,z=8} doChange(cid, stone8pos, monsters[8], npos) doCreateItem(1304,1,stone7pos) elseif item.actionid == 2012 and doCheckStone(stone9pos) == 0 then local npos = {x=87,y=54,z=8} doChange(cid, stone9pos, monsters[9], npos) doCreateItem(1304,1,stone8pos) elseif item.actionid == 2013 and doCheckStone(stone10pos) == 0 then local npos = {x=74,y=65,z=8} doChange(cid, stone10pos, monsters[10], npos) doCreateItem(1304,1,stone9pos) elseif item.actionid == 2014 then doCreateItem(1304,1,stone10pos) local npos = {x=83,y=59,z=8} doTeleportThing(cid, npos) doSendMagicEffect(npos,10) elseif doCheckStone(stone10pos) == 1 then roomBusy(cid, pos) elseif doCheckStone(stone9pos) == 1 then roomBusy(cid, pos) elseif doCheckStone(stone8pos) == 1 then roomBusy(cid, pos) elseif doCheckStone(stone7pos) == 1 then roomBusy(cid, pos) elseif doCheckStone(stone6pos) == 1 then roomBusy(cid, pos) elseif doCheckStone(stone5pos) == 1 then roomBusy(cid, pos) elseif doCheckStone(stone4pos) == 1 then roomBusy(cid, pos) elseif doCheckStone(stone3pos) == 1 then roomBusy(cid, pos) elseif doCheckStone(stone2pos) == 1 then roomBusy(cid, pos) elseif doCheckStone(stone1pos) == 1 then roomBusy(cid, pos) end end function onAddItem(moveitem, tileitem, pos) local function doCheckBody(moveitem, stonepos, monster) local stone = getThingfromPos(stonepos) if moveitem.itemid == 7349 and stone.itemid ~= 0 then doRemoveItem(stone.uid,1) doRemoveItem(moveitem.uid,1) doSendMagicEffect(stonepos,2) elseif moveitem.itemid == 3058 or moveitem.itemid == 3065 then doRemoveItem(moveitem.uid,1) local pos = getThingPos(monster) doCreatureAddHealth(monster,-10000) doCreateItem(1304,1,stonepos) doSetItemActionId(stone.uid,5999) end end if tileitem.actionid == 3001 then doCheckBody(moveitem, stone1pos, monster) elseif tileitem.actionid == 3002 then doCheckBody(moveitem, stone2pos, monster) elseif tileitem.actionid == 3003 then doCheckBody(moveitem, stone3pos, monster) elseif tileitem.actionid == 3004 then doCheckBody(moveitem, stone4pos, monster) elseif tileitem.actionid == 3005 then doCheckBody(moveitem, stone5pos, monster) elseif tileitem.actionid == 3006 then doCheckBody(moveitem, stone6pos, monster) elseif tileitem.actionid == 3007 then doCheckBody(moveitem, stone7pos, monster) elseif tileitem.actionid == 3008 then doCheckBody(moveitem, stone8pos, monster) elseif tileitem.actionid == 3009 then doCheckBody(moveitem, stone9pos, monster) elseif tileitem.actionid == 3010 then doCheckBody(moveitem, stone10pos, monster) end end
Na czerwono są pozycje kamieni, które blokują teleporty w komnatach (stone1pos blokuje w 1 komnacie itd.) Stackpos można zmieniać, jeśli macie pod kamieniem więcej cos niż ziemia (border jakiś czy cos, wtedy +1 do stackpos itd.)
Na niebiesko oznaczyłem tablice, które odpowiadają poziomom areny (1 tablica do Greenhorn, 2 do Scrappera, a 3 do Warlorda). Jak widać, są tam nazwy po kolei (1 komnata potem 2, 3,4 itd...). Można dać własne lub zostawić.
Zielony kolor to kamień, który blokuje nam przejście do teleportu w komnacie i który to ma zniknąć po zabiciu potwora.
Żółty kolor z kolei to współrzędne gdzie ma teleportować gracza, gdy ten przejdzie przez teleport w komnacie. Łatwo w tym się zorientować, (gdy w warunku [if] masz, actionid 2004 to teleportuje do komnaty 1, gdy masz 2005 to do 2 komnaty i tak do 2014, te współrzędne teleportują do pokoju z nagrodami. Fioletowy to kolor ciał... pierwszy numer zaznaczony tym kolorem to numer ciała, jakie pozostawiają po sobie potwory z areny (u mnie jest domyślnie i imo tak powinno być dobrze). Dwa kolejne to cala ludzi, (gdy ktoś padnie), ciała te to ciało kobiety i mężczyzny. Tu kolejność nie gra roli, pierwsze może być drugi i na odwrót.
Na biało ustawiłem Tekst, który wyświetli się, gdy ktoś jest w komnacie przed tobą, a ty próbujesz wejść. Dodam ze cofnie cię do tylu (tak jak w rl). No cóż... myślę ze teraz, gdy wszystko ustawiliście powinno działać.
Jeśli komuś się nie chce ustawiać wszystkiego to zamieszczam tutaj gotowy silnik bez żadnych skryptów oprócz tej areny.
http://www.speedyshare.com/194404588.html
(gdyby nie dll to wazylo by kolo 500 KB ale wolalem dodac)
Credits:
Chciałbym podziękować Noxitu za wsparcie oraz Killavusowi, dzięki któremu ten kod nie ma 20 KB XD
prosił bym moderatorów albo admina zeby przeniusł ten temat w dziele skrypty sry źle nacisłaem ;/
Ostatnio edytowany przez patryk12 (2007-08-22 23:57:40)
Offline
Spoko 10/10
Ostatnio edytowany przez wojtek15 (2007-08-23 09:50:17)
Offline
Przetestuje go pewnie fajny ale mozna ulepszyc zawsze jakies efekty itp.xD tylko narazie nie zamiezam 8.0 sciagac otsa bo nie mam w tej chwili
Offline