table.contains = function(array, value) for _, targetColumn in pairs(array) do if targetColumn == value then return true end end return false end _G.contains = table.contains string.trim = function(str) return str:gsub('^%s*(.-)%s*$', '%1') end string.splitTrimmed = function(str, sep) local res = {} for v in str:gmatch('([^' .. sep .. ']+)') do res[#res + 1] = v:trim() end return res end local stringMeta = getmetatable('') if stringMeta and stringMeta.__index then stringMeta.__index.splitTrimmed = string.splitTrimmed stringMeta.__index.trim = string.trim end TRUE = true FALSE = false result.getDataInt = result.getNumber result.getDataLong = result.getNumber result.getDataString = result.getString result.getDataStream = result.getStream LUA_ERROR = false LUA_NO_ERROR = true STACKPOS_GROUND = 0 STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE = 1 STACKPOS_SECOND_ITEM_ABOVE_GROUNDTILE = 2 STACKPOS_THIRD_ITEM_ABOVE_GROUNDTILE = 3 STACKPOS_FOURTH_ITEM_ABOVE_GROUNDTILE = 4 STACKPOS_FIFTH_ITEM_ABOVE_GROUNDTILE = 5 STACKPOS_TOP_CREATURE = 253 STACKPOS_TOP_FIELD = 254 STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE = 255 THING_TYPE_PLAYER = CREATURETYPE_PLAYER + 1 THING_TYPE_MONSTER = CREATURETYPE_MONSTER + 1 THING_TYPE_NPC = CREATURETYPE_NPC + 1 COMBAT_POISONDAMAGE = COMBAT_EARTHDAMAGE CONDITION_EXHAUST = CONDITION_EXHAUST_WEAPON TALKTYPE_ORANGE_1 = TALKTYPE_MONSTER_SAY TALKTYPE_ORANGE_2 = TALKTYPE_MONSTER_YELL NORTH = DIRECTION_NORTH EAST = DIRECTION_EAST SOUTH = DIRECTION_SOUTH WEST = DIRECTION_WEST SOUTHWEST = DIRECTION_SOUTHWEST SOUTHEAST = DIRECTION_SOUTHEAST NORTHWEST = DIRECTION_NORTHWEST NORTHEAST = DIRECTION_NORTHEAST do local function CreatureIndex(self, key) local methods = getmetatable(self) if key == "uid" then return methods.getId(self) elseif key == "type" then local creatureType = 0 if methods.isPlayer(self) then creatureType = THING_TYPE_PLAYER elseif methods.isMonster(self) then creatureType = THING_TYPE_MONSTER elseif methods.isNpc(self) then creatureType = THING_TYPE_NPC end return creatureType elseif key == "itemid" then return 1 elseif key == "actionid" then return 0 end return methods[key] end rawgetmetatable("Player").__index = CreatureIndex rawgetmetatable("Monster").__index = CreatureIndex rawgetmetatable("Npc").__index = CreatureIndex end do local function ItemIndex(self, key) local methods = getmetatable(self) if key == "itemid" then return methods.getId(self) elseif key == "actionid" then return methods.getActionId(self) elseif key == "uid" then return methods.getUniqueId(self) elseif key == "type" then return methods.getSubType(self) end return methods[key] end rawgetmetatable("Item").__index = ItemIndex rawgetmetatable("Container").__index = ItemIndex rawgetmetatable("Teleport").__index = ItemIndex end do local function ActionNewIndex(self, key, value) if key == "onUse" then self:onUse(value) return end rawset(self, key, value) end rawgetmetatable("Action").__newindex = ActionNewIndex end do local function TalkActionNewIndex(self, key, value) if key == "onSay" then self:onSay(value) return end rawset(self, key, value) end rawgetmetatable("TalkAction").__newindex = TalkActionNewIndex end do local function CreatureEventNewIndex(self, key, value) if key == "onLogin" then self:type("login") self:onLogin(value) return elseif key == "onLogout" then self:type("logout") self:onLogout(value) return elseif key == "onThink" then self:type("think") self:onThink(value) return elseif key == "onPrepareDeath" then self:type("preparedeath") self:onPrepareDeath(value) return elseif key == "onDeath" then self:type("death") self:onDeath(value) return elseif key == "onKill" then self:type("kill") self:onKill(value) return elseif key == "onAdvance" then self:type("advance") self:onAdvance(value) return elseif key == "onModalWindow" then self:type("modalwindow") self:onModalWindow(value) return elseif key == "onTextEdit" then self:type("textedit") self:onTextEdit(value) return elseif key == "onHealthChange" then self:type("healthchange") self:onHealthChange(value) return elseif key == "onManaChange" then self:type("manachange") self:onManaChange(value) return elseif key == "onExtendedOpcode" then self:type("extendedopcode") self:onExtendedOpcode(value) return end rawset(self, key, value) end rawgetmetatable("CreatureEvent").__newindex = CreatureEventNewIndex end do local function MoveEventNewIndex(self, key, value) if key == "onEquip" then self:type("equip") self:onEquip(value) return elseif key == "onDeEquip" then self:type("deequip") self:onDeEquip(value) return elseif key == "onAddItem" then self:type("additem") self:onAddItem(value) return elseif key == "onRemoveItem" then self:type("removeitem") self:onRemoveItem(value) return elseif key == "onStepIn" then self:type("stepin") self:onStepIn(value) return elseif key == "onStepOut" then self:type("stepout") self:onStepOut(value) return end rawset(self, key, value) end rawgetmetatable("MoveEvent").__newindex = MoveEventNewIndex end do local function GlobalEventNewIndex(self, key, value) if key == "onThink" then self:onThink(value) return elseif key == "onTime" then self:onTime(value) return elseif key == "onStartup" then self:type("startup") self:onStartup(value) return elseif key == "onShutdown" then self:type("shutdown") self:onShutdown(value) return elseif key == "onRecord" then self:type("record") self:onRecord(value) return end rawset(self, key, value) end rawgetmetatable("GlobalEvent").__newindex = GlobalEventNewIndex end do local function WeaponNewIndex(self, key, value) if key == "onUseWeapon" then self:onUseWeapon(value) return end rawset(self, key, value) end rawgetmetatable("Weapon").__newindex = WeaponNewIndex end do local function SpellNewIndex(self, key, value) if key == "onCastSpell" then self:onCastSpell(value) return end rawset(self, key, value) end rawgetmetatable("Spell").__newindex = SpellNewIndex end do local function MonsterTypeNewIndex(self, key, value) if key == "onThink" then self:eventType(MONSTERS_EVENT_THINK) self:onThink(value) return elseif key == "onAppear" then self:eventType(MONSTERS_EVENT_APPEAR) self:onAppear(value) return elseif key == "onDisappear" then self:eventType(MONSTERS_EVENT_DISAPPEAR) self:onDisappear(value) return elseif key == "onMove" then self:eventType(MONSTERS_EVENT_MOVE) self:onMove(value) return elseif key == "onSay" then self:eventType(MONSTERS_EVENT_SAY) self:onSay(value) return end rawset(self, key, value) end rawgetmetatable("MonsterType").__newindex = MonsterTypeNewIndex end function pushThing(thing) local t = {uid = 0, itemid = 0, type = 0, actionid = 0} if thing then if thing:isItem() then t.uid = thing:getUniqueId() t.itemid = thing:getId() if ItemType(t.itemid):hasSubType() then t.type = thing:getSubType() end t.actionid = thing:getActionId() elseif thing:isCreature() then t.uid = thing:getId() t.itemid = 1 if thing:isPlayer() then t.type = THING_TYPE_PLAYER elseif thing:isMonster() then t.type = THING_TYPE_MONSTER else t.type = THING_TYPE_NPC end end end return t end createCombatObject = Combat addCombatCondition = Combat.addCondition setCombatArea = Combat.setArea setCombatCallback = Combat.setCallback setCombatFormula = Combat.setFormula setCombatParam = Combat.setParameter Combat.setCondition = function(...) print("[Warning] Function Combat.setCondition was renamed to Combat.addCondition and will be removed in the future") Combat.addCondition(...) end setCombatCondition = function(...) print("[Warning] Function setCombatCondition was renamed to addCombatCondition and will be removed in the future") Combat.addCondition(...) end function doTargetCombatHealth(...) return doTargetCombat(...) end function doAreaCombatHealth(...) return doAreaCombat(...) end function doTargetCombatMana(cid, target, min, max, effect) return doTargetCombat(cid, target, COMBAT_MANADRAIN, min, max, effect) end function doAreaCombatMana(cid, pos, area, min, max, effect) return doAreaCombat(cid, COMBAT_MANADRAIN, pos, area, min, max, effect) end createConditionObject = Condition setConditionParam = Condition.setParameter setConditionFormula = Condition.setFormula addDamageCondition = Condition.addDamage addOutfitCondition = Condition.setOutfit function doCombat(cid, combat, var) return combat:execute(cid, var) end function isCreature(cid) return Creature(cid) end function isPlayer(cid) return Player(cid) end function isMonster(cid) return Monster(cid) end function isSummon(cid) return Creature(cid):getMaster() end function isNpc(cid) return Npc(cid) end function isItem(uid) return Item(uid) end function isContainer(uid) return Container(uid) end function getCreatureName(cid) local c = Creature(cid) return c and c:getName() or false end function getCreatureHealth(cid) local c = Creature(cid) return c and c:getHealth() or false end function getCreatureMaxHealth(cid) local c = Creature(cid) return c and c:getMaxHealth() or false end function getCreaturePosition(cid) local c = Creature(cid) return c and c:getPosition() or false end function getCreatureOutfit(cid) local c = Creature(cid) return c and c:getOutfit() or false end function getCreatureSpeed(cid) local c = Creature(cid) return c and c:getSpeed() or false end function getCreatureBaseSpeed(cid) local c = Creature(cid) return c and c:getBaseSpeed() or false end function getCreatureTarget(cid) local c = Creature(cid) if c then local target = c:getTarget() return target and target:getId() or 0 end return false end function getCreatureMaster(cid) local c = Creature(cid) if c then local master = c:getMaster() return master and master:getId() or c:getId() end return false end function getCreatureSummons(cid) local c = Creature(cid) if c == nil then return false end local result = {} for _, summon in ipairs(c:getSummons()) do result[#result + 1] = summon:getId() end return result end getCreaturePos = getCreaturePosition function doCreatureAddHealth(cid, health) local c = Creature(cid) return c and c:addHealth(health) or false end function doRemoveCreature(cid) local c = Creature(cid) return c and c:remove() or false end function doCreatureSetLookDir(cid, direction) local c = Creature(cid) return c and c:setDirection(direction) or false end function doCreatureSay(cid, text, type, ...) local c = Creature(cid) return c and c:say(text, type, ...) or false end function doCreatureChangeOutfit(cid, outfit) local c = Creature(cid) return c and c:setOutfit(outfit) or false end function doSetCreatureDropLoot(cid, doDrop) local c = Creature(cid) return c and c:setDropLoot(doDrop) or false end function doChangeSpeed(cid, delta) local c = Creature(cid) return c and c:changeSpeed(delta) or false end function doAddCondition(cid, conditionId) local c = Creature(cid) return c and c:addCondition(conditionId) or false end function doRemoveCondition(cid, conditionType, subId) local c = Creature(cid) return c and (c:removeCondition(conditionType, CONDITIONID_COMBAT, subId) or c:removeCondition(conditionType, CONDITIONID_DEFAULT, subId) or true) end function getCreatureCondition(cid, type, subId) local c = Creature(cid) return c and c:hasCondition(type, subId) or false end doSetCreatureDirection = doCreatureSetLookDir function registerCreatureEvent(cid, name) local c = Creature(cid) return c and c:registerEvent(name) or false end function unregisterCreatureEvent(cid, name) local c = Creature(cid) return c and c:unregisterEvent(name) or false end function getPlayerByName(name) local p = Player(name) return p and p:getId() or false end function getIPByPlayerName(name) local p = Player(name) return p and p:getIp() or false end function getPlayerGUID(cid) local p = Player(cid) return p and p:getGuid() or false end function getPlayerIp(cid) local p = Player(cid) return p and p:getIp() or false end function getPlayerAccountType(cid) local p = Player(cid) return p and p:getAccountType() or false end function getPlayerLastLoginSaved(cid) local p = Player(cid) return p and p:getLastLoginSaved() or false end function getPlayerName(cid) local p = Player(cid) return p and p:getName() or false end function getPlayerFreeCap(cid) local p = Player(cid) return p and (p:getFreeCapacity() / 100) or false end function getPlayerPosition(cid) local p = Player(cid) return p and p:getPosition() or false end function getPlayerMagLevel(cid) local p = Player(cid) return p and p:getMagicLevel() or false end function getPlayerAccess(cid) local player = Player(cid) if player == nil then return false end return player:getGroup():getAccess() and 1 or 0 end function getPlayerSkill(cid, skillId) local p = Player(cid) return p and p:getSkillLevel(skillId) or false end function getPlayerMana(cid) local p = Player(cid) return p and p:getMana() or false end function getPlayerMaxMana(cid) local p = Player(cid) return p and p:getMaxMana() or false end function getPlayerLevel(cid) local p = Player(cid) return p and p:getLevel() or false end function getPlayerTown(cid) local p = Player(cid) return p and p:getTown():getId() or false end function getPlayerVocation(cid) local p = Player(cid) return p and p:getVocation():getId() or false end function getPlayerSoul(cid) local p = Player(cid) return p and p:getSoul() or false end function getPlayerSex(cid) local p = Player(cid) return p and p:getSex() or false end function getPlayerStorageValue(cid, key) local p = Player(cid) return p and p:getStorageValue(key) or false end function getPlayerBalance(cid) local p = Player(cid) return p and p:getBankBalance() or false end function getPlayerMoney(cid) local p = Player(cid) return p and p:getMoney() or false end function getPlayerGroupId(cid) local p = Player(cid) return p and p:getGroup():getId() or false end function getPlayerLookDir(cid) local p = Player(cid) return p and p:getDirection() or false end function getPlayerLight(cid) local p = Player(cid) return p and p:getLight() or false end function getPlayerDepotItems(cid, depotId) local p = Player(cid) return p and p:getDepotItems(depotId) or false end function getPlayerSkullType(cid) local p = Player(cid) return p and p:getSkull() or false end function getPlayerLossPercent(cid) local p = Player(cid) return p and p:getDeathPenalty() or false end function getPlayerMount(cid, mountId) local p = Player(cid) return p and p:hasMount(mountId) or false end function getPlayerPremiumDays(cid) local p = Player(cid) return p and p:getPremiumDays() or false end function getPlayerBlessing(cid, blessing) local p = Player(cid) return p and p:hasBlessing(blessing) or false end function getPlayerFlagValue(cid, flag) local p = Player(cid) return p ~= nil and p:hasFlag(flag) or false end function getPlayerParty(cid) local player = Player(cid) if player == nil then return false end local party = player:getParty() if party == nil then return nil end return party:getLeader():getId() end function getPlayerGuildId(cid) local player = Player(cid) if player == nil then return false end local guild = player:getGuild() if guild == nil then return false end return guild:getId() end function getPlayerGuildLevel(cid) local p = Player(cid) return p and p:getGuildLevel() or false end function getPlayerGuildName(cid) local player = Player(cid) if player == nil then return false end local guild = player:getGuild() if guild == nil then return false end return guild:getName() end function getPlayerGuildRank(cid) local player = Player(cid) if player == nil then return false end local guild = player:getGuild() if guild == nil then return false end local rank = guild:getRankByLevel(player:getGuildLevel()) return rank and rank.name or false end function getPlayerGuildNick(cid) local p = Player(cid) return p and p:getGuildNick() or false end function getPlayerMasterPos(cid) local p = Player(cid) return p and p:getTown():getTemplePosition() or false end function getPlayerItemCount(cid, itemId, ...) local p = Player(cid) return p and p:getItemCount(itemId, ...) or false end function getPlayerSlotItem(cid, slot) local player = Player(cid) if player == nil then return pushThing(nil) end return pushThing(player:getSlotItem(slot)) end function getPlayerItemById(cid, deepSearch, itemId, ...) local player = Player(cid) if player == nil then return pushThing(nil) end return pushThing(player:getItemById(itemId, deepSearch, ...)) end function getPlayerFood(cid) local player = Player(cid) if player == nil then return false end local c = player:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT) return c and math.floor(c:getTicks() / 1000) or 0 end function canPlayerLearnInstantSpell(cid, name) local p = Player(cid) return p and p:canLearnSpell(name) or false end function getPlayerLearnedInstantSpell(cid, name) local p = Player(cid) return p and p:hasLearnedSpell(name) or false end function isPlayerGhost(cid) local p = Player(cid) return p and p:isInGhostMode() or false end function isPlayerPzLocked(cid) local p = Player(cid) return p and p:isPzLocked() or false end function isPremium(cid) local p = Player(cid) return p and p:isPremium() or false end function getPlayersByIPAddress(ip, mask) if mask == nil then mask = 0xFFFFFFFF end local masked = bit.band(ip, mask) local result = {} for _, player in ipairs(Game.getPlayers()) do if bit.band(player:getIp(), mask) == masked then result[#result + 1] = player:getId() end end return result end function getOnlinePlayers() local result = {} for _, player in ipairs(Game.getPlayers()) do result[#result + 1] = player:getName() end return result end function getPlayersByAccountNumber(accountNumber) local result = {} for _, player in ipairs(Game.getPlayers()) do if player:getAccountId() == accountNumber then result[#result + 1] = player:getId() end end return result end function getPlayerGUIDByName(name) local player = Player(name) if player then return player:getGuid() end local resultId = db.storeQuery("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(name)) if resultId ~= false then local guid = result.getDataInt(resultId, "id") result.free(resultId) return guid end return 0 end function getAccountNumberByPlayerName(name) local player = Player(name) if player then return player:getAccountId() end local resultId = db.storeQuery("SELECT `account_id` FROM `players` WHERE `name` = " .. db.escapeString(name)) if resultId ~= false then local accountId = result.getDataInt(resultId, "account_id") result.free(resultId) return accountId end return 0 end getPlayerAccountBalance = getPlayerBalance getIpByName = getIPByPlayerName function setPlayerStorageValue(cid, key, value) local p = Player(cid) return p and p:setStorageValue(key, value) or false end function doPlayerSetBalance(cid, balance) local p = Player(cid) return p and p:setBankBalance(balance) or false end function doPlayerAddMoney(cid, money) local p = Player(cid) return p and p:addMoney(money) or false end function doPlayerRemoveMoney(cid, money) local p = Player(cid) return p and p:removeMoney(money) or false end function doPlayerAddSoul(cid, soul) local p = Player(cid) return p and p:addSoul(soul) or false end function doPlayerSetVocation(cid, vocation) local p = Player(cid) return p and p:setVocation(Vocation(vocation)) or false end function doPlayerSetTown(cid, town) local p = Player(cid) return p and p:setTown(Town(town)) or false end function setPlayerGroupId(cid, groupId) local p = Player(cid) return p and p:setGroup(Group(groupId)) or false end function doPlayerSetSex(cid, sex) local p = Player(cid) return p and p:setSex(sex) or false end function doPlayerSetGuildLevel(cid, level) local p = Player(cid) return p and p:setGuildLevel(level) or false end function doPlayerSetGuildNick(cid, nick) local p = Player(cid) return p and p:setGuildNick(nick) or false end function doPlayerSetOfflineTrainingSkill(cid, skillId) local p = Player(cid) return p and p:setOfflineTrainingSkill(skillId) or false end function doShowTextDialog(cid, itemId, text) local p = Player(cid) return p and p:showTextDialog(itemId, text) or false end function doPlayerAddItemEx(cid, uid, ...) local p = Player(cid) return p and p:addItemEx(Item(uid), ...) or false end function doPlayerRemoveItem(cid, itemid, count, ...) local p = Player(cid) return p and p:removeItem(itemid, count, ...) or false end function doPlayerAddPremiumDays(cid, days) local p = Player(cid) return p and p:addPremiumDays(days) or false end function doPlayerRemovePremiumDays(cid, days) local p = Player(cid) return p and p:removePremiumDays(days) or false end function doPlayerAddBlessing(cid, blessing) local p = Player(cid) return p and p:addBlessing(blessing) or false end function doPlayerAddOutfit(cid, lookType, addons) local p = Player(cid) return p and p:addOutfitAddon(lookType, addons) or false end function doPlayerRemOutfit(cid, lookType, addons) local player = Player(cid) if player == nil then return false end if addons == 255 then return player:removeOutfit(lookType) else return player:removeOutfitAddon(lookType, addons) end end function canPlayerWearOutfit(cid, lookType, addons) local p = Player(cid) return p and p:hasOutfit(lookType, addons) or false end function doPlayerAddMount(cid, mountId) local p = Player(cid) return p and p:addMount(mountId) or false end function doPlayerRemoveMount(cid, mountId) local p = Player(cid) return p and p:removeMount(mountId) or false end function doPlayerSendCancel(cid, text) local p = Player(cid) return p and p:sendCancelMessage(text) or false end function doPlayerFeed(cid, food) local p = Player(cid) return p and p:feed(food) or false end function playerLearnInstantSpell(cid, name) local p = Player(cid) return p and p:learnSpell(name) or false end function doPlayerPopupFYI(cid, message) local p = Player(cid) return p and p:popupFYI(message) or false end function doSendTutorial(cid, tutorialId) local p = Player(cid) return p and p:sendTutorial(tutorialId) or false end function doAddMapMark(cid, pos, type, description) local p = Player(cid) return p and p:addMapMark(pos, type, description or "") or false end function doPlayerSendTextMessage(cid, type, text, ...) local p = Player(cid) return p and p:sendTextMessage(type, text, ...) or false end function doSendAnimatedText() debugPrint("Deprecated function.") return true end function doPlayerAddExp(cid, exp, useMult, ...) local player = Player(cid) if player == nil then return false end if useMult then exp = exp * Game.getExperienceStage(player:getLevel()) end return player:addExperience(exp, ...) end function doPlayerAddManaSpent(cid, mana) local p = Player(cid) return p and p:addManaSpent(mana) or false end function doPlayerAddSkillTry(cid, skillid, n) local p = Player(cid) return p and p:addSkillTries(skillid, n) or false end function doPlayerAddMana(cid, mana, ...) local p = Player(cid) return p and p:addMana(mana, ...) or false end function doPlayerJoinParty(cid, leaderId) local player = Player(cid) if player == nil then return false end if player:getParty() then player:sendTextMessage(MESSAGE_INFO_DESCR, "You are already in a party.") return true end local leader = Player(leaderId) if leader == nil then return false end local party = leader:getParty() if party == nil or party:getLeader() ~= leader then return true end for _, invitee in ipairs(party:getInvitees()) do if player ~= invitee then return true end end party:addMember(player) return true end function getPartyMembers(cid) local player = Player(cid) if player == nil then return false end local party = player:getParty() if party == nil then return false end local result = {party:getLeader():getId()} for _, member in ipairs(party:getMembers()) do result[#result + 1] = member:getId() end return result end doPlayerSendDefaultCancel = doPlayerSendCancel function getMonsterTargetList(cid) local monster = Monster(cid) if monster == nil then return false end local result = {} for _, creature in ipairs(monster:getTargetList()) do if monster:isTarget(creature) then result[#result + 1] = creature:getId() end end return result end function getMonsterFriendList(cid) local monster = Monster(cid) if monster == nil then return false end local z = monster:getPosition().z local result = {} for _, creature in ipairs(monster:getFriendList()) do if not creature:isRemoved() and creature:getPosition().z == z then result[#result + 1] = creature:getId() end end return result end function doSetMonsterTarget(cid, target) local monster = Monster(cid) if monster == nil then return false end if monster:getMaster() then return true end local target = Creature(cid) if target == nil then return false end monster:selectTarget(target) return true end function doMonsterChangeTarget(cid) local monster = Monster(cid) if monster == nil then return false end if monster:getMaster() then return true end monster:searchTarget(1) return true end function doCreateNpc(name, pos, ...) local npc = Game.createNpc(name, pos, ...) return npc and npc:setMasterPos(pos) or false end function doSummonCreature(name, pos, ...) local m = Game.createMonster(name, pos, ...) return m and m:getId() or false end function doConvinceCreature(cid, target) local creature = Creature(cid) if creature == nil then return false end local targetCreature = Creature(target) if targetCreature == nil then return false end creature:addSummon(targetCreature) return true end function getTownId(townName) local t = Town(townName) return t and t:getId() or false end function getTownName(townId) local t = Town(townId) return t and t:getName() or false end function getTownTemplePosition(townId) local t = Town(townId) return t and t:getTemplePosition() or false end function doSetItemActionId(uid, actionId) local i = Item(uid) return i and i:setActionId(actionId) or false end function doTransformItem(uid, newItemId, ...) local i = Item(uid) return i and i:transform(newItemId, ...) or false end function doChangeTypeItem(uid, newType) local i = Item(uid) return i and i:transform(i:getId(), newType) or false end function doRemoveItem(uid, ...) local i = Item(uid) return i and i:remove(...) or false end function getContainerSize(uid) local c = Container(uid) return c and c:getSize() or false end function getContainerCap(uid) local c = Container(uid) return c and c:getCapacity() or false end function getContainerItem(uid, slot) local container = Container(uid) if container == nil then return pushThing(nil) end return pushThing(container:getItem(slot)) end function doAddContainerItemEx(uid, virtualId) local container = Container(uid) if container == nil then return false end local res = container:addItemEx(Item(virtualId)) if res == nil then return false end return res end function doSendMagicEffect(pos, magicEffect, ...) return Position(pos):sendMagicEffect(magicEffect, ...) end function doSendDistanceShoot(fromPos, toPos, distanceEffect, ...) return Position(fromPos):sendDistanceEffect(toPos, distanceEffect, ...) end function isSightClear(fromPos, toPos, floorCheck) return Position(fromPos):isSightClear(toPos, floorCheck) end function getPromotedVocation(vocationId) local vocation = Vocation(vocationId) if vocation == nil then return 0 end local promotedVocation = vocation:getPromotion() if promotedVocation == nil then return 0 end return promotedVocation:getId() end function getGuildId(guildName) local resultId = db.storeQuery("SELECT `id` FROM `guilds` WHERE `name` = " .. db.escapeString(guildName)) if resultId == false then return false end local guildId = result.getDataInt(resultId, "id") result.free(resultId) return guildId end function getHouseName(houseId) local h = House(houseId) return h and h:getName() or false end function getHouseOwner(houseId) local h = House(houseId) return h and h:getOwnerGuid() or false end function getHouseEntry(houseId) local h = House(houseId) return h and h:getExitPosition() or false end function getHouseTown(houseId) local h = House(houseId) if h == nil then return false end local t = h:getTown() return t and t:getId() or false end function getHouseTilesSize(houseId) local h = House(houseId) return h and h:getTileCount() or false end function isItemStackable(itemId) return ItemType(itemId):isStackable() end function isItemRune(itemId) return ItemType(itemId):isRune() end function isItemDoor(itemId) return ItemType(itemId):isDoor() end function isItemContainer(itemId) return ItemType(itemId):isContainer() end function isItemFluidContainer(itemId) return ItemType(itemId):isFluidContainer() end function isItemMovable(itemId) return ItemType(itemId):isMovable() end function isCorpse(uid) local i = Item(uid) return i and ItemType(i:getId()):isCorpse() or false end isItemMoveable = isItemMovable isMoveable = isMovable function getItemName(itemId) return ItemType(itemId):getName() end function getItemWeight(itemId, ...) return ItemType(itemId):getWeight(...) / 100 end function getItemDescriptions(itemId) local itemType = ItemType(itemId) return { name = itemType:getName(), plural = itemType:getPluralName(), article = itemType:getArticle(), description = itemType:getDescription() } end function getItemIdByName(name) local id = ItemType(name):getId() if id == 0 then return false end return id end function getItemWeightByUID(uid, ...) local item = Item(uid) if item == nil then return false end local itemType = ItemType(item:getId()) return itemType:isStackable() and (itemType:getWeight(item:getCount(), ...) / 100) or (itemType:getWeight(1, ...) / 100) end function getItemRWInfo(uid) local item = Item(uid) if item == nil then return false end local rwFlags = 0 local itemType = ItemType(item:getId()) if itemType:isReadable() then rwFlags = bit.bor(rwFlags, 1) end if itemType:isWritable() then rwFlags = bit.bor(rwFlags, 2) end return rwFlags end function getContainerCapById(itemId) return ItemType(itemId):getCapacity() end function getFluidSourceType(itemId) local it = ItemType(itemId) return it.id ~= 0 and it:getFluidSource() or false end function hasProperty(uid, prop) local item = Item(uid) if item == nil then return false end local parent = item:getParent() if parent:isTile() and item == parent:getGround() then return parent:hasProperty(prop) else return item:hasProperty(prop) end end function doSetItemText(uid, text) local item = Item(uid) if item == nil then return false end if text ~= "" then item:setAttribute(ITEM_ATTRIBUTE_TEXT, text) else item:removeAttribute(ITEM_ATTRIBUTE_TEXT) end return true end function doSetItemSpecialDescription(uid, desc) local item = Item(uid) if item == nil then return false end if desc ~= "" then item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, desc) else item:removeAttribute(ITEM_ATTRIBUTE_DESCRIPTION) end return true end function doDecayItem(uid) local i = Item(uid) return i and i:decay() or false end function setHouseOwner(id, guid) local h = House(id) return h and h:setOwnerGuid(guid) or false end function getHouseRent(id) local h = House(id) return h and h:getRent() or nil end function getHouseAccessList(id, listId) local h = House(id) return h and h:getAccessList(listId) or nil end function setHouseAccessList(id, listId, listText) local h = House(id) return h and h:setAccessList(listId, listText) or false end function getHouseByPlayerGUID(playerGUID) for _, house in ipairs(Game.getHouses()) do if house:getOwnerGuid() == playerGUID then return house:getId() end end return nil end function getTileHouseInfo(pos) local t = Tile(pos) if t == nil then return false end local h = t:getHouse() return h and h:getId() or false end function getTilePzInfo(position) local t = Tile(position) if t == nil then return false end return t:hasFlag(TILESTATE_PROTECTIONZONE) end function getTileInfo(position) local t = Tile(position) if t == nil then return false end local ret = pushThing(t:getGround()) ret.protection = t:hasFlag(TILESTATE_PROTECTIONZONE) ret.nopz = ret.protection ret.nologout = t:hasFlag(TILESTATE_NOLOGOUT) ret.refresh = t:hasFlag(TILESTATE_REFRESH) ret.house = t:getHouse() ~= nil ret.bed = t:hasFlag(TILESTATE_BED) ret.depot = t:hasFlag(TILESTATE_DEPOT) ret.things = t:getThingCount() ret.creatures = t:getCreatureCount() ret.items = t:getItemCount() ret.topItems = t:getTopItemCount() ret.downItems = t:getDownItemCount() return ret end function getTileItemByType(position, itemType) local t = Tile(position) if t == nil then return pushThing(nil) end return pushThing(t:getItemByType(itemType)) end function getTileItemById(position, itemId, ...) local t = Tile(position) if t == nil then return pushThing(nil) end return pushThing(t:getItemById(itemId, ...)) end function getTileThingByPos(position) local t = Tile(position) if t == nil then if position.stackpos == -1 then return -1 end return pushThing(nil) end if position.stackpos == -1 then return t:getThingCount() end return pushThing(t:getThing(position.stackpos)) end function getTileThingByTopOrder(position, topOrder) local t = Tile(position) if t == nil then return pushThing(nil) end return pushThing(t:getItemByTopOrder(topOrder)) end function getTopCreature(position) local t = Tile(position) if t == nil then return pushThing(nil) end return pushThing(t:getTopCreature()) end function queryTileAddThing(thing, position, ...) local t = Tile(position) return t and t:queryAdd(thing, ...) or false end function doTeleportThing(uid, dest, pushMovement) if type(uid) == "userdata" then if uid:isCreature() then return uid:teleportTo(dest, pushMovement or false) else return uid:moveTo(dest) end else if uid >= 0x10000000 then local creature = Creature(uid) if creature then return creature:teleportTo(dest, pushMovement or false) end else local item = Item(uid) if item then return item:moveTo(dest) end end end return false end function getThingPos(uid) local thing if type(uid) ~= "userdata" then if uid >= 0x10000000 then thing = Creature(uid) else thing = Item(uid) end else thing = uid end if thing == nil then return false end local stackpos = 0 local tile = thing:getTile() if tile then stackpos = tile:getThingIndex(thing) end local position = thing:getPosition() position.stackpos = stackpos return position end function getThingfromPos(pos) local tile = Tile(pos) if tile == nil then return pushThing(nil) end local thing local stackpos = pos.stackpos or 0 if stackpos == STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE then thing = tile:getTopCreature() if thing == nil then local item = tile:getTopDownItem() if item and item:getType():isMovable() then thing = item end end elseif stackpos == STACKPOS_TOP_FIELD then thing = tile:getFieldItem() elseif stackpos == STACKPOS_TOP_CREATURE then thing = tile:getTopCreature() else thing = tile:getThing(stackpos) end return pushThing(thing) end function doRelocate(fromPos, toPos) if fromPos == toPos then return false end local fromTile = Tile(fromPos) if fromTile == nil then return false end if Tile(toPos) == nil then return false end for i = fromTile:getThingCount() - 1, 0, -1 do local thing = fromTile:getThing(i) if thing then if thing:isItem() then if ItemType(thing:getId()):isMovable() then thing:moveTo(toPos) end elseif thing:isCreature() then thing:teleportTo(toPos) end end end return true end function getThing(uid) return uid >= 0x10000000 and pushThing(Creature(uid)) or pushThing(Item(uid)) end function getConfigInfo(info) if type(info) ~= "string" then return nil end dofile('config.lua') return _G[info] end function getWorldCreatures(type) if type == 0 then return Game.getPlayerCount() elseif type == 1 then return Game.getMonsterCount() elseif type == 2 then return Game.getNpcCount() end return Game.getPlayerCount() + Game.getMonsterCount() + Game.getNpcCount() end saveData = saveServer function getGlobalStorageValue(key) return Game.getStorageValue(key) or -1 end function setGlobalStorageValue(key, value) Game.setStorageValue(key, value) return true end getWorldType = Game.getWorldType numberToVariant = Variant stringToVariant = Variant positionToVariant = Variant function targetPositionToVariant(position) local variant = Variant(position) variant.type = VARIANT_TARGETPOSITION return variant end variantToNumber = Variant.getNumber variantToString = Variant.getString variantToPosition = Variant.getPosition function doCreateTeleport(itemId, destination, position) local item = Game.createItem(itemId, 1, position) if not item:isTeleport() then item:remove() return false end item:setDestination(destination) return item:getUniqueId() end function getSpectators(centerPos, rangex, rangey, multifloor, onlyPlayers) local result = Game.getSpectators(centerPos, multifloor, onlyPlayers or false, rangex, rangex, rangey, rangey) if #result == 0 then return nil end for index, spectator in ipairs(result) do result[index] = spectator:getId() end return result end function broadcastMessage(message, messageType) Game.broadcastMessage(message, messageType) print("> Broadcasted message: \"" .. message .. "\".") end function Guild.addMember(self, player) return player:setGuild(guild) end function Guild.removeMember(self, player) return player:getGuild() == self and player:setGuild(nil) end function getPlayerInstantSpellCount(cid) local p = Player(cid) return p and #p:getInstantSpells() end function getPlayerInstantSpellInfo(cid, spellId) local player = Player(cid) if not player then return false end local spell = Spell(spellId) if not spell or not player:canCast(spell) then return false end return spell end function doSetItemOutfit(cid, item, time) local c = Creature(cid) return c and c:setItemOutfit(item, time) end function doSetMonsterOutfit(cid, name, time) local c = Creature(cid) return c and c:setMonsterOutfit(name, time) end function doSetCreatureOutfit(cid, outfit, time) local creature = Creature(cid) if not creature then return false end local condition = Condition(CONDITION_OUTFIT) condition:setOutfit({ lookTypeEx = itemType:getId() }) condition:setTicks(time) creature:addCondition(condition) return true end function doTileAddItemEx(pos, uid, flags) local tile = Tile(pos) if not tile then return false end local item = Item(uid) if item then return tile:addItemEx(item, flags) end return false end function isInArray(array, value) return table.contains(array, value) end function doCreateItem(itemid, count, pos) local tile = Tile(pos) if not tile then return false end local item = Game.createItem(itemid, count, pos) if item then return item:getUniqueId() end return false end function doCreateItemEx(itemid, count) local item = Game.createItem(itemid, count) if item then return item:getUniqueId() end return false end function doMoveCreature(cid, direction) local c = Creature(cid) return c ~= nil and c:move(direction) end function createFunctions(class) local exclude = {[2] = {"is"}, [3] = {"get", "set", "add", "can"}, [4] = {"need"}} local temp = {} for name, func in pairs(class) do local add = true for strLen, strTable in pairs(exclude) do if table.contains(strTable, name:sub(1, strLen)) then add = false end end if add then local str = name:sub(1, 1):upper() .. name:sub(2) local getFunc = function(self) return func(self) end local setFunc = function(self, ...) return func(self, ...) end local get = "get" .. str local set = "set" .. str if not (rawget(class, get) and rawget(class, set)) then table.insert(temp, {set, setFunc, get, getFunc}) end end end for _, func in ipairs(temp) do rawset(class, func[1], func[2]) rawset(class, func[3], func[4]) end end function doPlayerTakeItem(cid, itemid, count) return Player(cid):removeItem(itemid, count) end function isNumber(str) return tonumber(str) ~= nil end function isInArray(array, value) return table.contains(array, value) end local PASSIVE_LEVEL = 00 local BAG_ITEM_POS, BACK_EXT_POS, SEARCH_ITEM_POS, SEARCH_EXT_POS = 0, 0, 0, 0 local SUMMON_POS_FREE = 0 local QNT_ITEM_BAG = 0 local GOLD_POS = 01 local LIMIT_GOLD = 999999999 local FENDAS_CHECK, PASSIVAS_CHECK = "", "" local _BAG_ITEM = {[01] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}} local function onGetPassivas(player, id) if player:getStorageValue(_SYSTEM.POINTS_ATR[01]) == id then PASSIVE_LEVEL = player:getStorageValue(_SYSTEM.POINTS_ATR[08]) return true elseif player:getStorageValue(_SYSTEM.POINTS_ATR[02]) == id then PASSIVE_LEVEL = player:getStorageValue(_SYSTEM.POINTS_ATR[09]) return true elseif player:getStorageValue(_SYSTEM.POINTS_ATR[03]) == id then PASSIVE_LEVEL = player:getStorageValue(_SYSTEM.POINTS_ATR[10]) return true elseif player:getStorageValue(_SYSTEM.POINTS_ATR[04]) == id then PASSIVE_LEVEL = player:getStorageValue(_SYSTEM.POINTS_ATR[11]) return true elseif player:getStorageValue(_SYSTEM.POINTS_ATR[05]) == id then PASSIVE_LEVEL = player:getStorageValue(_SYSTEM.POINTS_ATR[12]) return true elseif player:getStorageValue(_SYSTEM.POINTS_ATR[06]) == id then PASSIVE_LEVEL = player:getStorageValue(_SYSTEM.POINTS_ATR[13]) return true else PASSIVE_LEVEL = 00 return false end end function onPlayerDesafios(player, desafio, und) local id = player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) if _DAILYS[id] then if _DAILYS[id].ID == desafio then if player:getStorageValue(_DESAFIOS[00].DESAFIO_COUNT) < 00 then player:setStorageValue(_DESAFIOS[00].DESAFIO_COUNT, und) else player:setStorageValue(_DESAFIOS[00].DESAFIO_COUNT, (player:getStorageValue(_DESAFIOS[00].DESAFIO_COUNT) + und)) end if player:getStorageValue(_DESAFIOS[00].DESAFIO_COUNT) < _DESAFIOS[desafio].MAX then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, _DESAFIOS[desafio].CHAT.. " (" ..player:getStorageValue(_DESAFIOS[00].DESAFIO_COUNT).. "/" .._DESAFIOS[desafio].MAX.. ")") else if _DESAFIOS[desafio].REWARDS.TYPE == 01 then -- EXP player:addExperience(_DESAFIOS[desafio].REWARDS.QNT, true, true) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, _DESAFIOS[desafio].CHAT.. " (" .._DESAFIOS[desafio].MAX.. "/" .._DESAFIOS[desafio].MAX.. ")\nRecompensa: EXP [" .._DESAFIOS[desafio].REWARDS.QNT.. "] | Pontos de Desafio [" .._DESAFIOS[desafio].DESAFIOS_COIN.. "]") elseif _DESAFIOS[desafio].REWARDS.TYPE == 02 then -- WHITE TASK PlayerTokenCoins(player, 01, _DESAFIOS[desafio].REWARDS.QNT, 01) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, _DESAFIOS[desafio].CHAT.. " (" .._DESAFIOS[desafio].MAX.. "/" .._DESAFIOS[desafio].MAX.. ")\nRecompensa: White Task [" .._DESAFIOS[desafio].REWARDS.QNT.. "] | Pontos de Desafio [" .._DESAFIOS[desafio].DESAFIOS_COIN.. "]") elseif _DESAFIOS[desafio].REWARDS.TYPE == 03 then -- YELLOW TASK PlayerTokenCoins(player, 02, _DESAFIOS[desafio].REWARDS.QNT, 01) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, _DESAFIOS[desafio].CHAT.. " (" .._DESAFIOS[desafio].MAX.. "/" .._DESAFIOS[desafio].MAX.. ")\nRecompensa: Yellow Task [" .._DESAFIOS[desafio].REWARDS.QNT.. "] | Pontos de Desafio [" .._DESAFIOS[desafio].DESAFIOS_COIN.. "]") elseif _DESAFIOS[desafio].REWARDS.TYPE == 04 then -- BLUE TASK PlayerTokenCoins(player, 03, _DESAFIOS[desafio].REWARDS.QNT, 01) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, _DESAFIOS[desafio].CHAT.. " (" .._DESAFIOS[desafio].MAX.. "/" .._DESAFIOS[desafio].MAX.. ")\nRecompensa: Blue Task [" .._DESAFIOS[desafio].REWARDS.QNT.. "] | Pontos de Desafio [" .._DESAFIOS[desafio].DESAFIOS_COIN.. "]") elseif _DESAFIOS[desafio].REWARDS.TYPE == 05 then -- VIP COINS PlayerVipCoins(player, 02, _DESAFIOS[desafio].REWARDS.QNT) player:sendCancelMessage("@LootMSG 3218 3 0 " .._DESAFIOS[desafio].REWARDS.QNT) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, _DESAFIOS[desafio].CHAT.. " (" .._DESAFIOS[desafio].MAX.. "/" .._DESAFIOS[desafio].MAX.. ")\nRecompensa: Vip Coins [" .._DESAFIOS[desafio].REWARDS.QNT.. "] | Pontos de Desafio [" .._DESAFIOS[desafio].DESAFIOS_COIN.. "]") elseif _DESAFIOS[desafio].REWARDS.TYPE == 06 then -- CRIPTOMOEDAS if player:getStorageValue(_SYSTEM.POINTS_ATR[07]) < 00 then player:setStorageValue(_SYSTEM.POINTS_ATR[07], 01) else player:setStorageValue(_SYSTEM.POINTS_ATR[07], (player:getStorageValue(_SYSTEM.POINTS_ATR[07]) + 01)) end player:sendCancelMessage("@LootMSG 3297 4 3 " .._DESAFIOS[desafio].REWARDS.QNT) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, _DESAFIOS[desafio].CHAT.. " (" .._DESAFIOS[desafio].MAX.. "/" .._DESAFIOS[desafio].MAX.. ")\nRecompensa: Criptomoedas [" .._DESAFIOS[desafio].REWARDS.QNT.. "] | Pontos de Desafio [" .._DESAFIOS[desafio].DESAFIOS_COIN.. "]") elseif _DESAFIOS[desafio].REWARDS.TYPE == 07 then -- ONLINE COINS if player:getStorageValue(_SYSTEM.ONLINE_COIN) < 00 then player:setStorageValue(_SYSTEM.ONLINE_COIN, 01) else player:setStorageValue(_SYSTEM.ONLINE_COIN, (player:getStorageValue(_SYSTEM.ONLINE_COIN) + 01)) end player:sendCancelMessage("@LootMSG 3160 0 0 " .._DESAFIOS[desafio].REWARDS.QNT) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, _DESAFIOS[desafio].CHAT.. " (" .._DESAFIOS[desafio].MAX.. "/" .._DESAFIOS[desafio].MAX.. ")\nRecompensa: Online Coins [" .._DESAFIOS[desafio].REWARDS.QNT.. "] | Pontos de Desafio [" .._DESAFIOS[desafio].DESAFIOS_COIN.. "]") end if player:getStorageValue(_SYSTEM.DESAFIOS_COIN) < 00 then player:setStorageValue(_SYSTEM.DESAFIOS_COIN, _DESAFIOS[desafio].DESAFIOS_COIN) else player:setStorageValue(_SYSTEM.DESAFIOS_COIN, (player:getStorageValue(_SYSTEM.DESAFIOS_COIN) + _DESAFIOS[desafio].DESAFIOS_COIN)) end player:sendCancelMessage("@LootMSG 3299 4 0 " .._DESAFIOS[desafio].DESAFIOS_COIN) player:setStorageValue(_DESAFIOS[00].DESAFIO_ID, nil) player:setStorageValue(_DESAFIOS[00].DESAFIO_COUNT, nil) doBackpack(player, 11) end end end end function PlayerMetas(player, type, act, pos) --[[ PlayerMetas abrange diversos sistemas para n�o usar Storage. O Type identifica qual sistema ser� executado. ]]-- local playerGuid = player:getGuid() local DANGEROUS_CHECK = "" if type == 1001 then -- Contagem de Dangerous local Defaut = "0,0,0,0,0,0,0,0,0,0,0,0" local Dangerous = db.storeQuery('SELECT value FROM `free_pass` WHERE type = ' ..type.. ' AND player_id = ' ..playerGuid.. ';') if Dangerous then DANGEROUS_CHECK = result.getDataString(Dangerous, "value") result.free() else db.query("INSERT INTO `free_pass` (`player_id`, `type`, `value`) VALUES (" .. playerGuid .. ", " ..type.. ", '" ..Defaut.. "');") DANGEROUS_CHECK = Defaut end if act == 00 then -- Apenas retornando DG local split = DANGEROUS_CHECK:splitTrimmed(",") return split[pos] end if act == 01 then -- Adicionando local split = DANGEROUS_CHECK:splitTrimmed(",") local ValueDG = "" for X = 01, 12 do if X == pos then local Value = tonumber(split[X]) + 01 if X == 01 then ValueDG = Value else ValueDG = ValueDG.. "," ..Value end else if X == 01 then ValueDG = split[X] else ValueDG = ValueDG.. "," ..split[X] end end end db.query("UPDATE `free_pass` SET `value` = '" ..ValueDG.. "' WHERE type = " ..type.. " AND player_id = " ..playerGuid.. ";") return true end end end function PlayerPassives(player, type, value) local Defaut = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" local playerGuid = player:getGuid() local Max = 100 if type == 00 then -- RETORNANDO PASSIVAS local Passivas = db.storeQuery('SELECT value FROM `free_pass` WHERE type = 1002 AND player_id = ' ..playerGuid.. ';') if Passivas then local PlayerPassivas = result.getDataString(Passivas, "value") player:sendCancelMessage("@PassivesLoad," ..PlayerPassivas) result.free() PASSIVAS_CHECK = PlayerPassivas else db.query("INSERT INTO `free_pass` (`player_id`, `type`, `value`) VALUES (" .. playerGuid .. ", 1002, '" ..Defaut.. "');") player:sendCancelMessage("@PassivesLoad," ..Defaut) PASSIVAS_CHECK = Defaut end end if type == 01 then -- EVOLUINDO UMA PASSIVA local Passivas = db.storeQuery('SELECT value FROM `free_pass` WHERE type = 1002 AND player_id = ' ..playerGuid.. ';') if Passivas then local PlayerPassivas = result.getDataString(Passivas, "value") result.free() local split = PlayerPassivas:splitTrimmed(",") local NewPassives = "" for X = 01, Max do if X == value then local Level = tonumber(split[X]) + 01 if Level <= 10 then if X == 01 then NewPassives = Level else NewPassives = NewPassives.. "," ..Level end else if X == 01 then NewPassives = "10" else NewPassives = NewPassives.. ",10" end end else if X == 01 then NewPassives = split[X] else NewPassives = NewPassives.. "," ..split[X] end end end db.query("UPDATE `free_pass` SET `value` = '" ..NewPassives.. "' WHERE type = 1002 AND player_id = " ..playerGuid.. ";") player:sendCancelMessage("@PassivesLoad," ..NewPassives) PASSIVAS_CHECK = NewPassives else local NewPassives = "" for X = 01, Max do if X == value then if X == 01 then NewPassives = "1" else NewPassives = NewPassives.. ",1" end else if X == 01 then NewPassives = "0" else NewPassives = NewPassives.. ",0" end end end db.query("INSERT INTO `free_pass` (`player_id`, `type`, `value`) VALUES (" .. playerGuid .. ", 1002, '" ..NewPassives.. "');") player:sendCancelMessage("@PassivesLoad," ..NewPassives) PASSIVAS_CHECK = NewPassives end end if type == 02 then -- CARREGANDO STATUS PASSIVA local PA_1 = player:getStorageValue(_SYSTEM.POINTS_ATR[01]) or 0 local PA_2 = player:getStorageValue(_SYSTEM.POINTS_ATR[02]) or 0 local PA_3 = player:getStorageValue(_SYSTEM.POINTS_ATR[03]) or 0 local PA_4 = player:getStorageValue(_SYSTEM.POINTS_ATR[04]) or 0 local PA_5 = player:getStorageValue(_SYSTEM.POINTS_ATR[05]) or 0 local PA_6 = player:getStorageValue(_SYSTEM.POINTS_ATR[06]) or 0 local POIN = player:getStorageValue(_SYSTEM.POINTS_ATR[07]) or 0 local EVENT = Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE) or 0 player:sendCancelMessage("@StatusPassive " ..POIN.. " " ..PA_1.. " " ..PA_2.. " " ..PA_3.. " " ..PA_4.. " " ..PA_5.. " " ..PA_6.. " " ..EVENT) end if type == 03 then -- RESETANDO TODAS AS PASSIVA local Passivas = db.storeQuery('SELECT value FROM `free_pass` WHERE type = 1002 AND player_id = ' ..playerGuid.. ';') if Passivas then db.query("UPDATE `free_pass` SET `value` = '" ..Defaut.. "' WHERE type = 1002 AND player_id = " ..playerGuid.. ";") player:sendCancelMessage("@PassivesLoad," ..Defaut) PASSIVAS_CHECK = Defaut else db.query("INSERT INTO `free_pass` (`player_id`, `type`, `value`) VALUES (" .. playerGuid .. ", 1002, '" ..Defaut.. "');") player:sendCancelMessage("@PassivesLoad," ..Defaut) PASSIVAS_CHECK = Defaut end end end function PlayerVipCoins(player, type, value) local Saldo = 0 local playerAccount = getAccountNumberByPlayerName(player:getName()) local DBase = db.storeQuery('SELECT * FROM `accounts` WHERE `id` = ' ..playerAccount .. ';') if DBase then Saldo = result.getDataInt(DBase, "premium_points") if type == 00 then return Saldo elseif type == 01 then db.query("UPDATE `accounts` SET `premium_points` = " ..(Saldo - value).. " WHERE `id` = " ..playerAccount.. ";") return true else db.query("UPDATE `accounts` SET `premium_points` = " ..(Saldo + value).. " WHERE `id` = " ..playerAccount.. ";") return true end else return Saldo end end function PlayerGoldCoins(player, type, value) Saldo = 0 if type == 00 then -- Saldo for _GOLD = 01, #_SYSTEM.GOLD_COIN do if player:getStorageValue(_SYSTEM.GOLD_COIN[_GOLD]) ~= nil and player:getStorageValue(_SYSTEM.GOLD_COIN[_GOLD]) > 0 then GOLD_POS = _GOLD else if _GOLD == 01 then GOLD_POS = 01 end break end end for _GET_SALDO = 01, GOLD_POS do Saldo = Saldo + player:getStorageValue(_SYSTEM.GOLD_COIN[_GET_SALDO]) end return Saldo end if type == 01 then -- Retirar PlayerGoldCoins(player, 00) if Saldo >= value then local SaldoInfo = player:getStorageValue(_SYSTEM.GOLD_COIN[GOLD_POS]) if SaldoInfo > value then player:setStorageValue(_SYSTEM.GOLD_COIN[GOLD_POS], (SaldoInfo - value)) return true elseif SaldoInfo == value then player:setStorageValue(_SYSTEM.GOLD_COIN[GOLD_POS], nil) return true else local RemoveMoney = value for X = 01, #GOLD_POS do if RemoveMoney > player:getStorageValue(_SYSTEM.GOLD_COIN[GOLD_POS]) then RemoveMoney = RemoveMoney - player:getStorageValue(_SYSTEM.GOLD_COIN[GOLD_POS]) player:setStorageValue(_SYSTEM.GOLD_COIN[GOLD_POS], nil) GOLD_POS = GOLD_POS - 01 elseif RemoveMoney == player:getStorageValue(_SYSTEM.GOLD_COIN[GOLD_POS]) then player:setStorageValue(_SYSTEM.GOLD_COIN[GOLD_POS], nil) break else player:setStorageValue(_SYSTEM.GOLD_COIN[GOLD_POS], (player:getStorageValue(_SYSTEM.GOLD_COIN[GOLD_POS]) - RemoveMoney)) break end end return true end else for _ZERO = 01, #_SYSTEM.GOLD_COIN do player:setStorageValue(_SYSTEM.GOLD_COIN[_ZERO], nil) end return true end end if type == 02 then -- Adicionar local AddMoney = value for _ADD = 01, #_SYSTEM.GOLD_COIN do local SaldoInfo = player:getStorageValue(_SYSTEM.GOLD_COIN[_ADD]) if SaldoInfo > 0 then if SaldoInfo < LIMIT_GOLD then if (AddMoney + SaldoInfo) <= LIMIT_GOLD then --print("Tem saldo anterior (" ..SaldoInfo.. "). Insert: " ..AddMoney) player:setStorageValue(_SYSTEM.GOLD_COIN[_ADD], (AddMoney + SaldoInfo)) break else AddMoney = AddMoney - (AddMoney + SaldoInfo) --print("Ultrapassou o limite: Insert: " ..LIMIT_GOLD) player:setStorageValue(_SYSTEM.GOLD_COIN[_ADD], LIMIT_GOLD) if _ADD == 10 then --print("N�o existe mais capacidade para dinheiro") return true end end else --print("N�o existe mais capacidade para dinheiro") return true end else if AddMoney <= LIMIT_GOLD then --print("Saldo Vazio: Insert: " ..AddMoney) player:setStorageValue(_SYSTEM.GOLD_COIN[_ADD], AddMoney) break else --print("Saldo vazio e ainda ultrapassou o limite: Insert: " ..LIMIT_GOLD) AddMoney = AddMoney - LIMIT_GOLD player:setStorageValue(_SYSTEM.GOLD_COIN[_ADD], LIMIT_GOLD) end end end player:sendCancelMessage("@Analyser#03#" ..value.. "#0") player:sendCancelMessage("@LootMSG 3001 0 0 " ..value) return true end end function PlayerTokenCoins(player, type, value, mult) if type == 01 then if player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_1) < 0 then player:setStorageValue(_SYSTEM.TASK[00].TASK_COIN_1, (player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_1) + ((value * mult) + 1))) else player:setStorageValue(_SYSTEM.TASK[00].TASK_COIN_1, (player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_1) + ((value * mult)))) end player:sendCancelMessage("@LootMSG 3205 0 0 " ..(value * mult)) if player:getStorageValue(_QUESTLOG[70].UID_01) == 02 then if player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_1) >= 05 then player:setStorageValue(_QUESTLOG[70].UID_01, 100) player:addExperience(5000, true, true) addEvent(function() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") end, 2 * 1000) end end elseif type == 02 then if player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_2) < 0 then player:setStorageValue(_SYSTEM.TASK[00].TASK_COIN_2, (player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_2) + ((value * mult) + 1))) else player:setStorageValue(_SYSTEM.TASK[00].TASK_COIN_2, (player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_2) + ((value * mult)))) end player:sendCancelMessage("@LootMSG 3205 3 0 " ..(value * mult)) elseif type == 03 then if player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_3) < 0 then player:setStorageValue(_SYSTEM.TASK[00].TASK_COIN_3, (player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_3) + ((value * mult) + 1))) else player:setStorageValue(_SYSTEM.TASK[00].TASK_COIN_3, (player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_3) + ((value * mult)))) end player:sendCancelMessage("@LootMSG 3205 2 0 " ..(value * mult)) end end function PlayerFendasDimensionais(player, type, act, id) local Defaut = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" local playerGuid = player:getGuid() if type == 1000 then if act == 00 then -- RETORNANDO FENDAS DA DB local Fendas = db.storeQuery('SELECT value FROM `free_pass` WHERE type = 1000 AND player_id = ' ..playerGuid.. ';') if Fendas then local FendasDimensionais = result.getDataString(Fendas, "value") player:sendCancelMessage("@Fendas," ..FendasDimensionais) result.free() FENDAS_CHECK = FendasDimensionais else db.query("INSERT INTO `free_pass` (`player_id`, `type`, `value`) VALUES (" .. playerGuid .. ", 1000, '" ..Defaut.. "');") player:sendCancelMessage("@Fendas," ..Defaut) FENDAS_CHECK = Defaut end end if act == 01 then -- CONCLUINDO FENDA DIMENSIONAL local Fendas = db.storeQuery('SELECT value FROM `free_pass` WHERE type = 1000 AND player_id = ' ..playerGuid.. ';') if Fendas then local FendasDimensionais = result.getDataString(Fendas, "value") result.free() local split = FendasDimensionais:splitTrimmed(",") local NewFendas = "" for X = 01, 50 do if X == id then if X == 01 then NewFendas = "1" else NewFendas = NewFendas.. ",1" end else if X == 01 then NewFendas = split[X] else NewFendas = NewFendas.. "," ..split[X] end end end db.query("UPDATE `free_pass` SET `value` = '" ..NewFendas.. "' WHERE type = 1000 AND player_id = " ..playerGuid.. ";") player:sendCancelMessage("@Fendas," ..NewFendas) FENDAS_CHECK = NewFendas else local NewFendas = "" for X = 01, 50 do if X == id then if X == 01 then NewFendas = "1" else NewFendas = NewFendas.. ",1" end else if X == 01 then NewFendas = "0" else NewFendas = NewFendas.. ",0" end end end db.query("INSERT INTO `free_pass` (`player_id`, `type`, `value`) VALUES (" .. playerGuid .. ", 1000, '" ..NewFendas.. "');") player:sendCancelMessage("@Fendas," ..NewFendas) FENDAS_CHECK = NewFendas end PlayerFendasDimensionais(player, 1000, 03) end if act == 02 then -- CHECAR SE CONCLUIU UMA FENDA ESPECIFICA PlayerFendasDimensionais(player, 1000, 00) local checkFendas = FENDAS_CHECK local split = checkFendas:splitTrimmed(",") if tonumber(split[id]) == 01 then return true else return false end end if act == 03 then -- CONTAR QUANTAS FENDAS J� CONCLUIU PlayerFendasDimensionais(player, 1000, 00) local QntFendas = 00 local checkFendas = FENDAS_CHECK local split = checkFendas:splitTrimmed(",") for X = 01, 50 do if split[X] == "1" then QntFendas = QntFendas + 01 end end if QntFendas == 20 then local OUTFIT_HE = 00666 local OUTFIT_SHE = 00667 if(not player:hasOutfit(OUTFIT_HE, 00)) or (not player:hasOutfit(OUTFIT_SHE, 00)) then player:addOutfit(OUTFIT_HE, 1) player:addOutfit(OUTFIT_SHE, 1) addEvent(function() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voce desbloqueou a recompensa [ Death Herald Outfit ].") end, 5000) end elseif QntFendas == 30 then addEvent(function() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voc� desbloqueou a recompensa [ 250 Criptomoedas ].") if player:getStorageValue(_SYSTEM.CRIPTOMOEDA) < 00 then player:setStorageValue(_SYSTEM.CRIPTOMOEDA, ((player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + 250) + 01)) else player:setStorageValue(_SYSTEM.CRIPTOMOEDA, (player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + 250)) end player:sendCancelMessage("@LootMSG 3297 4 3 250") end, 5000) elseif QntFendas == 40 then local OUTFIT_HE = 00696 local OUTFIT_SHE = 00697 if(not player:hasOutfit(OUTFIT_HE, 00)) or (not player:hasOutfit(OUTFIT_SHE, 00)) then player:addOutfit(OUTFIT_HE, 1) player:addOutfit(OUTFIT_SHE, 1) addEvent(function() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voce desbloqueou a recompensa [ Puppeteer Outfit ].") end, 5000) end elseif QntFendas == 50 then addEvent(function() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voc� desbloqueou a recompensa [ 500 Criptomoedas ].") if player:getStorageValue(_SYSTEM.CRIPTOMOEDA) < 00 then player:setStorageValue(_SYSTEM.CRIPTOMOEDA, ((player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + 500) + 01)) else player:setStorageValue(_SYSTEM.CRIPTOMOEDA, (player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + 500)) end player:sendCancelMessage("@LootMSG 3297 4 3 500") end, 5000) end return QntFendas end end return true end function onGetBackpackItem(player, itemid) doBackpack(player, 03, 3, 0, 01, itemid) return QNT_ITEM_BAG end function doBackpack(player, action, slot, ext, bagselect, itemid, rare, star, qnt, unique) local result = false if action == 00 then -- Organizar | Capacidade _BAG_TEMP = { [01] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [02] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [03] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [04] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [05] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [06] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [07] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [08] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [09] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [10] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [11] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [12] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [13] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [14] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [15] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [16] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [17] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [18] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [19] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [20] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [21] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [22] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [23] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [24] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [25] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [26] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [27] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [28] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [29] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [30] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [31] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [32] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [33] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [34] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [35] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [36] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [37] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [38] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [39] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [40] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [41] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [42] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [43] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [44] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [45] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [46] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [47] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [48] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [49] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [50] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [51] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [52] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [53] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [54] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [55] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [56] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [57] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [58] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [59] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [60] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [61] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [62] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [63] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [64] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [65] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [66] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [67] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [68] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [69] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [70] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [71] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [72] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [73] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [74] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [75] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [76] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [77] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [78] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [79] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; [80] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}; } player:setStorageValue(_SYSTEM.EXT_ACTIVE_BAG, ext) SEARCH_ITEM_POS = 0 local pos = 01 local EMPTY_BAG_POS = 0 local bag = ext for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) > 0 then _BAG_TEMP[pos].ID_01 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) _BAG_TEMP[pos].ID_02 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_02) _BAG_TEMP[pos].ID_03 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_03) _BAG_TEMP[pos].ID_04 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_04) _BAG_TEMP[pos].ID_05 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_05) _BAG_TEMP[pos].ID_06 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_06) _BAG_TEMP[pos].ID_07 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_07) _BAG_TEMP[pos].ID_08 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_08) _BAG_TEMP[pos].ID_09 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_09) _BAG_TEMP[pos].ID_10 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_10) pos = pos + 1 else if EMPTY_BAG_POS == 0 then EMPTY_BAG_POS = bag_pos BAG_ITEM_POS = bag_pos BACK_EXT_POS = bag end end end local StoExt = player:getStorageValue(_SYSTEM.EXTENSION_BACK[slot].UID_01) if StoExt < 0 then StoExt = 0 end if EMPTY_BAG_POS == 0 then if StoExt > 0 then if ext < StoExt then local bag = ext + 1 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) > 0 then _BAG_TEMP[pos].ID_01 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) _BAG_TEMP[pos].ID_02 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_02) _BAG_TEMP[pos].ID_03 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_03) _BAG_TEMP[pos].ID_04 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_04) _BAG_TEMP[pos].ID_05 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_05) _BAG_TEMP[pos].ID_06 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_06) _BAG_TEMP[pos].ID_07 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_07) _BAG_TEMP[pos].ID_08 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_08) _BAG_TEMP[pos].ID_09 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_09) _BAG_TEMP[pos].ID_10 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_10) pos = pos + 1 else if EMPTY_BAG_POS == 0 then EMPTY_BAG_POS = bag_pos BAG_ITEM_POS = bag_pos BACK_EXT_POS = bag end end end if EMPTY_BAG_POS == 0 then if (ext + 1) < StoExt then local bag = ext + 2 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) > 0 then _BAG_TEMP[pos].ID_01 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) _BAG_TEMP[pos].ID_02 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_02) _BAG_TEMP[pos].ID_03 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_03) _BAG_TEMP[pos].ID_04 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_04) _BAG_TEMP[pos].ID_05 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_05) _BAG_TEMP[pos].ID_06 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_06) _BAG_TEMP[pos].ID_07 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_07) _BAG_TEMP[pos].ID_08 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_08) _BAG_TEMP[pos].ID_09 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_09) _BAG_TEMP[pos].ID_10 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_10) pos = pos + 1 else if EMPTY_BAG_POS == 0 then EMPTY_BAG_POS = bag_pos BAG_ITEM_POS = bag_pos BACK_EXT_POS = bag end end end if EMPTY_BAG_POS == 0 then if (ext + 2) < StoExt then local bag = ext + 3 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) > 0 then _BAG_TEMP[pos].ID_01 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) _BAG_TEMP[pos].ID_02 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_02) _BAG_TEMP[pos].ID_03 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_03) _BAG_TEMP[pos].ID_04 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_04) _BAG_TEMP[pos].ID_05 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_05) _BAG_TEMP[pos].ID_06 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_06) _BAG_TEMP[pos].ID_07 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_07) _BAG_TEMP[pos].ID_08 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_08) _BAG_TEMP[pos].ID_09 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_09) _BAG_TEMP[pos].ID_10 = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_10) pos = pos + 1 else if EMPTY_BAG_POS == 0 then EMPTY_BAG_POS = bag_pos BAG_ITEM_POS = bag_pos BACK_EXT_POS = bag end end end end end end end end end end pos = 01 local x = ext for i = 01, _SYSTEM.MAX_BAG_SLOT do if _BAG_TEMP[pos].ID_01 > 0 then player:setStorageValue(_BACKPACK[slot][x][i].UID_01, _BAG_TEMP[pos].ID_01) else player:setStorageValue(_BACKPACK[slot][x][i].UID_01, nil) end if _BAG_TEMP[pos].ID_02 > 0 then player:setStorageValue(_BACKPACK[slot][x][i].UID_02, _BAG_TEMP[pos].ID_02) else player:setStorageValue(_BACKPACK[slot][x][i].UID_02, nil) end if _BAG_TEMP[pos].ID_03 > 0 then player:setStorageValue(_BACKPACK[slot][x][i].UID_03, _BAG_TEMP[pos].ID_03) else player:setStorageValue(_BACKPACK[slot][x][i].UID_03, nil) end if _BAG_TEMP[pos].ID_04 > 0 then player:setStorageValue(_BACKPACK[slot][x][i].UID_04, _BAG_TEMP[pos].ID_04) else player:setStorageValue(_BACKPACK[slot][x][i].UID_04, nil) end if _BAG_TEMP[pos].ID_05 > 0 then player:setStorageValue(_BACKPACK[slot][x][i].UID_05, _BAG_TEMP[pos].ID_05) else player:setStorageValue(_BACKPACK[slot][x][i].UID_05, nil) end if _BAG_TEMP[pos].ID_06 > 0 then player:setStorageValue(_BACKPACK[slot][x][i].UID_06, _BAG_TEMP[pos].ID_06) else player:setStorageValue(_BACKPACK[slot][x][i].UID_06, nil) end if _BAG_TEMP[pos].ID_07 > 0 then player:setStorageValue(_BACKPACK[slot][x][i].UID_07, _BAG_TEMP[pos].ID_07) else player:setStorageValue(_BACKPACK[slot][x][i].UID_07, nil) end if _BAG_TEMP[pos].ID_08 > 0 then player:setStorageValue(_BACKPACK[slot][x][i].UID_08, _BAG_TEMP[pos].ID_08) else player:setStorageValue(_BACKPACK[slot][x][i].UID_08, nil) end if _BAG_TEMP[pos].ID_09 > 0 then player:setStorageValue(_BACKPACK[slot][x][i].UID_09, _BAG_TEMP[pos].ID_09) else player:setStorageValue(_BACKPACK[slot][x][i].UID_09, nil) end if _BAG_TEMP[pos].ID_10 > 0 then player:setStorageValue(_BACKPACK[slot][x][i].UID_10, _BAG_TEMP[pos].ID_10) else player:setStorageValue(_BACKPACK[slot][x][i].UID_10, nil) end pos = pos + 1 end for y = 01, _SYSTEM.MAX_BAG_SLOT do player:sendCancelMessage("@loadBackpack " ..slot.. " " .._BAG_TEMP[y].ID_01.. " " .._BAG_TEMP[y].ID_02.. " " .._BAG_TEMP[y].ID_03.. " " .._BAG_TEMP[y].ID_04.. " " .._BAG_TEMP[y].ID_05.. " " .._BAG_TEMP[y].ID_06.. " ".._BAG_TEMP[y].ID_07.. " " .._BAG_TEMP[y].ID_08.. " " .._BAG_TEMP[y].ID_09.. " " .._BAG_TEMP[y].ID_10.. " " ..y) end if EMPTY_BAG_POS > 0 then result = true else result = false end end if action == 01 then -- Adicionar if player:getStorageValue(_SYSTEM.PLAYER_TRADE_ACT) > 00 then return result end if itemid > 0 then if qnt == nil then qnt = 01 end if SEARCH_ITEM_POS > 0 then local atual = player:getStorageValue(_BACKPACK[slot][SEARCH_EXT_POS][SEARCH_ITEM_POS].UID_04) player:setStorageValue(_BACKPACK[slot][SEARCH_EXT_POS][SEARCH_ITEM_POS].UID_04, (atual + qnt)) player:sendCancelMessage("@LootMSG " ..itemid.. " " ..rare.. " " ..star.. " " ..qnt) SEARCH_ITEM_POS = 0 result = true else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_01, itemid) player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_02, rare) player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_03, star) if unique then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_09, 01) end if slot == 4 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_10, 100) end if slot == 1 or slot == 2 or slot == 4 or slot == 5 or slot == 6 or slot == 7 or slot == 8 or slot == 9 then local BonusExtrasIds = {} if slot == 4 then if _ITEMS[itemid].GUN_TYPE == 01 then BonusExtrasIds = { 01, 03, 06, 07, 08, 09, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44 } elseif _ITEMS[itemid].GUN_TYPE == 02 then BonusExtrasIds = { 01, 02, 06, 07, 08, 09, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44 } elseif _ITEMS[itemid].GUN_TYPE == 03 then BonusExtrasIds = { 01, 05, 06, 07, 08, 09, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44 } else BonusExtrasIds = { 01, 04, 06, 07, 08, 09, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44 } end else BonusExtrasIds = { 01, 02, 03, 04, 05, 06, 07, 08, 09, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 42, 43, 44 } end local QntExtras = math.random(00, 03) if QntExtras > 00 then if QntExtras == 01 then local chooseExtras = BonusExtrasIds[math.random(01, #BonusExtrasIds)] player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_08, chooseExtras) elseif QntExtras == 02 then local chooseString = tostring(BonusExtrasIds[math.random(01, #BonusExtrasIds)].. "0" ..BonusExtrasIds[math.random(01, #BonusExtrasIds)]) local chooseExtras = tonumber(chooseString) player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_08, chooseExtras) elseif QntExtras == 03 then local chooseString = tostring(BonusExtrasIds[math.random(01, #BonusExtrasIds)].. "0" ..BonusExtrasIds[math.random(01, #BonusExtrasIds)].. "0" ..BonusExtrasIds[math.random(01, #BonusExtrasIds)]) local chooseExtras = tonumber(chooseString) player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_08, chooseExtras) end else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_08, nil) end --player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_08, tonumber(os.date("%d", os.time()).. "" ..os.date("%m", os.time()).. "" ..os.date("%y", os.time()))) end if slot == 3 or slot == 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_04, qnt) player:sendCancelMessage("@LootMSG " ..itemid.. " " ..rare.. " " ..star.. " " ..qnt) else player:sendCancelMessage("@LootMSG " ..itemid.. " " ..rare.. " " ..star.. " 1") end SEARCH_ITEM_POS = 0 result = true end else local path = _BAG_ITEM if path[01].ID_01 > 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_01, path[01].ID_01) else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_01, nil) end if path[01].ID_02 > 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_02, path[01].ID_02) else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_02, nil) end if path[01].ID_03 > 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_03, path[01].ID_03) else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_03, nil) end if path[01].ID_04 > 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_04, path[01].ID_04) else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_04, nil) end if path[01].ID_05 > 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_05, path[01].ID_05) else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_05, nil) end if path[01].ID_06 > 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_06, path[01].ID_06) else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_06, nil) end if path[01].ID_07 > 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_07, path[01].ID_07) else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_07, nil) end if path[01].ID_08 > 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_08, path[01].ID_08) else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_08, nil) end if path[01].ID_09 > 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_09, path[01].ID_09) else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_09, nil) end if path[01].ID_10 > 0 then player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_10, path[01].ID_10) else player:setStorageValue(_BACKPACK[slot][BACK_EXT_POS][BAG_ITEM_POS].UID_10, nil) end SEARCH_ITEM_POS = 0 result = true end end if action == 02 then -- Excluir if itemid ~= nil then if itemid > 1 then player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_04, itemid - 1) result = true else player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_01, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_02, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_03, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_04, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_05, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_06, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_07, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_08, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_09, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_10, nil) result = true end else player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_01, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_02, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_03, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_04, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_05, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_06, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_07, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_08, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_09, nil) player:setStorageValue(_BACKPACK[slot][ext][bagselect].UID_10, nil) result = true end end if action == 03 then -- Procurar SEARCH_ITEM_POS = 0 QNT_ITEM_BAG = 0 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][00][bag_pos].UID_01) == itemid then if player:getStorageValue(_BACKPACK[slot][00][bag_pos].UID_09) < 01 then SEARCH_ITEM_POS = bag_pos SEARCH_EXT_POS = 00 QNT_ITEM_BAG = player:getStorageValue(_BACKPACK[slot][00][bag_pos].UID_04) result = true break end end end local StoExt = player:getStorageValue(_SYSTEM.EXTENSION_BACK[slot].UID_01) if StoExt < 0 then StoExt = 0 end if SEARCH_ITEM_POS == 0 then if StoExt > 0 then if ext < StoExt then local bag = ext + 1 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) == itemid then if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_09) < 01 then SEARCH_ITEM_POS = bag_pos SEARCH_EXT_POS = bag QNT_ITEM_BAG = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_04) result = true break end end end if SEARCH_ITEM_POS == 0 then if (ext + 1) < StoExt then local bag = ext + 2 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) == itemid then if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_09) < 01 then SEARCH_ITEM_POS = bag_pos SEARCH_EXT_POS = bag QNT_ITEM_BAG = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_04) result = true break end end end if SEARCH_ITEM_POS == 0 then if (ext + 2) < StoExt then local bag = ext + 3 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) == itemid then if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_09) < 01 then SEARCH_ITEM_POS = bag_pos SEARCH_EXT_POS = bag QNT_ITEM_BAG = player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_04) result = true break end end end end end end end end end end end if action == 04 then -- Retornar Busca (Qnt Item) return QNT_ITEM_BAG end if action == 05 then -- Retornar Busca (Pos Bag) return SEARCH_ITEM_POS end if action == 06 then -- Retornar Busca (Ext Bag Pos) return SEARCH_EXT_POS end if action == 07 then -- Retornar Qnt Espa�os Vazio QNT_EMPTY_BAG = 0 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][00][bag_pos].UID_01) <= 0000 then QNT_EMPTY_BAG = QNT_EMPTY_BAG + 1 end end local StoExt = player:getStorageValue(_SYSTEM.EXTENSION_BACK[slot].UID_01) if StoExt < 0 then StoExt = 0 end if StoExt > 0 then if StoExt < 2 then local bag = 01 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) <= 0000 then QNT_EMPTY_BAG = QNT_EMPTY_BAG + 1 end end end if StoExt < 3 then local bag = 02 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) <= 0000 then QNT_EMPTY_BAG = QNT_EMPTY_BAG + 1 end end end if StoExt < 4 then local bag = 03 for bag_pos = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][bag][bag_pos].UID_01) <= 0000 then QNT_EMPTY_BAG = QNT_EMPTY_BAG + 1 end end end end return QNT_EMPTY_BAG end if action == 08 then -- Retornar Ultimo Espa�o Vazio return BAG_ITEM_POS end if action == 09 then -- Retornar Ext do Ultimo Espa�o Vazio return BACK_EXT_POS end if action == 10 then -- Atualizar Invent�rio em tempo real player:sendCancelMessage("@ReloadBackpack " ..slot) end if action == 11 then -- Atualizar Dinheiro e outros em tempo real local G = PlayerGoldCoins(player, 00) local O = player:getStorageValue(_SYSTEM.ONLINE_COIN) local V = PlayerVipCoins(player, 00) local R = player:getStorageValue(_SYSTEM.TASK[00].RANK) local E = player:getStorageValue(_SYSTEM.TASK[00].EXP) local C1 = player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_1) local C2 = player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_2) local C3 = player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_3) local A = player:getStorageValue(_SYSTEM.TASK[00].TASK_ATIVA) local Q = player:getStorageValue(_SYSTEM.TASK[00].QNT_ATIVA) local P = player:getStorageValue(_SYSTEM.PVP_POINTS) local C = player:getStorageValue(_SYSTEM.CRIPTOMOEDA) if O < 0 then player:setStorageValue(_SYSTEM.ONLINE_COIN, 0) O = 0 end if V < 0 then V = 0 end if P < 0 then player:setStorageValue(_SYSTEM.PVP_POINTS, 0) P = 0 end if C < 0 then C = 0 end player:sendCancelMessage("@LoadGold " ..G.. " " ..O) player:sendCancelMessage("@LoadCoinMenu " ..G.. " " ..O.. " " ..V.. " " ..R.. " " ..E.. " " ..C1.. " " ..C2.. " " ..C3.. " " ..A.. " " ..Q.. " " ..P.. " " ..C) end if action == 12 then -- Atualizar Quests for X = 01, #_QUESTLOG do if _QUESTLOG[X].Type == "NORMAL" then player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01)) elseif _QUESTLOG[X].Type == "HUNT" then player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01).. " " ..player:getStorageValue(_QUESTLOG[X].Value[01]).. " " .._QUESTLOG[X].Value[02]) else player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01).. " " ..onGetBackpackItem(player, _QUESTLOG[X].Value[01]).. " " .._QUESTLOG[X].Value[02]) end end end if action == 13 then -- Organizar Backpack if player:getStorageValue(_SYSTEM.PLAYER_TRADE_ACT) > 00 then return result end _BAG_TEMP = { [01] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [02] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [03] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [04] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [05] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [06] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [07] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [08] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [09] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [10] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [11] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [12] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [13] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [14] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [15] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [16] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [17] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [18] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [19] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [20] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [21] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [22] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [23] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [24] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [25] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [26] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [27] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [28] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [29] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [30] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [31] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [32] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [33] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [34] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [35] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [36] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [37] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [38] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [39] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [40] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [41] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [42] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [43] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [44] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [45] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [46] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [47] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [48] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [49] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [50] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [51] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [52] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [53] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [54] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [55] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [56] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [57] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [58] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [59] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [60] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [61] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [62] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [63] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [64] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [65] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [66] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [67] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [68] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [69] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [70] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [71] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [72] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [73] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [74] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [75] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [76] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [77] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [78] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [79] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; [80] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000, VALUE = 00}; } _BAG_TEMPO_POS = 01 if ext == 01 then -- Organizar por Raridade for RARE_ID = 00, 04 do for EXT = 00, 03 do for BAG_POS = 01, 20 do if player:getStorageValue(_BACKPACK[slot][EXT][01].UID_01) > 00 then if player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01) > 00 then if player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02) == RARE_ID then _BAG_TEMP[_BAG_TEMPO_POS].ID_01 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01) _BAG_TEMP[_BAG_TEMPO_POS].ID_02 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02) _BAG_TEMP[_BAG_TEMPO_POS].ID_03 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03) _BAG_TEMP[_BAG_TEMPO_POS].ID_04 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_04) _BAG_TEMP[_BAG_TEMPO_POS].ID_05 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_05) _BAG_TEMP[_BAG_TEMPO_POS].ID_06 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_06) _BAG_TEMP[_BAG_TEMPO_POS].ID_07 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_07) _BAG_TEMP[_BAG_TEMPO_POS].ID_08 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_08) _BAG_TEMP[_BAG_TEMPO_POS].ID_09 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_09) _BAG_TEMP[_BAG_TEMPO_POS].ID_10 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_10) _BAG_TEMPO_POS = _BAG_TEMPO_POS + 01 end else break end else break end end end end local BAG_POS = 01 local EXT = 00 for X = 01, #_BAG_TEMP do if X == 21 then BAG_POS = 01 EXT = 01 elseif X == 41 then BAG_POS = 01 EXT = 02 elseif X == 61 then BAG_POS = 01 EXT = 03 end if _BAG_TEMP[X].ID_01 > 00 then player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01, _BAG_TEMP[X].ID_01) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02, _BAG_TEMP[X].ID_02) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03, _BAG_TEMP[X].ID_03) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_04, _BAG_TEMP[X].ID_04) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_05, _BAG_TEMP[X].ID_05) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_06, _BAG_TEMP[X].ID_06) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_07, _BAG_TEMP[X].ID_07) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_08, _BAG_TEMP[X].ID_08) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_09, _BAG_TEMP[X].ID_09) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_10, _BAG_TEMP[X].ID_10) BAG_POS = BAG_POS + 01 else player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_04, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_05, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_06, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_07, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_08, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_09, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_10, nil) end end for ORDER = 01, _SYSTEM.MAX_BAG_SLOT do player:sendCancelMessage("@loadBackpack " ..slot.. " " .._BAG_TEMP[ORDER].ID_01.. " " .._BAG_TEMP[ORDER].ID_02.. " " .._BAG_TEMP[ORDER].ID_03.. " " .._BAG_TEMP[ORDER].ID_04.. " " .._BAG_TEMP[ORDER].ID_05.. " " .._BAG_TEMP[ORDER].ID_06.. " ".._BAG_TEMP[ORDER].ID_07.. " " .._BAG_TEMP[ORDER].ID_08.. " " .._BAG_TEMP[ORDER].ID_09.. " " .._BAG_TEMP[ORDER].ID_10.. " " ..ORDER) end return true elseif ext == 02 then -- Organizar por Level local LevelOrder = {} for EXT = 00, 03 do for BAG_POS = 01, 20 do if player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01) > 00 then if slot == 02 or slot == 04 or slot == 05 or slot == 06 or slot == 08 or slot == 09 then local REQUISITO_LEVEL = 00 _BAG_TEMP[_BAG_TEMPO_POS].ID_01 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01) _BAG_TEMP[_BAG_TEMPO_POS].ID_02 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02) _BAG_TEMP[_BAG_TEMPO_POS].ID_03 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03) _BAG_TEMP[_BAG_TEMPO_POS].ID_04 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_04) _BAG_TEMP[_BAG_TEMPO_POS].ID_05 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_05) _BAG_TEMP[_BAG_TEMPO_POS].ID_06 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_06) _BAG_TEMP[_BAG_TEMPO_POS].ID_07 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_07) _BAG_TEMP[_BAG_TEMPO_POS].ID_08 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_08) _BAG_TEMP[_BAG_TEMPO_POS].ID_09 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_09) _BAG_TEMP[_BAG_TEMPO_POS].ID_10 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_10) if slot == 04 then local GUN_BASE_LEVEL = _ITEMS[player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01)].LEVEL local LEVEL_FOR_RARE = 05 local LEVEL_FOR_LEVEL = 04 local GUN_RARE = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02) or 0 local GUN_LEVEL = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_07) or 0 local GUN_STAR = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03) or 0 if GUN_RARE < 00 then GUN_RARE = 00 end if GUN_LEVEL < 00 then GUN_LEVEL = 00 end if GUN_STAR < 00 then GUN_STAR = 00 end REQUISITO_LEVEL = GUN_BASE_LEVEL + (GUN_RARE * LEVEL_FOR_RARE) + (GUN_LEVEL * LEVEL_FOR_LEVEL) + ((GUN_STAR * 10) * LEVEL_FOR_LEVEL) else local LEVEL_EQUIP = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_05) or 0 local LEVEL_STAR = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03) or 0 local LEVEL_DEF = 10000 if LEVEL_EQUIP < 0 then LEVEL_EQUIP = 0 end if LEVEL_STAR < 0 then LEVEL_STAR = 0 end if _ITEMS[player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01)].DEF ~= nil then LEVEL_DEF = _ITEMS[player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01)].DEF end REQUISITO_LEVEL = (LEVEL_DEF + LEVEL_EQUIP + (LEVEL_STAR * 10)) * 02 end player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_04, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_05, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_06, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_07, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_08, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_09, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_10, nil) _BAG_TEMP[_BAG_TEMPO_POS].VALUE = REQUISITO_LEVEL _BAG_TEMPO_POS = _BAG_TEMPO_POS + 01 table.insert(LevelOrder, REQUISITO_LEVEL) else return false end else break end end end table.sort(LevelOrder) local BAG_POS = 01 local EXT = 00 for LVL = 01, #LevelOrder do local LEVEL = LevelOrder[LVL] for POS = 01, #_BAG_TEMP do if _BAG_TEMP[POS].VALUE > 00 then if _BAG_TEMP[POS].VALUE == LEVEL then if LVL == 21 then BAG_POS = 01 EXT = 01 elseif LVL == 41 then BAG_POS = 01 EXT = 02 elseif LVL == 61 then BAG_POS = 01 EXT = 03 end player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01, _BAG_TEMP[POS].ID_01) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02, _BAG_TEMP[POS].ID_02) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03, _BAG_TEMP[POS].ID_03) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_04, _BAG_TEMP[POS].ID_04) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_05, _BAG_TEMP[POS].ID_05) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_06, _BAG_TEMP[POS].ID_06) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_07, _BAG_TEMP[POS].ID_07) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_08, _BAG_TEMP[POS].ID_08) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_09, _BAG_TEMP[POS].ID_09) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_10, _BAG_TEMP[POS].ID_10) _BAG_TEMP[POS].ID_01 = 0000 _BAG_TEMP[POS].ID_02 = 0000 _BAG_TEMP[POS].ID_03 = 0000 _BAG_TEMP[POS].ID_04 = 0000 _BAG_TEMP[POS].ID_05 = 0000 _BAG_TEMP[POS].ID_06 = 0000 _BAG_TEMP[POS].ID_07 = 0000 _BAG_TEMP[POS].ID_08 = 0000 _BAG_TEMP[POS].ID_09 = 0000 _BAG_TEMP[POS].ID_10 = 0000 _BAG_TEMP[POS].VALUE = 0000 BAG_POS = BAG_POS + 01 break end end end end for ORDER = 01, _SYSTEM.MAX_BAG_SLOT do local A = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_01) local B = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_02) local C = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_03) local D = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_04) local E = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_05) local F = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_06) local G = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_07) local H = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_08) local I = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_09) local J = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_10) player:sendCancelMessage("@loadBackpack " ..slot.. " " ..A.. " " ..B.. " " ..C.. " " ..D.. " " ..E.. " " ..F.. " "..G.. " " ..H.. " " ..I.. " " ..J.. " " ..ORDER) end return true elseif ext == 03 then -- Organizar por Pre�o local PriceOrder = {} for EXT = 00, 03 do for BAG_POS = 01, 20 do if player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01) > 00 then local PriceUnd = 00 _BAG_TEMP[_BAG_TEMPO_POS].ID_01 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01) _BAG_TEMP[_BAG_TEMPO_POS].ID_02 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02) _BAG_TEMP[_BAG_TEMPO_POS].ID_03 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03) _BAG_TEMP[_BAG_TEMPO_POS].ID_04 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_04) _BAG_TEMP[_BAG_TEMPO_POS].ID_05 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_05) _BAG_TEMP[_BAG_TEMPO_POS].ID_06 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_06) _BAG_TEMP[_BAG_TEMPO_POS].ID_07 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_07) _BAG_TEMP[_BAG_TEMPO_POS].ID_08 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_08) _BAG_TEMP[_BAG_TEMPO_POS].ID_09 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_09) _BAG_TEMP[_BAG_TEMPO_POS].ID_10 = player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_10) if slot == 03 then _BAG_TEMP[_BAG_TEMPO_POS].VALUE = _ITEMS[player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01)].PRICE * player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_04) else _BAG_TEMP[_BAG_TEMPO_POS].VALUE = _ITEMS[player:getStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01)].PRICE end PriceUnd = _BAG_TEMP[_BAG_TEMPO_POS].VALUE player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_04, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_05, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_06, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_07, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_08, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_09, nil) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_10, nil) table.insert(PriceOrder, PriceUnd) _BAG_TEMPO_POS = _BAG_TEMPO_POS + 01 else break end end end table.sort(PriceOrder) local BAG_POS = 01 local EXT = 00 for PRICE_ITEM = 01, #PriceOrder do local PRICE = PriceOrder[PRICE_ITEM] for POS = 01, #_BAG_TEMP do if _BAG_TEMP[POS].VALUE > 00 then if _BAG_TEMP[POS].VALUE == PRICE then if PRICE_ITEM == 21 then BAG_POS = 01 EXT = 01 elseif PRICE_ITEM == 41 then BAG_POS = 01 EXT = 02 elseif PRICE_ITEM == 61 then BAG_POS = 01 EXT = 03 end player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_01, _BAG_TEMP[POS].ID_01) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_02, _BAG_TEMP[POS].ID_02) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_03, _BAG_TEMP[POS].ID_03) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_04, _BAG_TEMP[POS].ID_04) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_05, _BAG_TEMP[POS].ID_05) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_06, _BAG_TEMP[POS].ID_06) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_07, _BAG_TEMP[POS].ID_07) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_08, _BAG_TEMP[POS].ID_08) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_09, _BAG_TEMP[POS].ID_09) player:setStorageValue(_BACKPACK[slot][EXT][BAG_POS].UID_10, _BAG_TEMP[POS].ID_10) _BAG_TEMP[POS].ID_01 = 0000 _BAG_TEMP[POS].ID_02 = 0000 _BAG_TEMP[POS].ID_03 = 0000 _BAG_TEMP[POS].ID_04 = 0000 _BAG_TEMP[POS].ID_05 = 0000 _BAG_TEMP[POS].ID_06 = 0000 _BAG_TEMP[POS].ID_07 = 0000 _BAG_TEMP[POS].ID_08 = 0000 _BAG_TEMP[POS].ID_09 = 0000 _BAG_TEMP[POS].ID_10 = 0000 _BAG_TEMP[POS].VALUE = 0000 BAG_POS = BAG_POS + 01 break end end end end for ORDER = 01, _SYSTEM.MAX_BAG_SLOT do local A = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_01) local B = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_02) local C = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_03) local D = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_04) local E = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_05) local F = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_06) local G = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_07) local H = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_08) local I = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_09) local J = player:getStorageValue(_BACKPACK[slot][00][ORDER].UID_10) player:sendCancelMessage("@loadBackpack " ..slot.. " " ..A.. " " ..B.. " " ..C.. " " ..D.. " " ..E.. " " ..F.. " "..G.. " " ..H.. " " ..I.. " " ..J.. " " ..ORDER) end return true end end return result end function onBonusExtra(type, value, id) local SPLIT = value:splitTrimmed("0") local BONUS = tonumber(SPLIT[type]) or 0 if _BONUS_EXTRA[BONUS] then if id == 01 then return BONUS else return _BONUS_EXTRA[BONUS].VALUE end else return 0 end end function doInventario(player, action, slot, ext, bagselect) local result = false if action == 00 then -- Atualizar TEMP_BAG_ITEM = {[01] = {ID_01 = 0000, ID_02 = 0000, ID_03 = 0000, ID_04 = 0000, ID_05 = 0000, ID_06 = 0000, ID_07 = 0000, ID_08 = 0000, ID_09 = 0000, ID_10 = 0000}} local _slot = 0 -- INVENT�RIO for i = 01, 10 do if player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_01) > 0 then _slot = i -- WEAPONS EQUIP ITEMS TEMP_BAG_ITEM[01].ID_01 = player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_01) -- ID | ID | ID TEMP_BAG_ITEM[01].ID_02 = player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_02) -- RARE | RARE | RARE TEMP_BAG_ITEM[01].ID_03 = player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_03) -- STAR | STAR | STAR TEMP_BAG_ITEM[01].ID_04 = player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_04) -- SKILL 01 | | QNT TEMP_BAG_ITEM[01].ID_05 = player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_05) -- SKILL 02 | LEVEL | TEMP_BAG_ITEM[01].ID_06 = player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_06) -- SKILL 03 | ATR1 | TEMP_BAG_ITEM[01].ID_07 = player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_07) -- LEVEL | ATR2 | TEMP_BAG_ITEM[01].ID_08 = player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_08) -- DATA | DATA | DATA TEMP_BAG_ITEM[01].ID_09 = player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_09) -- UNIQUE ITEM | UNIQUE ITEM | UNIQUE ITEM TEMP_BAG_ITEM[01].ID_10 = player:getStorageValue(_SYSTEM.INVENTARIO[i].UID_10) -- AMMO else _slot = i TEMP_BAG_ITEM[01].ID_01 = 0 TEMP_BAG_ITEM[01].ID_02 = 0 TEMP_BAG_ITEM[01].ID_03 = 0 TEMP_BAG_ITEM[01].ID_04 = 0 TEMP_BAG_ITEM[01].ID_05 = 0 TEMP_BAG_ITEM[01].ID_06 = 0 TEMP_BAG_ITEM[01].ID_07 = 0 TEMP_BAG_ITEM[01].ID_08 = 0 TEMP_BAG_ITEM[01].ID_09 = 0 TEMP_BAG_ITEM[01].ID_10 = 0 end player:sendCancelMessage("@ReloadInv " .._slot.. " " ..TEMP_BAG_ITEM[01].ID_01.. " " ..TEMP_BAG_ITEM[01].ID_02.. " " ..TEMP_BAG_ITEM[01].ID_03.. " " ..TEMP_BAG_ITEM[01].ID_04.. " " ..TEMP_BAG_ITEM[01].ID_05.. " " ..TEMP_BAG_ITEM[01].ID_06.. " "..TEMP_BAG_ITEM[01].ID_07.. " " ..TEMP_BAG_ITEM[01].ID_08.. " " ..TEMP_BAG_ITEM[01].ID_09.. " " ..TEMP_BAG_ITEM[01].ID_10) end result = true end if action == 01 then -- Adicionar if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_01) > 0 then _BAG_ITEM[01].ID_01 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_01) else _BAG_ITEM[01].ID_01 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_02) > 0 then _BAG_ITEM[01].ID_02 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_02) else _BAG_ITEM[01].ID_02 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_03) > 0 then _BAG_ITEM[01].ID_03 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_03) else _BAG_ITEM[01].ID_03 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_04) > 0 then _BAG_ITEM[01].ID_04 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_04) else _BAG_ITEM[01].ID_04 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_05) > 0 then _BAG_ITEM[01].ID_05 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_05) else _BAG_ITEM[01].ID_05 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) > 0 then _BAG_ITEM[01].ID_06 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) else _BAG_ITEM[01].ID_06 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_07) > 0 then _BAG_ITEM[01].ID_07 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_07) else _BAG_ITEM[01].ID_07 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_08) > 0 then _BAG_ITEM[01].ID_08 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_08) else _BAG_ITEM[01].ID_08 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_09) > 0 then _BAG_ITEM[01].ID_09 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_09) else _BAG_ITEM[01].ID_09 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_10) > 0 then _BAG_ITEM[01].ID_10 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_10) else _BAG_ITEM[01].ID_10 = 0 end local path = _BACKPACK[slot][ext][bagselect] player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_01, player:getStorageValue(path.UID_01)) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_02, player:getStorageValue(path.UID_02)) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_03, player:getStorageValue(path.UID_03)) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_04, player:getStorageValue(path.UID_04)) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_05, player:getStorageValue(path.UID_05)) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_06, player:getStorageValue(path.UID_06)) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_07, player:getStorageValue(path.UID_07)) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_08, player:getStorageValue(path.UID_08)) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_09, player:getStorageValue(path.UID_09)) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_10, player:getStorageValue(path.UID_10)) if _BAG_ITEM[01].ID_01 > 0 then local path = _BACKPACK[slot][ext][bagselect] player:setStorageValue(path.UID_01, _BAG_ITEM[01].ID_01) player:setStorageValue(path.UID_02, _BAG_ITEM[01].ID_02) player:setStorageValue(path.UID_03, _BAG_ITEM[01].ID_03) player:setStorageValue(path.UID_04, _BAG_ITEM[01].ID_04) player:setStorageValue(path.UID_05, _BAG_ITEM[01].ID_05) player:setStorageValue(path.UID_06, _BAG_ITEM[01].ID_06) player:setStorageValue(path.UID_07, _BAG_ITEM[01].ID_07) player:setStorageValue(path.UID_08, _BAG_ITEM[01].ID_08) player:setStorageValue(path.UID_09, _BAG_ITEM[01].ID_09) player:setStorageValue(path.UID_10, _BAG_ITEM[01].ID_10) else local path = _BACKPACK[slot][ext][bagselect] player:setStorageValue(path.UID_01, nil) player:setStorageValue(path.UID_02, nil) player:setStorageValue(path.UID_03, nil) player:setStorageValue(path.UID_04, nil) player:setStorageValue(path.UID_05, nil) player:setStorageValue(path.UID_06, nil) player:setStorageValue(path.UID_07, nil) player:setStorageValue(path.UID_08, nil) player:setStorageValue(path.UID_09, nil) player:setStorageValue(path.UID_10, nil) end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_01) > 0 then _BAG_ITEM[01].ID_01 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_01) else _BAG_ITEM[01].ID_01 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_02) > 0 then _BAG_ITEM[01].ID_02 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_02) else _BAG_ITEM[01].ID_02 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_03) > 0 then _BAG_ITEM[01].ID_03 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_03) else _BAG_ITEM[01].ID_03 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_04) > 0 then _BAG_ITEM[01].ID_04 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_04) else _BAG_ITEM[01].ID_04 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_05) > 0 then _BAG_ITEM[01].ID_05 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_05) else _BAG_ITEM[01].ID_05 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) > 0 then _BAG_ITEM[01].ID_06 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) else _BAG_ITEM[01].ID_06 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_07) > 0 then _BAG_ITEM[01].ID_07 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_07) else _BAG_ITEM[01].ID_07 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_08) > 0 then _BAG_ITEM[01].ID_08 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_08) else _BAG_ITEM[01].ID_08 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_09) > 0 then _BAG_ITEM[01].ID_09 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_09) else _BAG_ITEM[01].ID_09 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_10) > 0 then _BAG_ITEM[01].ID_10 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_10) else _BAG_ITEM[01].ID_10 = 0 end player:sendCancelMessage("@EquiparItemInv " ..slot.. " " .._BAG_ITEM[01].ID_01.. " " .._BAG_ITEM[01].ID_02.. " " .._BAG_ITEM[01].ID_03.. " " .._BAG_ITEM[01].ID_04.. " " .._BAG_ITEM[01].ID_05.. " " .._BAG_ITEM[01].ID_06.. " ".._BAG_ITEM[01].ID_07.. " " .._BAG_ITEM[01].ID_08.. " " .._BAG_ITEM[01].ID_09.. " " .._BAG_ITEM[01].ID_10) doInventario(player, 07) result = true end if action == 02 then -- Remover if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_01) > 0 then _BAG_ITEM[01].ID_01 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_01) else _BAG_ITEM[01].ID_01 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_02) > 0 then _BAG_ITEM[01].ID_02 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_02) else _BAG_ITEM[01].ID_02 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_03) > 0 then _BAG_ITEM[01].ID_03 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_03) else _BAG_ITEM[01].ID_03 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_04) > 0 then _BAG_ITEM[01].ID_04 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_04) else _BAG_ITEM[01].ID_04 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_05) > 0 then _BAG_ITEM[01].ID_05 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_05) else _BAG_ITEM[01].ID_05 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) > 0 then _BAG_ITEM[01].ID_06 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) else _BAG_ITEM[01].ID_06 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_07) > 0 then _BAG_ITEM[01].ID_07 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_07) else _BAG_ITEM[01].ID_07 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_08) > 0 then _BAG_ITEM[01].ID_08 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_08) else _BAG_ITEM[01].ID_08 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_09) > 0 then _BAG_ITEM[01].ID_09 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_09) else _BAG_ITEM[01].ID_09 = 0 end if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_10) > 0 then _BAG_ITEM[01].ID_10 = player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_10) else _BAG_ITEM[01].ID_10 = 0 end doBackpack(player, 01, slot, 0, 0, 0) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_01, nil) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_02, nil) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_03, nil) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_04, nil) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_05, nil) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_06, nil) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_07, nil) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_08, nil) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_09, nil) player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_10, nil) doInventario(player, 07) result = true end if action == 03 then -- Load HUD doInventario(player, 00) player:sendCancelMessage("@LoadQuestMap") player:sendCancelMessage("@CureSkill " ..player:getStorageValue(_SYSTEM.SKILL_CURE[01]).. " " ..player:getStorageValue(_SYSTEM.SKILL_CURE[02])) player:sendCancelMessage("@LoadHotkey") local DESCONTRUIR_EVENT = 00 if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) > 00 then if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) == 08 then DESCONTRUIR_EVENT = 01 end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, eventMessage) end if player:getStorageValue(_DESAFIOS[00].DESAFIO_TYPE) == 02 then DESCONTRUIR_EVENT = 01 end player:sendCancelMessage("@ToolsLoad " ..player:getStorageValue(_SYSTEM.TOOLS[01]).. " " ..player:getStorageValue(_SYSTEM.TOOLS[02]).. " " ..DESCONTRUIR_EVENT) local IDD_1 = player:getStorageValue(_SYSTEM.MAESTRIA[01]) local IDD_2 = player:getStorageValue(_SYSTEM.ESPECIALISTA[01]) local IDD_3 = player:getStorageValue(_SYSTEM.MAESTRIA[02]) local IDD_4 = player:getStorageValue(_SYSTEM.ESPECIALISTA[02]) player:sendCancelMessage("@MaestriaEsp " ..IDD_1.. " " ..IDD_2.. " " ..IDD_3.. " " ..IDD_4) -- Reset GlobalStorage Dangerous local tile = Tile(player:getPosition()):hasFlag(TILESTATE_PVPZONE) if not tile then player:setTown(Town(01)) for X = 01, #_SYSTEM.DANGEROUS do for Z = 01, #_SYSTEM.DANGEROUS[X] do if player:getStorageValue(_SYSTEM.DANGEROUS[X][Z].STORAGE) > 0 then --Game.setStorageValue(_SYSTEM.DANGEROUS[X][Z].STORAGE, nil) player:setStorageValue(_SYSTEM.DANGEROUS[X][Z].STORAGE, nil) player:setStorageValue(_SYSTEM.DANGEROUS[X][Z].RECOMPENSA[01], nil) end end end end player:sendCancelMessage("@StarCliente") local ExAmulet = player:getStorageValue(_SYSTEM.EXTENSION_BACK[001].UID_01) local ExHelmet = player:getStorageValue(_SYSTEM.EXTENSION_BACK[002].UID_01) local ExBackpack = player:getStorageValue(_SYSTEM.EXTENSION_BACK[003].UID_01) local ExWeapon = player:getStorageValue(_SYSTEM.EXTENSION_BACK[004].UID_01) local ExArmor = player:getStorageValue(_SYSTEM.EXTENSION_BACK[005].UID_01) local ExGlove = player:getStorageValue(_SYSTEM.EXTENSION_BACK[006].UID_01) local ExRing = player:getStorageValue(_SYSTEM.EXTENSION_BACK[007].UID_01) local ExLegs = player:getStorageValue(_SYSTEM.EXTENSION_BACK[008].UID_01) local ExBoots = player:getStorageValue(_SYSTEM.EXTENSION_BACK[009].UID_01) player:sendCancelMessage("@reloadEx " ..ExAmulet.. " " ..ExHelmet.. " " ..ExBackpack.. " " ..ExWeapon.. " " ..ExArmor.. " " ..ExGlove.. " " ..ExRing.. " " ..ExLegs.. " " ..ExBoots) local Kazemir = player:getStorageValue(_SYSTEM.NEXUS[001].UID_01) local Sunset = player:getStorageValue(_SYSTEM.NEXUS[002].UID_01) local Bonebrook = player:getStorageValue(_SYSTEM.NEXUS[003].UID_01) local Kimbolton = player:getStorageValue(_SYSTEM.NEXUS[004].UID_01) local Huampali = player:getStorageValue(_SYSTEM.NEXUS[005].UID_01) local Rivermine = player:getStorageValue(_SYSTEM.NEXUS[006].UID_01) local Kopec = player:getStorageValue(_SYSTEM.NEXUS[008].UID_01) local Hanva = player:getStorageValue(_SYSTEM.NEXUS[009].UID_01) local Sodon = player:getStorageValue(_SYSTEM.NEXUS[010].UID_01) player:sendCancelMessage("@Nexus " ..Kazemir.. " " ..Sunset.. " " ..Bonebrook.. " " ..Kimbolton.. " " ..Huampali.. " " ..Rivermine.. " 01 " ..Kopec.. " " ..Hanva.. " " ..Sodon) doBackpack(player, 11) result = true end if action == 04 then -- Carrega Status do Invent�rio local ATK = 0 local DEF = 0 local ESQ = 0 local MAG = 0 local Penalidade = player:getStorageValue(_SYSTEM.PENALIDADES[02]) local ExtraDEF = 00 local ExtraESQ = 00 local ExtraMAG = 00 local GoldDrTaxa = 0 local ExpCrit = 0 local AtrCritico = 0 local AtrTaxa= 0 local AtrHpCrit = 0 local AtrDamage = 0 local HPCritTaxa = 0 local DropTaxa = 0 local FIRE = 0 local ICE = 0 local ENERGY = 0 local EARTH = 0 local DEATH = 0 local VIDA = 0 local DEST = 0 local AMMO = 0 local DISP = 0 local HAB = 0 local CRIT = 0 local POINTS = 0 if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[02].STORAGE) > 00 then DEF = DEF + 25 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[03].STORAGE) > 00 then ESQ = ESQ + 25 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[04].STORAGE) > 00 then FIRE = FIRE + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[05].STORAGE) > 00 then ICE = ICE + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[06].STORAGE) > 00 then ENERGY = ENERGY + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[07].STORAGE) > 00 then EARTH = EARTH + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[08].STORAGE) > 00 then DEATH = DEATH + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[10].STORAGE) > 00 then DEF = DEF + 25 ESQ = ESQ + 25 FIRE = FIRE + 10 ICE = ICE + 10 ENERGY = ENERGY + 10 EARTH = EARTH + 10 DEATH = DEATH + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[11].STORAGE) > 00 then if player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE) == 01 then FIRE = FIRE + 50 elseif player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE) == 02 then ICE = ICE + 50 elseif player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE) == 03 then ENERGY = ENERGY + 50 elseif player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE) == 04 then EARTH = EARTH + 50 else player:setStorageValue(_GLOBAL_RANDOM.BUFFS[11].STORAGE, nil) player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE, nil) end end -- COLETANDO STATUS local _SLOTS = { [01] = {_SYSTEM.INVENTARIO[02].UID_01, _SYSTEM.INVENTARIO[02].UID_02, _SYSTEM.INVENTARIO[02].UID_03, _SYSTEM.INVENTARIO[02].UID_05, _SYSTEM.INVENTARIO[02].UID_06, _SYSTEM.INVENTARIO[02].UID_07}; [02] = {_SYSTEM.INVENTARIO[05].UID_01, _SYSTEM.INVENTARIO[05].UID_02, _SYSTEM.INVENTARIO[05].UID_03, _SYSTEM.INVENTARIO[05].UID_05, _SYSTEM.INVENTARIO[05].UID_06, _SYSTEM.INVENTARIO[05].UID_07}; [03] = {_SYSTEM.INVENTARIO[06].UID_01, _SYSTEM.INVENTARIO[06].UID_02, _SYSTEM.INVENTARIO[06].UID_03, _SYSTEM.INVENTARIO[06].UID_05, _SYSTEM.INVENTARIO[06].UID_06, _SYSTEM.INVENTARIO[06].UID_07}; [04] = {_SYSTEM.INVENTARIO[08].UID_01, _SYSTEM.INVENTARIO[08].UID_02, _SYSTEM.INVENTARIO[08].UID_03, _SYSTEM.INVENTARIO[08].UID_05, _SYSTEM.INVENTARIO[08].UID_06, _SYSTEM.INVENTARIO[08].UID_07}; [05] = {_SYSTEM.INVENTARIO[09].UID_01, _SYSTEM.INVENTARIO[09].UID_02, _SYSTEM.INVENTARIO[09].UID_03, _SYSTEM.INVENTARIO[09].UID_05, _SYSTEM.INVENTARIO[09].UID_06, _SYSTEM.INVENTARIO[09].UID_07}; } for SLOT_ID = 01, 05 do local itemID = player:getStorageValue(_SLOTS[SLOT_ID][01]) if itemID > 0 then local RareItem = 0 local StarItem = 0 local LevelItem = 0 local ItemART1 = 0 local ItemART2 = 0 if player:getStorageValue(_SLOTS[SLOT_ID][02]) > 0 then RareItem = player:getStorageValue(_SLOTS[SLOT_ID][02]) end if player:getStorageValue(_SLOTS[SLOT_ID][03]) > 0 then StarItem = player:getStorageValue(_SLOTS[SLOT_ID][03]) end if player:getStorageValue(_SLOTS[SLOT_ID][04]) > 0 then LevelItem = player:getStorageValue(_SLOTS[SLOT_ID][04]) end if player:getStorageValue(_SLOTS[SLOT_ID][05]) > 0 then ItemART1 = player:getStorageValue(_SLOTS[SLOT_ID][05]) end if player:getStorageValue(_SLOTS[SLOT_ID][06]) > 0 then ItemART2 = player:getStorageValue(_SLOTS[SLOT_ID][06]) end local itemRecLevel = (_ITEMS[itemID].DEF + LevelItem + (StarItem * 10)) * 2 if player:getLevel() >= itemRecLevel then if player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 05 then ExtraDEF = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) elseif player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 06 then ExtraESQ = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) elseif player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 07 then ExtraMAG = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) end if ItemART1 == 04 then ExtraDEF = ExtraDEF + 01 end if ItemART2 == 04 then ExtraDEF = ExtraDEF + 01 end if ItemART1 == 02 then AtrCritico = AtrCritico + 01 end if ItemART2 == 02 then AtrCritico = AtrCritico + 01 end if ItemART1 == 03 then AtrTaxa = AtrTaxa + 01 end if ItemART2 == 03 then AtrTaxa = AtrTaxa + 01 end if ItemART1 == 05 then AtrHpCrit = AtrHpCrit + 01 end if ItemART2 == 05 then AtrHpCrit = AtrHpCrit + 01 end if ItemART1 == 06 then AtrDamage = AtrDamage + 01 end if ItemART2 == 06 then AtrDamage = AtrDamage + 01 end if ItemART1 == 07 then HPCritTaxa = HPCritTaxa + 01 end if ItemART2 == 07 then HPCritTaxa = HPCritTaxa + 01 end if ItemART1 == 11 then ExpCrit = ExpCrit + 01 end if ItemART2 == 11 then ExpCrit = ExpCrit + 01 end if ItemART1 == 15 then DropTaxa = DropTaxa + 01 end if ItemART2 == 15 then DropTaxa = DropTaxa + 01 end if ItemART1 == 16 then GoldDrTaxa = GoldDrTaxa + 01 end if ItemART2 == 16 then GoldDrTaxa = GoldDrTaxa + 01 end if ItemART1 == 08 then local CriticalHealth = 70 * (player:getBaseMaxHealth() / 100) if player:getHealth() >= CriticalHealth then ExtraESQ = ExtraESQ + 01 end end if ItemART2 == 08 then local CriticalHealth = 70 * (player:getBaseMaxHealth() / 100) if player:getHealth() >= CriticalHealth then ExtraESQ = ExtraESQ + 01 end end if ExtraDEF < 0 then ExtraDEF = 0 end if ExtraESQ < 0 then ExtraESQ = 0 end if ExtraMAG < 0 then ExtraMAG = 0 end DEF = DEF + (_ITEMS[itemID].DEF + _RARIDADES[RareItem].Arm) + (StarItem * 10) + LevelItem ESQ = ESQ + (_ITEMS[itemID].ESQ + _RARIDADES[RareItem].Arm) + (StarItem * 10) + LevelItem if _ITEMS[itemID].MAG_TYPE then if _ITEMS[itemID].MAG_TYPE == "FIRE" then FIRE = FIRE + (_ITEMS[itemID].MAG + _RARIDADES[RareItem].Arm) + (StarItem * 10) + LevelItem elseif _ITEMS[itemID].MAG_TYPE == "ICE" then ICE = ICE + (_ITEMS[itemID].MAG + _RARIDADES[RareItem].Arm) + (StarItem * 10) + LevelItem elseif _ITEMS[itemID].MAG_TYPE == "ENERGY" then ENERGY = ENERGY + (_ITEMS[itemID].MAG + _RARIDADES[RareItem].Arm) + (StarItem * 10) + LevelItem elseif _ITEMS[itemID].MAG_TYPE == "EARTH" then EARTH = EARTH + (_ITEMS[itemID].MAG + _RARIDADES[RareItem].Arm) + (StarItem * 10) + LevelItem elseif _ITEMS[itemID].MAG_TYPE == "DEATH" then DEATH = DEATH + (_ITEMS[itemID].MAG + _RARIDADES[RareItem].Arm) + (StarItem * 10) + LevelItem end end end end end if ExtraDEF > 0 then local AtrTotal = _ATRIBUTOS[04].PERCENT * ExtraDEF ExtraDEF = AtrTotal - ((ExtraDEF - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if AtrCritico > 0 then local AtrTotal = _ATRIBUTOS[02].PERCENT * AtrCritico AtrCritico = AtrTotal - ((AtrCritico - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if AtrTaxa > 0 then local AtrTotal = _ATRIBUTOS[03].PERCENT * AtrTaxa AtrTaxa = AtrTotal - ((AtrTaxa - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if AtrHpCrit > 0 then local AtrTotal = _ATRIBUTOS[05].PERCENT * AtrHpCrit AtrHpCrit = AtrTotal - ((AtrHpCrit - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if AtrDamage > 0 then local AtrTotal = _ATRIBUTOS[06].PERCENT * AtrDamage AtrDamage = AtrTotal - ((AtrDamage - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if HPCritTaxa > 0 then local AtrTotal = _ATRIBUTOS[07].PERCENT * HPCritTaxa HPCritTaxa = AtrTotal - ((HPCritTaxa - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if ExpCrit > 0 then local AtrTotal = _ATRIBUTOS[11].PERCENT * ExpCrit ExpCrit = AtrTotal - ((ExpCrit - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if DropTaxa > 0 then local AtrTotal = _ATRIBUTOS[15].PERCENT * DropTaxa DropTaxa = AtrTotal - ((DropTaxa - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if GoldDrTaxa > 0 then local AtrTotal = _ATRIBUTOS[16].PERCENT * GoldDrTaxa GoldDrTaxa = AtrTotal - ((GoldDrTaxa - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if ExtraESQ > 0 then local AtrTotal = _ATRIBUTOS[08].PERCENT * ExtraESQ ExtraESQ = AtrTotal - ((ExtraESQ - 01) * _SYSTEM.ATR_SYSTEM_DIM) end DEF = DEF + ExtraDEF ESQ = ESQ + ExtraESQ MAG = MAG + ExtraMAG AtrCritico = AtrCritico + 05 AtrTaxa = AtrTaxa + 05 if player:getStorageValue(_SYSTEM.INVENTARIO[07].UID_01) > 0 then local RingID = player:getStorageValue(_SYSTEM.INVENTARIO[07].UID_01) local RingRA = player:getStorageValue(_SYSTEM.INVENTARIO[07].UID_02) local RingST = player:getStorageValue(_SYSTEM.INVENTARIO[07].UID_03) local RingLV = player:getStorageValue(_SYSTEM.INVENTARIO[07].UID_05) if RingID == 7006 then -- Aumenta seu Dano Cr�tico em + 50%. AtrCritico = AtrCritico + 50 end if RingID == 7007 then -- Aumenta sua Taxa Cr�tica em + 10%. AtrTaxa = AtrTaxa + 10 end if RingID == 7009 then -- Aumenta sua ESQ em + 20. ESQ = ESQ + 20 end if RingID == 7010 then -- Aumenta sua resist�ncia contra danos do tipo DEATH em 10% ( + 05 por raridade ). if RingRA < 0 then RingRA = 0 end DEATH = DEATH + 10 + (05 * RingRA) end if RingID == 7011 then -- Aumenta sua resist�ncia contra danos do tipo ENERGY em 10% ( + 05 por raridade ). if RingRA < 0 then RingRA = 0 end ENERGY = ENERGY + 10 + (05 * RingRA) end if RingID == 7012 then -- Aumenta sua resist�ncia contra danos do tipo ICE em 10% ( + 05 por raridade ). if RingRA < 0 then RingRA = 0 end ICE = ICE + 10 + (05 * RingRA) end if RingID == 7013 then -- Aumenta sua resist�ncia contra danos do tipo FIRE em 10% ( + 05 por raridade ). if RingRA < 0 then RingRA = 0 end FIRE = FIRE + 10 + (05 * RingRA) end if RingID == 7014 then -- Aumenta sua resist�ncia contra danos do tipo EARTH em 10% ( + 05 por raridade ). if RingRA < 0 then RingRA = 0 end EARTH = EARTH + 10 + (05 * RingRA) end end if Penalidade > 0 then Penalidade = 30 - player:getStorageValue(_SYSTEM.PENALIDADES[02]) else Penalidade = 30 end local PVPPoints = 0 if player:getStorageValue(_SYSTEM.PVP_POINTS) > 0 then PVPPoints = player:getStorageValue(_SYSTEM.PVP_POINTS) end if player:getStorageValue(_SYSTEM.POINTS_ATR[01]) > 0 then VIDA = player:getStorageValue(_SYSTEM.POINTS_ATR[01]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[02]) > 0 then DEST = player:getStorageValue(_SYSTEM.POINTS_ATR[02]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[03]) > 0 then AMMO = player:getStorageValue(_SYSTEM.POINTS_ATR[03]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[04]) > 0 then DISP = player:getStorageValue(_SYSTEM.POINTS_ATR[04]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[05]) > 0 then HAB = player:getStorageValue(_SYSTEM.POINTS_ATR[05]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[06]) > 0 then CRIT = player:getStorageValue(_SYSTEM.POINTS_ATR[06]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[07]) > 0 then POINTS = player:getStorageValue(_SYSTEM.POINTS_ATR[07]) end player:sendCancelMessage("@LoadStatus " ..player:getSpeed().. " " ..DEF.. " " ..ESQ.. " " ..MAG.. " " ..AtrTaxa.. " " ..AtrCritico.. " " ..Penalidade.. " " ..PVPPoints.. " " ..FIRE.. " " ..ICE.. " " ..ENERGY.. " " ..EARTH.. " " ..DEATH) player:sendCancelMessage("@AtriStatus " ..VIDA.. " " ..DEST.. " " ..AMMO.. " " ..DISP.. " " ..HAB.. " " ..CRIT.. " " ..POINTS) local IDD_1 = player:getStorageValue(_SYSTEM.MAESTRIA[01]) local IDD_2 = player:getStorageValue(_SYSTEM.ESPECIALISTA[01]) local IDD_3 = player:getStorageValue(_SYSTEM.MAESTRIA[02]) local IDD_4 = player:getStorageValue(_SYSTEM.ESPECIALISTA[02]) player:sendCancelMessage("@MaestriaEsp " ..IDD_1.. " " ..IDD_2.. " " ..IDD_3.. " " ..IDD_4) PlayerPassives(player, 00) PlayerPassives(player, 02) if player:getStorageValue(_QUESTLOG[206].UID_01) == 02 then player:sendCancelMessage("@TutorShow 48") player:sendCancelMessage("@@NewbieStart 49") end end if action == 05 then -- Carrega os Buffs local BUFF_1 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[01].STORAGE) local BUFF_2 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[02].STORAGE) local BUFF_3 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[03].STORAGE) local BUFF_4 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[04].STORAGE) local BUFF_5 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[05].STORAGE) local BUFF_6 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[06].STORAGE) local BUFF_7 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[07].STORAGE) local BUFF_8 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[08].STORAGE) local BUFF_9 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[09].STORAGE) local BUFF_10 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[10].STORAGE) local BUFF_11 = player:getStorageValue(_GLOBAL_RANDOM.BUFFS[11].STORAGE) local EVENT_4 = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE) player:sendCancelMessage("@BuffLoad " ..BUFF_1.. " " ..BUFF_2.. " " ..BUFF_3.. " " ..BUFF_4.. " " ..BUFF_5.. " " ..BUFF_6.. " " ..BUFF_7.. " " ..BUFF_8.. " " ..BUFF_9.. " " ..BUFF_10.. " " ..BUFF_11.. " " ..EVENT_4) end if action == 06 then -- Carrega os Pontos de Atributos local VIDA = 0 local DEST = 0 local AMMO = 0 local DISP = 0 local HAB = 0 local CRIT = 0 local POINTS = 0 if player:getStorageValue(_SYSTEM.POINTS_ATR[01]) > 0 then VIDA = player:getStorageValue(_SYSTEM.POINTS_ATR[01]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[02]) > 0 then DEST = player:getStorageValue(_SYSTEM.POINTS_ATR[02]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[03]) > 0 then AMMO = player:getStorageValue(_SYSTEM.POINTS_ATR[03]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[04]) > 0 then DISP = player:getStorageValue(_SYSTEM.POINTS_ATR[04]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[05]) > 0 then HAB = player:getStorageValue(_SYSTEM.POINTS_ATR[05]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[06]) > 0 then CRIT = player:getStorageValue(_SYSTEM.POINTS_ATR[06]) end if player:getStorageValue(_SYSTEM.POINTS_ATR[07]) > 0 then POINTS = player:getStorageValue(_SYSTEM.POINTS_ATR[07]) end player:sendCancelMessage("@AtriStatus " ..VIDA.. " " ..DEST.. " " ..AMMO.. " " ..DISP.. " " ..HAB.. " " ..CRIT.. " " ..POINTS) end if action == 07 then -- Carrega Informa��es de Defesa/Ataque do Personagem local DEF = 0 local ESQ = 0 local ExtraDEF = 00 local ExtraESQ = 00 local ExtraMAG = 00 local CuraESQ = 00 local CancelInv = 00 local FearPara = 00 local CanPara = 00 local DmgHalf = 00 local BombFire = 00 local BombEnergy = 00 local BombIce = 00 local BombDeath = 00 local BombEarth = 00 local BombHoly = 00 local BombPhysical = 00 local SkillDmg = 00 local ValueESQ = 00 local ResPlayer = 00 local FIRE = 0 local ICE = 0 local ENERGY = 0 local DEST = 0 local EARTH = 0 local DEATH = 0 local ExetaRes = 0 local AtrCritico = 0 local AtrTaxa = 0 local AtrHpCrit = 0 local AtrDamage = 0 local HPCritTaxa = 0 local ExpCrit = 0 local DropTaxa = 0 local GoldDrTaxa = 0 local CriDistan = 0 local CriEXP = 0 local FreeRun = 0 -- COLETANDO STATUS local _SLOTS = { [01] = {_SYSTEM.INVENTARIO[02].UID_01, _SYSTEM.INVENTARIO[02].UID_02, _SYSTEM.INVENTARIO[02].UID_03, _SYSTEM.INVENTARIO[02].UID_05, _SYSTEM.INVENTARIO[02].UID_06, _SYSTEM.INVENTARIO[02].UID_07}; [02] = {_SYSTEM.INVENTARIO[05].UID_01, _SYSTEM.INVENTARIO[05].UID_02, _SYSTEM.INVENTARIO[05].UID_03, _SYSTEM.INVENTARIO[05].UID_05, _SYSTEM.INVENTARIO[05].UID_06, _SYSTEM.INVENTARIO[05].UID_07}; [03] = {_SYSTEM.INVENTARIO[06].UID_01, _SYSTEM.INVENTARIO[06].UID_02, _SYSTEM.INVENTARIO[06].UID_03, _SYSTEM.INVENTARIO[06].UID_05, _SYSTEM.INVENTARIO[06].UID_06, _SYSTEM.INVENTARIO[06].UID_07}; [04] = {_SYSTEM.INVENTARIO[08].UID_01, _SYSTEM.INVENTARIO[08].UID_02, _SYSTEM.INVENTARIO[08].UID_03, _SYSTEM.INVENTARIO[08].UID_05, _SYSTEM.INVENTARIO[08].UID_06, _SYSTEM.INVENTARIO[08].UID_07}; [05] = {_SYSTEM.INVENTARIO[09].UID_01, _SYSTEM.INVENTARIO[09].UID_02, _SYSTEM.INVENTARIO[09].UID_03, _SYSTEM.INVENTARIO[09].UID_05, _SYSTEM.INVENTARIO[09].UID_06, _SYSTEM.INVENTARIO[09].UID_07}; } if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[02].STORAGE) > 00 then DEF = DEF + 25 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[03].STORAGE) > 00 then ESQ = ESQ + 25 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[04].STORAGE) > 00 then FIRE = FIRE + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[05].STORAGE) > 00 then ICE = ICE + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[06].STORAGE) > 00 then ENERGY = ENERGY + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[07].STORAGE) > 00 then EARTH = EARTH + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[08].STORAGE) > 00 then DEATH = DEATH + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[10].STORAGE) > 00 then DEF = DEF + 25 ESQ = ESQ + 25 FIRE = FIRE + 10 ICE = ICE + 10 ENERGY = ENERGY + 10 EARTH = EARTH + 10 DEATH = DEATH + 10 end if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[11].STORAGE) > 00 then if player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE) == 01 then FIRE = FIRE + 50 elseif player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE) == 02 then ICE = ICE + 50 elseif player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE) == 03 then ENERGY = ENERGY + 50 elseif player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE) == 04 then EARTH = EARTH + 50 else player:setStorageValue(_GLOBAL_RANDOM.BUFFS[11].STORAGE, nil) player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE, nil) end end if player:getStorageValue(_SYSTEM.INVENTARIO[01].UID_01) > 0 then if player:getStorageValue(_SYSTEM.INVENTARIO[01].UID_01) == 1016 then if player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) > 00 then local RareAmulet = player:getStorageValue(_SYSTEM.INVENTARIO[01].UID_02) local StarAmulet = player:getStorageValue(_SYSTEM.INVENTARIO[01].UID_03) local LevelAmulet = player:getStorageValue(_SYSTEM.INVENTARIO[01].UID_05) local ProtectDef = 02 if RareAmulet < 0 then RareAmulet = 0 end if StarAmulet < 0 then StarAmulet = 0 end if LevelAmulet < 0 then LevelAmulet = 0 end ResPlayer = ResPlayer + (ProtectDef * (RareAmulet + 01) + ((StarAmulet + 01) * LevelAmulet)) end end end for SLOT_ID = 01, 05 do local itemID = player:getStorageValue(_SLOTS[SLOT_ID][01]) if itemID > 0 then local RareItem = 0 local StarItem = 0 local LevelItem = 0 local ItemART1 = 0 local ItemART2 = 0 if player:getStorageValue(_SLOTS[SLOT_ID][02]) > 0 then RareItem = player:getStorageValue(_SLOTS[SLOT_ID][02]) end if player:getStorageValue(_SLOTS[SLOT_ID][03]) > 0 then StarItem = player:getStorageValue(_SLOTS[SLOT_ID][03]) end if player:getStorageValue(_SLOTS[SLOT_ID][04]) > 0 then LevelItem = player:getStorageValue(_SLOTS[SLOT_ID][04]) end if player:getStorageValue(_SLOTS[SLOT_ID][05]) > 0 then ItemART1 = player:getStorageValue(_SLOTS[SLOT_ID][05]) end if player:getStorageValue(_SLOTS[SLOT_ID][06]) > 0 then ItemART2 = player:getStorageValue(_SLOTS[SLOT_ID][06]) end local itemRecLevel = (_ITEMS[itemID].DEF + LevelItem + (StarItem * 10)) * 2 if player:getLevel() >= itemRecLevel then if player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 05 then ExtraDEF = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) elseif player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 06 then ExtraESQ = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) elseif player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 07 then ExtraMAG = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) elseif player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 16 then ResPlayer = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) elseif player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 18 then DEATH = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) elseif player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 19 then FIRE = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) elseif player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 20 then ICE = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) elseif player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 21 then ENERGY = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) elseif player:getStorageValue(_SYSTEM.AMULET_VALUES[00][02]) == 22 then EARTH = player:getStorageValue(_SYSTEM.AMULET_VALUES[00][03]) end if ItemART1 == 01 then ExetaRes = 01 end if ItemART2 == 01 then ExetaRes = 01 end if ItemART1 == 02 then AtrCritico = AtrCritico + 01 end if ItemART2 == 02 then AtrCritico = AtrCritico + 01 end if ItemART1 == 03 then AtrTaxa = AtrTaxa + 01 end if ItemART2 == 03 then AtrTaxa = AtrTaxa + 01 end if ItemART1 == 05 then AtrHpCrit = AtrHpCrit + 01 end if ItemART2 == 05 then AtrHpCrit = AtrHpCrit + 01 end if ItemART1 == 06 then AtrDamage = AtrDamage + 01 end if ItemART2 == 06 then AtrDamage = AtrDamage + 01 end if ItemART1 == 07 then HPCritTaxa = HPCritTaxa + 01 end if ItemART2 == 07 then HPCritTaxa = HPCritTaxa + 01 end if ItemART1 == 11 then ExpCrit = ExpCrit + 01 end if ItemART1 == 13 then FreeRun = 01 end if ItemART2 == 13 then FreeRun = 01 end if ItemART1 == 15 then DropTaxa = DropTaxa + 01 end if ItemART1 == 15 then DropTaxa = DropTaxa + 01 end if ItemART2 == 15 then DropTaxa = DropTaxa + 01 end if ItemART1 == 16 then GoldDrTaxa = GoldDrTaxa + 01 end if ItemART2 == 16 then GoldDrTaxa = GoldDrTaxa + 01 end if ItemART1 == 20 then CriDistan = CriDistan + 01 end if ItemART2 == 20 then CriDistan = CriDistan + 01 end if ItemART1 == 32 then CriEXP = 01 end if ItemART2 == 32 then CriEXP = 01 end if ItemART2 == 04 then ExtraDEF = ExtraDEF + 01 end if ItemART2 == 04 then ExtraDEF = ExtraDEF + 01 end if ItemART1 == 08 then local CriticalHealth = 70 * (player:getBaseMaxHealth() / 100) if player:getHealth() >= CriticalHealth then ExtraESQ = ExtraESQ + 01 end end if ItemART2 == 08 then local CriticalHealth = 70 * (player:getBaseMaxHealth() / 100) if player:getHealth() >= CriticalHealth then ExtraESQ = ExtraESQ + 01 end end if ItemART1 == 10 then CuraESQ = CuraESQ + 01 end if ItemART2 == 10 then CuraESQ = CuraESQ + 01 end if ItemART1 == 11 then CancelInv = 01 end if ItemART2 == 11 then CancelInv = 01 end if ItemART1 == 12 then FearPara = FearPara + 01 end if ItemART2 == 12 then FearPara = FearPara + 01 end if ItemART1 == 13 then CanPara = 01 end if ItemART2 == 13 then CanPara = 01 end if ItemART1 == 14 then DmgHalf = 01 end if ItemART2 == 14 then DmgHalf = 01 end if ItemART1 == 17 then BombFire = BombFire + 01 end if ItemART2 == 17 then BombFire = BombFire + 01 end if ItemART1 == 18 then BombEnergy = BombEnergy + 01 end if ItemART2 == 18 then BombEnergy = BombEnergy + 01 end if ItemART1 == 19 then BombIce = BombIce + 01 end if ItemART2 == 19 then BombIce = BombIce + 01 end if ItemART1 == 21 then BombDeath = BombDeath + 01 end if ItemART2 == 21 then BombDeath = BombDeath + 01 end if ItemART1 == 22 then BombEarth = BombEarth + 01 end if ItemART2 == 22 then BombEarth = BombEarth + 01 end if ItemART1 == 23 then BombHoly = BombHoly + 01 end if ItemART2 == 23 then BombHoly = BombHoly + 01 end if ItemART1 == 24 then BombPhysical = BombPhysical + 01 end if ItemART2 == 24 then BombPhysical = BombPhysical + 01 end if ItemART1 == 26 then SkillDmg = SkillDmg + 01 end if ItemART2 == 26 then SkillDmg = SkillDmg + 01 end if ItemART1 == 40 then ValueESQ = ValueESQ + 01 end if ItemART2 == 40 then ValueESQ = ValueESQ + 01 end if ExtraDEF < 0 then ExtraDEF = 0 end if ExtraESQ < 0 then ExtraESQ = 0 end if ExtraMAG < 0 then ExtraMAG = 0 end DEF = DEF + (_ITEMS[itemID].DEF + _RARIDADES[RareItem].Arm) + (StarItem * 10) ESQ = ESQ + (_ITEMS[itemID].ESQ + _RARIDADES[RareItem].Arm) + (StarItem * 10) if _ITEMS[itemID].MAG_TYPE then if _ITEMS[itemID].MAG_TYPE == "FIRE" then FIRE = FIRE + (_ITEMS[itemID].MAG + _RARIDADES[RareItem].Arm) + (StarItem * 10) + ExtraMAG elseif _ITEMS[itemID].MAG_TYPE == "ICE" then ICE = ICE + (_ITEMS[itemID].MAG + _RARIDADES[RareItem].Arm) + (StarItem * 10) + ExtraMAG elseif _ITEMS[itemID].MAG_TYPE == "ENERGY" then ENERGY = ENERGY + (_ITEMS[itemID].MAG + _RARIDADES[RareItem].Arm) + (StarItem * 10) + ExtraMAG elseif _ITEMS[itemID].MAG_TYPE == "EARTH" then EARTH = EARTH + (_ITEMS[itemID].MAG + _RARIDADES[RareItem].Arm) + (StarItem * 10) + ExtraMAG elseif _ITEMS[itemID].MAG_TYPE == "DEATH" then DEATH = DEATH + (_ITEMS[itemID].MAG + _RARIDADES[RareItem].Arm) + (StarItem * 10) + ExtraMAG end end end end end if ExtraDEF > 0 then local AtrTotal = _ATRIBUTOS[04].PERCENT * ExtraDEF ExtraDEF = AtrTotal - ((ExtraDEF - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if ExtraESQ > 0 then local AtrTotal = _ATRIBUTOS[08].PERCENT * ExtraESQ ExtraESQ = AtrTotal - ((ExtraESQ - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if CuraESQ > 0 then local AtrTotal = _ATRIBUTOS[10].PERCENT * CuraESQ CuraESQ = AtrTotal - ((CuraESQ - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if FearPara > 0 then local AtrTotal = _ATRIBUTOS[12].PERCENT * FearPara FearPara = AtrTotal - ((FearPara - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if BombFire > 0 then local AtrTotal = _ATRIBUTOS[17].PERCENT * BombFire BombFire = AtrTotal - ((BombFire - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if BombEnergy > 0 then local AtrTotal = _ATRIBUTOS[18].PERCENT * BombEnergy BombEnergy = AtrTotal - ((BombEnergy - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if BombIce > 0 then local AtrTotal = _ATRIBUTOS[19].PERCENT * BombIce BombIce = AtrTotal - ((BombIce - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if BombDeath > 0 then local AtrTotal = _ATRIBUTOS[21].PERCENT * BombDeath BombDeath = AtrTotal - ((BombDeath - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if BombEarth > 0 then local AtrTotal = _ATRIBUTOS[22].PERCENT * BombEarth BombEarth = AtrTotal - ((BombEarth - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if BombHoly > 0 then local AtrTotal = _ATRIBUTOS[23].PERCENT * BombHoly BombHoly = AtrTotal - ((BombHoly - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if BombPhysical > 0 then local AtrTotal = _ATRIBUTOS[23].PERCENT * BombPhysical BombPhysical = AtrTotal - ((BombPhysical - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if SkillDmg > 0 then local AtrTotal = _ATRIBUTOS[26].PERCENT * SkillDmg SkillDmg = AtrTotal - ((SkillDmg - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if ValueESQ > 0 then local AtrTotal = _ATRIBUTOS[40].PERCENT * ValueESQ ValueESQ = AtrTotal - ((ValueESQ - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if AtrCritico > 0 then local AtrTotal = _ATRIBUTOS[02].PERCENT * AtrCritico AtrCritico = AtrTotal - ((AtrCritico - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if AtrTaxa > 0 then local AtrTotal = _ATRIBUTOS[03].PERCENT * AtrTaxa AtrTaxa = AtrTotal - ((AtrTaxa - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if AtrHpCrit > 0 then local AtrTotal = _ATRIBUTOS[05].PERCENT * AtrHpCrit AtrHpCrit = AtrTotal - ((AtrHpCrit - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if AtrDamage > 0 then local AtrTotal = _ATRIBUTOS[06].PERCENT * AtrDamage AtrDamage = AtrTotal - ((AtrDamage - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if HPCritTaxa > 0 then local AtrTotal = _ATRIBUTOS[07].PERCENT * HPCritTaxa HPCritTaxa = AtrTotal - ((HPCritTaxa - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if ExpCrit > 0 then local AtrTotal = _ATRIBUTOS[11].PERCENT * ExpCrit ExpCrit = AtrTotal - ((ExpCrit - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if DropTaxa > 0 then local AtrTotal = _ATRIBUTOS[15].PERCENT * DropTaxa DropTaxa = AtrTotal - ((DropTaxa - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if GoldDrTaxa > 0 then local AtrTotal = _ATRIBUTOS[16].PERCENT * GoldDrTaxa GoldDrTaxa = AtrTotal - ((GoldDrTaxa - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if CriDistan > 0 then local AtrTotal = _ATRIBUTOS[20].PERCENT * CriDistan GoldDrTaxa = AtrTotal - ((CriDistan - 01) * _SYSTEM.ATR_SYSTEM_DIM) end if player:getStorageValue(_SYSTEM.INVENTARIO[07].UID_01) > 0 then local RingID = player:getStorageValue(_SYSTEM.INVENTARIO[07].UID_01) local RingRA = player:getStorageValue(_SYSTEM.INVENTARIO[07].UID_02) local RingST = player:getStorageValue(_SYSTEM.INVENTARIO[07].UID_03) local RingLV = player:getStorageValue(_SYSTEM.INVENTARIO[07].UID_05) if RingID == 7009 then -- Aumenta sua ESQ em + 20. ESQ = ESQ + 20 end if RingID == 7010 then -- Aumenta sua resist�ncia contra danos do tipo DEATH em 10% ( + 05 por raridade ). if RingRA < 0 then RingRA = 0 end DEATH = DEATH + 10 + (05 * RingRA) end if RingID == 7011 then -- Aumenta sua resist�ncia contra danos do tipo ENERGY em 10% ( + 05 por raridade ). if RingRA < 0 then RingRA = 0 end ENERGY = ENERGY + 10 + (05 * RingRA) end if RingID == 7012 then -- Aumenta sua resist�ncia contra danos do tipo ICE em 10% ( + 05 por raridade ). if RingRA < 0 then RingRA = 0 end ICE = ICE + 10 + (05 * RingRA) end if RingID == 7013 then -- Aumenta sua resist�ncia contra danos do tipo FIRE em 10% ( + 05 por raridade ). if RingRA < 0 then RingRA = 0 end FIRE = FIRE + 10 + (05 * RingRA) end if RingID == 7014 then -- Aumenta sua resist�ncia contra danos do tipo EARTH em 10% ( + 05 por raridade ). if RingRA < 0 then RingRA = 0 end EARTH = EARTH + 10 + (05 * RingRA) end end if ValueESQ > 0 then ESQ = ESQ + ValueESQ end if SkillDmg > 0 then player:setStorageValue(_SYSTEM.ATR_VALUES[04], SkillDmg) else player:setStorageValue(_SYSTEM.ATR_VALUES[04], nil) end -- BUSCAR INFORMA��ES DO BONUS EXTRA local cid = player:getId() local SLOTS_BONUS_EXTRA = {02, 04, 05, 06, 08, 09} local StrBonus = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} for X = 01, #SLOTS_BONUS_EXTRA do local _BON = SLOTS_BONUS_EXTRA[X] if player:getStorageValue(_SYSTEM.INVENTARIO[_BON].UID_08) > 0 then local BonusUM = onBonusExtra(01, tostring(player:getStorageValue(_SYSTEM.INVENTARIO[_BON].UID_08)), 01) or 0 if BonusUM > 00 then local BonusUMValue = onBonusExtra(01, tostring(player:getStorageValue(_SYSTEM.INVENTARIO[_BON].UID_08)), 02) local SomaBonus = StrBonus[BonusUM] + BonusUMValue StrBonus[BonusUM] = SomaBonus local BonusDois = onBonusExtra(02, tostring(player:getStorageValue(_SYSTEM.INVENTARIO[_BON].UID_08)), 01) or 0 if BonusDois > 00 then local BonusDoisValue = onBonusExtra(02, tostring(player:getStorageValue(_SYSTEM.INVENTARIO[_BON].UID_08)), 02) local SomaBonus = StrBonus[BonusDois] + BonusDoisValue StrBonus[BonusDois] = SomaBonus local BonusTres = onBonusExtra(03, tostring(player:getStorageValue(_SYSTEM.INVENTARIO[_BON].UID_08)), 01) or 0 if BonusTres > 00 then local BonusTresValue = onBonusExtra(03, tostring(player:getStorageValue(_SYSTEM.INVENTARIO[_BON].UID_08)), 02) local SomaBonus = StrBonus[BonusTres] + BonusTresValue StrBonus[BonusTres] = SomaBonus end end end end end local str = "" for F = 01, #StrBonus do if F == 01 then str = StrBonus[F] else str = str.. "," ..StrBonus[F] end player:sendCancelMessage("@BonusExtraClient " ..F.. " " ..StrBonus[F]) end --print("_BONUS_EXTRA_TABLE: " ..str) _BONUS_EXTRA_TABLE[cid] = StrBonus AtrTaxa = AtrTaxa + 05 AtrCritico = AtrCritico + 05 player:setStorageValue(_PLAYER_INFO.DEF, DEF) player:setStorageValue(_PLAYER_INFO.ESQ, ESQ) player:setStorageValue(_PLAYER_INFO.FIRE, FIRE) player:setStorageValue(_PLAYER_INFO.ICE, ICE) player:setStorageValue(_PLAYER_INFO.ENERGY, ENERGY) player:setStorageValue(_PLAYER_INFO.EARTH, EARTH) player:setStorageValue(_PLAYER_INFO.DEATH, DEATH) player:setStorageValue(_PLAYER_INFO.RES_PLAYER, ResPlayer) player:setStorageValue(_PLAYER_INFO.EXTRA_DEF, ExtraDEF) player:setStorageValue(_PLAYER_INFO.EXTRA_ESQ, ExtraESQ) player:setStorageValue(_PLAYER_INFO.EXTRA_MAG, ExtraMAG) player:setStorageValue(_PLAYER_INFO.CURA_ESQ, CuraESQ) player:setStorageValue(_PLAYER_INFO.FEAR_PARA, FearPara) player:setStorageValue(_PLAYER_INFO.BOMB_FIRE, BombFire) player:setStorageValue(_PLAYER_INFO.BOMB_ENERGY, BombEnergy) player:setStorageValue(_PLAYER_INFO.BOMB_ICE, BombIce) player:setStorageValue(_PLAYER_INFO.BOMB_EARTH, BombEarth) player:setStorageValue(_PLAYER_INFO.BOMB_DEATH, BombDeath) player:setStorageValue(_PLAYER_INFO.BOMB_HOLY, BombHoly) player:setStorageValue(_PLAYER_INFO.BOMB_PHYSICAL, BombPhysical) player:setStorageValue(_PLAYER_INFO.CANCEL_INV, CancelInv) player:setStorageValue(_PLAYER_INFO.CAN_PARA, CanPara) player:setStorageValue(_PLAYER_INFO.DMG_HALF, DmgHalf) player:setStorageValue(_PLAYER_INFO.ATR_CRITICO, AtrCritico) player:setStorageValue(_PLAYER_INFO.ATR_TAXA, AtrTaxa) player:setStorageValue(_PLAYER_INFO.ATR_HP_CRITICO, AtrHpCrit) player:setStorageValue(_PLAYER_INFO.ATR_DAMAGE, AtrDamage) player:setStorageValue(_PLAYER_INFO.HP_CRIT_TAXA, HPCritTaxa) player:setStorageValue(_PLAYER_INFO.DROP_TAXA, DropTaxa) player:setStorageValue(_PLAYER_INFO.GOLD_ATR_TAX, GoldDrTaxa) player:setStorageValue(_PLAYER_INFO.EXP_CRIT, ExpCrit) player:setStorageValue(_PLAYER_INFO.EXETA_RES, ExetaRes) player:setStorageValue(_PLAYER_INFO.CRIT_DIST, CriDistan) player:setStorageValue(_PLAYER_INFO.CRIT_EXP, CriEXP) player:setStorageValue(_PLAYER_INFO.FREE_RUN, FreeRun) end return result end function doSummon(player, action, star, id) if action == 00 then -- Atualizar | Organizar local _SUMMONS_ORDER = { [01] = {ID_01 = 0000}, [02] = {ID_01 = 0000}, [03] = {ID_01 = 0000}, [04] = {ID_01 = 0000}, [05] = {ID_01 = 0000}, [06] = {ID_01 = 0000}, [07] = {ID_01 = 0000}, [08] = {ID_01 = 0000}, [09] = {ID_01 = 0000}, [10] = {ID_01 = 0000}, [11] = {ID_01 = 0000}, [12] = {ID_01 = 0000}, [13] = {ID_01 = 0000}, [14] = {ID_01 = 0000}, [15] = {ID_01 = 0000}, [16] = {ID_01 = 0000}, [17] = {ID_01 = 0000}, [18] = {ID_01 = 0000}, [19] = {ID_01 = 0000}, [20] = {ID_01 = 0000}, [21] = {ID_01 = 0000}, [22] = {ID_01 = 0000}, [23] = {ID_01 = 0000}, [24] = {ID_01 = 0000}, [25] = {ID_01 = 0000}, [26] = {ID_01 = 0000}, [27] = {ID_01 = 0000}, [28] = {ID_01 = 0000}, [29] = {ID_01 = 0000}, [30] = {ID_01 = 0000}, [31] = {ID_01 = 0000}, [32] = {ID_01 = 0000}, [33] = {ID_01 = 0000}, [34] = {ID_01 = 0000}, [35] = {ID_01 = 0000}, [36] = {ID_01 = 0000}, [37] = {ID_01 = 0000}, [38] = {ID_01 = 0000}, [39] = {ID_01 = 0000}, [40] = {ID_01 = 0000}, [41] = {ID_01 = 0000}, [42] = {ID_01 = 0000}, [43] = {ID_01 = 0000}, [44] = {ID_01 = 0000}, [45] = {ID_01 = 0000}, [46] = {ID_01 = 0000}, [47] = {ID_01 = 0000}, [48] = {ID_01 = 0000}, [49] = {ID_01 = 0000}, [50] = {ID_01 = 0000} } local SUM_POS = 1 local SUMMON_MAX = 0 SUMMON_POS_FREE = 0 for i = 01, 50 do if player:getStorageValue(_SUMMONS[star][i].UID_01) > 0 then _SUMMONS_ORDER[SUM_POS].ID_01 = player:getStorageValue(_SUMMONS[star][i].UID_01) SUM_POS = SUM_POS + 1 SUMMON_MAX = SUMMON_MAX + 1 else if SUMMON_POS_FREE == 0 then SUMMON_POS_FREE = i end end end for y = 01, 50 do player:setStorageValue(_SUMMONS[star][y].UID_01, _SUMMONS_ORDER[y].ID_01) end player:sendCancelMessage("@LoadSummon 00 " ..SUMMON_MAX) for POS = 01, 50 do player:sendCancelMessage("@LoadSummon " ..POS.. " " .._SUMMONS_ORDER[POS].ID_01) end return SUMMON_MAX end if action == 01 then -- Ganhar player:setStorageValue(_SUMMONS[star][SUMMON_POS_FREE].UID_01, id) return true end if action == 02 then -- Procurar local SUMMON_ID_POS = 0 for i = 01, 50 do if player:getStorageValue(_SUMMONS[star][i].UID_01) == id then SUMMON_ID_POS = i break end end return SUMMON_ID_POS end if action == 03 then -- Equipar local sum_id = player:getStorageValue(_SUMMONS[star][id].UID_01) player:setStorageValue(_SYSTEM.INVENTARIO[10].UID_01, sum_id) player:sendCancelMessage("@EquipSummon " ..sum_id) end end function onDamage(player, id, lvl, star, retorno, skillid) local GUN_ID = id local GUN_LEVEL = 00 local GUN_STAR = 00 local GUN_RARE = 00 local ATR_DMG_MIN = 00 local DMG_FOR_LEVEL = 00 local DMG_FOR_PASS = 00 local GUN_RARE = player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_02) or 0 local cid = player:getId() if _ITEMS[GUN_ID] then if _ITEMS[GUN_ID].GUN_TYPE == 01 then DMG_FOR_LEVEL = 01 -- METRALHADORA elseif _ITEMS[GUN_ID].GUN_TYPE == 02 then DMG_FOR_LEVEL = 03 -- PISTOLA elseif _ITEMS[GUN_ID].GUN_TYPE == 03 then DMG_FOR_LEVEL = 02 -- RIFLES elseif _ITEMS[GUN_ID].GUN_TYPE == 04 then DMG_FOR_LEVEL = 04 -- ESPINGARDA end end if lvl ~= nil and lvl > 0 then GUN_LEVEL = lvl end if star ~= nil and star > 0 then GUN_STAR = star end local DanoMinBase = 0 local DanoMaxBase = 0 DanoMinBase = _ITEMS[GUN_ID].MIN or 0 if _ITEMS[GUN_ID].GUN_TYPE == 01 then RARE_DMG = _RARIDADES[GUN_RARE].Arm else RARE_DMG = _RARIDADES[GUN_RARE].Gun end local DanoMinAtual = (DanoMinBase + (GUN_STAR * 10)) + (GUN_LEVEL * DMG_FOR_LEVEL) + RARE_DMG if player:getStorageValue(_SYSTEM.ATR_VALUES[04]) > 0 then ATR_DMG_MIN = ATR_DMG_MIN + player:getStorageValue(_SYSTEM.ATR_VALUES[04]) * (DanoMinAtual / 100) end if _SPELLS[skillid].ELEMENT == "FIRE" then if onGetPassivas(player, 51) then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[51].POWER_BASE + (_PASSIVES[51].POWER_FOR_LEVEL * (PASSIVE_LEVEL - 01)) if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) == 02 then -- PASSIVA DAS CORES if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE) == _PASSIVES[51].CATEGORY then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[51].BOOST end end end if _BONUS_EXTRA_TABLE[cid] then local ID_BONUS = 23 if _BONUS_EXTRA_TABLE[cid][ID_BONUS] > 00 then DMG_FOR_PASS = DMG_FOR_PASS + _BONUS_EXTRA_TABLE[cid][ID_BONUS] end end end if _SPELLS[skillid].ELEMENT == "ICE" then if onGetPassivas(player, 52) then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[52].POWER_BASE + (_PASSIVES[52].POWER_FOR_LEVEL * (PASSIVE_LEVEL - 01)) if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) == 02 then -- PASSIVA DAS CORES if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE) == _PASSIVES[52].CATEGORY then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[52].BOOST end end end if _BONUS_EXTRA_TABLE[cid] then local ID_BONUS = 24 if _BONUS_EXTRA_TABLE[cid][ID_BONUS] > 00 then DMG_FOR_PASS = DMG_FOR_PASS + _BONUS_EXTRA_TABLE[cid][ID_BONUS] end end end if _SPELLS[skillid].ELEMENT == "ENERGY" then if onGetPassivas(player, 53) then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[53].POWER_BASE + (_PASSIVES[53].POWER_FOR_LEVEL * (PASSIVE_LEVEL - 01)) if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) == 02 then -- PASSIVA DAS CORES if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE) == _PASSIVES[53].CATEGORY then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[53].BOOST end end end if _BONUS_EXTRA_TABLE[cid] then local ID_BONUS = 27 if _BONUS_EXTRA_TABLE[cid][ID_BONUS] > 00 then DMG_FOR_PASS = DMG_FOR_PASS + _BONUS_EXTRA_TABLE[cid][ID_BONUS] end end end if _SPELLS[skillid].ELEMENT == "EARTH" then if onGetPassivas(player, 54) then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[54].POWER_BASE + (_PASSIVES[54].POWER_FOR_LEVEL * (PASSIVE_LEVEL - 01)) if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) == 02 then -- PASSIVA DAS CORES if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE) == _PASSIVES[54].CATEGORY then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[54].BOOST end end end if _BONUS_EXTRA_TABLE[cid] then local ID_BONUS = 25 if _BONUS_EXTRA_TABLE[cid][ID_BONUS] > 00 then DMG_FOR_PASS = DMG_FOR_PASS + _BONUS_EXTRA_TABLE[cid][ID_BONUS] end end end if _SPELLS[skillid].ELEMENT == "DEATH" then if onGetPassivas(player, 55) then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[55].POWER_BASE + (_PASSIVES[55].POWER_FOR_LEVEL * (PASSIVE_LEVEL - 01)) if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) == 02 then -- PASSIVA DAS CORES if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE) == _PASSIVES[55].CATEGORY then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[55].BOOST end end end if _BONUS_EXTRA_TABLE[cid] then local ID_BONUS = 28 if _BONUS_EXTRA_TABLE[cid][ID_BONUS] > 00 then DMG_FOR_PASS = DMG_FOR_PASS + _BONUS_EXTRA_TABLE[cid][ID_BONUS] end end end if _SPELLS[skillid].ELEMENT == "HOLY" then if onGetPassivas(player, 56) then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[56].POWER_BASE + (_PASSIVES[56].POWER_FOR_LEVEL * (PASSIVE_LEVEL - 01)) if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) == 02 then -- PASSIVA DAS CORES if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE) == _PASSIVES[56].CATEGORY then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[56].BOOST end end end if _BONUS_EXTRA_TABLE[cid] then local ID_BONUS = 26 if _BONUS_EXTRA_TABLE[cid][ID_BONUS] > 00 then DMG_FOR_PASS = DMG_FOR_PASS + _BONUS_EXTRA_TABLE[cid][ID_BONUS] end end end if _SPELLS[skillid].ELEMENT == "PHYSICAL" then if onGetPassivas(player, 57) then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[57].POWER_BASE + (_PASSIVES[57].POWER_FOR_LEVEL * (PASSIVE_LEVEL - 01)) if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) == 02 then -- PASSIVA DAS CORES if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE) == _PASSIVES[57].CATEGORY then DMG_FOR_PASS = DMG_FOR_PASS + _PASSIVES[57].BOOST end end end if _BONUS_EXTRA_TABLE[cid] then local ID_BONUS = 29 if _BONUS_EXTRA_TABLE[cid][ID_BONUS] > 00 then DMG_FOR_PASS = DMG_FOR_PASS + _BONUS_EXTRA_TABLE[cid][ID_BONUS] end end end local MinFinal = DanoMinAtual + (_SPELLS[skillid].DMG * (DanoMinAtual / 100)) + ATR_DMG_MIN if MinFinal < 0 then MinFinal = MinFinal * -1 end if _BONUS_EXTRA_TABLE[cid] then local ID_BONUS = 43 if _BONUS_EXTRA_TABLE[cid][ID_BONUS] > 00 then DMG_FOR_PASS = DMG_FOR_PASS + _BONUS_EXTRA_TABLE[cid][ID_BONUS] end end if DMG_FOR_PASS > 00 then MinFinal = MinFinal + math.floor(DMG_FOR_PASS * (MinFinal / 100)) end return MinFinal end function onDepot(player, type, ext, dpos, slot, extbag, pos, qnt) local DEPOT_TEMP = { [001] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [002] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [003] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [004] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [005] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [006] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [007] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [008] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [009] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [010] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [011] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [012] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [013] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [014] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [015] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [016] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [017] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [018] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [019] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [020] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [021] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [022] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [023] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [024] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [025] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [026] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [027] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [028] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [029] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [030] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [031] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [032] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [033] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [034] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [035] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [036] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [037] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [038] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [039] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [040] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [041] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [042] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [043] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [044] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [045] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [046] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [047] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [048] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [049] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [050] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [051] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [052] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [053] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [054] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [055] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [056] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [057] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [058] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [059] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [060] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [061] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [062] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [063] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [064] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [065] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [066] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [067] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [068] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [069] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [070] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [071] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [072] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [073] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [074] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [075] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [076] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [077] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [078] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [079] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [080] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [081] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [082] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [083] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [084] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [085] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [086] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [087] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [088] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [089] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [090] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [091] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [092] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [093] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [094] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [095] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [096] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [097] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [098] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [099] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; [100] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000, VALUE = 000}; } if type == 00 then -- ORGANIZAR local DepotTempPos = 01 for X = 01, #DEPOT_TEMP do local ITEM_ID = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_01) if ITEM_ID > 0 and _ITEMS[ITEM_ID] then if _ITEMS[ITEM_ID].SLOT_EQUIP == 00 or _ITEMS[ITEM_ID].SLOT_EQUIP == 03 or _ITEMS[ITEM_ID].SLOT_EQUIP > 09 then if player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_04) > 00 then DEPOT_TEMP[DepotTempPos].UID_01 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_01) DEPOT_TEMP[DepotTempPos].UID_02 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_02) DEPOT_TEMP[DepotTempPos].UID_03 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_03) DEPOT_TEMP[DepotTempPos].UID_04 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_04) DEPOT_TEMP[DepotTempPos].UID_05 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_05) DEPOT_TEMP[DepotTempPos].UID_06 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_06) DEPOT_TEMP[DepotTempPos].UID_07 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_07) DEPOT_TEMP[DepotTempPos].UID_08 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_08) DEPOT_TEMP[DepotTempPos].UID_09 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_09) DEPOT_TEMP[DepotTempPos].UID_10 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_10) DepotTempPos = DepotTempPos + 01 end else DEPOT_TEMP[DepotTempPos].UID_01 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_01) DEPOT_TEMP[DepotTempPos].UID_02 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_02) DEPOT_TEMP[DepotTempPos].UID_03 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_03) DEPOT_TEMP[DepotTempPos].UID_04 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_04) DEPOT_TEMP[DepotTempPos].UID_05 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_05) DEPOT_TEMP[DepotTempPos].UID_06 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_06) DEPOT_TEMP[DepotTempPos].UID_07 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_07) DEPOT_TEMP[DepotTempPos].UID_08 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_08) DEPOT_TEMP[DepotTempPos].UID_09 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_09) DEPOT_TEMP[DepotTempPos].UID_10 = player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_10) DepotTempPos = DepotTempPos + 01 end end end for Z = 01, #DEPOT_TEMP do if DEPOT_TEMP[Z].UID_01 > 00 then player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_01, DEPOT_TEMP[Z].UID_01) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_02, DEPOT_TEMP[Z].UID_02) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_03, DEPOT_TEMP[Z].UID_03) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_04, DEPOT_TEMP[Z].UID_04) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_05, DEPOT_TEMP[Z].UID_05) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_06, DEPOT_TEMP[Z].UID_06) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_07, DEPOT_TEMP[Z].UID_07) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_08, DEPOT_TEMP[Z].UID_08) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_09, DEPOT_TEMP[Z].UID_09) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_10, DEPOT_TEMP[Z].UID_10) else player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][Z].UID_10, nil) end end for Y = 01, #DEPOT_TEMP do local A = DEPOT_TEMP[Y].UID_01 local B = DEPOT_TEMP[Y].UID_02 local C = DEPOT_TEMP[Y].UID_03 local D = DEPOT_TEMP[Y].UID_04 local E = DEPOT_TEMP[Y].UID_05 local F = DEPOT_TEMP[Y].UID_06 local G = DEPOT_TEMP[Y].UID_07 local H = DEPOT_TEMP[Y].UID_08 local I = DEPOT_TEMP[Y].UID_09 local J = DEPOT_TEMP[Y].UID_10 player:sendCancelMessage("@DepotItems " ..A.. " " ..B.. " " ..C.. " " ..D.. " " ..E.. " " ..F.. " " ..G.. " " ..H.. " " ..I.. " " ..J.. " " ..Y) end end if type == 01 then -- ADICIONAR local DEPOT_EMPTY_POS = 00 local STACK_DEPOT_POS = 00 for X = 01, #DEPOT_TEMP do if slot == 03 or slot == 00 or slot == 11 or slot == 12 then if player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_01) > 00 then if player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_09) <= 00 and player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_09) <= 00 then if player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_01) == player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_01) then STACK_DEPOT_POS = X break end end else DEPOT_EMPTY_POS = X break end else if player:getStorageValue(_SYSTEM.DEPOT[ext][X].UID_01) <= 00 then DEPOT_EMPTY_POS = X break end end end if DEPOT_EMPTY_POS > 00 or STACK_DEPOT_POS > 00 then if slot == 03 or slot == 00 or slot == 11 or slot == 12 then if STACK_DEPOT_POS > 00 then player:setStorageValue(_SYSTEM.DEPOT[ext][STACK_DEPOT_POS].UID_04, (player:getStorageValue(_SYSTEM.DEPOT[ext][STACK_DEPOT_POS].UID_04) + qnt)) else player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_01, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_01)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_02, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_02)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_03, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_03)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_04, qnt) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_05, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_05)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_06, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_06)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_07, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_07)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_08, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_08)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_09, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_09)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_10, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_10)) end if qnt < player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_04) then player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_04, (player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_04) - qnt)) else player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_01, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_02, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_03, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_04, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_05, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_06, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_07, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_08, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_09, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_10, nil) end else player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_01, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_01)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_02, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_02)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_03, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_03)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_04, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_04)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_05, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_05)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_06, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_06)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_07, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_07)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_08, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_08)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_09, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_09)) player:setStorageValue(_SYSTEM.DEPOT[ext][DEPOT_EMPTY_POS].UID_10, player:getStorageValue(_BACKPACK[slot][extbag][pos].UID_10)) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_01, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_02, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_03, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_05, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_06, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_07, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_08, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_09, nil) player:setStorageValue(_BACKPACK[slot][extbag][pos].UID_10, nil) end doBackpack(player, 00, slot, extbag, 01) onDepot(player, 00, ext) player:sendCancelMessage("@closedBackpack") return true else return false end end if type == 02 then -- RETIRAR local ITEM_ID = player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_01) local SLOT_PADRAO = 00 if _ITEMS[ITEM_ID] then if _ITEMS[ITEM_ID].SLOT_EQUIP == 00 or _ITEMS[ITEM_ID].SLOT_EQUIP == 03 or _ITEMS[ITEM_ID].SLOT_EQUIP > 09 then SLOT_PADRAO = 03 else SLOT_PADRAO = _ITEMS[ITEM_ID].SLOT_EQUIP end if doBackpack(player, 00, SLOT_PADRAO, extbag, 01) then local rare = player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_02) local star = player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_03) local uni = player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_09) if SLOT_PADRAO == 03 then if uni > 0 then if doBackpack(player, 01, SLOT_PADRAO, extbag, 00, ITEM_ID, rare, star, qnt, uni) then player:getPosition():sendMagicEffect(14) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_10, nil) end else doBackpack(player, 03, SLOT_PADRAO, extbag, 01, ITEM_ID) -- Procurar if doBackpack(player, 01, SLOT_PADRAO, extbag, 00, ITEM_ID, rare, star, qnt) then player:getPosition():sendMagicEffect(14) if qnt >= player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_04) then player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_10, nil) else player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_04, (player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_04) - qnt)) end end end else doBackpack(player, 00, slot, extbag, 01) local PosBag = doBackpack(player, 08) local ExtBag = doBackpack(player, 09) player:setStorageValue(_BACKPACK[SLOT_PADRAO][ExtBag][PosBag].UID_01, player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_01)) player:setStorageValue(_BACKPACK[SLOT_PADRAO][ExtBag][PosBag].UID_02, player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_02)) player:setStorageValue(_BACKPACK[SLOT_PADRAO][ExtBag][PosBag].UID_03, player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_03)) player:setStorageValue(_BACKPACK[SLOT_PADRAO][ExtBag][PosBag].UID_04, player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_04)) player:setStorageValue(_BACKPACK[SLOT_PADRAO][ExtBag][PosBag].UID_05, player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_05)) player:setStorageValue(_BACKPACK[SLOT_PADRAO][ExtBag][PosBag].UID_06, player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_06)) player:setStorageValue(_BACKPACK[SLOT_PADRAO][ExtBag][PosBag].UID_07, player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_07)) player:setStorageValue(_BACKPACK[SLOT_PADRAO][ExtBag][PosBag].UID_08, player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_08)) player:setStorageValue(_BACKPACK[SLOT_PADRAO][ExtBag][PosBag].UID_09, player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_09)) player:setStorageValue(_BACKPACK[SLOT_PADRAO][ExtBag][PosBag].UID_10, player:getStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_10)) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][dpos].UID_10, nil) end doBackpack(player, 00, SLOT_PADRAO, extbag, 01) onDepot(player, 00, ext) return true else player:popupFYI("N�o h� espa�o em sua backpack.") return false end end end if type == 04 then -- DELETAR TODO O DEPOT for X = 01, #DEPOT_TEMP do player:setStorageValue(_SYSTEM.DEPOT[ext][X].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][X].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][X].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][X].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][X].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][X].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][X].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][X].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][X].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[ext][X].UID_10, nil) end onDepot(player, 00, ext) end if type == 05 then -- ORGANIZAR POR RARIDADE local _BAG_TEMPO_POS = 01 for RARE_ID = 00, 04 do for BAG_POS = 01, 100 do if player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01) > 00 then if _ITEMS[player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01)] then if player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02) == RARE_ID then DEPOT_TEMP[_BAG_TEMPO_POS].UID_01 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01) DEPOT_TEMP[_BAG_TEMPO_POS].UID_02 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02) DEPOT_TEMP[_BAG_TEMPO_POS].UID_03 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03) DEPOT_TEMP[_BAG_TEMPO_POS].UID_04 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04) DEPOT_TEMP[_BAG_TEMPO_POS].UID_05 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05) DEPOT_TEMP[_BAG_TEMPO_POS].UID_06 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06) DEPOT_TEMP[_BAG_TEMPO_POS].UID_07 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07) DEPOT_TEMP[_BAG_TEMPO_POS].UID_08 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08) DEPOT_TEMP[_BAG_TEMPO_POS].UID_09 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09) DEPOT_TEMP[_BAG_TEMPO_POS].UID_10 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10) _BAG_TEMPO_POS = _BAG_TEMPO_POS + 01 end end else break end end end for X = 01, #DEPOT_TEMP do if DEPOT_TEMP[X].UID_01 > 00 then player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_01, DEPOT_TEMP[X].UID_01) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_02, DEPOT_TEMP[X].UID_02) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_03, DEPOT_TEMP[X].UID_03) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_04, DEPOT_TEMP[X].UID_04) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_05, DEPOT_TEMP[X].UID_05) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_06, DEPOT_TEMP[X].UID_06) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_07, DEPOT_TEMP[X].UID_07) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_08, DEPOT_TEMP[X].UID_08) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_09, DEPOT_TEMP[X].UID_09) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_10, DEPOT_TEMP[X].UID_10) else player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[01][X].UID_10, nil) end end for ORDER = 01, #DEPOT_TEMP do local A = DEPOT_TEMP[ORDER].UID_01 local B = DEPOT_TEMP[ORDER].UID_02 local C = DEPOT_TEMP[ORDER].UID_03 local D = DEPOT_TEMP[ORDER].UID_04 local E = DEPOT_TEMP[ORDER].UID_05 local F = DEPOT_TEMP[ORDER].UID_06 local G = DEPOT_TEMP[ORDER].UID_07 local H = DEPOT_TEMP[ORDER].UID_08 local I = DEPOT_TEMP[ORDER].UID_09 local J = DEPOT_TEMP[ORDER].UID_10 player:sendCancelMessage("@DepotItems " ..A.. " " ..B.. " " ..C.. " " ..D.. " " ..E.. " " ..F.. " " ..G.. " " ..H.. " " ..I.. " " ..J.. " " ..ORDER) end end if type == 06 then -- ORGANIZAR POR LEVEL local _BAG_TEMPO_POS = 01 local LevelOrder = {} for BAG_POS = 01, #DEPOT_TEMP do if player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01) > 00 then if _ITEMS[player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01)] then local REQUISITO_LEVEL = 00 local slot = _ITEMS[player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01)].SLOT_EQUIP if slot == 02 or slot == 04 or slot == 05 or slot == 06 or slot == 08 or slot == 09 then DEPOT_TEMP[_BAG_TEMPO_POS].UID_01 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01) DEPOT_TEMP[_BAG_TEMPO_POS].UID_02 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02) DEPOT_TEMP[_BAG_TEMPO_POS].UID_03 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03) DEPOT_TEMP[_BAG_TEMPO_POS].UID_04 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04) DEPOT_TEMP[_BAG_TEMPO_POS].UID_05 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05) DEPOT_TEMP[_BAG_TEMPO_POS].UID_06 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06) DEPOT_TEMP[_BAG_TEMPO_POS].UID_07 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07) DEPOT_TEMP[_BAG_TEMPO_POS].UID_08 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08) DEPOT_TEMP[_BAG_TEMPO_POS].UID_09 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09) DEPOT_TEMP[_BAG_TEMPO_POS].UID_10 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10) if slot == 04 then local GUN_BASE_LEVEL = _ITEMS[player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01)].LEVEL local LEVEL_FOR_RARE = 05 local LEVEL_FOR_LEVEL = 04 local GUN_RARE = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02) or 0 local GUN_LEVEL = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07) or 0 local GUN_STAR = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03) or 0 if GUN_RARE < 00 then GUN_RARE = 00 end if GUN_LEVEL < 00 then GUN_LEVEL = 00 end if GUN_STAR < 00 then GUN_STAR = 00 end REQUISITO_LEVEL = GUN_BASE_LEVEL + (GUN_RARE * LEVEL_FOR_RARE) + (GUN_LEVEL * LEVEL_FOR_LEVEL) + ((GUN_STAR * 10) * LEVEL_FOR_LEVEL) else local LEVEL_EQUIP = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05) or 0 local LEVEL_STAR = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03) or 0 local LEVEL_DEF = 10000 if LEVEL_EQUIP < 0 then LEVEL_EQUIP = 0 end if LEVEL_STAR < 0 then LEVEL_STAR = 0 end if _ITEMS[player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01)].DEF ~= nil then LEVEL_DEF = _ITEMS[player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01)].DEF end REQUISITO_LEVEL = (LEVEL_DEF + LEVEL_EQUIP + (LEVEL_STAR * 10)) * 02 end player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10, nil) DEPOT_TEMP[_BAG_TEMPO_POS].VALUE = REQUISITO_LEVEL _BAG_TEMPO_POS = _BAG_TEMPO_POS + 01 table.insert(LevelOrder, REQUISITO_LEVEL) else REQUISITO_LEVEL = 01 DEPOT_TEMP[_BAG_TEMPO_POS].UID_01 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01) DEPOT_TEMP[_BAG_TEMPO_POS].UID_02 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02) DEPOT_TEMP[_BAG_TEMPO_POS].UID_03 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03) DEPOT_TEMP[_BAG_TEMPO_POS].UID_04 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04) DEPOT_TEMP[_BAG_TEMPO_POS].UID_05 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05) DEPOT_TEMP[_BAG_TEMPO_POS].UID_06 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06) DEPOT_TEMP[_BAG_TEMPO_POS].UID_07 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07) DEPOT_TEMP[_BAG_TEMPO_POS].UID_08 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08) DEPOT_TEMP[_BAG_TEMPO_POS].UID_09 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09) DEPOT_TEMP[_BAG_TEMPO_POS].UID_10 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10, nil) DEPOT_TEMP[_BAG_TEMPO_POS].VALUE = REQUISITO_LEVEL _BAG_TEMPO_POS = _BAG_TEMPO_POS + 01 table.insert(LevelOrder, REQUISITO_LEVEL) end else player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10, nil) end else break end end table.sort(LevelOrder) local BAG_POS = 01 for LVL = 01, #LevelOrder do local LEVEL = LevelOrder[LVL] for POS = 01, #DEPOT_TEMP do if DEPOT_TEMP[POS].VALUE > 00 then if DEPOT_TEMP[POS].VALUE == LEVEL then player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01, DEPOT_TEMP[POS].UID_01) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02, DEPOT_TEMP[POS].UID_02) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03, DEPOT_TEMP[POS].UID_03) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04, DEPOT_TEMP[POS].UID_04) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05, DEPOT_TEMP[POS].UID_05) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06, DEPOT_TEMP[POS].UID_06) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07, DEPOT_TEMP[POS].UID_07) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08, DEPOT_TEMP[POS].UID_08) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09, DEPOT_TEMP[POS].UID_09) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10, DEPOT_TEMP[POS].UID_10) DEPOT_TEMP[POS].UID_01 = 0000 DEPOT_TEMP[POS].UID_02 = 0000 DEPOT_TEMP[POS].UID_03 = 0000 DEPOT_TEMP[POS].UID_04 = 0000 DEPOT_TEMP[POS].UID_05 = 0000 DEPOT_TEMP[POS].UID_06 = 0000 DEPOT_TEMP[POS].UID_07 = 0000 DEPOT_TEMP[POS].UID_08 = 0000 DEPOT_TEMP[POS].UID_09 = 0000 DEPOT_TEMP[POS].UID_10 = 0000 DEPOT_TEMP[POS].VALUE = 0000 BAG_POS = BAG_POS + 01 break end end end end for ORDER = 01, #DEPOT_TEMP do local A = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_01) local B = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_02) local C = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_03) local D = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_04) local E = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_05) local F = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_06) local G = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_07) local H = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_08) local I = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_09) local J = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_10) player:sendCancelMessage("@DepotItems " ..A.. " " ..B.. " " ..C.. " " ..D.. " " ..E.. " " ..F.. " " ..G.. " " ..H.. " " ..I.. " " ..J.. " " ..ORDER) end return true end if type == 07 then -- ORGANIZAR POR PRE�O local PriceOrder = {} local _BAG_TEMPO_POS = 01 for BAG_POS = 01, #DEPOT_TEMP do if player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01) > 00 then if _ITEMS[player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01)] then local PriceUnd = 00 DEPOT_TEMP[_BAG_TEMPO_POS].UID_01 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01) DEPOT_TEMP[_BAG_TEMPO_POS].UID_02 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02) DEPOT_TEMP[_BAG_TEMPO_POS].UID_03 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03) DEPOT_TEMP[_BAG_TEMPO_POS].UID_04 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04) DEPOT_TEMP[_BAG_TEMPO_POS].UID_05 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05) DEPOT_TEMP[_BAG_TEMPO_POS].UID_06 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06) DEPOT_TEMP[_BAG_TEMPO_POS].UID_07 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07) DEPOT_TEMP[_BAG_TEMPO_POS].UID_08 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08) DEPOT_TEMP[_BAG_TEMPO_POS].UID_09 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09) DEPOT_TEMP[_BAG_TEMPO_POS].UID_10 = player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10) local slot = _ITEMS[player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01)].SLOT_EQUIP if slot == 03 or slot == 00 then DEPOT_TEMP[_BAG_TEMPO_POS].VALUE = _ITEMS[player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01)].PRICE * player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04) else DEPOT_TEMP[_BAG_TEMPO_POS].VALUE = _ITEMS[player:getStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01)].PRICE end PriceUnd = DEPOT_TEMP[_BAG_TEMPO_POS].VALUE player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10, nil) table.insert(PriceOrder, PriceUnd) _BAG_TEMPO_POS = _BAG_TEMPO_POS + 01 else player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09, nil) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10, nil) end else break end end table.sort(PriceOrder) local BAG_POS = 01 for PRICE_ITEM = 01, #PriceOrder do local PRICE = PriceOrder[PRICE_ITEM] for POS = 01, #DEPOT_TEMP do if DEPOT_TEMP[POS].VALUE > 00 then if DEPOT_TEMP[POS].VALUE == PRICE then player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_01, DEPOT_TEMP[POS].UID_01) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_02, DEPOT_TEMP[POS].UID_02) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_03, DEPOT_TEMP[POS].UID_03) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_04, DEPOT_TEMP[POS].UID_04) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_05, DEPOT_TEMP[POS].UID_05) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_06, DEPOT_TEMP[POS].UID_06) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_07, DEPOT_TEMP[POS].UID_07) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_08, DEPOT_TEMP[POS].UID_08) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_09, DEPOT_TEMP[POS].UID_09) player:setStorageValue(_SYSTEM.DEPOT[01][BAG_POS].UID_10, DEPOT_TEMP[POS].UID_10) DEPOT_TEMP[POS].UID_01 = 0000 DEPOT_TEMP[POS].UID_02 = 0000 DEPOT_TEMP[POS].UID_03 = 0000 DEPOT_TEMP[POS].UID_04 = 0000 DEPOT_TEMP[POS].UID_05 = 0000 DEPOT_TEMP[POS].UID_06 = 0000 DEPOT_TEMP[POS].UID_07 = 0000 DEPOT_TEMP[POS].UID_08 = 0000 DEPOT_TEMP[POS].UID_09 = 0000 DEPOT_TEMP[POS].UID_10 = 0000 DEPOT_TEMP[POS].VALUE = 0000 BAG_POS = BAG_POS + 01 break end end end end for ORDER = 01, #DEPOT_TEMP do local A = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_01) local B = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_02) local C = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_03) local D = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_04) local E = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_05) local F = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_06) local G = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_07) local H = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_08) local I = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_09) local J = player:getStorageValue(_SYSTEM.DEPOT[01][ORDER].UID_10) player:sendCancelMessage("@DepotItems " ..A.. " " ..B.. " " ..C.. " " ..D.. " " ..E.. " " ..F.. " " ..G.. " " ..H.. " " ..I.. " " ..J.. " " ..ORDER) end return true end end function onLoadShop(player) for X = 01, #_SHOP_PRODUCTS do for Y = 01, #_SHOP_PRODUCTS[X] do local A = _SHOP_PRODUCTS[X][Y].VIP.ORIGIN_PRICE local B = _SHOP_PRODUCTS[X][Y].VIP.PROMO_PRICE local C = _SHOP_PRODUCTS[X][Y].ONLINE.ORIGIN_PRICE local D = _SHOP_PRODUCTS[X][Y].ONLINE.PROMO_PRICE local E = _SHOP_PRODUCTS[X][Y].PVP.ORIGIN_PRICE local F = _SHOP_PRODUCTS[X][Y].PVP.PROMO_PRICE local G = 01 if _SHOP_PRODUCTS[X][Y].VISIBLE == false then G = 00 end player:sendCancelMessage("@LoadShop " ..X.. " " ..Y.. " " ..A.. " " ..B.. " " ..C.. " " ..D.. " " ..E.. " " ..F.. " " ..G) end end end _G.contains = table.contains if string.splitTrimmed then local stringMeta = getmetatable('') if stringMeta and stringMeta.__index then stringMeta.__index.splitTrimmed = string.splitTrimmed end end