feat(Scripts/Commands): Item restoration command (#9538)

* Implement item restore command & move itemmove to new item cmd

* Implement LANG_COMMAND_DISABLED

* Prevent command usage if no config is set

* WIP: `.item restore list`

* Fix restore list & create base for restore item

* Send item to player via mail

* Put player as last argument

* Use Postmaster & fix restore list

* Show item name in restore list

* Update HandleItemMoveCommand to be using the api

Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com>

* Send item instantly if online
This commit is contained in:
Noxies
2021-12-09 03:57:15 +01:00
committed by GitHub
parent 8ae8db5283
commit c95c29838b
7 changed files with 226 additions and 35 deletions

View File

@@ -593,7 +593,10 @@ void CharacterDatabaseConnection::DoPrepareStatements()
// Recovery Item
PrepareStatement(CHAR_INS_RECOVERY_ITEM, "INSERT INTO recovery_item (Guid, ItemEntry, Count) VALUES (?, ?, ?)", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_RECOVERY_ITEM, "SELECT id, itemEntry, Count FROM recovery_item WHERE id = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_RECOVERY_ITEM_LIST, "SELECT id, itemEntry, Count FROM recovery_item WHERE Guid = ? ORDER BY id DESC", CONNECTION_SYNCH);
PrepareStatement(CHAR_DEL_RECOVERY_ITEM, "DELETE FROM recovery_item WHERE Guid = ? AND ItemEntry = ? AND Count = ? ORDER BY Id DESC LIMIT 1", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_RECOVERY_ITEM_BY_RECOVERY_ID, "DELETE FROM recovery_item WHERE id = ?", CONNECTION_ASYNC);
// Character names
PrepareStatement(CHAR_INS_RESERVED_PLAYER_NAME, "INSERT IGNORE INTO reserved_name (name) VALUES (?)", CONNECTION_ASYNC);