• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Hity

Hakur

New Member
Joined
Feb 12, 2012
Messages
145
Reaction score
1
Witam, mam do was pytanie. Otóż w moim vocations.xml pozmieniałem tak że niekiedy postać ma meleeDamage="25.0" i np mam na tej postaci bron o ataku 6 (najlepszy item ma atak 13) Gdy udeżam training monka na postaci 100 poziomowej mam w niego hity strasznie zróżnicowane.
16:17 You deal 1138 damage to a training monk.
16:17 You deal 226 damage to a training monk.
16:17 You deal 828 damage to a training monk.
16:17 You deal 722damage to a training monk.
16:17 You deal 798 damage to a training monk.
16:17 You deal 78 damage to a training monk.
Chodzi o to że hity pierw niby ok git jest dmg taki jaki miał a co jakiś czas wchodzi taki mały hity jak widać na wyżej wypisanym przykładzie czyli średnie hity to 700-800 a tutaj nagle wchodzi hit za 78 ;/ Wiecie może co zrobić aby hity trzymały się kupy?
 
w configu:

criticalHitChance = 0

jesli nie pomoże to pokombinuj z

weapons.cpp

PHP:
int32_t WeaponMelee::getWeaponDamage(const Player* player, const Creature*, const Item* item, bool maxDamage /*= false*/) const
{
	int32_t attackSkill = player->getWeaponSkill(item), attackValue = std::max((int32_t)0,
		(int32_t(item->getAttack() + item->getExtraAttack()) - elementDamage));
	float attackFactor = player->getAttackFactor();

	double maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor);
	if(random_range(1, 100) < g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE))
	{
		maxValue = std::pow(maxValue, g_config.getDouble(ConfigManager::CRITICAL_HIT_MUL));
		player->sendCritical();
	}

	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);
}
 
Nie chodzi o criticale bo one zwiekszają dmg np z 700 do 1000, chodzi o melee minDamage czy cuś
 
Code:
Vocation* vocation = player->getVocation(); 
    if(vocation && vocation->getMultiplier(MULTIPLIER_MELEE) [B]!= 1.0[/B]) 
        maxValue *= vocation->getMultiplier(MULTIPLIER_MELEE);
 
Code:
Vocation* vocation = player->getVocation(); 
    if(vocation && vocation->getMultiplier(MULTIPLIER_MELEE) [B]!= 1.0[/B]) 
        maxValue *= vocation->getMultiplier(MULTIPLIER_MELEE);

ty zdajesz sobie wgl. sprawę co mu własnie wysłałeś?

linijki, które odpowiadają za pobieranie mnożnika dmg z vocations.xml, tutaj nie o to chodzi


@topic,

czyli tak jak pisałem, pokombinuj z

int32_t WeaponMelee::getWeaponDamage

w weapons.cpp
 
Multiplier z vocations.xml działa wyłącznie na wartość maksymalną ciosu, oznacza to że gdy twoja postać ma zabrać potworki 0-40 obrażeń, a twój multiplier wynosi 20 to będzie zabierać 0-800.


Rozwiązanie (nie sprawdzane):
PHP:
int32_t WeaponMelee::getWeaponDamage(const Player* player, const Creature*, const Item* item, bool maxDamage /*= false*/) const 
{ 
    int32_t attackSkill = player->getWeaponSkill(item), attackValue = std::max((int32_t)0, 
        (int32_t(item->getAttack() + item->getExtraAttack()) - elementDamage)); 
    float attackFactor = player->getAttackFactor(); 

    double maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor); 
    if(random_range(1, 100) < g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE)) 
    { 
        maxValue = std::pow(maxValue, g_config.getDouble(ConfigManager::CRITICAL_HIT_MUL)); 
        player->sendCritical(); 
    } 

    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((int32_t)(ret * 0.6), ret, DISTRO_NORMAL); 
}
 
Back
Top