Ir para conteúdo

Kemix

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    Kemix deu reputação a Mikhael em SHOPSYSTEM - ERRO AO CONCLUIR UMA COMPRA NO SHOP.   
    Esse aqui:
     
    http://www.tibiaking.com/forum/forums/topic/36403-tfs-12-1097-1100-globalfull-otherworld-hearth-of-destruction-quest-battlefield-last-man-standing-capture-the-flag-zoombie-event-war-anti-entrosa-website-database-sources-v30/  
    RESOLVIDO.
     
    no Arquivo shopsystem.php.
     
    Alterei:
     
    PARA:
     
     
  2. Gostei
    Kemix deu reputação a L3K0T em como modificar attack speed limit nas sources?   
    creature.h
     
    #define EVENT_CREATURECOUNT 1
    #define EVENT_CREATURE_THINK_INTERVAL 50
     
     
    player.cpp
     
    uint32_t Player::getAttackSpeed()
    {
        Item* weapon = getWeapon();
        // nie 'attackSpeed', bo taka zmienna juz moze istniec w klasie Creature/Player
        int32_t attackSpeedzik;
        if(weapon && weapon->getAttackSpeed() != 0)
            attackSpeedzik = vocation->getAttackSpeed() - (getSkill(SKILL_AXE, SKILL_LEVEL) * 13) - weapon->getAttackSpeed();
        else
            attackSpeedzik = vocation->getAttackSpeed() - (getSkill(SKILL_AXE, SKILL_LEVEL) * 13);
        if(attackSpeedzik > 0)
            return (uint32_t) attackSpeedzik;
        else
            return 1;
    }
  3. Gostei
    Kemix recebeu reputação de Huske em Sistema de Resete   
    MySQL:
    ALTER TABLE `players` ADD `resets` INT(11) NOT NULL DEFAULT "0";  
     
    Sources:
     
    player.h
     
    Procure por:
    uint32_t level; Adicione abaixo:
    uint32_t resets;  
     
    iologindata.cpp
     
    Procure por:
    bool IOLoginData::loadPlayerById(Player* player, uint32_t id) Substitua a parte que tenha querry por:
    query << "SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `resets`, `maglevel`, `health`, `healthmax`, `blessings`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `conditions`, `skulltime`, `skull`, `town_id`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries` FROM `players` WHERE `id` = " << id; Procure por:
    bool IOLoginData::loadPlayerByName(Player* player, const std::string& name) Substitua a parte que tenha querry por:
    query << "SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `resets`, `maglevel`, `health`, `healthmax`, `blessings`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `conditions`, `skulltime`, `skull`, `town_id`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries` FROM `players` WHERE `name` = " << db->escapeString(name); Procure por:
    player->level = std::max<uint32_t>(1, result->getNumber<uint32_t>("level")); Adicione abaixo:
    player->resets = result->getNumber<uint32_t>("resets"); Procure por:
    query << "`level` = " << player->level << ','; Adicione abaixo:
    query << "`resets` = " << player->resets << ", ";  
     
    player.cpp
     
    procure por:
    s << " (Level " << level << ")"; Substitua por:
    s << " You are " << vocation->getVocDescription() << ". [Resets " << resets << "]";  
     
    player.h
     
    procure por:
    uint32_t level; Abaixo adicione:
    uint32_t resets; procure por:
    uint32_t getLevel() const { return level; } Adicione abaixo:
    uint32_t getResets() const { return resets; } void setResets(int32_t amount) { resets += amount; if (resets < 0) { resets = 0; } }  
     
    luascript.cpp
     
    Procure por:
    registerMethod("Player", "getLevel", LuaScriptInterface::luaPlayerGetLevel); Abaixo adicione:
    registerMethod("Player", "getResets", LuaScriptInterface::luaPlayerGetResets); registerMethod("Player", "setResets", LuaScriptInterface::luaPlayerSetResets); Procure por:
    int LuaScriptInterface::luaPlayerGetLevel(lua_State* L) { // player:getLevel() Player* player = getUserdata<Player>(L, 1); if (player) { lua_pushnumber(L, player->getLevel()); } else { lua_pushnil(L); } return 1; } Adicione abaixo:
    int LuaScriptInterface::luaPlayerGetResets(lua_State* L) { //getResets(cid) Player* player = getUserdata<Player>(L, 1); if (player) { lua_pushnumber(L, player->getResets()); } else { lua_pushnil(L); } return 1; } int LuaScriptInterface::luaPlayerSetResets(lua_State* L) { //setResets(cid, amount) int32_t amount = getNumber<int32_t>(L, 2); Player* player = getUserdata<Player>(L, 1); if (player) { player->setResets(amount); lua_pushboolean(L, true); } else { lua_pushnil(L); } return 1; }     luascript.h   procure por: static int luaPlayerGetLevel(lua_State* L); Adicione abaixo:
    static int luaPlayerGetResets(lua_State* L); static int luaPlayerSetResets(lua_State* L);  
    - Npc para esse sistema de resete
    - Aumento de damage por esse sistema de reset
  4. Gostei
    Kemix deu reputação a Bruno Minervino em [10.90] Vanaheim Global Opensource - TFS 1.2   
    Um método diferente de agir. Escolhas diferentes, um projeto surpreendente, e o melhor é opensource. Sim, você pode ter acesso a este servidor que estou desenvolvendo em parceria com a Serversoft para você.

    Um servidor com uma mega estrutura para suportar seus jogadores online sem nenhum problema como: debug, bug de clonagem, instabilidade entre diversos outros dos servidores free's disponíveis para download nessa vasta internet tibiana.

    Uma inovação no ramo de OTservers, distribuindo não só a datapack como as sourcers e os sistemas, absolutamente tudo que você procura. Basta baixar, compilar... Mas eu não sei compilar. Não há problema nisso, o OTPanel da Serversoft faz tudo isso para você. Basta clicar num botão de "play" e ver a mágica acontecer.

    O projeto Vanaheim, foi criado com o intuito de ser inteiramente grátis para toda a comunidade. Um servidor no qual a diversão é o fator principal, um projeto com viabilidade absoluta por todos os tibianos.

    O projeto conta com uma área exclusiva no GitHub para que todos possam acompanhar a evolução do mesmo, dia a dia, diversas atualizações estarão disponíveis a todos. Desde uma action até uma modificação na source vocês terão acesso.

    O servidor conta com um mapa Global Full, quando eu digo full, quero dizer que está 99.99% do mapa completo, sem bugs entre outros.
    Um servidor que você escolhe a rate experience/skill que desejar, ele vai se adaptar! Você pode escolher se quer ou não que as quests tenham as missões originais 100%!

    E o melhor? Além do servidor estar disponível para download ele está online para quem quiser conhecer o projeto, ajudar de alguma forma e o melhor de tudo, se divertir.

    Venha se divertir: http://www.vanaheimglobal.com
     
    RATES
     
    Level 8 - 50: 300x
    Level 51 - 80: 200x
    Level 81 - 100: 150x
    Level 101 - 140: 90x
    Level 141 - 160: 70x
    Level 161 - 180: 60x
    Level 181 - 200: 50x
    Level 201 - 230: 40x
    Level 231 - 260: 30x
    Level 261 - 290: 20x
    Level 291 - 310: 15x
    Level 311 - 340: 10x
    Level 341 - 350: 8x
    Level 351 - 380: 6x
    Level 381 - 430: 4x
    Level 431 - 450: 2x
    Level 451+: 1x
     
     
    Skill: 40x
    Magic: 8x
    Loot: 3x
     
     
    EVENTOS
     
     
    Em Breve.
     
     
    IMAGENS
     
     
    Em Breve.
     
     
    GITHUB
     
     
    Para acompanhar e baixar o servidor atualizado, segue o link do nosso projeto no GitHub:
     

     
    DOWNLOADS
     
     
     
     
    Servidor
    Mapa
    Yasir
    Scan
     
    CRÉDITOS

    TFS Team
    Orts Project
    Bruno Minervino
     
  5. Gostei
    Kemix recebeu reputação de neykos em NPC para Reset   
    @neyko
    config = { minlevel = 150, --- Level inical para resetar price = 10000, --- Preço inicial para resetar newlevel = 20, --- Level após reset priceByReset = 0, --- Preço acrescentado por reset bonus = 100, ---- Bonus de vida e mana por reset maxresets = 50, ---- Maximo de resets levelbyreset = 0 --- Quanto de level vai precisar a mais no próximo reset } function addReset(cid) player = Player(cid) resets = getResets(cid) resethp = bonus * (resets + 1) player:setMaxHealth(resethp) resetmana = bonus * (resets + 1) player:setMaxMana(resetmana) playerid = player:getGuid()     player:remove() db.query("UPDATE `players` SET `resets`="..resets.. + 1",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") db.query("UPDATE `players` SET `level`="..config.newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."")     return true end   
     
    @mkmmkm
     
    Tem alguns sistemas, o link no inicio do tópico é para fazer isso, mas pela modificação na distro,
     
  6. Gostei
    Kemix recebeu reputação de Magalhaes92 em Sistema de Resete   
    MySQL:
    ALTER TABLE `players` ADD `resets` INT(11) NOT NULL DEFAULT "0";  
     
    Sources:
     
    player.h
     
    Procure por:
    uint32_t level; Adicione abaixo:
    uint32_t resets;  
     
    iologindata.cpp
     
    Procure por:
    bool IOLoginData::loadPlayerById(Player* player, uint32_t id) Substitua a parte que tenha querry por:
    query << "SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `resets`, `maglevel`, `health`, `healthmax`, `blessings`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `conditions`, `skulltime`, `skull`, `town_id`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries` FROM `players` WHERE `id` = " << id; Procure por:
    bool IOLoginData::loadPlayerByName(Player* player, const std::string& name) Substitua a parte que tenha querry por:
    query << "SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `resets`, `maglevel`, `health`, `healthmax`, `blessings`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `conditions`, `skulltime`, `skull`, `town_id`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries` FROM `players` WHERE `name` = " << db->escapeString(name); Procure por:
    player->level = std::max<uint32_t>(1, result->getNumber<uint32_t>("level")); Adicione abaixo:
    player->resets = result->getNumber<uint32_t>("resets"); Procure por:
    query << "`level` = " << player->level << ','; Adicione abaixo:
    query << "`resets` = " << player->resets << ", ";  
     
    player.cpp
     
    procure por:
    s << " (Level " << level << ")"; Substitua por:
    s << " You are " << vocation->getVocDescription() << ". [Resets " << resets << "]";  
     
    player.h
     
    procure por:
    uint32_t level; Abaixo adicione:
    uint32_t resets; procure por:
    uint32_t getLevel() const { return level; } Adicione abaixo:
    uint32_t getResets() const { return resets; } void setResets(int32_t amount) { resets += amount; if (resets < 0) { resets = 0; } }  
     
    luascript.cpp
     
    Procure por:
    registerMethod("Player", "getLevel", LuaScriptInterface::luaPlayerGetLevel); Abaixo adicione:
    registerMethod("Player", "getResets", LuaScriptInterface::luaPlayerGetResets); registerMethod("Player", "setResets", LuaScriptInterface::luaPlayerSetResets); Procure por:
    int LuaScriptInterface::luaPlayerGetLevel(lua_State* L) { // player:getLevel() Player* player = getUserdata<Player>(L, 1); if (player) { lua_pushnumber(L, player->getLevel()); } else { lua_pushnil(L); } return 1; } Adicione abaixo:
    int LuaScriptInterface::luaPlayerGetResets(lua_State* L) { //getResets(cid) Player* player = getUserdata<Player>(L, 1); if (player) { lua_pushnumber(L, player->getResets()); } else { lua_pushnil(L); } return 1; } int LuaScriptInterface::luaPlayerSetResets(lua_State* L) { //setResets(cid, amount) int32_t amount = getNumber<int32_t>(L, 2); Player* player = getUserdata<Player>(L, 1); if (player) { player->setResets(amount); lua_pushboolean(L, true); } else { lua_pushnil(L); } return 1; }     luascript.h   procure por: static int luaPlayerGetLevel(lua_State* L); Adicione abaixo:
    static int luaPlayerGetResets(lua_State* L); static int luaPlayerSetResets(lua_State* L);  
    - Npc para esse sistema de resete
    - Aumento de damage por esse sistema de reset
  7. Gostei
    Kemix recebeu reputação de neykos em NPC para Reset   
    Npc para o sistema de reset:
    http://www.tibiaking.com/forum/topic/65646-sistema-de-resete/#comment-374457
     
     
    data/npc/reseter.XML:
    <?xml version="1.0" encoding="UTF-8"?> <npc name="Reseter" script="reseter.lua">     <health now="1000" max="1000"/>     <look type="133" head="95" body="86" legs="86" feet="38" addons="3"/>         <parameters>             <parameter key="message_greet" value="Hello |PLAYERNAME|.I've been waiting for you to come.. Say 'reset' or 'quantity'" />             <parameter key="message_farewell" value="Cya folk." />             <parameter key="message_walkaway" value="How Rude!" />         </parameters> </npc>   
    data/npc/scripts/reseter.lua:
    local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 player = Player(cid) config = { minlevel = 150, --- Level inical para resetar price = 10000, --- Preço inicial para resetar newlevel = 20, --- Level após reset priceByReset = 0, --- Preço acrescentado por reset percent = 10, ---- Porcentagem da vida/mana que você terá ao resetar (em relação à sua antiga vida total) maxresets = 50, ---- Maximo de resets levelbyreset = 0 --- Quanto de level vai precisar a mais no próximo reset } function addReset(cid) player = Player(cid) resets = getResets(cid) hp = player:getMaxHealth() resethp = hp*(config.percent/100) player:setMaxHealth(resethp) mana = player:getMaxMana() resetmana = mana*(config.percent/100) player:setMaxMana(resetmana) playerid = player:getGuid()     player:remove() db.query("UPDATE `players` SET `resets`="..resets.. + 1",`experience`= 0 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 npcHandler:say('You want to reset your character? It will cost '..newPrice..' gp\'s!', cid) npcHandler.topic[cid] = 1 else npcHandler:say('You already reached the maximum reset level!', cid) end elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 1 then if player:getLevel() > newminlevel then if player:removeMoney(newPrice) then addEvent(function() if isPlayer(cid) then addReset(cid) end end, 3000) local number = getResets(cid)+1 local msg ="---[Reset: "..number.."]-- You have reseted!  You'll be disconnected in 3 seconds." player:popupFYI(msg)  npcHandler.topic[cid] = 0 npcHandler:releaseFocus(cid) else npcHandler:say('Its necessary to have at least '..newPrice..' gp\'s for reseting!', cid) npcHandler.topic[cid] = 0 end else npcHandler:say('The minimum level for reseting is '..newminlevel..'!', cid) npcHandler.topic[cid] = 0 end elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then npcHandler.topic[cid] = 0 npcHandler:releaseFocus(cid) npcHandler:say('Ok.', cid) elseif msgcontains(msg, 'quantity') then npcHandler:say('You have a total of '..getResets(cid)..' reset(s).', cid) npcHandler.topic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())   
    Para configurar mexa nessa parte do npc:
    config = { minlevel = 150, --- Level inical para resetar price = 10000, --- Preço inicial para resetar newlevel = 20, --- Level após reset priceByReset = 0, --- Preço acrescentado por reset percent = 10, ---- Porcentagem da vida/mana que você terá ao resetar (em relação à sua antiga vida total) maxresets = 50, ---- Maximo de resets levelbyreset = 0 --- Quanto de level vai precisar a mais no próximo reset } Créditos: Flavio S
  8. Gostei
    Kemix recebeu reputação de Fir3element em Aumento de damage por resete   
    Script usado em conjunto com: Sistema de resete     COMBAT.CPP procure: int size0 = lua_gettop(L); adicionar abaixo: int mares = g_config.getNumber(ConfigManager::MAGIC_RES_DAM); procure: damage.primary.value = normal_random( LuaScriptInterface::getNumber<int32_t>(L, -2), LuaScriptInterface::getNumber<int32_t>(L, -1) ); lua_pop(L, 2); } substitua: damage.primary.value = normal_random( LuaScriptInterface::getNumber<int32_t>(L, -2) * ((player->getResets() * mares/100) + 1), LuaScriptInterface::getNumber<int32_t>(L, -1) * ((player->getResets() * mares/100) + 1) ); lua_pop(L, 2); }     WEAPONS.H procure: static int32_t getMaxMeleeDamage(int32_t attackSkill, int32_t attackValue); adicone abaixo: static int32_t getMaxWeaponDamage(uint32_t level, uint32_t resets, int32_t attackSkill, int32_t attackValue, float attackFactor);       WEAPONS.CPP procure: int32_t Weapons::getMaxWeaponDamage(uint32_t level, int32_t attackSkill, int32_t attackValue, float attackFactor) { int meres = g_config.getNumber(ConfigManager::MELEE_RES_DAM); return static_cast<int32_t>(std::ceil((2 * (attackValue * (attackSkill + 5.8) / 25 + (level - 1) / 10.)) / attackFactor)); } substitua: int32_t Weapons::getMaxWeaponDamage(uint32_t level, uint32_t resets, int32_t attackSkill, int32_t attackValue, float attackFactor) { int meres = g_config.getNumber(ConfigManager::MELEE_RES_DAM); return static_cast<int32_t>(std::ceil(((resets * meres/100) + 1) * (2 * (attackValue * (attackSkill + 5.8) / 25 + (level - 1) / 10.)) / attackFactor)); } procure: int32_t maxDamage = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); substitua: int32_t maxDamage = Weapons::getMaxWeaponDamage(player->getLevel(), player->getResets(), attackSkill, attackValue, attackFactor); procure: int32_t maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); substitua: int32_t maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), player->getResets(), attackSkill, attackValue, attackFactor); procure: int32_t maxValue = static_cast<int32_t>(Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor) * player->getVocation()->meleeDamageMultiplier); substitua: int32_t maxValue = static_cast<int32_t>(Weapons::getMaxWeaponDamage(player->getLevel(), player->getResets(), attackSkill, attackValue, attackFactor) * player->getVocation()->meleeDamageMultiplier); procure: int32_t maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); substitua: int32_t maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), player->getResets(), attackSkill, attackValue, attackFactor); procure: int32_t maxValue = static_cast<int32_t>(Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor) * player->getVocation()->distDamageMultiplier); substitua: int32_t maxValue = static_cast<int32_t>(Weapons::getMaxWeaponDamage(player->getLevel(), player->getResets(), attackSkill, attackValue, attackFactor) * player->getVocation()->distDamageMultiplier);     COMFIGMANAGER.CPP procure: integer[RATE_SPAWN] = getGlobalNumber(L, "rateSpawn", 1); adicione abaixo: integer[MELEE_RES_DAM] = getGlobalNumber(L, "MeleeDamResMult", 10); integer[MAGIC_RES_DAM] = getGlobalNumber(L, "MagicDamResMult", 10);     CONFIGMANAGER.H procure: RATE_SPAWN, adicione baixo: MELEE_RES_DAM, MAGIC_RES_DAM,     LUASCRIPT.CPP procure: registerEnumIn("configKeys", ConfigManager::RATE_SPAWN) adicione abaixo: registerEnumIn("configKeys", ConfigManager::MELEE_RES_DAM) registerEnumIn("configKeys", ConfigManager::MAGIC_RES_DAM)  
     
     
    Depois adicione no config.lua do seu servidor:
    -- Reset -- NOTE: % of damage for reset MeleeDamResMult = 100 MagicDamResMult = 100 Dessa forma cada resete o dano do player vai aumentar 100% em hit e 100% em magia.
  9. Gostei
    Kemix recebeu reputação de vankk em Aumento de damage por resete   
    Script usado em conjunto com: Sistema de resete     COMBAT.CPP procure: int size0 = lua_gettop(L); adicionar abaixo: int mares = g_config.getNumber(ConfigManager::MAGIC_RES_DAM); procure: damage.primary.value = normal_random( LuaScriptInterface::getNumber<int32_t>(L, -2), LuaScriptInterface::getNumber<int32_t>(L, -1) ); lua_pop(L, 2); } substitua: damage.primary.value = normal_random( LuaScriptInterface::getNumber<int32_t>(L, -2) * ((player->getResets() * mares/100) + 1), LuaScriptInterface::getNumber<int32_t>(L, -1) * ((player->getResets() * mares/100) + 1) ); lua_pop(L, 2); }     WEAPONS.H procure: static int32_t getMaxMeleeDamage(int32_t attackSkill, int32_t attackValue); adicone abaixo: static int32_t getMaxWeaponDamage(uint32_t level, uint32_t resets, int32_t attackSkill, int32_t attackValue, float attackFactor);       WEAPONS.CPP procure: int32_t Weapons::getMaxWeaponDamage(uint32_t level, int32_t attackSkill, int32_t attackValue, float attackFactor) { int meres = g_config.getNumber(ConfigManager::MELEE_RES_DAM); return static_cast<int32_t>(std::ceil((2 * (attackValue * (attackSkill + 5.8) / 25 + (level - 1) / 10.)) / attackFactor)); } substitua: int32_t Weapons::getMaxWeaponDamage(uint32_t level, uint32_t resets, int32_t attackSkill, int32_t attackValue, float attackFactor) { int meres = g_config.getNumber(ConfigManager::MELEE_RES_DAM); return static_cast<int32_t>(std::ceil(((resets * meres/100) + 1) * (2 * (attackValue * (attackSkill + 5.8) / 25 + (level - 1) / 10.)) / attackFactor)); } procure: int32_t maxDamage = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); substitua: int32_t maxDamage = Weapons::getMaxWeaponDamage(player->getLevel(), player->getResets(), attackSkill, attackValue, attackFactor); procure: int32_t maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); substitua: int32_t maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), player->getResets(), attackSkill, attackValue, attackFactor); procure: int32_t maxValue = static_cast<int32_t>(Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor) * player->getVocation()->meleeDamageMultiplier); substitua: int32_t maxValue = static_cast<int32_t>(Weapons::getMaxWeaponDamage(player->getLevel(), player->getResets(), attackSkill, attackValue, attackFactor) * player->getVocation()->meleeDamageMultiplier); procure: int32_t maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); substitua: int32_t maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), player->getResets(), attackSkill, attackValue, attackFactor); procure: int32_t maxValue = static_cast<int32_t>(Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor) * player->getVocation()->distDamageMultiplier); substitua: int32_t maxValue = static_cast<int32_t>(Weapons::getMaxWeaponDamage(player->getLevel(), player->getResets(), attackSkill, attackValue, attackFactor) * player->getVocation()->distDamageMultiplier);     COMFIGMANAGER.CPP procure: integer[RATE_SPAWN] = getGlobalNumber(L, "rateSpawn", 1); adicione abaixo: integer[MELEE_RES_DAM] = getGlobalNumber(L, "MeleeDamResMult", 10); integer[MAGIC_RES_DAM] = getGlobalNumber(L, "MagicDamResMult", 10);     CONFIGMANAGER.H procure: RATE_SPAWN, adicione baixo: MELEE_RES_DAM, MAGIC_RES_DAM,     LUASCRIPT.CPP procure: registerEnumIn("configKeys", ConfigManager::RATE_SPAWN) adicione abaixo: registerEnumIn("configKeys", ConfigManager::MELEE_RES_DAM) registerEnumIn("configKeys", ConfigManager::MAGIC_RES_DAM)  
     
     
    Depois adicione no config.lua do seu servidor:
    -- Reset -- NOTE: % of damage for reset MeleeDamResMult = 100 MagicDamResMult = 100 Dessa forma cada resete o dano do player vai aumentar 100% em hit e 100% em magia.
  10. Gostei
    Kemix deu reputação a Fir3element em Sistema de Resete   
    corrige essa parte ae:
     
    registerMethod("Player", "getLevel", LuaScriptInterface::luaPlayerGetResets); registerMethod("Player", "getLevel", LuaScriptInterface::luaPlayerSetResets);  
    acho q o certo é isso:
    registerMethod("Player", "getResets", LuaScriptInterface::luaPlayerGetResets); registerMethod("Player", "setResets", LuaScriptInterface::luaPlayerSetResets);
  11. Gostei
    Kemix recebeu reputação de vankk em NPC para Reset   
    Npc para o sistema de reset:
    http://www.tibiaking.com/forum/topic/65646-sistema-de-resete/#comment-374457
     
     
    data/npc/reseter.XML:
    <?xml version="1.0" encoding="UTF-8"?> <npc name="Reseter" script="reseter.lua">     <health now="1000" max="1000"/>     <look type="133" head="95" body="86" legs="86" feet="38" addons="3"/>         <parameters>             <parameter key="message_greet" value="Hello |PLAYERNAME|.I've been waiting for you to come.. Say 'reset' or 'quantity'" />             <parameter key="message_farewell" value="Cya folk." />             <parameter key="message_walkaway" value="How Rude!" />         </parameters> </npc>   
    data/npc/scripts/reseter.lua:
    local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 player = Player(cid) config = { minlevel = 150, --- Level inical para resetar price = 10000, --- Preço inicial para resetar newlevel = 20, --- Level após reset priceByReset = 0, --- Preço acrescentado por reset percent = 10, ---- Porcentagem da vida/mana que você terá ao resetar (em relação à sua antiga vida total) maxresets = 50, ---- Maximo de resets levelbyreset = 0 --- Quanto de level vai precisar a mais no próximo reset } function addReset(cid) player = Player(cid) resets = getResets(cid) hp = player:getMaxHealth() resethp = hp*(config.percent/100) player:setMaxHealth(resethp) mana = player:getMaxMana() resetmana = mana*(config.percent/100) player:setMaxMana(resetmana) playerid = player:getGuid()     player:remove() db.query("UPDATE `players` SET `resets`="..resets.. + 1",`experience`= 0 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 npcHandler:say('You want to reset your character? It will cost '..newPrice..' gp\'s!', cid) npcHandler.topic[cid] = 1 else npcHandler:say('You already reached the maximum reset level!', cid) end elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 1 then if player:getLevel() > newminlevel then if player:removeMoney(newPrice) then addEvent(function() if isPlayer(cid) then addReset(cid) end end, 3000) local number = getResets(cid)+1 local msg ="---[Reset: "..number.."]-- You have reseted!  You'll be disconnected in 3 seconds." player:popupFYI(msg)  npcHandler.topic[cid] = 0 npcHandler:releaseFocus(cid) else npcHandler:say('Its necessary to have at least '..newPrice..' gp\'s for reseting!', cid) npcHandler.topic[cid] = 0 end else npcHandler:say('The minimum level for reseting is '..newminlevel..'!', cid) npcHandler.topic[cid] = 0 end elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then npcHandler.topic[cid] = 0 npcHandler:releaseFocus(cid) npcHandler:say('Ok.', cid) elseif msgcontains(msg, 'quantity') then npcHandler:say('You have a total of '..getResets(cid)..' reset(s).', cid) npcHandler.topic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())   
    Para configurar mexa nessa parte do npc:
    config = { minlevel = 150, --- Level inical para resetar price = 10000, --- Preço inicial para resetar newlevel = 20, --- Level após reset priceByReset = 0, --- Preço acrescentado por reset percent = 10, ---- Porcentagem da vida/mana que você terá ao resetar (em relação à sua antiga vida total) maxresets = 50, ---- Maximo de resets levelbyreset = 0 --- Quanto de level vai precisar a mais no próximo reset } Créditos: Flavio S
  12. Gostei
    Kemix recebeu reputação de vankk em Sistema de Resete   
    MySQL:
    ALTER TABLE `players` ADD `resets` INT(11) NOT NULL DEFAULT "0";  
     
    Sources:
     
    player.h
     
    Procure por:
    uint32_t level; Adicione abaixo:
    uint32_t resets;  
     
    iologindata.cpp
     
    Procure por:
    bool IOLoginData::loadPlayerById(Player* player, uint32_t id) Substitua a parte que tenha querry por:
    query << "SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `resets`, `maglevel`, `health`, `healthmax`, `blessings`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `conditions`, `skulltime`, `skull`, `town_id`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries` FROM `players` WHERE `id` = " << id; Procure por:
    bool IOLoginData::loadPlayerByName(Player* player, const std::string& name) Substitua a parte que tenha querry por:
    query << "SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `resets`, `maglevel`, `health`, `healthmax`, `blessings`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `conditions`, `skulltime`, `skull`, `town_id`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries` FROM `players` WHERE `name` = " << db->escapeString(name); Procure por:
    player->level = std::max<uint32_t>(1, result->getNumber<uint32_t>("level")); Adicione abaixo:
    player->resets = result->getNumber<uint32_t>("resets"); Procure por:
    query << "`level` = " << player->level << ','; Adicione abaixo:
    query << "`resets` = " << player->resets << ", ";  
     
    player.cpp
     
    procure por:
    s << " (Level " << level << ")"; Substitua por:
    s << " You are " << vocation->getVocDescription() << ". [Resets " << resets << "]";  
     
    player.h
     
    procure por:
    uint32_t level; Abaixo adicione:
    uint32_t resets; procure por:
    uint32_t getLevel() const { return level; } Adicione abaixo:
    uint32_t getResets() const { return resets; } void setResets(int32_t amount) { resets += amount; if (resets < 0) { resets = 0; } }  
     
    luascript.cpp
     
    Procure por:
    registerMethod("Player", "getLevel", LuaScriptInterface::luaPlayerGetLevel); Abaixo adicione:
    registerMethod("Player", "getResets", LuaScriptInterface::luaPlayerGetResets); registerMethod("Player", "setResets", LuaScriptInterface::luaPlayerSetResets); Procure por:
    int LuaScriptInterface::luaPlayerGetLevel(lua_State* L) { // player:getLevel() Player* player = getUserdata<Player>(L, 1); if (player) { lua_pushnumber(L, player->getLevel()); } else { lua_pushnil(L); } return 1; } Adicione abaixo:
    int LuaScriptInterface::luaPlayerGetResets(lua_State* L) { //getResets(cid) Player* player = getUserdata<Player>(L, 1); if (player) { lua_pushnumber(L, player->getResets()); } else { lua_pushnil(L); } return 1; } int LuaScriptInterface::luaPlayerSetResets(lua_State* L) { //setResets(cid, amount) int32_t amount = getNumber<int32_t>(L, 2); Player* player = getUserdata<Player>(L, 1); if (player) { player->setResets(amount); lua_pushboolean(L, true); } else { lua_pushnil(L); } return 1; }     luascript.h   procure por: static int luaPlayerGetLevel(lua_State* L); Adicione abaixo:
    static int luaPlayerGetResets(lua_State* L); static int luaPlayerSetResets(lua_State* L);  
    - Npc para esse sistema de resete
    - Aumento de damage por esse sistema de reset
  13. Gostei
    Kemix recebeu reputação de BrunoLeo em Correção de script   
    Faça oque zipter98 mandou, mas no modules.lua
    Depois de : 
    Coloque:
    Ficando assim:
     

Informação Importante

Confirmação de Termo