Davood
01-27-2008, 05:14 PM
If you have merchants with prices over 35k or so it breaks them and they will buy things at much higher than they will sell at...
to fix this, I opened clientprocess.cpp and clientpacket.cpp
and replaced every instance of
127/100
with
1.27
Also I had to replace the one instance of 0.884 to 0.9 for the buyback, because with 0.884 it was making the merchants pay too much for equipment.. something to do with too many decimal points in the calculation.. im sure there is a more elegant solution to this, maybe increasing the variable widths ?
This allowed my merchants to sell things for 100s of thousands of plat and buy back at the proper (lower) value.
------------------
another thing I noticed in attack.cpp
the way slay undead damage is calculated is wrong, it isnt x1 more damage, its x16, so I changed the values in the case statement to look like this :
if(defender && defender->GetBodyType() == BT_Undead || defender->GetBodyType() == BT_SummonedUndead || defender->GetBodyType() == BT_Vampire){
switch(GetAA(aaSlayUndead)){
case 1:
critMod += 533;
break;
case 2:
critMod += 1066;
break;
case 3:
critMod += 1600;
break;
}
}
i'm slowly reading and tweaking the source code.. anything else I notice that isn't on par with live i'll report...
i'm currently investigating how all the battle coding works, and I will report on that as I re-align the algorithms with how live works.
to fix this, I opened clientprocess.cpp and clientpacket.cpp
and replaced every instance of
127/100
with
1.27
Also I had to replace the one instance of 0.884 to 0.9 for the buyback, because with 0.884 it was making the merchants pay too much for equipment.. something to do with too many decimal points in the calculation.. im sure there is a more elegant solution to this, maybe increasing the variable widths ?
This allowed my merchants to sell things for 100s of thousands of plat and buy back at the proper (lower) value.
------------------
another thing I noticed in attack.cpp
the way slay undead damage is calculated is wrong, it isnt x1 more damage, its x16, so I changed the values in the case statement to look like this :
if(defender && defender->GetBodyType() == BT_Undead || defender->GetBodyType() == BT_SummonedUndead || defender->GetBodyType() == BT_Vampire){
switch(GetAA(aaSlayUndead)){
case 1:
critMod += 533;
break;
case 2:
critMod += 1066;
break;
case 3:
critMod += 1600;
break;
}
}
i'm slowly reading and tweaking the source code.. anything else I notice that isn't on par with live i'll report...
i'm currently investigating how all the battle coding works, and I will report on that as I re-align the algorithms with how live works.