Alakarsiann wrote:The game sever only queries the character's alignment when the character first logs in and is created.
-Alakar
Right, which causes some side issues.
Anyhow, I've added the following trigger to reduce the impact to alignment penalties.
- Code: Select all
CREATE DEFINER=`root`@`localhost` TRIGGER `character_alignment_fix` BEFORE UPDATE ON `character` FOR EACH ROW BEGIN
set @diff = ABS(new.Alignment) - ABS(old.Alignment);
IF (new.Alignment < old.Alignment) then
IF (@diff < 10000000) then
set new.Alignment = old.Alignment;
ELSE
set new.Alignment = new.Alignment + (@diff/2) ;
END IF;
END IF;
END
This makes alignment hits for knock out, looting, trespassing, and initial attacks not apply an alignment penalty in the database. You will still have it in game, until you log out and back in.
In addition, praying will not raise your alignment until both client and database are back in sync. Death will apply the penalty as it exists in the client at the moment death occurs.