Postado Março 8, 2015 10 anos Este é um post popular. Ola, atualmente a variação de dano é enorme e não importa qual arma você usa e quanto de skill você tem, na formula o dano minimo é sempre 0. Então vou mostrar pra vocês onde pode ser editado para resolver esse problema • Versão - Otx 2(final) -- Baseado na Tfs 0.3.7 • Em weapons.ccp procure por: bool Weapon::useFist(Player* player, Creature* target) { const Position& playerPos = player->getPosition(); const Position& targetPos = target->getPosition(); if(!Position::areInRange<1,1>(playerPos, targetPos)) return false; float attackFactor = player->getAttackFactor(); int32_t attackSkill = player->getSkill(SKILL_FIST, SKILL_LEVEL), attackValue = g_config.getNumber(ConfigManager::FIST_BASE_ATTACK); double maxDamage = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); if (g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE) + player->getCriticalHitChance() >= random_range(1, 100)) { maxDamage = (maxDamage + ((g_config.getNumber(ConfigManager::CRITICAL_DAMAGE) + player->getCriticalDamage())/100) * maxDamage); g_game.addAnimatedText(playerPos, COLOR_DARKRED, "CRITICAL!"); } Vocation* vocation = player->getVocation(); if(vocation && vocation->getMultiplier(MULTIPLIER_MELEE) != 1.0) maxDamage *= vocation->getMultiplier(MULTIPLIER_MELEE); maxDamage = std::floor(maxDamage); int32_t damage = -random_range(0, (int32_t)maxDamage, DISTRO_NORMAL); CombatParams fist; fist.blockedByArmor = true; fist.blockedByShield = true; fist.combatType = COMBAT_PHYSICALDAMAGE; Combat::doCombatHealth(player, target, damage, damage, fist); if(!player->hasFlag(PlayerFlag_NotGainSkill) && player->getAddAttackSkill()) player->addSkillAdvance(SKILL_FIST, 1); return true; } Nessa parte: int32_t damage = -random_range(0, (int32_t)maxDamage, DISTRO_NORMAL); Troque por: int32_t damage = -random_range((int32_t)maxDamage/2, (int32_t)maxDamage, DISTRO_NORMAL); Sendo assim o dano de fist tera uma variedade de danomaximo/2 a danomaximo • Agora para editar o dano de arma, procure: int32_t WeaponMelee::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const { const Position& playerPos = player->getPosition(); const Position& targetPos = target->getPosition(); int32_t attackSkill = player->getWeaponSkill(item), attackValue = std::max((int32_t)0, (int32_t(item->getAttack() + item->getExtraAttack()) - item->getElementDamage())); float attackFactor = player->getAttackFactor(); double maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); if (g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE) + player->getCriticalHitChance() >= random_range(1, 100)) { maxValue = (maxValue + ((g_config.getNumber(ConfigManager::CRITICAL_DAMAGE) + player->getCriticalDamage()) / 100) * maxValue); g_game.addAnimatedText(playerPos, COLOR_DARKRED, "CRITICAL!"); } Vocation* vocation = player->getVocation(); if(vocation && vocation->getMultiplier(MULTIPLIER_MELEE) != 1.0) maxValue *= vocation->getMultiplier(MULTIPLIER_MELEE); int32_t ret = (int32_t)std::floor(maxValue); if(maxDamage) return -ret; return -random_range(0, ret, DISTRO_NORMAL); } Nessa parte: return -random_range(0, ret, DISTRO_NORMAL); Troque por: return -random_range(ret/2, ret, DISTRO_NORMAL); Sendo assim o dano de (sword,axe e club) terá uma variedade de danomaximo/2 a danomaximo • Agora dano de arma elemental, procure: int32_t WeaponMelee::getWeaponElementDamage(const Player* player, const Item* item, bool maxDamage/* = false*/) const { int32_t attackSkill = player->getWeaponSkill(item), attackValue = item->getElementDamage(); float attackFactor = player->getAttackFactor(); double maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); Vocation* vocation = player->getVocation(); if(vocation && vocation->getMultiplier(MULTIPLIER_MELEE) != 1.0) maxValue *= vocation->getMultiplier(MULTIPLIER_MELEE); int32_t ret = (int32_t)std::floor(maxValue); if(maxDamage) return -ret; return -random_range(0, ret, DISTRO_NORMAL); } Nessa parte: return -random_range(0, ret, DISTRO_NORMAL); Troque por: return -random_range(ret/2, ret, DISTRO_NORMAL); Sendo assim o dano elemental de (sword,axe e club) terá uma variedade de danomaximo/2 a danomaximo • Agora distance, procure: int32_t WeaponDistance::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const { const Position& playerPos = player->getPosition(); const Position& targetPos = target->getPosition(); int32_t attackValue = attack; if(item->getWeaponType() == WEAPON_AMMO) { if(Item* bow = const_cast<Player*>(player)->getWeapon(true)) attackValue += bow->getAttack() + bow->getExtraAttack(); } int32_t attackSkill = player->getSkill(SKILL_DIST, SKILL_LEVEL); float attackFactor = player->getAttackFactor(); double maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); if (g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE) + player->getCriticalHitChance() >= random_range(1, 100)) { maxValue *= (maxValue + ((g_config.getNumber(ConfigManager::CRITICAL_DAMAGE) + player->getCriticalDamage())/100) * maxValue); g_game.addAnimatedText(playerPos, COLOR_DARKRED, "CRITICAL!"); } Vocation* vocation = player->getVocation(); if(vocation && vocation->getMultiplier(MULTIPLIER_DISTANCE) != 1.0) maxValue *= vocation->getMultiplier(MULTIPLIER_DISTANCE); int32_t ret = (int32_t)std::floor(maxValue); if(maxDamage) return -ret; int32_t minValue = 0; if(target) { if(target->getPlayer()) minValue = (int32_t)std::ceil(player->getLevel() * 0.1); else minValue = (int32_t)std::ceil(player->getLevel() * 0.2); } return -random_range(minValue, ret, DISTRO_NORMAL); } É essa parte q faz o dano minimo: if(target) { if(target->getPlayer()) minValue = (int32_t)std::ceil(player->getLevel() * 0.1); -----aqui é o dano minimo em players(o seu level x 0.1) else minValue = (int32_t)std::ceil(player->getLevel() * 0.2); -----aqui é o dano minimo em monstros(o seu level x 0.2) } Bom é só espero ter ajudado =) Qualquer duvida post ai q eu tento ajudar Meu primeiro tópico então não deve estar bom =X Editado Março 9, 2015 10 anos por rohfagundes (veja o histórico de edições)
Postado Março 9, 2015 10 anos Tópico aprovado, dei uma formata melhor dele. Obrigado por compartilhar. Este tópico foi movido: Para: "OTServ → Programação Open Tibia → Códigos Prontos" STYLLER OT 2022
Postado Março 9, 2015 10 anos Autor Tópico aprovado, dei uma formata melhor dele. Obrigado por compartilhar. Este tópico foi movido: Para: "OTServ → Programação Open Tibia → Códigos Prontos" opa vlw =) fiz um edit no topico para mostrar a versao q usei
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.