Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Changing max stats

Initiate Mage
Joined
May 21, 2022
Messages
2
Reaction score
0
Hello, does anyone know how to limit max stats points per class?

Example, BK have 32767 each attributes, strength, agility, vitality and energy, if we combine it all, it will sum as 131,068.
I want to limit it as 80,000 only not 131,068.

Same like this script but this is not working.

Code:
UPDATE Character
SET LevelUpPoint=0
Where Strenght+Dexterity+Vitality+Energy= 80000
and class = 0

Thank in advance.
 
Newbie Spellweaver
Joined
Sep 8, 2011
Messages
67
Reaction score
252
Hi, I dont normally do Mu but, Ideally, you'd want to limit it through source probs. Not sure how Mu works, but generally the data just gets thrown in to the db while a player is already active and the data doesn't get repulled, so data may end up mismatching from client/server, and db.

The issue with the sql script, it doesn't check >= 80000, so LevelUpPoint won't get set to 0.
 
Upvote 0
Joined
Oct 8, 2006
Messages
740
Reaction score
289
I think you can make a SQL Trigger in your SQL database to be triggered when a special event is occurring or if you have access to the DataServer source code, you can do the UPDATE when the level up event is happening. This way you don't need to always execute the UPDATE query which you are trying to use. Search for SQL Trigger syntax and try to understand how to create one for your database.

It can be something like
Code:
[COLOR=#000000]DROP TRIGGER IF EXISTS check_max_stats;[/COLOR]
[COLOR=#000000]GO[/COLOR]
[COLOR=#000000]CREATE TRIGGER check_max_stats ON [MuOnline].Characters AFTER UPDATE[/COLOR]
[COLOR=#000000]AS BEGIN[/COLOR]
[COLOR=#000000]DECLARE @ AccID INT;[/COLOR]
[COLOR=#000000]DECLARE @ Strength INT;
    DECLARE @ Dexterity INT;
    DECLARE @ Vitality INT;
    DECLARE @ Energy INT;
    DECLARE @ Leadership INT;

    DECLARE @ maxstatPoints INT;
    SET @ maxstatPoints = 80000;

[/COLOR]
[COLOR=#000000]SELECT @AccID= updt.AccountID FROM UPDATE updt;[/COLOR]
[COLOR=#000000]SELECT [/COLOR]@ Strength[COLOR=#000000] = updt.Strength FROM UPDATE updt;
    SELECT [/COLOR]@ Dexterity[COLOR=#000000] = updt.Dexterity FROM UPDATE updt;[/COLOR]
[COLOR=#000000]    SELECT [/COLOR]@ Vitality[COLOR=#000000] = updt.Vitality FROM UPDATE updt;[/COLOR]
[COLOR=#000000]    SELECT [/COLOR]@ Energy[COLOR=#000000] = updt.Energy FROM UPDATE updt;[/COLOR]
[COLOR=#000000]    SELECT [/COLOR]@ Leadership [COLOR=#000000]= updt.Leadership FROM UPDATE updt;
    [/COLOR]
[COLOR=#000000]IF ( [/COLOR]@ Strength [COLOR=#000000]+ [/COLOR]@ Dexterity[COLOR=#000000] + [/COLOR]@ Vitality[COLOR=#000000] + [/COLOR]@ Energy[COLOR=#000000] + [/COLOR]@ Leadership[COLOR=#000000]) > @ maxstatPoints[/COLOR]
[COLOR=#000000]        //DO SOMETHING WHEN SUM IS HIGHER THAN MAXSTATPOINTS
        [/COLOR]
[COLOR=#000000]ELSE[/COLOR]
[COLOR=#000000]THROW51000,'Error: Can not update character',1;[/COLOR]
[COLOR=#000000]END;

[/COLOR]

Sorry for the format. The forum doesn't allow me to use some specific annotations under CODE tag. Delete the space between @ and variable name.
Most importantly is to get the idea from it.
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Jul 13, 2019
Messages
86
Reaction score
37
Hello, does anyone know how to limit max stats points per class?

Example, BK have 32767 each attributes, strength, agility, vitality and energy, if we combine it all, it will sum as 131,068.
I want to limit it as 80,000 only not 131,068.

Same like this script but this is not working.

Code:
UPDATE Character
SET LevelUpPoint=0
Where Strenght+Dexterity+Vitality+Energy= 80000
and class = 0

Thank in advance.

if you are using a muemu server, you can limit the points in the server's configuration, every time the character adds more than the allowed amount, the server will refuse and return the added points.


swBPNe8 - Changing max stats - RaGEZONE Forums

ReaperKID - Changing max stats - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Upvote 0
Joined
Oct 8, 2006
Messages
740
Reaction score
289
It's okay with the config as you've mentioned but only if you want to limit the max number per attribute. He wants a max stats value for overall stats so when he sums up every attribute it won't be greater than the value he needs.

E.g. If you want to have the attribute value sum = 80000, in the config you need 20000 for each. But if you want 40000 str and 20000 agi and 20000 ene? The sum is 80000, but the config won't allow to have a value greater than 20000 for str.
 
Upvote 0
Newbie Spellweaver
Joined
Jul 13, 2019
Messages
86
Reaction score
37
with customizations, I think should be made from source, you can do more things
 
Upvote 0
Back
Top