No skill loss if alignment in the + ?

Place for sharing your game modifications for Life is Feudal: Your Own

Remystemple
 
Posts: 80
Joined: 15 Jan 2015, 22:30

No skill loss if alignment in the + ?

Post by Remystemple » 01 Feb 2015, 18:19

hey guys. thanks for all the help so far. my server is running amazingly. another thing i'm trying to do is set it up so that if you have a pos alignment you get no skill loss on death. is this doable?
i'd like "good" players to be rewarded.


SKuDD3r
 
Posts: 15
Joined: 01 Feb 2015, 19:41

Re: No skill loss if alignment in the + ?

Post by SKuDD3r » 01 Feb 2015, 19:42

Do some digging, its not very hard to find.


Remystemple
 
Posts: 80
Joined: 15 Jan 2015, 22:30

Re: No skill loss if alignment in the + ?

Post by Remystemple » 01 Feb 2015, 20:07

will do.

thanks.


SKuDD3r
 
Posts: 15
Joined: 01 Feb 2015, 19:41

Re: No skill loss if alignment in the + ?

Post by SKuDD3r » 05 Feb 2015, 23:01

Create a trigger, do something like this on update. Untested, but should be the correct way to hook into the alignment modification, just make sure you use insert/update

BEGIN
IF OLD.Alignment > '1' THEN
SET NEW.Alignment = OLD.Alignment-1;
END IF;
END


RudgerWolvram
 
Posts: 37
Joined: 01 Jan 2015, 22:27

Re: No skill loss if alignment in the + ?

Post by RudgerWolvram » 06 Feb 2015, 00:43

It's "possible" and SKuDD3r is on the right track, however you were asking about skill lose, not alignment loss.

The problem with setting character attributes, like skills, while the character is logged in is the server process keeps those in memory.
For example, I have character X, they have 20 skill in forestry. I manually set their skill in the DB while they are logged in to 60. They go and pick a branch or plant a tree, now their skill in forestry is 20.563.

So in order for it to work, once the character died, you could trigger on the skill table update and check the char_death log table for recent death (within 10 seconds) of the Time column. Then check the characters alignment to see if it's positive. You could also do a multiplier. say their skill is between 0 and 15, then multiply the skill loss by .5 to reduce the loss by half, if 16-30, then .25 to reduce by 75%, etc.

Anyway, once the trigger modifies the skill values, the player will need to not do anything with those skills and re-log in order for them to take effect.

So yes, it's possible, just requires the players to do something.

Also, in the midst of battles, it won't be that effective. If they lose skill in 1h swords, and they run back, re-equip and jump back into the fight and hit someone with a sword, the server will undo what the trigger is attempting since they didn't re-log.


SKuDD3r
 
Posts: 15
Joined: 01 Feb 2015, 19:41

Re: No skill loss if alignment in the + ?

Post by SKuDD3r » 06 Feb 2015, 03:17

Server trumps client, while the visual indication on the client will not appear correct until a relog or other method of forcing memory update technically it should not matter.

The game does client -> check server -> discrepancy -> server set. Unfortunately it does not backtrack from server -> client.

I ran a few tests on this with my herb stacking mod and it works fine. I made all herbs picked 100% quality so they would auto stack on new inventory creation, while the client displays the old quality because there is not update method, the quality is 100% and the herbs stack properly.

I've been trying to figure out how to hook into the gm stat skill set command, as that does update the client and database at the same time.

Return to Game mods

cron