What's new

Inne Szukam Rain Item event i Serek Event

Status
Not open for further replies.

xLeito

User
Joined
Aug 7, 2014
Messages
33
Reaction score
0
Witam potrzebuje skrypt na rain item event i na serek event. Prosze o pomoc
 

Skajowski

Senior User
Joined
Jun 11, 2010
Messages
1,160
Reaction score
90
Odp: Szukam Rain Item event i Serek Event

[LUA] local fromPos = {x=76, y=65, z=7}
local toPos = {x=82, y=70, z=7}
local items = {{8306,1}, {2157,2}, {7735,1}, {8306,1}, {2184,1}, {9932,1}, {8306,1}, {9693,1}}
local maxItems = 14

function isWalkable(pos, creature, proj, pz)
if getTileThingByPos({x=pos.x,y=pos.y,z=pos.z,stackpo s=0}).itemid == 0 then return false end
local n = not proj and 3 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return true
end
end
end
return true
end

function checkPositions(n)
local pos = {x=math.random(fromPos.x,toPos.x), y=math.random(fromPos.y,toPos.y), z=math.random(fromPos.z,toPos.z)}
if isWalkable(pos, true, false, true) then
return pos
end
return (n < 50 and checkPositions(n+1) or false)
end

function onSay(cid, words, param)
doBroadcastMessage("Rain item event will start in 1 minutes. Go to deposit.", MESSAGE_EVENT_ADVANCE)
return addEvent(spawnItem, 60000, 1)
end

function spawnItem(created)
if created >= maxItems then
return doBroadcastMessage("Rain Item Event just finished!", MESSAGE_EVENT_ADVANCE)
end
local itemPos, itemInf = checkPositions(1), math.random(#items)
doCreateItem(items[itemInf][1], items[itemInf][2], itemPos)
doSendMagicEffect(itemPos, CONST_ME_LOSEENERGY)
return addEvent(spawnItem, 5000, created+1)
end[/LUA]
<talkaction log="yes" words="/rainitem" access="5" event="script" value="rainitem.lua"/>
+ serek event http://tibia.net.pl/threads/560456-Serek-Event
 
Last edited:

equero

Active User
Joined
May 3, 2011
Messages
68
Reaction score
0
Odp: Szukam Rain Item event i Serek Event

Sorry ?e odkopuj? ale mam b??d
[LUA][22/03/2016 12:30:10] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/rainevent.lua:7: '}' expected near 's'
[22/03/2016 12:30:10] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/rainevent.lua)
[22/03/2016 12:30:10] data/talkactions/scripts/rainevent.lua:7: '}' expected near 's'[/LUA]
 

#NOOB

Senior User
Joined
May 25, 2014
Messages
901
Reaction score
89
Odp: Szukam Rain Item event i Serek Event

Bo w stackpos wdupi?a si? spacja. Dok?adnie tutaj:
if getTileThingByPos({x=pos.x,y=pos.y,z=pos.z,stackpo s=0}).itemid == 0 then return false end

Usu? j? i gotowe.
 
Last edited:
Status
Not open for further replies.
Top