Ir para conteúdo

eSvira

Membro
  • Registro em

  • Última visita

  1. Here for top lvl with rebirth system for tfs 1.x: function onThink(interval) local max, query = 5, db.storeQuery("SELECT `name`, `level`, `rebirth` FROM `players` WHERE `id` > 6 AND `group_id` < 2 ORDER BY `rebirth` DESC, `level` DESC, `name` ASC;") local str = "TOP "..max.." Rank Level:\n\n" if query ~= false then k = 0 repeat k = k + 1 str = str .. "\n " .. k .. " - ".. result.getString(query, "name") .." Level:[".. result.getNumber(query, "level") .."] Rebirth:[".. result.getNumber(query, "rebirth") .."]" until not result.next(query) or k == max -- query:free() end broadcastMessage(str, MESSAGE_EVENT_ADVANCE) return true end
  2. .Server: OTX 3.7 El bug ocurre al crear un LOOT, afecta levemente el funcionamiento aunque se mejoran la mayoría de los ítems. El error en la consola se ve así Así es como está escrito el guión en sí. function getper() local n = 1 for i=1,10 do n = n+math.random(0,10) if n < 8*i then break end end return n end local lootable_slots = {'hp','mp','ml','melee','shield','dist'} function assign_loot_Slot(pos) local c = Tile(pos):getTopDownItem() if c ~= nil then if c:isContainer() then local h = c:getItemHoldingCount() if h > 0 then for i = 1, h do local i_Ex = c:getItem(i - 1) local itemEx = { itemid = i_Ex:getId(), uid = i_Ex:getUniqueId() } if (isArmor(itemEx.uid) or isWeapon(itemEx.uid) or isShield(itemEx.uid)) and not isItemStackable(itemEx.uid) then if math.random(1,5) == 5 then if math.random(1, 100) <= 15 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Great loot.") nam = Item(itemEx.uid):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) nam = nam..' ['..lootable_slots[math.random(1, #lootable_slots)]..'.+'..getper()..'%]' doSetItemSpecialDescription(itemEx.uid, nam) if math.random(1, 100) <= 10 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Amazing loot.") nam = nam..' ['..lootable_slots[math.random(1, #lootable_slots)]..'.+'..getper()..'%]' doSetItemSpecialDescription(itemEx.uid, nam) if math.random(1, 100) <= 5 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Good loot.") nam = nam..' ['..lootable_slots[math.random(1, #lootable_slots)]..'.+'..getper()..'%]' doSetItemSpecialDescription(itemEx.uid, nam) end end end end end end return true end end end end function onKill(cid, target, lastHit) if (not isSummon(target)) then addEvent(assign_loot_Slot, 2, getThingPos(target)) end return true end ¡Muchas gracias por toda su ayuda y sugerencias! Solution! In line 22 add:
  3. eSvira postou uma resposta no tópico em Códigos C++
    TFS 1.2?
  4. change for: function onKill(player, target) if Game.getStorageValue(MONSTER_HUNT.storages.monster) == nil then return true end if not player or not target then return true end if player:getStorageValue(MONSTER_HUNT.storages.player) == -1 then player:setStorageValue(MONSTER_HUNT.storages.player, 0) end if target:isMonster() ~= nil then return true end if target:isMonster() and target:getName():lower() == (MONSTER_HUNT.list[Game.getStorageValue(MONSTER_HUNT.storages.monster)]):lower() then player:setStorageValue(MONSTER_HUNT.storages.player, player:getStorageValue(MONSTER_HUNT.storages.player) + 1) player:sendTextMessage(MESSAGE_STATUS_BLUE_LIGHT, MONSTER_HUNT.messages.prefix .. MONSTER_HUNT.messages.kill:format(player:getStorageValue(MONSTER_HUNT.storages.player), target:getName())) table.insert(MONSTER_HUNT.players, {player:getId(), player:getStorageValue(MONSTER_HUNT.storages.player)}) end return true end

Informação Importante

Confirmação de Termo