Forum > Serverside Modding

[SOLVED] [Trinity 3.3.5] Static Weapon Skills

(1/1)

Degen:
Searched all over and couldn't find any info on this.

I'm trying to change a character's weapon skill (Let's say One-handed Swords) to be 1 out of 500 at level 1, and not have the cap increase by 5 every time they level up. Does anyone have an idea on how to do this?

Edit: I think I found what I'm looking for in the player.cpp, but the c++ is gibberish to me and I can't figure out how to change what I want to change. If anyone knows their way around all these global variables, I'd love some insight.

Another edit: I finally solved this after much trial and error. Tried my best to describe it below but there are probably things I've overlooked so don't take this as a tutorial.



Max weapon skill is defined in Unit.h, I set it to 1000 instead of 5 * player level.

--- Code: ---uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }

--- End code ---
to...

--- Code: ---uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return 1000; }

--- End code ---


Player.cpp also needs to be edited where "5 * plevel" is hardcoded in.

--- Code: ---uint32 skilldif = 5 * plevel - (defence ? GetBaseDefenseSkillValue() : GetBaseWeaponSkillValue(attType));

--- End code ---
to...

--- Code: ---uint32 skilldif = 1000 - (defence ? GetBaseDefenseSkillValue() : GetBaseWeaponSkillValue(attType));

--- End code ---

The skilldif variable in this calculation will now round down from 1000 instead of 5. Edit it accordingly.

--- Code: ---float chance = float(3 * lvldif * skilldif) / plevel;

--- End code ---

Being constantly far away from weapon skill cap means combat will be mostly misses. I myself solved this by removing miss chance completely, but there are probably better ways..

Navigation

[0] Message Index

Go to full version