Hello OTLand.
I've modified OpenTibia mount system to add attackSpeed in mounts.xml
Eemple about it work, if you have in vocations.xml attackspeed="2000" and in mounts.xml you have attackspeed="1900", the attack speed of player is now 100. It's a simple interval. This code I made to OpenTibia SVN Servers, tested on Rev 5948
Let start code
In creature.cpp after
Add this
After
Add this
In creature.h after
Add this
After
Add this
In mount.cpp after
Add this
In mount.h replace it
For this
After this
Add this
In player.cpp in function uint32_t Player::getAttackSpeed() const replace it
For this
Compile, and rebuild all
Don't forget to add attackspeed="0" in your mounts.xml
Crédits: Me (Tryller)
I've modified OpenTibia mount system to add attackSpeed in mounts.xml
Eemple about it work, if you have in vocations.xml attackspeed="2000" and in mounts.xml you have attackspeed="1900", the attack speed of player is now 100. It's a simple interval. This code I made to OpenTibia SVN Servers, tested on Rev 5948
Let start code
In creature.cpp after
PHP:
mountSpeed = 0;
Add this
PHP:
mountAttackSpeed = 0;
After
PHP:
mountSpeed = mount.speed;
Add this
PHP:
mountAttackSpeed = mount.attackSpeed;
In creature.h after
PHP:
const int32_t getMountSpeed() const {return (ridingMount ? mountSpeed : 0);}
Add this
PHP:
const int32_t getMountAttackSpeed() const {return (ridingMount ? mountAttackSpeed : 0);}
After
PHP:
int32_t mountSpeed;
Add this
PHP:
int32_t mountAttackSpeed;
In mount.cpp after
PHP:
if(readXMLInteger(p, "speed", intValue)){
mount.speed = intValue;
}
Add this
PHP:
if(readXMLInteger(p, "attackspeed", intValue)){
mount.attackSpeed = intValue;
}
In mount.h replace it
PHP:
Mount() : mountId(0), lookType(0), speed(0), isPremium(false), isDefault(false), name("") {}
For this
PHP:
Mount() : mountId(0), lookType(0), speed(0), attackSpeed(0), isPremium(false), isDefault(false), name("") {}
After this
PHP:
uint32_t speed;
Add this
PHP:
uint32_t attackSpeed;
In player.cpp in function uint32_t Player::getAttackSpeed() const replace it
PHP:
return vocation->getAttackSpeed();
For this
PHP:
return vocation->getAttackSpeed() - getPlayer()->getMountAttackSpeed();
Compile, and rebuild all
Don't forget to add attackspeed="0" in your mounts.xml
Crédits: Me (Tryller)
Last edited: