What's new

Quest i lvl doors

olgierd555

Senior User
Joined
May 28, 2008
Messages
650
Reaction score
21
witam.
jak wlanczam serva i chce wejsc postacia przez lvl door (bramka lvlowa)
to nic nie pisze, ale wyskakuje w konsoli
[25/08/2009 14:58:15] Lua Script Error: [Action Interface]
[25/08/2009 14:58:15] data/actions/scripts/other/doors.lua:eek:nUse
[25/08/2009 14:58:15] attempt to index a nil value
[25/08/2009 14:58:15] stack traceback:
[25/08/2009 14:58:15] [C]: in function 'isInArray'
[25/08/2009 14:58:15] data/actions/scripts/other/doors.lua:13: in function <data/actions/scripts/other/doors.lua:12>
[25/08/2009 14:58:16] Lua Script Error: [Action Interface]
[25/08/2009 14:58:16] data/actions/scripts/other/doors.lua:eek:nUse
[25/08/2009 14:58:16] attempt to index a nil value
[25/08/2009 14:58:16] stack traceback:
[25/08/2009 14:58:16] [C]: in function 'isInArray'
[25/08/2009 14:58:16] data/actions/scripts/other/doors.lua:13: in function <data/actions/scripts/other/doors.lua:12>
[25/08/2009 14:58:16] Lua Script Error: [Action Interface]
[25/08/2009 14:58:16] data/actions/scripts/other/doors.lua:eek:nUse
[25/08/2009 14:58:16] attempt to index a nil value
[25/08/2009 14:58:16] stack traceback:
[25/08/2009 14:58:16] [C]: in function 'isInArray'
[25/08/2009 14:58:16] data/actions/scripts/other/doors.lua:13: in function <data/actions/scripts/other/doors.lua:12>
[25/08/2009 14:58:17] Lua Script Error: [Action Interface]
[25/08/2009 14:58:17] data/actions/scripts/other/doors.lua:eek:nUse
[25/08/2009 14:58:17] attempt to index a nil value
[25/08/2009 14:58:17] stack traceback:
[25/08/2009 14:58:17] [C]: in function 'isInArray'
[25/08/2009 14:58:17] data/actions/scripts/other/doors.lua:13: in function <data/actions/scripts/other/doors.lua:12>
[25/08/2009 14:58:17] Lua Script Error: [Action Interface]
[25/08/2009 14:58:17] data/actions/scripts/other/doors.lua:eek:nUse
[25/08/2009 14:58:17] attempt to index a nil value
[25/08/2009 14:58:17] stack traceback:
[25/08/2009 14:58:17] [C]: in function 'isInArray'
[25/08/2009 14:58:17] data/actions/scripts/other/doors.lua:13: in function <data/actions/scripts/other/doors.lua:12>
[25/08/2009 14:58:18] Lua Script Error: [Action Interface]
[25/08/2009 14:58:18] data/actions/scripts/other/doors.lua:eek:nUse
[25/08/2009 14:58:18] attempt to index a nil value
[25/08/2009 14:58:18] stack traceback:
[25/08/2009 14:58:18] [C]: in function 'isInArray'
[25/08/2009 14:58:18] data/actions/scripts/other/doors.lua:13: in function <data/actions/scripts/other/doors.lua:12>
[25/08/2009 14:58:18] Lua Script Error: [Action Interface]
[25/08/2009 14:58:18] data/actions/scripts/other/doors.lua:eek:nUse
sorka ale klawiatura mi sie zepsula i nie dam quote
i questy tez nie dzialaja, oto skrypt ze questem
function onUse(cid, item, frompos, item2, topos)
prize = item.uid
count = item.actionid
if prize > 0 and prize < 7000 then
queststatus = getPlayerStorageValue(cid,prize)
if queststatus == -1 then
if count > 1 then
doPlayerSendTextMessage(cid,22,'You have found '.. count ..' of ' .. getItemName(prize) .. '.')
doPlayerAddItem(cid,prize,count)
setPlayerStorageValue(cid,prize,1)
else
doPlayerSendTextMessage(cid,22,'You have found a ' .. getItemName(prize) .. '.')
doPlayerAddItem(cid,prize,1)
setPlayerStorageValue(cid,prize,1)
end
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return 1
else
return 0
end
end
znalazlem inne takie tematy, ale nikt dam nie otrzymal pomocy
 

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
Odp: Quest i lvl doors

lepiej sie pochwal tym plikiem doors.lua bo nie chce cos mi sie wierzyc w te bledy
 

olgierd555

Senior User
Joined
May 28, 2008
Messages
650
Reaction score
21
Odp: Quest i lvl doors

function checkStackpos(item, position)
position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local thing = getThingfromPos(position)
position.stackpos = STACKPOS_TOP_FIELD
local field = getThingfromPos(position)
if item.uid ~= thing.uid and thing.itemid >= 100 or field.itemid ~= 0 then
return FALSE
end
return TRUE
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
if isInArray(questDoors, item.itemid) == TRUE then
if getPlayerStorageValue(cid, item.actionid) ~= -1 then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return TRUE
elseif isInArray(levelDoors, item.itemid) == TRUE then
if item.actionid > 0 and getPlayerLevel(cid) >= item.actionid - 1000 then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
end
return TRUE
elseif isInArray(keys, item.itemid) == TRUE then
if itemEx.actionid > 0 then
if item.actionid == itemEx.actionid then
if doors[itemEx.itemid] ~= nil then
doTransformItem(itemEx.uid, doors[itemEx.itemid])
return TRUE
end
end
doPlayerSendCancel(cid, "The key does not match.")
return TRUE
end
return FALSE
elseif isInArray(horizontalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition) == TRUE then
local newPosition = toPosition
newPosition.y = newPosition.y + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if doorCreature.itemid ~= 0 then
if getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid then
doPlayerSendCancel(cid, "Sorry, not possible.")
else
doTeleportThing(doorCreature.uid, newPosition, TRUE)
if isInArray(openSpecialDoors, item.itemid) ~= TRUE then
doTransformItem(item.uid, item.itemid - 1)
end
end
return TRUE
end
doTransformItem(item.uid, item.itemid - 1)
return TRUE
elseif isInArray(verticalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition) == TRUE then
local newPosition = toPosition
newPosition.x = newPosition.x + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if doorCreature.itemid ~= 0 then
if getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid then
doPlayerSendCancel(cid, "Sorry, not possible.")
else
doTeleportThing(doorCreature.uid, newPosition, TRUE)
if isInArray(openSpecialDoors, item.itemid) ~= TRUE then
doTransformItem(item.uid, item.itemid - 1)
end
end
return TRUE
end
doTransformItem(item.uid, item.itemid - 1)
return TRUE
elseif doors[item.itemid] ~= nil and checkStackpos(item, fromPosition) == TRUE then
if item.actionid == 0 then
doTransformItem(item.uid, doors[item.itemid])
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
end
return TRUE
end
return FALSE
end
 

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
Odp: Quest i lvl doors

kolego sprawdzi co masz nagle na 14 lini to moze to cie zaciekawi ze uzywasz moim zdaniem zlego kod lub zle dajesz drzwi
 

Avexor

User
Joined
Aug 18, 2009
Messages
26
Reaction score
3
Odp: Quest i lvl doors

Przypominam ze LEVEL GATE (bramke levelowa) robi sie b.latwo czyli na przyklad 0500 i bramka bedzie od 500 levela, (0500 wpisac w to drugie pole chyba unique id) proste ^^
 
Last edited:

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
Odp: Quest i lvl doors

Przypominam ze LEVEL GATE (bramke levelowa) robi sie b.latwo czyli na przyklad 0500 i bramka bedzie od 500 levela, (0500 wpisac w to drugie pole chyba unique id) proste ^^
tego nie slyszalem ze actionid zaczynaja sie od zera bo jakos mi sie wydawalo ze one sie zaczynaj od 100 jak juz takie chcesz cos pisac to lepiej sie zastanow bo na 500 lvl to sie daje action 1500
 

Avexor

User
Joined
Aug 18, 2009
Messages
26
Reaction score
3
Odp: Quest i lvl doors

Przepraszam, m?j blad, wpisuje sie w UniqueID
i zaczyna sie od 0!!!
 
Last edited:

olgierd555

Senior User
Joined
May 28, 2008
Messages
650
Reaction score
21
Odp: Quest i lvl doors

tyle, ze ja potrzebuje questa na wszystko
a co do drzwi, to chyba nie moze byc action, bo bramek lvlowych jest duzo i co kazda inny lvl (bo uniqueid mozna tylko jedno
 

olgierd555

Senior User
Joined
May 28, 2008
Messages
650
Reaction score
21
Odp: Quest i lvl doors

tylko, ze ja potrzebuje jeden uniwersalny skrypt na quest na wszystko co moveable i jeden uniwersalny skrypt na wszystkie lvldoors
edit: quest znalazlem
http://tibia.net.pl/pomoc-z-ot/154341-problem-quest.html
ale dalej szukam doors
xArT iRoK said:
kolego sprawdzi co masz nagle na 14 lini to moze to cie zaciekawi ze uzywasz moim zdaniem zlego kod lub zle dajesz drzwi
daje actions id=lvl+1000
 
Last edited:

olgierd555

Senior User
Joined
May 28, 2008
Messages
650
Reaction score
21
Odp: Quest i lvl doors

odswiezam
daje normalnie, np.: 1009 dalem i prubowalem wejsc 8 lvlem, wyskoczyl blad w konsoli, a nic nie napisano do gracza
znaczy nie bylo tego:
Only the worthy may pass.
 

Dubler

Lua Factory =)
Joined
Apr 8, 2009
Messages
1,874
Reaction score
112
Odp: Quest i lvl doors

ja mia?em dok?adnie to samo i skopiowa?em doors.lua z innego silnika...

wklej to i b?dzie git: (o ile masz TFS 0.3.5) je?li inny to napisz jaki)
local function checkStackpos(item, position)
position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local thing = getThingFromPos(position)
position.stackpos = STACKPOS_TOP_FIELD
local field = getThingFromPos(position)
return (item.uid == thing.uid or thing.itemid < 100 or field.itemid == 0)
end
local function doorEnter(cid, item, toPosition)
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(fromPosition.x ~= CONTAINER_POSITION and isPlayerPzLocked(cid) and getTileInfo(fromPosition).protection) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end
if(getItemLevelDoor(item.itemid) > 0) then
if(item.actionid == 189) then
if(not isPremium(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return true
end
doorEnter(cid, item, toPosition)
return true
end
local gender = item.actionid - 186
if(isInArray({PLAYERSEX_FEMALE, PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender)) then
if(gender ~= getPlayerSex(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return true
end
doorEnter(cid, item, toPosition)
return true
end
local skull = item.actionid - 180
if(skull >= SKULL_NONE and skull <= SKULL_BLACK) then
if(skull ~= getCreatureSkullType(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return true
end
doorEnter(cid, item, toPosition)
return true
end
local group = item.actionid - 150
if(group >= 0 and group < 30) then
if(group > getPlayerGroupId(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return true
end
doorEnter(cid, item, toPosition)
return true
end
local vocation = item.actionid - 100
if(vocation >= 0 and vocation < 50) then
local playerVocationInfo = getVocationInfo(getPlayerVocation(cid))
if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return true
end
doorEnter(cid, item, toPosition)
return true
end
if(item.actionid == 190 or (item.actionid ~= 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid)))) then
doorEnter(cid, item, toPosition)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
end
return true
end
if(isInArray(specialDoors, item.itemid)) then
if(item.actionid == 100 or (item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) > 0)) then
doorEnter(cid, item, toPosition)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return true
end
if(isInArray(keys, item.itemid)) then
if(itemEx.actionid > 0) then
if(item.actionid == itemEx.actionid and doors[itemEx.itemid] ~= nil) then
doTransformItem(itemEx.uid, doors[itemEx.itemid])
return true
end
doPlayerSendCancel(cid, "The key does not match.")
return true
end
return false
end
if(isInArray(horizontalOpenDoors, item.itemid) and checkStackpos(item, fromPosition)) then
local newPosition = toPosition
newPosition.y = newPosition.y + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if(doorCreature.itemid ~= 0) then
local pzDoorPosition = getTileInfo(doorPosition).protection
local pzNewPosition = getTileInfo(newPosition).protection
if((pzDoorPosition and not pzNewPosition and doorCreature.uid ~= cid) or
(not pzDoorPosition and pzNewPosition and doorCreature.uid == cid and isPlayerPzLocked(cid))) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTeleportThing(doorCreature.uid, newPosition)
if(not isInArray(closingDoors, item.itemid)) then
doTransformItem(item.uid, item.itemid - 1)
end
end
return true
end
doTransformItem(item.uid, item.itemid - 1)
return true
end
if(isInArray(verticalOpenDoors, item.itemid) and checkStackpos(item, fromPosition)) then
local newPosition = toPosition
newPosition.x = newPosition.x + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if(doorCreature.itemid ~= 0) then
if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTeleportThing(doorCreature.uid, newPosition)
if(not isInArray(closingDoors, item.itemid)) then
doTransformItem(item.uid, item.itemid - 1)
end
end
return true
end
doTransformItem(item.uid, item.itemid - 1)
return true
end
if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition)) then
if(item.actionid == 0) then
doTransformItem(item.uid, doors[item.itemid])
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
end
return true
end
return false
end
 

olgierd555

Senior User
Joined
May 28, 2008
Messages
650
Reaction score
21
Odp: Quest i lvl doors

nie dziala mi to, a w silniku pisze cos tam crying damson 0.3.4
edit:niedzialaja drzwi na 0.3.4
lolz
edit2: if item.actionid > 0 and getPlayerLevel(cid) >= item.actionid - 1000 then
to znaczy, ze system sprawdza czy gracz ma wyzszy lub ruwno od actionid -1000
czyli np.: system sprawdza czy gracz ma lub wyzszy niz >= 1100 - 1000
 
Last edited:

olgierd555

Senior User
Joined
May 28, 2008
Messages
650
Reaction score
21
Odp: Quest i lvl doors

prosze o zamkniecie tematu, jakby kto pytal jak to zrobilem to:
wystarczy drzwi przekierowac do pliku z drzwiami, ale lvl drzwi kierowac to nowego pliku, w ktorym jest skrypt na lvldoor, a jesli beda przekierowanie lvldoorow na plik doors to wtedy nie dziala ^^
pozdro, bez powazania, jasiu...
 
Top