Ir para conteúdo

Bruno Rezende

Membro
  • Registro em

  • Última visita

Tudo que Bruno Rezende postou

  1. Tem um bug crítico nesse sistema, se você anunciar qualquer item em troca de um container qualquer (backpack), quando der "/offer buy" e a oferta, se ele pedir um container e esse container for seu container principal (ou estiver em uso), ele é removido com tudo que tem dentro.
  2. Por algum motivo, jogadores estão conseguindo duplicar item no meu OTX, eles postam oferta de um item, ele vai pra pagina Web mas não é removido do player
  3. pode compartilhar conosco a solução?
  4. Achou o tradeOff.js? Se sim, pode compartilhar?
  5. @luanluciano93 uma outra dúvida, não deveria ter formula.hit? Ou ela é calculada em outro lugar? elseif (isPlayer(attacker) and (type == STATSCHANGE_HEALTHGAIN or type == STATSCHANGE_MANAGAIN) and (getCreatureHealth(cid) < getCreatureMaxHealth(cid)) and (getPlayerStorageValue(cid, REWARDCHEST.storageExaust) >= os.time())) then for key, valor in pairs(REWARDCHEST.bosses) do if getPlayerStorageValue(cid, valor.storage) > 0 then if getCreatureHealth(cid) + value > getCreatureMaxHealth(cid) then local add = getCreatureMaxHealth(cid) - getCreatureHealth(cid) setPlayerStorageValue(attacker, valor.storage, getPlayerStorageValue(attacker, valor.storage) + math.ceil((add / REWARDCHEST.formula.suport))) else setPlayerStorageValue(attacker, valor.storage, getPlayerStorageValue(attacker, valor.storage) + math.ceil((value / REWARDCHEST.formula.suport))) end end end end return true end
  6. .Qual servidor ou website você utiliza como base? OTX 2 Você tem o código disponível? Se tiver publique-o aqui: void Player::onTarget(Creature* target) { Creature::onTarget(target); if(target == this) { addInFightTicks(false); return; } if(hasFlag(PlayerFlag_NotGainInFight)) return; Player* targetPlayer = target->getPlayer(); if(targetPlayer && !isPartner(targetPlayer) && !isAlly(targetPlayer)) { if(!pzLocked && g_game.getWorldType() == WORLDTYPE_HARDCORE) { pzLocked = true; sendIcons(); } if(getSkull() == SKULL_NONE && getSkullType(targetPlayer) == SKULL_YELLOW) { addAttacked(targetPlayer); targetPlayer->sendCreatureSkull(this); } else if(!targetPlayer->hasAttacked(this)) { if(!pzLocked) { pzLocked = true; sendIcons(); } if(!Combat::isInPvpZone(this, targetPlayer) && !isEnemy(this)) { addAttacked(targetPlayer); if(targetPlayer->getSkull() == SKULL_NONE && getSkull() == SKULL_NONE && (!guildId || !targetPlayer->getGuildId())) { setSkull(SKULL_WHITE); g_game.updateCreatureSkull(this); } if(getSkull() == SKULL_NONE) targetPlayer->sendCreatureSkull(this); } } } addInFightTicks(false); } Bom dia pessoal, hoje percebi que meu servidor está com um comportamento (não sei se esperado) mas indesejado, vamos pensar no seguinte cenário: Player 1 Ataca Player 2 (e pega White Skull) Player 2 ataca de volta player 1 e consegue entrar numa Protection Zone (não deveria/gostaria) Após sair da PZ, o player 2 ataca novamente o player 1 e vira Yellow Skull, e agora sim fica com PZ lock Gostaria que já no primeiro ataque o Player 2 ficasse com PZ lock, poderiam me ajudar? Consegui resolver: // DE else if(!targetPlayer->hasAttacked(this)) { if(!pzLocked) { pzLocked = true; sendIcons(); } // PARA else { if(!pzLocked) { pzLocked = true; sendIcons(); }
  7. Funcionou, poderia me ajudar somente no refino do script? Exemplo, ao tentar dar use de novo (se os walls tiverem sumido) da esse erro na console: 2023-06-19 17:04:25 - [Error - Action Interface] 2023-06-19 17:04:25 - data/actions/scripts/gatescastle.lua:onUse 2023-06-19 17:04:25 - Description: 2023-06-19 17:04:25 - (luaDoRemoveItem) Item not found Outro ponto é, como restringir o uso da alavanca a somente se o player tiver 100 itens do ID 4848 com ele?
  8. @Vodkart e se eu precisar remover 6 paredes e também ter 100 itens de um tipo pra usar a alavanca, como ficaria?
  9. Alguem tem a solução desse bug? Não consigo encontrar em lugar nenhum.
  10. Deixar mais rápido até que consegui, alterei aqui: while rand >= loop do local roll = math.random(1, 100) index = math.random(#config.items) if roll <= config.items[index].chance then local item = config.items[index] loop = loop + 1 addEvent(raffle, loop * 500, item) end end addEvent(result, (rand + 2) * 500, cid) else mas o exaust não acompanha a finalização da roleta, depois que ela acaba ainda precisa esperar um tempo, tô tentando arrumar.
  11. Conseguiu? Tb achei meio devagar aqui, até achei onde da uma acelerada, mas o exhaust nao acompanha, o cara recebe o premio e ainda tem que esperar um tempo.
  12. Sim, é idêntico ao que você postou, só queria ver essa questão mesmo do container diferente pra reward a e divisão dos rewards.
  13. Por incrível que pareça sim. O container é funcional , conforme imagem. Mas quando mato o boss, recebo uma letter. Poderia avaliar meu script pra ver se está correto @luanluciano93, por favor?
  14. Coloquei todos como 3 @luanluciano93, mas ainda parece não dividir bem. Também não consegui entender o cálculo, saberia explicar? Uma coisa que percebi, se trocar o id do Reward Bag, o script não entrega a reward. sistemas/ REWARDCHEST = { rewardBagId = 2595, formula = {hit = 3, block = 3, suport = 3}, storageExaust = 60000, town_id = 1, creaturescripts/rewardchestboss dofile('data/sistemas/rewardchest.lua') local function addRewardLoot(uid, bossName, tabela_reward) local money = math.random(10, 40) local msg = "The following items are available in your reward chest:" local chest = doCreateItemEx(REWARDCHEST.rewardBagId) doItemSetAttribute(chest, "description", "Reward System has kill the boss ".. bossName ..".") if table.maxn(tabela_reward) > 0 then for x = 1, table.maxn(tabela_reward) do local rand = math.random(100) if rand <= tabela_reward[x][3] then local count = math.random(1, tabela_reward[x][2]) doAddContainerItem(chest, tabela_reward[x][1], count) msg = msg .. " ".. (count > 1 and count or "") .." "..getItemNameById(tabela_reward[x][1]).."," end end doPlayerSendTextMessage(uid, MESSAGE_INFO_DESCR, msg .. " and ".. money .." platinum coins.") else doPlayerSendTextMessage(uid, MESSAGE_INFO_DESCR, msg .. " ".. money .." platinum coins.") end doAddContainerItem(chest, 2152, money) doPlayerSendMailByName(getPlayerName(uid), chest, REWARDCHEST.town_id) local boss = REWARDCHEST.bosses[bossName] setPlayerStorageValue(uid, boss.storage, 0) doSendMagicEffect(getPlayerPosition(uid), CONST_ME_MAGIC_BLUE) end local function addLoot(tabela_loot, tabela_reward, all_loot) if table.maxn(tabela_loot) > 0 then if all_loot then for x = 1, table.maxn(tabela_loot) do table.insert(tabela_reward, tabela_loot[x]) end else table.insert(tabela_reward, tabela_loot[math.random(table.maxn(tabela_loot))]) end end return tabela_reward end local function rewardChestSystem(bossName) local players = {} local boss = REWARDCHEST.bosses[bossName] for _, uid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(uid, boss.storage) > 0 then table.insert(players, uid) end end table.sort(players, function(a, b) return getPlayerStorageValue(a, boss.storage) > getPlayerStorageValue(b, boss.storage) end) local porcentagem = math.ceil(getPlayerStorageValue(players[1], boss.storage)) for i = 1, table.maxn(players) do local tabela_reward = {} local pontos = getPlayerStorageValue(players[i], boss.storage) if i == 1 then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) addLoot(boss.raro, tabela_reward, false) addLoot(boss.sempre, tabela_reward, true) elseif i >= 2 and pontos >= math.ceil((porcentagem * 0.8)) then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) addLoot(boss.raro, tabela_reward, false) addLoot(boss.muito_raro, tabela_reward, false) elseif pontos < math.ceil((porcentagem * 0.8)) and pontos >= math.ceil((porcentagem * 0.6)) then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) addLoot(boss.raro, tabela_reward, false) elseif pontos < math.ceil((porcentagem * 0.6)) and pontos >= math.ceil((porcentagem * 0.4)) then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) elseif pontos < math.ceil((porcentagem * 0.4)) and pontos >= math.ceil((porcentagem * 0.1)) then addLoot(boss.comum, tabela_reward, false) end addRewardLoot(players[i], bossName, tabela_reward) end end function onDeath(cid, corpse, killer) local boss = REWARDCHEST.bosses[getCreatureName(cid):lower()] if boss then addEvent(rewardChestSystem, 1000, getCreatureName(cid):lower()) end return true end function onStatsChange(cid, attacker, type, combat, value) if isMonster(cid) and type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) then local boss = REWARDCHEST.bosses[getCreatureName(cid):lower()] if boss and attacker then setPlayerStorageValue(attacker, boss.storage, getPlayerStorageValue(attacker, boss.storage) + math.ceil((value / REWARDCHEST.formula.hit))) end end return true end rewardchestpontos dofile('data/sistemas/rewardchest.lua') function onLogin(cid) for key, value in pairs(REWARDCHEST.bosses) do if getPlayerStorageValue(cid, value.storage) > 0 then setPlayerStorageValue(cid, value.storage, 0) end end registerCreatureEvent(cid, "RewardChestStats") return true end function onStatsChange(cid, attacker, type, combat, value) if isMonster(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then local boss = REWARDCHEST.bosses[getCreatureName(attacker):lower()] if boss then setPlayerStorageValue(cid, boss.storage, getPlayerStorageValue(cid, boss.storage) + math.ceil((value / REWARDCHEST.formula.block))) setPlayerStorageValue(cid, REWARDCHEST.storageExaust, os.time() + 5) end elseif (isPlayer(attacker) and (type == STATSCHANGE_HEALTHGAIN or type == STATSCHANGE_MANAGAIN) and (getCreatureHealth(cid) < getCreatureMaxHealth(cid)) and (getPlayerStorageValue(cid, REWARDCHEST.storageExaust) >= os.time())) then for key, valor in pairs(REWARDCHEST.bosses) do if getPlayerStorageValue(cid, valor.storage) > 0 then if getCreatureHealth(cid) + value > getCreatureMaxHealth(cid) then local add = getCreatureMaxHealth(cid) - getCreatureHealth(cid) setPlayerStorageValue(attacker, valor.storage, getPlayerStorageValue(attacker, valor.storage) + math.ceil((add / REWARDCHEST.formula.suport))) else setPlayerStorageValue(attacker, valor.storage, getPlayerStorageValue(attacker, valor.storage) + math.ceil((value / REWARDCHEST.formula.suport))) end end end end return true end
  15. Alguém ainda consegue dar suporte nesse script? Aqui funcionou até bem, porém o blocker sempre leva grande parte dos loots, shooters e EDs não ganham praticamente nada. Como alterar isso @luanluciano93?
  16. pode detalhar um pouco mais irmão? Sei que tá bem detalhado já, mas não consegui avançar
  17. encontrou?
  18. Bruno Rezende postou uma resposta no tópico em Códigos C++
    Não tem como colocar um bônus de EXP atrelado ao nível do monstro?
  19. Mesmo problema aqui, se alguém puder ajudar
  20. Não tem, mas consegui resolver: https://github.com/otland/tfs-old-svn/blob/r3884/player.cpp#L1381 nessa função void Player::onChangeZone(ZoneType_t zone) eu adicionei if(zone == ZONE_PROTECTION) { if(Condition* condition = getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)) { removeCondition(condition); } } acima de sendIcons();
  21. Tentei, mesmo com isso o battle volta após sair do PZ, sem nada que justifique voltar o battle.
  22. .Qual servidor ou website você utiliza como base? OTX 2 Você tem o código disponível? Se tiver publique-o aqui: bool ProtocolGame::logout(bool displayEffect, bool forceLogout) { //dispatcher thread if(!player) return false; if(player->hasCondition(CONDITION_EXHAUST, 1)) { player->sendTextMessage(MSG_STATUS_SMALL, "You have to wait a while."); return false; } if(!player->isRemoved()) { if(!forceLogout) { if(!IOLoginData::getInstance()->hasCustomFlag(player->getAccount(), PlayerCustomFlag_CanLogoutAnytime)) { if(player->getTile()->hasFlag(TILESTATE_NOLOGOUT)) { if(Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, 500, 0, false, 1)) player->addCondition(condition); player->sendCancelMessage(RET_YOUCANNOTLOGOUTHERE); return false; } if(player->getZone() != ZONE_PROTECTION && player->hasCondition(CONDITION_INFIGHT)) { if(Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, 500, 0, false, 1)) player->addCondition(condition); player->sendCancelMessage(RET_YOUMAYNOTLOGOUTDURINGAFIGHT); return false; } if(!g_creatureEvents->playerLogout(player, false)) //let the script handle the error message return false; } else g_creatureEvents->playerLogout(player, true); } else if(!g_creatureEvents->playerLogout(player, true)) return false; if(displayEffect && !player->isGhost()) g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF); } player->client->clear(true); disconnect(); if(player->isRemoved()) return true; return g_game.removeCreature(player); } Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. Em luta: Vou pra um PZ (battle removido) Mas logo após sair do PZ o battle volta Gostaria que, quando não estivesse com PZ locked (apenas com battle), quando um player entrasse numa área PZ o battle fosse removido.
  23. conseguiu resolver isso?
  24. Same problem here, fixed?

Informação Importante

Confirmação de Termo