How to reset players in your database

Tutorial explaining how to reset your server without losing the players.

1 - Running commands via SQL:

  • To get started, you must access your database through your https://your-ip/phpmyadmin, log into your administrative account. In the table to your left you will see the following infos:

  • Access your database, I will use otservbrglobal as an example.

  • Access the SQL button to be able to run the codes:

2 - Understanding each function and customizing the codes:

Here are the UPDATES, ie the commands to update player information:

UPDATE players SET level=2;            - Sets the level of all your players.
UPDATE players SET vocation=0;         - Defines the vocation of all your players.
UPDATE players SET health=155;         - The life of all your players.
UPDATE players SET healthmax=155;      - The maximum life of all your players.
UPDATE players SET experience=100;     - Sets the initial exp of all your players.
UPDATE players SET lookbody=94;        - Sets the outfit color.
UPDATE players SET lookfeet=78;        - Sets the outfit color.
UPDATE players SET lookhead=78;        - Sets the outfit color.
UPDATE players SET looklegs=0;         - Sets the outfit color.
UPDATE players SET looktype=129;       - Defines the outfit.
UPDATE players SET lookaddons=0;       - Resets addons.
UPDATE players SET maglevel=0;         - Sets the magic level of all players.
UPDATE players SET mana=60;            - The mana of all players.
UPDATE players SET manamax=60;         - The maximum mana of all players.
UPDATE players SET manaspent=0;        - Defines how much mana your players have already spent.
UPDATE players SET soul=100;           - Sets the Soul of all players.
UPDATE players SET town_id=1;          - The city your player will be born in, IDs range from 1 to 23.
UPDATE players SET posx=32069;         - Defines the position on the X axis from where your players will log in for the first time.
UPDATE players SET posy=31901;         - Defines the position on the Y axis from where your players will log in for the first time.
UPDATE players SET posz=6;             - Defines the position on the Z axis from where your players will log in for the first time.
UPDATE players SET cap=410;            - Sets the total amount of cap without items.
UPDATE players SET sex=0;              - Sets the gender of your players.
UPDATE players SET skull=0;            - Sets the frags of your players.
UPDATE players SET skulltime=0;        - Set the time to expire the frags.
UPDATE players SET blessings=0;        - Defines if your players will start with bless.
UPDATE players SET blessings1=1;       - Bless 1.
UPDATE players SET blessings2=1;       - Bless 2.
UPDATE players SET blessings3=1;       - Bless 3.
UPDATE players SET blessings4=1;       - Bless 4.
UPDATE players SET blessings5=1;       - Bless 5.
UPDATE players SET blessings6=1;       - Bless 6.
UPDATE players SET blessings7=0;       - Bless 7.
UPDATE players SET blessings8=0;       - Bless 8.
UPDATE players SET balance=0;          - Defines the amount of money your players will have in the bank.
UPDATE players SET quickloot_fallback=0; - Resets your players' loot settings.
UPDATE players SET offlinetraining_time=43200; - Defines the time the player will have to train Offline.
UPDATE players SET stamina=2520;          - Sets player's stamina in minutes.
UPDATE players SET skill_fist=10;         - Sets the player's first skill.
UPDATE players SET skill_fist_tries=0;    - Sets the player's first skill.
UPDATE players SET skill_club=10;         - Defines the player's skill club.
UPDATE players SET skill_club_tries=0;    - Defines the player's skill club.
UPDATE players SET skill_sword=10;        - Sets the player's sword skill.
UPDATE players SET skill_sword_tries=0;   - Sets the player's sword skill.
UPDATE players SET skill_axe=10;          - Sets the player's ax skill.
UPDATE players SET skill_axe_tries=0;     - Sets the player's ax skill.
UPDATE players SET skill_dist=10;         - Sets the player's skill distance.
UPDATE players SET skill_dist_tries=0;    - Sets the player's skill distance.
UPDATE players SET skill_shielding=0;     - Sets the player's shield skill.
UPDATE players SET skill_shielding_tries=0; - Sets the player's shield skill.
UPDATE players SET skill_fishing=10;      - Sets the player's fishing skill.
UPDATE players SET skill_fishing_tries=0; - Sets the player's fishing skill.
UPDATE players SET xpboost_stamina=0;     - Sets the player's expboost reset.
UPDATE players SET xpboost_value=0;       - Sets the player's expboost reset.
UPDATE players SET marriage_status=0;     - Defines if the player is married.
UPDATE players SET marriage_spouse=-1;    - Defines if the player has already married.
UPDATE players SET bonus_rerolls=0;       - Defines if the player has already run the prey.

Here are the DELETES, that is, the commands to delete the information of the players:

DELETE FROM player_storage;            - Removes all storage
DELETE FROM player_items;              - Removes all items from players.
DELETE FROM player_depotitems;         - Removes all items from players' depot(DP).
DELETE FROM player_stash;              - Removes all items from Supply Stash
DELETE FROM player_rewards;            - Removes all rewards.
DELETE FROM player_inboxitems;         - Removes all inbox items.
DELETE FROM player_hirelings;          - Removes hirelings from houses
DELETE FROM player_deaths;             - Removes player deaths.
DELETE FROM coins_transactions;        - Removes the history of coins transactions.
DELETE FROM house_lists;               - Removes the owners of the houses.
DELETE FROM houses;                    - Remove items from houses.
DELETE FROM accounts WHERE coins > 0;  - Removes player coins. 

Credits:

  • dracoalv.

Last updated