Visualest
New Member
- Joined
- Mar 11, 2016
- Messages
- 25
- Reaction score
- 2
Hello everyone, hope you guys could help me to fix this problem, it might be simple but i'm new to tibia scripts,
Event is (FireStorm)
everything works fine, the players gets tped, but the issue is the fire damage is so slow it hits the floor once every 10 mins, is there anyway i could fix this issue, so the storm works perfectly, if so please inform me!
Here is the script:
Event is (FireStorm)
everything works fine, the players gets tped, but the issue is the fire damage is so slow it hits the floor once every 10 mins, is there anyway i could fix this issue, so the storm works perfectly, if so please inform me!
Here is the script:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Fire Storm Event" version="1.0" author="iFate" contact="otland.net/members/iFate/" enabled="yes">
<config name="lms_config">
<![CDATA[
configFire = {
storage = 8998, -- set free storage
eventStorage = 6254, -- set free storage
joinEventStorage = 5535, -- set free storage
countPlayerStorage = 7373, -- set free storage
exhaustStorage = 8387,
maxPlayers = 50, -- max players in event
teleportPos = {x=1210 ,y=1165,z=7}, -- position to which player is teleporting
rewardID = {9020}, -- reward id which player can win (reward is random)
minLevel = 1, -- minimum of level with which player can join to event
days = {
['Monday'] = {'12:47:00'},
['Tuesday'] = {'12:47:00'},
['Wednesday'] = {'12:47:00'},
['Thursday'] = {'12:47:00'},
['Friday'] = {'12:47:00'},
['Saturday'] = {'12:47:00'},
['Sunday'] = {'12:47:00'}
},
minPlayers = 2,
delayTime = 3.0, -- time in which players who joined to event are teleporting to teleport position
timeToStartEvent = 30 -- time from teleport to start event
}
arena = {fromPos = {x=1205,y=1162,z=7}, -- left top corner of event room
toPos = {x=1212,y=1169,z=7} -- right bottom corner of event room
}
y, x = 1, 1
]]>
</config>
<lib name="lms_fire_lib">
<![CDATA[
function doStartEvent()
doSetStorage(configFire.joinEventStorage, -1)
if configFire.minPlayers <= getStorage(configFire.countPlayerStorage) + 1 then
for _, cid in ipairs(getPlayersOnline()) do
if getCreatureStorage(cid, configFire.storage) == 1 then
addEvent(doSetStorage, configFire.timeToStartEvent * 1000, configFire.eventStorage, 1)
doCreatureSetStorage(cid, configFire.storage, -1)
doCreatureSetNoMove(cid, false)
doRemoveCondition(cid, CONDITION_INFIGHT)
doTeleportThing(cid, configFire.teleportPos)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready, The Event will start in ' .. configFire.timeToStartEvent .. ' seconds.')
end
end
else
for _, cid in ipairs(getPlayersOnline()) do
if getCreatureStorage(cid, configFire.storage) == 1 then
doCreatureSetNoMove(cid, false)
doRemoveCondition(cid, CONDITION_INFIGHT)
end
end
doBroadcastMessage('The fire storm event has not started because not enough players joined.', MESSAGE_EVENT_ADVANCE)
end
doSetStorage(configFire.countPlayerStorage, 0)
end
]]>
</lib>
<talkaction words="!event" event="script">
<![CDATA[
domodlib("lms_config")
function onSay(cid, words, param)
local storage, playerJoined, counter = getCreatureStorage(cid, configFire.storage), {}, getStorage(configFire.countPlayerStorage)
if getStorage(configFire.joinEventStorage) == 1 then
if(param == '') then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'Command param required (say: "!event join" or "!event leave").')
end
if configFire.minLevel ~= nil then
if getPlayerLevel(cid) < configFire.minLevel then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You cannot join The Fire Storm Event if you do not have a require level. [' .. configFire.minLevel .. ']')
end
end
if getTileInfo(getThingPos(cid)).protection ~= true then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You cannot join The Fire Storm Event if you are not in a Protection Zone.')
end
if exhaustion.check(cid, configFire.exhaustStorage) ~= false then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You must wait' .. exhaustion.get(cid, configFire.exhaustStorage) .. ' seconds.')
end
if param == 'join' then
if storage <= 0 then
if counter ~= configFire.maxPlayers - 1 then
doSetStorage(configFire.countPlayerStorage, 0)
for _, pid in ipairs(getPlayersOnline()) do
if getCreatureStorage(pid, configFire.storage) > 0 then
table.insert(playerJoined, pid)
doSetStorage(configFire.countPlayerStorage, #playerJoined)
end
end
local count = getStorage(configFire.countPlayerStorage)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, count == 0 and 'You are first in the fire storm event.' or count == 1 and 'There is 1 player in fire storm event.' or count > 1 and 'There are '.. count ..' players in fire storm event.')
doCreatureSetStorage(cid, configFire.storage, 1)
doCreatureSetNoMove(cid, true)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have joined the Fire Storm Event, You may not move until the Event has started please wait patiently...')
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'Max players in event have been reached.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You already joined the Event, Wait patiently for it to start.')
end
elseif param == 'leave' then
if storage > 0 then
doCreatureSetNoMove(cid, false)
doRemoveCondition(cid, CONDITION_INFIGHT)
doCreatureSetStorage(cid, configFire.storage, -1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have left the Fire Run Event, And you can move now.')
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You cannot leave The Fire Storm Event.')
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You cannot join/leave The Fire Storm Event yet.')
end
exhaustion.set(cid, configFire.exhaustStorage, 5)
return true
end
]]>
</talkaction>
<talkaction words="!startfire" access="5" event="script">
<![CDATA[
domodlib("lms_config")
domodlib("lms_fire_lib")
function onSay(cid, words, param)
doBroadcastMessage('Fire Storm Event will start in ' .. configFire.delayTime .. ' minutes. You can join the Fire Storm Event by using this command "!event join".', MESSAGE_EVENT_ADVANCE)
for _, pid in ipairs(getPlayersOnline()) do
if getCreatureStorage(pid, configFire.storage) == 1 then
doCreatureSetStorage(pid, configFire.storage, -1)
doSetStorage(configFire.countPlayerStorage, 0)
doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
end
end
doSetStorage(configFire.joinEventStorage, 1)
addEvent(doStartEvent, configFire.delayTime * 60 * 1000)
return true
end
]]>
</talkaction>
<event type="think" name="LMS_Event_Start" event="script">
<![CDATA[
domodlib("lms_config")
domodlib("lms_fire_lib")
local daysOpen = {}
for k, v in pairs(configFire.days) do
table.insert(daysOpen, k)
end
function onThink(cid, interval)
if isInArray(daysOpen, os.date('%A')) then
if isInArray(configFire.days[os.date('%A')], os.date('%X', os.time())) then
if getStorage(configFire.joinEventStorage) ~= 1 then
doBroadcastMessage('Fire Storm Event will start in '.. configFire.delayTime ..' minutes. You can join the event by typing "!event join".', MESSAGE_EVENT_ADVANCE)
for _, pid in ipairs(getPlayersOnline()) do
if getCreatureStorage(pid, configFire.storage) == 1 then
doCreatureSetStorage(pid, configFire.storage, -1)
doSetStorage(configFire.countPlayerStorage, 0)
doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
end
end
doSetStorage(configFire.joinEventStorage, 1)
addEvent(doStartEvent, configFire.delayTime * 60 * 1000)
end
end
end
return true
end
]]>
</event>