Postado Agosto 17, 2023 1 ano Autor Entao o meu é Sql entao tem executei na data base e talz mais erro Permanece nem Vale a Pena eu Pegar desse Baiak pq e Tudo Mysql
Postado Agosto 17, 2023 1 ano 16 minutos atrás, djteteh disse: Entao o meu é Sql entao tem executei na data base e talz mais erro Permanece nem Vale a Pena eu Pegar desse Baiak pq e Tudo Mysql Tive que pesquisar um pouco e encontrei uma solução que deve funcionar para você, pois utiliza SQLite. Será necessário fazer algumas alterações em sua source e no SQLite. Depois, você pode adicionar os scripts que enviei. É possível que funcione sem precisar usar MySQL. https://tibiaking.com/forums/topic/32727-reset-system/ Editado Agosto 17, 2023 1 ano por GM Vortex (veja o histórico de edições)
Postado Agosto 18, 2023 1 ano 17 horas atrás, GM Vortex disse: Há um bom tempo atrás, baixei este servidor Baiak. Peguei esses sistemas e adicionei o meu próprio mapa custom, que não é Baiak nem Global. Testei e estava funcionando bem. Depois, descobri que saiu a base TFS Nekiro Downgrade. Gostei muito e abandonei o meu OTX 8.6, migrando para o TFS 1.5 Nekiro. Eu não entendo por que as pessoas não baixam este servidor. Já está completo com tudo, incluindo sistemas de montarias, roleta, cassino, reset com dano e muito mais. É só baixar este servidor e trocar o mapa, ou se preferir, manter este mapa mesmo. Está pronto e é simples. essa base baiak king ta cheia de bug, muita coisa incompleta Editado Agosto 18, 2023 1 ano por ubnt22 (veja o histórico de edições)
Postado Agosto 18, 2023 1 ano Autor 22 horas atrás, GM Vortex disse: Tive que pesquisar um pouco e encontrei uma solução que deve funcionar para você, pois utiliza SQLite. Será necessário fazer algumas alterações em sua source e no SQLite. Depois, você pode adicionar os scripts que enviei. É possível que funcione sem precisar usar MySQL. https://tibiaking.com/forums/topic/32727-reset-system/ jA Fiz Tudo isso mais mesmo assim nao tenho uma talk action do modo que Falei para esse Script
Postado Setembro 7, 2023 1 ano Bom Dia. finalmente, encontrei uma solução para o aumento de dano por reset, sem precisar de muitas modificações na source ou libs adicionais. É simples de implementar, basta adicionar e usar um comando ou NPC com um storage. foi testado e está funcionando corretamente. OTX 2 ou 3. combat.cpp procure esta linha. bool Combat::CombatHealthFunc(Creature* caster, Creature* target, const CombatParams& params, void* data) Basta substituir todo o código aqui. bool Combat::CombatHealthFunc(Creature* caster, Creature* target, const CombatParams& params, void* data) { int32_t change = 0; if (Combat2Var* var = (Combat2Var*)data) { change = var->change; if (!change) change = random_range(var->minChange, var->maxChange, DISTRO_NORMAL); } if (g_game.combatBlockHit(params.combatType, caster, target, change, params.blockedByShield, params.blockedByArmor, params.itemId != 0)) return false; CombatParams _params = params; if (_params.element.damage && _params.element.type != COMBAT_NONE) g_game.combatBlockHit(_params.element.type, caster, target, _params.element.damage, params.blockedByShield, params.blockedByArmor, params.itemId != 0, true); if (g_config.getBool(ConfigManager::USE_BLACK_SKULL)) { if (caster && caster->getPlayer() && target->getPlayer() && target->getSkull() != SKULL_BLACK) { _params.element.damage /= 2; if (change < 0) change /= 2; } } else { if (caster && caster->getPlayer() && target->getPlayer()) { _params.element.damage /= 2; if (change < 0) change /= 2; } } { std::string value; caster->getStorage("14335", value); int32_t plus = (int32_t)(atoi(value.c_str())); double resetpower = plus * 2.0; if (plus > 0 && params.combatType != COMBAT_HEALING) change = (int32_t)std::ceil(change + change * resetpower / 100); } if (!g_game.combatChangeHealth(_params, caster, target, change, false)) return false; CombatConditionFunc(caster, target, params, NULL); CombatDispelFunc(caster, target, params, NULL); return true; } mais uma vez procure essa linha. bool Combat::CombatManaFunc(Creature* caster, Creature* target, const CombatParams& params, void* data) Basta substituir todo o código aqui. bool Combat::CombatManaFunc(Creature* caster, Creature* target, const CombatParams& params, void* data) { int32_t change = 0; if (Combat2Var* var = (Combat2Var*)data) { change = var->change; if (!change) change = random_range(var->minChange, var->maxChange, DISTRO_NORMAL); } if (g_game.combatBlockHit(COMBAT_MANADRAIN, caster, target, change, false, false, params.itemId != 0)) return false; if (g_config.getBool(ConfigManager::USE_BLACK_SKULL)) { if (change < 0 && caster && caster->getPlayer() && target->getPlayer() && target->getSkull() != SKULL_BLACK) change /= 2; } else { if (change < 0 && caster && caster->getPlayer() && target->getPlayer()) change /= 2; } { std::string value; caster->getStorage("14335", value); int32_t plus = (int32_t)(atoi(value.c_str())); double resetpower = plus * 2.0; if (plus > 0 && params.combatType != COMBAT_MANADRAIN) change = (int32_t)std::ceil(change + change * resetpower / 100); } if (!g_game.combatChangeMana(caster, target, change)) return false; CombatConditionFunc(caster, target, params, NULL); CombatDispelFunc(caster, target, params, NULL); return true; } Apenas compile, então vamos adicionar um npc reset. npc reset local config = { minlevel = 3500, --- initial level to reset price = 100000000, ---initial price to reset newlevel = 20, --- level after reset priceByReset = 100000000, --- price added per reset percent = 40, ---- percentage of health/mana you will have upon reset (relative to your old total health) maxresets = 20, levelbyreset = 100 --- how much more level will you need in the next reset } function getResets(uid) resets = getPlayerStorageValue(uid, 14335) if resets < 0 then resets = 0 end return resets end local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid function addReset(cid) if(npcHandler:isFocused(cid)) then npcHandler:releaseFocus(cid) end talkState[talkUser] = 0 resets = getResets(cid) setPlayerStorageValue(cid, 14335, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) local hp = getCreatureMaxHealth(cid) local resethp = hp*(config.percent/100) setCreatureMaxHealth(cid, resethp) local differencehp = (hp - resethp) doCreatureAddHealth(cid, -differencehp) local mana = getCreatureMaxMana(cid) local resetmana = mana*(config.percent/100) setCreatureMaxMana(cid, resetmana) local differencemana = (mana - resetmana) doCreatureAddMana(cid, -differencemana) doRemoveCreature(cid) local description = resets+1 db.query("UPDATE `players` SET `description` = ' [Reset: "..description.."]' WHERE `players`.`id`= ".. playerid .."") db.query("UPDATE `players` SET `level`="..config.newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") return true end local newPrice = config.price + (getResets(cid) * config.priceByReset) local newminlevel = config.minlevel + (getResets(cid) * config.levelbyreset) if msgcontains(msg, 'reset') then if getResets(cid) < config.maxresets then selfSay('Voce gostaria de resetar? Isso vai custar '..newPrice..' gp\'s!', cid) talkState[talkUser] = 1 else selfSay('Voce ja atingiu o nivel maximo de resets!', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) < newPrice then selfSay('E necessesario ter '..newPrice..' gp\'s para resetar!', cid) elseif getPlayerLevel(cid) < newminlevel then selfSay('O level minimo para resetar e '..newminlevel..'!', cid) else doPlayerRemoveMoney(cid,newPrice) playerid = getPlayerGUID(cid) addEvent(function() if isPlayer(cid) then addReset(cid) end end, 3000) local number = getResets(cid)+1 local msg ="---[Reset: "..number.."]-- Voce resetou! Voce sera disconectado em 3 segundos." doPlayerPopupFYI(cid, msg) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then talkState[talkUser] = 0 npcHandler:releaseFocus(cid) selfSay('Ok.', cid) elseif msgcontains(msg, 'quantity') then selfSay('You have a total of '..getResets(cid)..' reset(s).', cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) #OBS: 2,0 é igual a duas vezes o valor original, não vinte vezes. Então quando você multiplica algo por 2,0 você está duplicando o valor original. double resetpower = plus * 2.0; Eu recomendo definir o valor para 1,5, pois aumentará o dano a cada reset. Qualquer reset do sistema que use storage, basta alterar o valor da reset do sistema. caster->getStorage("14335", value); Obs: Peguei o código do @Underwar e fiz algumas alterações, então compilei sem erro... https://tibiaking.com/forums/topic/104756-aumentar-dano-por-reset/ @MokkEste usuário do TibiaKing testou e aprovou.. Editado Setembro 7, 2023 1 ano por GM Vortex (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.