Rooking player now possible

Reserved storage value 30017 to enable first items when a player is rooked.
#17
This commit is contained in:
Alejandro Mujica 2019-04-13 18:53:53 -04:00
parent d1224058dd
commit 10bc933659
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,7 @@
function onLogin(player)
if player:getLastLoginSaved() <= 0 then
if player:getLastLoginSaved() <= 0 or player:getStorageValue(30017) == 1 then
player:setStorageValue(30017, 0) -- reset storage for first items
-- Items
if player:getSex() == PLAYERSEX_FEMALE then
player:addItem(3562, 1, true, -1, CONST_SLOT_ARMOR)

View File

@ -1732,8 +1732,7 @@ void Player::death(Creature* lastHitCreature)
loginPosition = getTemplePosition();
// Restart first items
lastLoginSaved = 0;
lastLogout = 0;
addStorageValue(30017, 1);
// Restart items
for (int32_t slot = CONST_SLOT_FIRST; slot <= CONST_SLOT_LAST; slot++)