[Release] Auto balance Script for Factions

09/01/2011 20:03 HoaX.#1
Hier ein kleines Script um die Spieler auf beiden Seiten auszugleichen.
Vielleicht nicht für jeden zu gebrauchen, aber hilfreich.

UM ist sofort freigeschaltet.

Die Spieler loggen sich einfach ein und können einen Character auf der zugewiesenen Seite erstellen.
Dies kann umgangen werden wenn man auf [Delete] klickt im Character Change Window.


Diesen Teil in die Prozedur dbo.usp_Try_GameLogin_Taiwan einfügen:

Code:
-- ********* SHAIYA ALLIANCE ********* --
-- Auto Team balance
-- By [Dev]HoaX (c)2011 - 2015

DECLARE @enabled bit

-- !- 1 = Enabled / 0 = Disabled -!
SET @ENABLED =	1
-- !------------------------------!


IF (@ENABLED = 1)
BEGIN
DECLARE @Country tinyint, @light int, @fury int, @exist int

SET @UserUID = (SELECT TOP 1 UserUID FROM PS_UserData.dbo.Users_Master WHERE UserID = @UserID)
SET @exist = (SELECT COUNT(UserUID) FROM PS_GameData.dbo.UserMaxGrow WHERE UserUID = @UserUID)

IF (@exist = 0)
BEGIN
	SET @light = (SELECT COUNT(Country) FROM PS_GameData.dbo.UserMaxGrow WHERE Country = 0)
	SET @fury =  (SELECT COUNT(Country) FROM PS_GameData.dbo.UserMaxGrow WHERE Country = 1)
		
	IF (@light <= @fury)
	BEGIN
		SET @Country = 0
	END
	
	IF (@light >= @fury)
	BEGIN
		SET @Country = 1
	END

INSERT INTO PS_GameData.dbo.UserMaxGrow(ServerID, UserUID, Country, MaxGrow, Del)
VALUES(1, @UserUID, @Country, 3, 0)
END
END
-- ************************************** --
09/01/2011 23:12 -III-#2
Not to sound rude or anything, but your posts go back and forth between English and German, which you obviously speak both quite well. May I make a simple request? Pick a language or post with a translation of both.

Again, I understand this is your choice, I just fail to see the point of bouncing back and forth. All it does is cause a person to need a translator for one post, but not another, and then again for the next.

I suppose if this works for only a DE client, it is sensible, but somehow, I doubt that.

Loose translation for everyone else:

"Here is a small script to balance character creation on both factions. It may not be for all, but it is useful, for some. UM is automatically unlocked.

Players simply log in, and create a toon on an automatically chosen faction screen. Players can bypass this by simply choosing the DELETE option once on the screen.

Insert the following changes into usp_Try_GameLogin_Taiwan:"

Code:
-- ********* SHAIYA ALLIANCE ********* --
-- Auto Team balance
-- By [Dev]HoaX (c)2011 - 2015

DECLARE @enabled bit

-- !- 1 = Enabled / 0 = Disabled -!
SET @ENABLED =	1
-- !------------------------------!


IF (@ENABLED = 1)
BEGIN
DECLARE @Country tinyint, @light int, @fury int, @exist int

SET @UserUID = (SELECT TOP 1 UserUID FROM PS_UserData.dbo.Users_Master WHERE UserID = @UserID)
SET @exist = (SELECT COUNT(UserUID) FROM PS_GameData.dbo.UserMaxGrow WHERE UserUID = @UserUID)

IF (@exist = 0)
BEGIN
	SET @light = (SELECT COUNT(Country) FROM PS_GameData.dbo.UserMaxGrow WHERE Country = 0)
	SET @fury =  (SELECT COUNT(Country) FROM PS_GameData.dbo.UserMaxGrow WHERE Country = 1)
		
	IF (@light <= @fury)
	BEGIN
		SET @Country = 0
	END
	
	IF (@light >= @fury)
	BEGIN
		SET @Country = 1
	END

INSERT INTO PS_GameData.dbo.UserMaxGrow(ServerID, UserUID, Country, MaxGrow, Del)
VALUES(1, @UserUID, @Country, 3, 0)
END
END
-- ************************************** --
Credits to the OP.
09/01/2011 23:17 HoaX.#3
Thanks, I will do that next time.
09/07/2011 02:29 -III-#4
I finally got around to testing this out, and figured I would reply back. This does, indeed, work. And it does work quite well.

I am not sure I will use it, as my imbalance in mainly with PvP action, rather than merely fury to light ratio as a whole. 42% UoF and 58% AoL, yet UoF dominates PvP. Closing the percentage gap would only increase UoF's dominance. Anyway, that was a bit off topic...

The true point is, anyone who has a balanced PvP base, or may be starting a server from scratch, this could prove very useful in keeping close Fury vs Light numbers.

Truly a very useful release, and very much appreciated. Nice work.