local config = {
--> Wagoniki kazoo
[14906] = {git_id = 7131, git_id2 = 7132, T_pos = {x=32674,y=31976,z=15}, lever_name = "wagoniki kazoo, do steamboat", NIE_przekrec = "yes", NIE_getTop = "yes", ACH = "yes", ACH_stg = 20093, ACH_id = 100, ACH_nr = 93, ACH_name = "Rollercoaster" },
[14907] = {git_id = 7131, git_id2 = 7132, T_pos = {x=32607,y=31909,z=9}, lever_name = "wagoniki kazoo, do shops", NIE_przekrec = "yes", NIE_getTop = "yes", ACH = "yes", ACH_stg = 20093, ACH_id = 100, ACH_nr = 93, ACH_name = "Rollercoaster" },
[14908] = {git_id = 7131, git_id2 = 7132, T_pos = {x=32654,y=31903,z=8}, lever_name = "wagoniki kazoo, do depot", NIE_przekrec = "yes", NIE_getTop = "yes", ACH = "yes", ACH_stg = 20093, ACH_id = 100, ACH_nr = 93, ACH_name = "Rollercoaster" },
[14909] = {git_id = 7131, git_id2 = 7132, T_pos = {x=32625,y=31922,z=11}, lever_name = "wagoniki kazoo, do temple", NIE_przekrec = "yes", NIE_getTop = "yes", ACH = "yes", ACH_stg = 20093, ACH_id = 100, ACH_nr = 93, ACH_name = "Rollercoaster" },
[14910] = {git_id = 7131, git_id2 = 7132, T_pos = {x=32577,y=31977,z=9 }, lever_name = "wagoniki kazoo, do main gate", NIE_przekrec = "yes", NIE_getTop = "yes", ACH = "yes", ACH_stg = 20093, ACH_id = 100, ACH_nr = 93, ACH_name = "Rollercoaster" },
--> Winda kazoo (na prawo, mozna wjechac na sama gore obok takich pol pszenicy)
[14922] = {git_id = 1945, przekrecona_id = 1946, odkrec = "yes", P_pos = {x=32636,y=31881,z=7}, T_pos = {x=32636,y=31881,z=2}, lever_name = "winda kazoo, w gore"},
[14923] = {git_id = 1946, przekrecona_id = 1945, odkrec = "yes", P_pos = {x=32636,y=31881,z=2}, T_pos = {x=32636,y=31881,z=7}, lever_name = "winda kazoo, w dol"},
--> Farmine winda
[14930] = {git_id = 1946, przekrecona_id = 1945, odkrec = "yes", P_pos = {x=32991,y=31539,z=1}, T_pos = {x=32991,y=31539,z=4}, lever_name = "winda farmine, carpet w dol"},
[14931] = {git_id = 1945, przekrecona_id = 1946, odkrec = "yes", P_pos = {x=32991,y=31539,z=4}, T_pos = {x=32991,y=31539,z=1}, lever_name = "winda farmine, carpet w gore"},
[14932] = {git_id = 1946, przekrecona_id = 1945, odkrec = "yes", P_pos = {x=32993,y=31547,z=4}, T_pos = {x=33061,y=31527,z=10}, lever_name = "winda farmine, glowna w dol (do farmine III)"},
[14933] = {git_id = 1945, przekrecona_id = 1946, odkrec = "yes", P_pos = {x=33061,y=31527,z=10}, T_pos = {x=32993,y=31547,z=4}, lever_name = "winda farmine, glowna w gore (z farmine III)"},
[14934] = {git_id = 1945, przekrecona_id = 1946, odkrec = "yes", P_pos = {x=33061,y=31527,z=12}, T_pos = {x=32993,y=31547,z=4}, lever_name = "winda farmine, glowna w gore (z farmine II)"},
[14935] = {git_id = 1945, przekrecona_id = 1946, odkrec = "yes", P_pos = {x=33061,y=31527,z=14}, T_pos = {x=32993,y=31547,z=4}, lever_name = "winda farmine, glowna w gore (z farmine I)"},
--> Orc edron, dzwignia niszczaca kamien
[14942] = {git_id = 1945, REMOVE = "yes", func = "R", R_item = 1285, R_pos = {x=33171,y=31897,z=8,stackpos=1}, NIE_getTop = "yes", NIE_efektuj = "yes", lever_name = "odblokowywanie kamienia na orcach edron, usuwanie"},
[14942] = {git_id = 1946, REMOVE = "yes", func = "C", R_item = 1285, R_pos = {x=33171,y=31897,z=8,stackpos=1}, NIE_getTop = "yes", NIE_efektuj = "yes", lever_name = "odblokowywanie kamienia na orcach edron, tworzenie"},
--[] = {przekrecona_id = 1946, NIE_przekrec = "yes", NIE_getTop = "yes", P_pos = {x=32636,y=31881,z=7}, T_pos = {x=32636,y=31881,z=2}, lever_name = "przyklad"},
}
--[[
git_id - id dzwigni kiedy jest dobra do uzycia, jest uzyteczna :)
przekrecona_id - id dzwigni kiedy jest przekrecona i po uzyciu zmienia tylko id -1 by stac sie uzyteczna :)
P_pos - miejsce gdzie musi stac gracz
T_pos - miejsce gdzie zostaje teleportowany
]]--
local c = {
cancel_storage_msg = "Sorry you are not authorized to use this lever",
standardowy_efekt = 10,
}
local git_id2 = 0
local costamser = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = config[item.actionid]
if v then
---> gdy dzwignia jest juz przekrecona, to odkrec na wlasciwa jesli v.odkrec == "yes"
if item.itemid == v.przekrecona_id then
if v.odkrec == "yes" then
doTransformItem(item.uid, item.itemid-1)
end
end
if v.git_id2 == nil then
git_id2 = v.git_id
elseif v.git_id2 ~= nil then
git_id2 = v.git_id2
end
if (item.itemid == v.git_id or item.itemid == git_id2) then
---> ewentualne sprawdzanie storage z warunkiem zwracajacym falsz gdy storage playera jest MNIEJSZE/NIEROWNE/WIEKSZE itd. od wymaganego id
if (v.storage ~= nil) then
if v.stg_jakie == ">=" then
if GET_STG(cid, v.storage) < v.storage_id then
costamser = 1
end
elseif v.stg_jakie == "<=" then
if GET_STG(cid, v.storage) > v.storage_id then
costamser = 1
end
elseif v.stg_jakie == "<" then
if GET_STG(cid, v.storage) >= v.storage_id then
costamser = 1
end
elseif v.stg_jakie == ">" then
if GET_STG(cid, v.storage) <= v.storage_id then
costamser = 1
end
elseif v.stg_jakie == "=" then
if GET_STG(cid, v.storage) ~= v.storage_id then
costamser = 1
end
end
if costamser >= 1 then
if (v.cancel_msg == nil) then
return doPlayerSendCancel(cid, "" .. c.cancel_storage_msg .. "")
elseif (v.cancel_msg ~= nil) then
return doPlayerSendCancel(cid, "" .. v.cancel_msg .. "")
end
end
end
---> teleportowanie
if (v.NIE_getTop == nil) then
doTeleportThing(getTopCreature(v.P_pos).uid, v.T_pos)
end
---> przekrecanie
if (v.NIE_przekrec == nil) and (v.przekrec_specjalnie_id == nil) then
doTransformItem(item.uid, item.itemid+1)
end
if (v.przekrec_specjalnie_id ~= nil) then
doTransformItem(item.uid, v.przekrec_specjalnie_id)
end
---> efektowanie
if (v.NIE_efektuj == nil) and (v.efekt_special == nil) then
doSendMagicEffect(getCreaturePosition(cid),c.standardowy_efekt)
end
if (v.efekt_special ~= nil) then
doSendMagicEffect(getCreaturePosition(cid),v.efekt_special)
end
---> achievementowanie
if (v.ACH == "yes") then
if GET_STG(cid, v.ACH_stg) < 0 then
SET_STG(cid, v.ACH_stg, 0)
end
if GET_STG(cid, v.ACH_stg) < v.ACH_id then
SET_STG(cid, v.ACH_stg, GET_STG(cid, v.ACH_stg) + 1)
end
if GET_STG(cid, v.ACH_stg) == v.ACH_id then
doPlayerSendTextMessage(cid,22, 'Congratulations, you earned the achievement "' ..(v.ACH_name).. '".')
doPlayerAddAchievement(cid, v.ACH_nr)
end
end
---> usuwanie itemow
if v.REMOVE == "yes" then
if v.func == "R" then
doRemoveItem(getThingfromPos(v.R_pos).uid, 1)
end
end
---> tworzenie itemow
if v.REMOVE == "yes" then
if v.func == "C" then
doCreateItem(v.R_item, 1, v.R_pos)
end
end
end
end
return true
end
local config = {
--> Wagoniki kazoo
[14906] = {git_id = 7131, git_id2 = 7132, T_pos = {x=32674,y=31976,z=15}, lever_name = "wagoniki kazoo, do steamboat", NIE_przekrec = "yes", NIE_getTop = "yes", ACH = "yes", ACH_stg = 20093, ACH_id = 100, ACH_nr = 93, ACH_name = "Rollercoaster" },
[14907] = {git_id = 7131, git_id2 = 7132, T_pos = {x=32607,y=31909,z=9}, lever_name = "wagoniki kazoo, do shops", NIE_przekrec = "yes", NIE_getTop = "yes", ACH = "yes", ACH_stg = 20093, ACH_id = 100, ACH_nr = 93, ACH_name = "Rollercoaster" },
[14908] = {git_id = 7131, git_id2 = 7132, T_pos = {x=32654,y=31903,z=8}, lever_name = "wagoniki kazoo, do depot", NIE_przekrec = "yes", NIE_getTop = "yes", ACH = "yes", ACH_stg = 20093, ACH_id = 100, ACH_nr = 93, ACH_name = "Rollercoaster" },
[14909] = {git_id = 7131, git_id2 = 7132, T_pos = {x=32625,y=31922,z=11}, lever_name = "wagoniki kazoo, do temple", NIE_przekrec = "yes", NIE_getTop = "yes", ACH = "yes", ACH_stg = 20093, ACH_id = 100, ACH_nr = 93, ACH_name = "Rollercoaster" },
[14910] = {git_id = 7131, git_id2 = 7132, T_pos = {x=32577,y=31977,z=9 }, lever_name = "wagoniki kazoo, do main gate", NIE_przekrec = "yes", NIE_getTop = "yes", ACH = "yes", ACH_stg = 20093, ACH_id = 100, ACH_nr = 93, ACH_name = "Rollercoaster" },
--> Winda kazoo (na prawo, mozna wjechac na sama gore obok takich pol pszenicy)
[14922] = {git_id = 1945, przekrecona_id = 1946, odkrec = "yes", P_pos = {x=32636,y=31881,z=7}, T_pos = {x=32636,y=31881,z=2}, lever_name = "winda kazoo, w gore"},
[14923] = {git_id = 1946, przekrecona_id = 1945, odkrec = "yes", P_pos = {x=32636,y=31881,z=2}, T_pos = {x=32636,y=31881,z=7}, lever_name = "winda kazoo, w dol"},
--> Farmine winda
[14930] = {git_id = 1946, przekrecona_id = 1945, odkrec = "yes", P_pos = {x=32991,y=31539,z=1}, T_pos = {x=32991,y=31539,z=4}, lever_name = "winda farmine, carpet w dol"},
[14931] = {git_id = 1945, przekrecona_id = 1946, odkrec = "yes", P_pos = {x=32991,y=31539,z=4}, T_pos = {x=32991,y=31539,z=1}, lever_name = "winda farmine, carpet w gore"},
[14932] = {git_id = 1946, przekrecona_id = 1945, odkrec = "yes", P_pos = {x=32993,y=31547,z=4}, T_pos = {x=33061,y=31527,z=10}, lever_name = "winda farmine, glowna w dol (do farmine III)"},
[14933] = {git_id = 1945, przekrecona_id = 1946, odkrec = "yes", P_pos = {x=33061,y=31527,z=10}, T_pos = {x=32993,y=31547,z=4}, lever_name = "winda farmine, glowna w gore (z farmine III)"},
[14934] = {git_id = 1945, przekrecona_id = 1946, odkrec = "yes", P_pos = {x=33061,y=31527,z=12}, T_pos = {x=32993,y=31547,z=4}, lever_name = "winda farmine, glowna w gore (z farmine II)"},
[14935] = {git_id = 1945, przekrecona_id = 1946, odkrec = "yes", P_pos = {x=33061,y=31527,z=14}, T_pos = {x=32993,y=31547,z=4}, lever_name = "winda farmine, glowna w gore (z farmine I)"},
--> Orc edron, dzwignia niszczaca kamien
[14942] = {git_id = 1945, REMOVE = "yes", func = "R", R_item = 1285, R_pos = {x=33171,y=31897,z=8,stackpos=1}, NIE_getTop = "yes", NIE_efektuj = "yes", lever_name = "odblokowywanie kamienia na orcach edron, usuwanie"},
[14942] = {git_id = 1946, REMOVE = "yes", func = "C", R_item = 1285, R_pos = {x=33171,y=31897,z=8,stackpos=1}, NIE_getTop = "yes", NIE_efektuj = "yes", lever_name = "odblokowywanie kamienia na orcach edron, tworzenie"},
--[] = {przekrecona_id = 1946, NIE_przekrec = "yes", NIE_getTop = "yes", P_pos = {x=32636,y=31881,z=7}, T_pos = {x=32636,y=31881,z=2}, lever_name = "przyklad"},
}
--[[
git_id - id dzwigni kiedy jest dobra do uzycia, jest uzyteczna :)
przekrecona_id - id dzwigni kiedy jest przekrecona i po uzyciu zmienia tylko id -1 by stac sie uzyteczna :)
P_pos - miejsce gdzie musi stac gracz
T_pos - miejsce gdzie zostaje teleportowany
]]--
local c = {
cancel_storage_msg = "Sorry you are not authorized to use this lever",
standardowy_efekt = 10,
}
local git_id2 = 0
local costamser = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = config[item.actionid]
if v then
---> gdy dzwignia jest juz przekrecona, to odkrec na wlasciwa jesli v.odkrec == "yes"
if item.itemid == v.przekrecona_id then
if v.odkrec == "yes" then
doTransformItem(item.uid, item.itemid-1)
end
end
if v.git_id2 == nil then
git_id2 = v.git_id
elseif v.git_id2 ~= nil then
git_id2 = v.git_id2
end
if (item.itemid == v.git_id or item.itemid == git_id2) then
---> ewentualne sprawdzanie storage z warunkiem zwracajacym falsz gdy storage playera jest MNIEJSZE/NIEROWNE/WIEKSZE itd. od wymaganego id
if (v.storage ~= nil) then
if v.stg_jakie == ">=" then
if GET_STG(cid, v.storage) < v.storage_id then
costamser = 1
end
elseif v.stg_jakie == "<=" then
if GET_STG(cid, v.storage) > v.storage_id then
costamser = 1
end
elseif v.stg_jakie == "<" then
if GET_STG(cid, v.storage) >= v.storage_id then
costamser = 1
end
elseif v.stg_jakie == ">" then
if GET_STG(cid, v.storage) <= v.storage_id then
costamser = 1
end
elseif v.stg_jakie == "=" then
if GET_STG(cid, v.storage) ~= v.storage_id then
costamser = 1
end
end
if costamser >= 1 then
if (v.cancel_msg == nil) then
return doPlayerSendCancel(cid, "" .. c.cancel_storage_msg .. "")
elseif (v.cancel_msg ~= nil) then
return doPlayerSendCancel(cid, "" .. v.cancel_msg .. "")
end
end
end
---> teleportowanie
if (v.NIE_getTop == nil) then
doTeleportThing(getTopCreature(v.P_pos).uid, v.T_pos)
end
---> przekrecanie
if (v.NIE_przekrec == nil) and (v.przekrec_specjalnie_id == nil) then
doTransformItem(item.uid, item.itemid+1)
end
if (v.przekrec_specjalnie_id ~= nil) then
doTransformItem(item.uid, v.przekrec_specjalnie_id)
end
---> efektowanie
if (v.NIE_efektuj == nil) and (v.efekt_special == nil) then
doSendMagicEffect(getCreaturePosition(cid),c.standardowy_efekt)
end
if (v.efekt_special ~= nil) then
doSendMagicEffect(getCreaturePosition(cid),v.efekt_special)
end
---> achievementowanie
if (v.ACH == "yes") then
if GET_STG(cid, v.ACH_stg) < 0 then
SET_STG(cid, v.ACH_stg, 0)
end
if GET_STG(cid, v.ACH_stg) < v.ACH_id then
SET_STG(cid, v.ACH_stg, GET_STG(cid, v.ACH_stg) + 1)
end
if GET_STG(cid, v.ACH_stg) == v.ACH_id then
doPlayerSendTextMessage(cid,22, 'Congratulations, you earned the achievement "' ..(v.ACH_name).. '".')
doPlayerAddAchievement(cid, v.ACH_nr)
end
end
---> usuwanie itemow
if v.REMOVE == "yes" then
if v.func == "R" then
doRemoveItem(getThingfromPos(v.R_pos).uid, 1)
end
end
---> tworzenie itemow
if v.REMOVE == "yes" then
if v.func == "C" then
doCreateItem(v.R_item, 1, v.R_pos)
end
end
end
end
return true
end