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

C++ || 3 requests.

breadmaker

New Member
Joined
Jul 16, 2010
Messages
160
Reaction score
3
Hello.

I need some OTserv's codes (C++) on Tibia 8.50 .

First:
The soul regain 1 soul points after kill (random) 2-3 monsters.

Second:
Where I can change player hits in monster and in other player ? I want 50% less hits to players in pvp (from spells and from melee attacks).

Third:
How I can add Critical depends on your soul ? Example:
- If you have 30 soul your critical rate is 10%
- If you have 60 soul your critical rate is 20%
- On 100 soul your critical is 50%.
After done critical, hit on monster is "X%" more than on soulless hit and subtitle - "Critical!"


Fourth
It's possible to add on weapon 20 points faster attacking ?
If vocation have 2000 attack speed the weapon after equip will be 2000-20 = 1980 attack speed.
And in name after Attack and Defense it will be: Speed
Example: Attack: 30 Defense: 15 Speed: 20
 
1. Just some simple onKill:
Code:
function onKill(cid, target, damage, flags)
	if not isPlayer(cid) or not isMonster(target) then
		return true
	end

	if math.random(3) == 1 then
		doPlayerAddSoul(cid, 1)
	end

	return true
end

2. It's in combat.cpp or game.cpp (Server source files).

3. Not sure how does onStatsChange works but maybe you can do through it with modyfing value, if not then you have to edit combat/game.cppin sources.

4. doItemSetAttribute(item.uid, "attackspeed", 1980)
 
Third:
How I can add Critical depends on your soul ? Example:
- If you have 30 soul your critical rate is 10%
- If you have 60 soul your critical rate is 20%
- On 100 soul your critical is 50%.
After done critical, hit on monster is "X%" more than on soulless hit and subtitle - "Critical!"
weapons.cpp:
find
Code:
if(random_range(1, 100) <= g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE))
change for example to:
Code:
if(random_range(1, 100) <= player->getSoul())

Have fun xD
 
Back
Top