Djivar
AKA Wickedviruz
Hi!
I am trying to implement svarground arena on a TFS 1.4.2 evo map
But i can not get it to work... i have tried to debug the code but i am stuck. soo the problem i i talk to the npc, pay the fee and i get the storagevalue 1100 = 1 and 1101 = 1 stored in the database.
But when i try to enter the door i get the message "The door seems to be sealed against unwanted intruders." altho i should not be?
this is my server response from my prints:
And this is the actions.xml
this is arena_door.lua with all the print statements:
this is the 051-storages.lua:
if you need more code, please just ask for it i will do my best to respod as soon as possible!
I am trying to implement svarground arena on a TFS 1.4.2 evo map
But i can not get it to work... i have tried to debug the code but i am stuck. soo the problem i i talk to the npc, pay the fee and i get the storagevalue 1100 = 1 and 1101 = 1 stored in the database.
But when i try to enter the door i get the message "The door seems to be sealed against unwanted intruders." altho i should not be?
this is my server response from my prints:
Code:
Nicke has logged in.
Player Storage Value (Arena): 1
Action ID: 13100
Checking storage for arena entrance door: 1101
Transforming item and teleporting player.
And this is the actions.xml
XML:
<!-- Arena Quest-->
<action actionid="13100" script="quests/svargrond arena/arena_door.lua" />
<action actionid="26100" script="quests/svargrond arena/arena_door.lua" />
<action actionid="27100" script="quests/svargrond arena/arena_door.lua" />
<action actionid="28100" script="quests/svargrond arena/arena_door.lua" />
this is arena_door.lua with all the print statements:
Lua:
local storages = {
[26100] = Storage.SvargrondArena.Greenhorn,
[27100] = Storage.SvargrondArena.Scrapper,
[28100] = Storage.SvargrondArena.Warlord
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
-- Cannot use opened door
if item.itemid == 5133 then
print("Door is already open.")
return false
end
print("Player Storage Value (Arena): " .. player:getStorageValue(Storage.SvargrondArena.Arena))
if player:getStorageValue(Storage.SvargrondArena.Arena) < 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'This door seems to be sealed against unwanted intruders.')
return true
end
-- Doors to rewards
local cStorage = storages[item.actionid]
print("Action ID: " .. item.actionid)
if cStorage then
print("Checking storage for rewards door: " .. cStorage)
if player:getStorageValue(cStorage) ~= 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It\'s locked.')
return true
end
item:transform(item.itemid + 1)
player:teleportTo(toPosition, true)
else
print("Checking storage for arena entrance door: " .. Storage.SvargrondArena.Pit)
if player:getStorageValue(Storage.SvargrondArena.Pit) ~= 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'This door seems to be sealed against unwanted intruders.')
return true
end
print("Transforming item and teleporting player.")
item:transform(item.itemid + 1)
player:teleportTo(toPosition, true)
end
return true
end
this is the 051-storages.lua:
Code:
SvargrondArena = {
Arena = 1100,
Pit = 1101,
QuestLogGreenhorn = 50140,
QuestLogScrapper = 50141,
QuestLogWarlord = 50142,
RewardGreenhorn = 26300,
RewardScrapper = 27300,
RewardWarlord = 28300,
TrophyGreenhorn = 1103,
TrophyScrapper = 1105,
TrophyWarlord = 1107,
-- Reward Doors
Greenhorn = 26100,
Scrapper = 27100,
Warlord = 28100
},
if you need more code, please just ask for it i will do my best to respod as soon as possible!