• 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!

Defense modify

Pawcio6

Member
Joined
Sep 26, 2009
Messages
143
Solutions
4
Reaction score
15
Hi
I want to when you turn fightmode to defense this will multiple taking less dmg by armor too, and when 2 monsters attacks you first dmg is less but second is normal.The second thing is to count defense from weapon and shield becouse it work only on 1 item.Last one is change defense to work when taking all physical dmg not only melee ex. when monster have
<attacks><attack name="physical" interval="1000" chance="1000" range="7" min="-300" max="-500">
<attribute key="shootEffect" value="SMALLHOLY"/>
defense dont work. Sorry for my poor english but i hope some1 undestrand :D 0.3.6 tfs i found some in sources
case FIGHTMODE_DEFENSE:
{
if((OTSYS_TIME() - lastAttack) < const_cast<Player*>(this)->getAttackSpeed()) //attacking will cause us to get into normal defense
return 1.0f;

return 2.0f;
}
tried
case FIGHTMODE_DEFENSE:
return 2.0f;
but it doesnt help
and
return ((int32_t)std::ceil(((float)(defenseSkill * (defenseValue * 0.015)) + (defenseValue * 0.1)) * defenseFactor));
some1 help ? :p
 
I done defense from 2 items and find something like that
if(checkArmor)
{
int32_t armorValue = getArmor(), minArmorReduction = 0,
maxArmorReduction = 0;
if(armorValue > 1)
{
minArmorReduction = (int32_t)std::ceil(armorValue * 0.475);
maxArmorReduction = (int32_t)std::ceil(
((armorValue * 0.475) - 1) + minArmorReduction);
}
else if(armorValue == 1)
{
minArmorReduction = 1;
maxArmorReduction = 1;
}
damage -= random_range(minArmorReduction, maxArmorReduction);
if(damage <= 0)
{
damage = 0;
blockType = BLOCK_ARMOR;
}
}
but dont know how to check fight mode is defense :<
 
Back
Top