Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- id = ID da Pedra
- -- pos = Pos da Pedra
- -- pressTime = Tempo que ficará preso pressionando o tile que remove a Pedra (Em segundos)
- -- durationTime = Por quanto tempo a Pedra ficará ausente (Em segundos)
- local id = {
- [20201] = {id = 1354, pos = {x = 1564, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20202] = {id = 1354, pos = {x = 1558, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20203] = {id = 1354, pos = {x = 1552, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20204] = {id = 1354, pos = {x = 1546, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20205] = {id = 1354, pos = {x = 1540, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20206] = {id = 1354, pos = {x = 1534, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20207] = {id = 1354, pos = {x = 1528, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20208] = {id = 1354, pos = {x = 1522, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20209] = {id = 1354, pos = {x = 1516, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20210] = {id = 1354, pos = {x = 1510, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20211] = {id = 1354, pos = {x = 1504, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20212] = {id = 1354, pos = {x = 1498, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20213] = {id = 1354, pos = {x = 1492, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20214] = {id = 1354, pos = {x = 1486, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20215] = {id = 1354, pos = {x = 1480, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20216] = {id = 1354, pos = {x = 1473, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20217] = {id = 1354, pos = {x = 1466, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20218] = {id = 1354, pos = {x = 1459, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20219] = {id = 1354, pos = {x = 1452, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20220] = {id = 1354, pos = {x = 1445, y = 1523, z = 10}, pressTime = 30, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- [20221] = {id = 1354, pos = {x = 1437, y = 1523, z = 10}, pressTime = 60, durationTime = 10,
- monsters = {
- {monster = "dragon", pos = {x = 1564, y = 1523, z = 10}},
- {monster = "demon", pos = {x = 1564, y = 1523, z = 10}},
- }
- },
- }
- function onStepIn(cid, item, position, fromPosition)
- if isPlayer(cid) then
- get = id[item.actionid]
- if get then
- setPlayerStorageValue(cid, 20200, item.actionid)
- rock = getTileItemById(get.pos, get.id)
- if rock.uid > 0 then
- local condition = createConditionObject(CONDITION_INFIGHT)
- setConditionParam(condition, CONDITION_PARAM_TICKS, get.pressTime * 1000)
- doAddCondition(cid, condition)
- mayNotMove(cid, true)
- doRemainCountBySwatt(getThingPos(cid), get.pressTime, "Ready!", math.random(1, 255))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The rock button is loading, wait to remove the rock.")
- addEvent(function()
- if isPlayer(cid) then
- rockPOS, rockID = get.pos, get.id
- rockUID = getTileItemById(rockPOS, rockID).uid
- doSendMagicEffect(rockPOS, CONST_ME_POFF)
- doRemoveItem(rockUID, 1)
- mayNotMove(cid, false)
- nget = id[getPlayerStorageValue(cid, 20200)]
- if not nget then print('Ocorreu um erro no script de remover pedra e sumonar monstro [By Swatt].') end
- for a = 1, #nget.monsters do
- creat = getTopCreature(nget.monsters[a].pos)
- if creat.uid > 0 then doRemoveCreature(creat.uid) end
- doSendMagicEffect(nget.monsters[a].pos, CONST_ME_EXPLOSIONAREA)
- doCreateMonster(nget.monsters[a].monster, nget.monsters[a].pos)
- end
- addEvent(function()
- doSendMagicEffect(rockPOS, CONST_ME_EXPLOSIONAREA)
- doCreateItem(rockID, 1, rockPOS)
- end, get.durationTime * 1000)
- end
- end, get.pressTime * 1000)
- end
- end
- end
- return true
- end
- function doRemainCountBySwatt(pos, tempo, texto, color)
- for x = 0, tempo do
- addEvent(function()
- if x < tempo then
- doSendAnimatedText(pos, ""..(tempo - x).."", color)
- else
- doSendAnimatedText(pos, ""..texto.."", color)
- end
- end, 1000*x)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment