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

Feature Edit player attack speed

Joined
Apr 17, 2008
Messages
1,922
Solutions
1
Reaction score
188
Location
Venezuela
Hello, i'm learning to compile so i've scripted a feature that change the player attack speed

Let's start :p!

player.cpp
Find:
Code:
return vocation->getAttackSpeed()
Replace with this:
Code:
return vocation->getAttackSpeed() - g_config.getNumber(ConfigManager::EXTRA_ATTACK_SPEED);

configmanager.cpp
Find:
Code:
	m_confDouble[RATE_PVP_EXPERIENCE] = getGlobalDouble("rateExperienceFromPlayers", 0);
After it, paste this:
Code:
	m_confNumber[EXTRA_ATTACK_SPEED] = getGlobalNumber("attackSpeed", 0);

configmanager.h
Find this:
Code:
NAME_REPORT_TYPE,
After it, paste this:
Code:
EXTRA_ATTACK_SPEED,

Now save and compile, then go to config.lua and paste this
Code:
attackSpeed = 0

Default = 0, Biggest value, biggest speed

Bugs:
If you set a very high speed, then the player will not attack.
 
Awesome, I like this.

While you're at it, do you think you could make a function such as:

setPlayerExtraAttackSpeed(cid, 200)

For instance, this would minus(-) 200 ms from the players attack speed. This would help a lot of people out, I'm positive.

++Rep
 
Good way to learn how to compile but, why would someone need to lower attack speed? At least make it possible to choose wether you want to increase it or decrease it. Anyway, good work :)
 
Good way to learn how to compile but, why would someone need to lower attack speed? At least make it possible to choose wether you want to increase it or decrease it. Anyway, good work :)

Negative = faster.
The smaller the number of attackspeed is, the faster you attack.
Also; if it automatically adds a negative amount [makes it faster], you would only need to make it -200, and it would make the attack slower.

Oh, also, ontopic, good job, I suppose.
It would make some people's job way shorter.

Good job. :p
 
While you're at it, do you think you could make a function such as:

setPlayerExtraAttackSpeed(cid, 200)

For instance, this would minus(-) 200 ms from the players attack speed. This would help a lot of people out, I'm positive.

++Rep

Agreed!

But still good work as always, dark :)
 
Last edited:
if you skill get higher you attack speed get higher and that you need to use a X kind of weapons :)
 
i got problem! i have done everything as he wrote but it dosnt work for me! i use 0.3.6pl1 !!! When i stand in place it shots slowly but when i move up and down it shots more faster! WHY?
 
i did all this steps but still atk the same as before !! any help please
i use cryingdamson 0.3.6 (8.60) V8.2 Source .
and i want to make all vocations didn't loss any thing when they die except one vocation i am trying to make new version of madness data in 8.6 if you know it .
please help fast sorry i am still new at scripting and compiling but i need it and i still miss some things to do .
 
Back
Top