Postado Março 25, 2018 7 anos Olá pessoal estou com esse Fly System , queria pedir quem puder me ajudar que por favor. a colocar Level para usar, e também para cada voc diferente configurada uma outfit diferente e também nao poder usar enquanto estiver battle ! quem puder me ajudar fico muito grato , +REP !! LIB: Citar FLY_STORAGE = getConfigValue("flyStorage") flyBlackSQM = false nonFlyableBorder = {7576, 7577} changeSpeed = true flySpeed = 500 waterSpeed = 150 ITEM_FLYTILE = 460 ITEM_WATERTILE = 4625 FLY_OUTFIT = {lookType = 657, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0} WATER = {4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619} RANGEX = 1 RANGEY = 1 ret = { "You are now flying.", "You are not flying anymore.", "You cannot stop flying here.", "You are not flying.", "You cannot up here.", "You cannot down here.", "You cannot go to there." } storPos = {x = 1200, y = 1201, z = 1202} function isWalkable(pos, creature, proj, pz) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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 false end end end return true end function getAreaToRemove(pos1, pos2) local t = getDirectionTo(pos1, pos2) local pos = { [0] = { {x = pos1.x + 1, y = pos1.y + 1, z = pos1.z}, {x = pos1.x, y = pos1.y + 1, z = pos1.z}, {x = pos1.x - 1, y = pos1.y + 1, z = pos1.z} }, [2] = { {x = pos1.x + 1, y = pos1.y - 1, z = pos1.z}, {x = pos1.x, y = pos1.y - 1, z = pos1.z}, {x = pos1.x - 1, y = pos1.y - 1, z = pos1.z} }, [1] = { {x = pos1.x - 1, y = pos1.y - 1, z = pos1.z}, {x = pos1.x - 1, y = pos1.y, z = pos1.z}, {x = pos1.x - 1, y = pos1.y + 1, z = pos1.z} }, [3] = { {x = pos1.x + 1, y = pos1.y - 1, z = pos1.z}, {x = pos1.x + 1, y = pos1.y, z = pos1.z}, {x = pos1.x + 1, y = pos1.y + 1, z = pos1.z} }, [7] = { {x = pos1.x - 1, y = pos1.y - 1, z = pos1.z}, {x = pos1.x - 1, y = pos1.y, z = pos1.z}, {x = pos1.x - 1, y = pos1.y + 1, z = pos1.z}, {x = pos1.x, y = pos1.y + 1, z = pos1.z}, {x = pos1.x + 1, y = pos1.y + 1, z = pos1.z} }, [6] = { {x = pos1.x + 1, y = pos1.y - 1, z = pos1.z}, {x = pos1.x + 1, y = pos1.y, z = pos1.z}, {x = pos1.x + 1, y = pos1.y + 1, z = pos1.z}, {x = pos1.x, y = pos1.y + 1, z = pos1.z}, {x = pos1.x - 1, y = pos1.y + 1, z = pos1.z} }, [5] = { {x = pos1.x - 1, y = pos1.y - 1, z = pos1.z}, {x = pos1.x - 1, y = pos1.y, z = pos1.z}, {x = pos1.x - 1, y = pos1.y + 1, z = pos1.z}, {x = pos1.x, y = pos1.y - 1, z = pos1.z}, {x = pos1.x + 1, y = pos1.y - 1, z = pos1.z} }, [4] = { {x = pos1.x - 1, y = pos1.y - 1, z = pos1.z}, {x = pos1.x, y = pos1.y - 1, z = pos1.z}, {x = pos1.x + 1, y = pos1.y - 1, z = pos1.z}, {x = pos1.x + 1, y = pos1.y, z = pos1.z}, {x = pos1.x + 1, y = pos1.y + 1, z = pos1.z} } } return pos[t] end function doCreateTile(pos) doAreaCombatHealth(0, 0, pos, 0, 0, 0, 255) end Talkactions : Citar function onSay(cid, words, param) local pos = getCreaturePosition(cid) pos.stackpos = 0 if(words == "!fly") then if getCreatureStorage(cid, FLY_STORAGE) > 0 then if not isWalkable(getCreaturePosition(cid)) or getThingFromPos(pos).itemid == ITEM_FLYTILE or getThingFromPos(pos).itemid == ITEM_WATERTILE then doPlayerSendCancel(cid, ret[3]) return true end doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doCreatureSetStorage(cid, FLY_STORAGE, 0) doRemoveCondition(cid, CONDITION_OUTFIT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, ret[2]) return true else doCreatureSetStorage(cid, FLY_STORAGE, 1) doRemoveConditions(cid, true) doSetCreatureOutfit(cid, FLY_OUTFIT, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, ret[1]) if changeSpeed then doChangeSpeed(cid, flySpeed) end return true end elseif(words == "fly") then if param == "up" then pos.z = pos.z - 1 doCreateTile(pos) if getCreatureStorage(cid, FLY_STORAGE) < 1 then doPlayerSendCancel(cid, ret[4]) return true end if(getCreaturePosition(cid).z == 0) or (getThingFromPos(pos).itemid ~= ITEM_FLYTILE and getThingFromPos(pos).itemid > 0) or (getTileInfo(pos).house) then doPlayerSendCancel(cid, ret[5]) return true end local tpos = pos tpos.stackpos = 253 if isCreature(getThingFromPos(tpos).uid) then doPlayerSendCancel(cid, ret[5]) return true end local toCreate = {} for _, area in ipairs(getArea(pos, RANGEX, RANGEY)) do doCreateTile(area) local thing = getThingFromPos(area) if thing.itemid < 1 then table.insert(toCreate, area) end end if getThingFromPos(pos).itemid < 1 then for _, create in ipairs(toCreate) do create.stackpos = 0 doCreateItem(ITEM_FLYTILE, 1, create) end doTeleportThing(cid, pos) if changeSpeed then doChangeSpeed(cid, flySpeed) end pos.z = pos.z + 1 doSendMagicEffect(pos, CONST_ME_BLOCKHIT) for _, area in ipairs(getArea(pos, RANGEX, RANGEY)) do doCreateTile(area) local thing = getThingFromPos(area) if thing.itemid == ITEM_FLYTILE then doRemoveItem(thing.uid) elseif thing.itemid == ITEM_WATERTILE then doTransformItem(thing.uid, WATER[1]) end end else doPlayerSendCancel(cid, ret[7]) end elseif param == "down" then pos.z = pos.z + 1 doCreateTile(pos) if getCreatureStorage(cid, FLY_STORAGE) < 1 then doPlayerSendCancel(cid, ret[4]) return true end if getCreaturePosition(cid).z == 14 then doPlayerSendCancel(cid, ret[6]) return true end if(getTileInfo(pos).house) then doPlayerSendCancel(cid, ret[6]) return true end local cpos = getCreaturePosition(cid) cpos.stackpos = 0 if getThingFromPos(cpos).itemid ~= ITEM_FLYTILE then doPlayerSendCancel(cid, ret[6]) return true end local tpos = pos tpos.stackpos = 253 if isCreature(getThingFromPos(tpos).uid) then doPlayerSendCancel(cid, ret[6]) return true end local toCreate = {} for _, area in ipairs(getArea(pos, RANGEX, RANGEY)) do doCreateTile(area) local thing = getThingFromPos(area) if(thing.itemid < 1 or isInArray(WATER, thing.itemid)) then table.insert(toCreate, area) end end local x = false if isWalkable(pos) or getThingFromPos(pos).itemid < 1 or isInArray(WATER, getThingFromPos(pos).itemid) then for _, create in ipairs(toCreate) do if isInArray(WATER, getThingFromPos(create).itemid) then doTransformItem(getThingFromPos(create).uid, ITEM_WATERTILE) x = (create.z == pos.z and true or false) else doCreateItem(ITEM_FLYTILE, 1, create) end end doTeleportThing(cid, pos) doSendMagicEffect(pos, (x and CONST_ME_WATERSPLASH or getThingFromPos(pos).itemid == ITEM_WATERTILE and CONST_ME_WATERSPLASH or CONST_ME_NONE)) if changeSpeed then doChangeSpeed(cid, (x and (-getCreatureSpeed(cid) + waterSpeed + getCreatureBaseSpeed(cid)) or (-getCreatureSpeed(cid) + flySpeed + getCreatureBaseSpeed(cid)))) end pos.z = pos.z - 1 doSendMagicEffect(pos, CONST_ME_BLOCKHIT) for _, area in ipairs(getArea(pos, RANGEX, RANGEY)) do local thing = getThingFromPos(area) if thing.itemid == ITEM_FLYTILE then doRemoveItem(thing.uid) end end else doPlayerSendCancel(cid, ret[7]) end end end return true end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.