Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Darkflame Lego Universe: switch user faction

In a DarkFLame Lego Universe game server, a player can be a member of only one faction. You choose this early on in the game (maybe 2 hours into the gameplay). Each account can have up to 4 characters to play with, so you can play a full game with each faction.

What I have written is therefore not necessary for any user to be able to play every aspect of the game. It's overkill, and absurd, and silly. I did it because I can. And for those of you who have nothing better to do, can follow in my footsteps.

I have added two functions to dlu_lib which lets an admin adjust the factions on a user account.

I added function set_char_factions() which adjusts the bare "is sentinel" flags stored on a character. Here is an example usage:

cons = dlu_lib.Connections(use_db = True, char_id = 203)
cons.set_char_factions(["sentinel", "paradox"], True)

To remove faction(s), pass False as the second parameter.

cons.set_char_factions(["assembly"], False)

The second function sets the primary faction for a character. This affects which tokens get dropped as loot.

I don't have a solution yet for adjusting existing tokens into a different faction's tokens, or for an in-game converter.

Additional notes

Some of the server game code checks in a particular order if the player has various faction flags. If you were to give a character the completed missions for both "Join Assembly" and "Join Paradox," the tokens that would drop would be only assembly. Assembly is first in that list.

Useful files

Comments