Działanie: Runa przenosi nas do więzienia. Kraty (chodzi mi o kraty o id 5733-5737) może otworzyć tylko GM.
Wchodzimy w data/spells/runes
Tworzymy notatnik , a w nim wpisujemy:
function onUse(cid, item, frompos, item2, topos)
if getPlayerAccess(cid) >=2 then creature2pos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} creature2 = getThingfromPos(creature2pos)
if creature2.itemid > 0 then cela1={x=114, y=112, z=8} cela2={x=116, y=112, z=8} cela3={x=118, y=115, z=8} cela4={x=118, y=117, z=8} cela5={x=116, y=119, z=8} cela6={x=114, y=119, z=8} cela7={x=111, y=117, z=8} doPlayerSendTextMessage(cid,22,"Poszedl siedziec!") rand = math.random(1,7) if rand == 1 then doTeleportThing(creature2.uid,cela1) elseif rand == 2 then doTeleportThing(creature2.uid,cela2) elseif rand == 3 then doTeleportThing(creature2.uid,cela3) elseif rand == 4 then doTeleportThing(creature2.uid,cela4) elseif rand == 5 then doTeleportThing(creature2.uid,cela5) elseif rand == 6 then doTeleportThing(creature2.uid,cela6) elseif rand == 7 then doTeleportThing(creature2.uid,cela7) end doPlayerSendTextMessage(creature2.uid,18,"Posiedzisz tu torche.") else doPlayerSendCancel(cid,"Pudlo.") end else doPlayerSendCancel(cid,"IDZ Z TYM PRZEDMIOTEM DO GM A DOSTANIESZ WYSOKA NAGRODE") end return 1 end
Zapisujemy jako: wiezienie.lua
Tworzymy notatnik , a w nim wpisujemy:
function onUse(cid, item, frompos, item2, topos)
if getPlayerAccess(cid) > 0 then doTransformItem(item.uid,item.itemid+1) else doPlayerSendCancel(cid,"Tylko GM moze Cie wypuscic") end
return 1 end
kraty2.lua
function onUse(cid, item, frompos, item2, topos)
doTransformItem(item.uid,item.itemid-1) return 1
end
Zapisujemy go jako: kraty1.lua
Wchodzimy w data/actions/actions.xml
Dodajemy tam linijki:
<action itemid="2297" script="wiezienie.lua" allowfaruse="1" /> <action itemid="5733" script="kraty1.lua" /> <action itemid="5736" script="kraty1.lua" /> <action itemid="5734" script="kraty2.lua" /> <action itemid="5737" script="kraty2.lua" />
|