drakylucas
Intermediate OT User
- Joined
- Dec 15, 2015
- Messages
- 236
- Solutions
- 7
- Reaction score
- 122
Hello everyone.
I made this system based on a server that I've played called "Ruthless Chaos".
How does it works?
You will configure the maximum level (e.g. 300) and, after the player reachs the maximum level, every time that he advances again, he will return to the maximum level and the passive damage will be increased in 1%, but the exp-rate of that player will be reduced. The greater the passive damage, the lower the experience rate. (so it'll be very hard to reach high values).
It works on the lastest TFS (1.2, 1.3, etc) from the original fork on github.
Installation:
I'll do every step using the website "diff", so you can see what I've changed. I think this way is easier to you find the correct place to add these things.
Sources:
File: combat.cpp
place: CombatDamage Combat::getCombatDamage(Creature* creature, Creature* target) const
click here to see the difference
File: configmanager.cpp
place: bool ConfigManager::load()
click here to see the difference
File: configmanager.h
place: enum integer_config_t {
click here to see the difference
File: iologindata.cpp
place: bool IOLoginData::loadPlayerById(Player* player, uint32_t id)
click here to see the difference
File: iologindata.cpp (same file)
place: bool IOLoginData::loadPlayerByName(Player* player, const std::string& name)
click here to see the difference
File: iologindata.cpp (same file)
place: bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)
click here to see the difference
File: iologindata.cpp (same file)
place: bool IOLoginData::savePlayer(Player* player)
click here to see the difference
File: luascript.cpp
place: near all "registerEnumIn"
click here to see the difference
File: luascript.cpp (same file)
place: near all registerMethod
click here to see the difference
File: luascript.cpp (same file)
place: after the function int LuaScriptInterface::luaPlayerSetStamina(lua_State* L)
click here to see the difference
File: luascript.h
place: after static int luaPlayerSetStamina(lua_State* L);
click here to see the difference
File: player.cpp
place: std::string Player::getDescription(int32_t lookDistance) const
click here to see the difference
File: player.cpp (same file)
place: void Player::addExperience(Creature* source, uint64_t exp, bool sendText/* = false*/)
click here to see the difference
File: player.cpp (same file)
place: void Player::removeExperience(uint64_t exp, bool sendText/* = false*/)
click here to see the difference
File: player.cpp (same file)
place: void Player::death(Creature* lastHitCreature)
click here to see the difference
File: player.h
place: near uint8_t getMagicLevelPercent() const {
click here to see the difference
File: player.h
place: near uint8_t magLevelPercent = 0;
click here to see the difference
File: weapons.cpp
place: int32_t Weapons::getMaxWeaponDamage(uint32_t level, int32_t attackSkill, int32_t attackValue, float attackFactor)
click here to see the difference
File: weapons.cpp (same file)
place: bool Weapon::useFist(Player* player, Creature* target)
click here to see the difference
File: weapons.cpp (same file)
place: int32_t WeaponMelee::getElementDamage(const Player* player, const Creature*, const Item* item) const
click here to see the difference
File: weapons.cpp (same file)
place: int32_t WeaponMelee::getWeaponDamage(const Player* player, const Creature*, const Item* item, bool maxDamage /*= false*/) const
click here to see the difference
File: weapons.cpp (same file)
place: int32_t WeaponDistance::getElementDamage(const Player* player, const Creature* target, const Item* item) const --> note: method with the same name as above, but with an additional parameter "target"
click here to see the difference
File: weapons.cpp (same file)
place: int32_t WeaponDistance::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const
click here to see the difference
File: weapons.h
place: static int32_t getMaxWeaponDamage(uint32_t level, int32_t attackSkill, int32_t attackValue, float attackFactor);
click here to see the difference
Server folder:
File: data/events/scripts/player.lua
place: function PlayernGainExperience(source, exp, rawExp)
click here to see the difference
note: you can edit the formula here (or let it without change anything)
File: config.lua
place: anywhere
click here to see the difference
Database:
(during the creation of the server, you can change this on the schemas.sql)
click here to see the difference
If the server already exists (but, the player levels aren't on the maximum level yet), you can use this sql command:
(or you can simply use any software to edit your database and add the "passivedamagebonus" as an integer after the level)
I think that's it.
If I forgot anything, please ask me and I'll fix ASAP.
If you implement this on your server, please let some screenshots in this topic aswell xD.
I'll try to post some screenshots soon.
I do not authorize anyone to share this in other forums. If you want to share, share the OTLand link, and not the content of the post.
I made this system based on a server that I've played called "Ruthless Chaos".
How does it works?
You will configure the maximum level (e.g. 300) and, after the player reachs the maximum level, every time that he advances again, he will return to the maximum level and the passive damage will be increased in 1%, but the exp-rate of that player will be reduced. The greater the passive damage, the lower the experience rate. (so it'll be very hard to reach high values).
It works on the lastest TFS (1.2, 1.3, etc) from the original fork on github.
Installation:
I'll do every step using the website "diff", so you can see what I've changed. I think this way is easier to you find the correct place to add these things.
Sources:
File: combat.cpp
place: CombatDamage Combat::getCombatDamage(Creature* creature, Creature* target) const
click here to see the difference
File: configmanager.cpp
place: bool ConfigManager::load()
click here to see the difference
File: configmanager.h
place: enum integer_config_t {
click here to see the difference
File: iologindata.cpp
place: bool IOLoginData::loadPlayerById(Player* player, uint32_t id)
click here to see the difference
File: iologindata.cpp (same file)
place: bool IOLoginData::loadPlayerByName(Player* player, const std::string& name)
click here to see the difference
File: iologindata.cpp (same file)
place: bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)
click here to see the difference
File: iologindata.cpp (same file)
place: bool IOLoginData::savePlayer(Player* player)
click here to see the difference
File: luascript.cpp
place: near all "registerEnumIn"
click here to see the difference
File: luascript.cpp (same file)
place: near all registerMethod
click here to see the difference
File: luascript.cpp (same file)
place: after the function int LuaScriptInterface::luaPlayerSetStamina(lua_State* L)
click here to see the difference
File: luascript.h
place: after static int luaPlayerSetStamina(lua_State* L);
click here to see the difference
File: player.cpp
place: std::string Player::getDescription(int32_t lookDistance) const
click here to see the difference
File: player.cpp (same file)
place: void Player::addExperience(Creature* source, uint64_t exp, bool sendText/* = false*/)
click here to see the difference
File: player.cpp (same file)
place: void Player::removeExperience(uint64_t exp, bool sendText/* = false*/)
click here to see the difference
File: player.cpp (same file)
place: void Player::death(Creature* lastHitCreature)
click here to see the difference
File: player.h
place: near uint8_t getMagicLevelPercent() const {
click here to see the difference
File: player.h
place: near uint8_t magLevelPercent = 0;
click here to see the difference
File: weapons.cpp
place: int32_t Weapons::getMaxWeaponDamage(uint32_t level, int32_t attackSkill, int32_t attackValue, float attackFactor)
click here to see the difference
File: weapons.cpp (same file)
place: bool Weapon::useFist(Player* player, Creature* target)
click here to see the difference
File: weapons.cpp (same file)
place: int32_t WeaponMelee::getElementDamage(const Player* player, const Creature*, const Item* item) const
click here to see the difference
File: weapons.cpp (same file)
place: int32_t WeaponMelee::getWeaponDamage(const Player* player, const Creature*, const Item* item, bool maxDamage /*= false*/) const
click here to see the difference
File: weapons.cpp (same file)
place: int32_t WeaponDistance::getElementDamage(const Player* player, const Creature* target, const Item* item) const --> note: method with the same name as above, but with an additional parameter "target"
click here to see the difference
File: weapons.cpp (same file)
place: int32_t WeaponDistance::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const
click here to see the difference
File: weapons.h
place: static int32_t getMaxWeaponDamage(uint32_t level, int32_t attackSkill, int32_t attackValue, float attackFactor);
click here to see the difference
Server folder:
File: data/events/scripts/player.lua
place: function PlayernGainExperience(source, exp, rawExp)
click here to see the difference
note: you can edit the formula here (or let it without change anything)
LUA:
exp = exp * (Game.getExperienceStage(self:getLevel()) / (self:getPassiveDamageBonus()+1))
File: config.lua
place: anywhere
click here to see the difference
Database:
(during the creation of the server, you can change this on the schemas.sql)
click here to see the difference
If the server already exists (but, the player levels aren't on the maximum level yet), you can use this sql command:
PHP:
alter table `players` add `passivedamagebonus` int(11) not null default 0 after `level`;
I think that's it.
If I forgot anything, please ask me and I'll fix ASAP.
If you implement this on your server, please let some screenshots in this topic aswell xD.
I'll try to post some screenshots soon.
I do not authorize anyone to share this in other forums. If you want to share, share the OTLand link, and not the content of the post.
Last edited by a moderator: