mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Items: Implemented CreateTime item field and changed refund/soulbound trade timers to also count time offline
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
ALTER TABLE `item_instance` ADD `createTime` bigint NOT NULL DEFAULT '0' AFTER `playedTime`;
|
||||
|
||||
UPDATE `item_instance` SET `createTime` = COALESCE(
|
||||
(SELECT LEAST(c.`logout_time`, GREATEST(c.`createTime`, c.`logout_time` -
|
||||
((c.`totaltime`-`playedTime`)
|
||||
/ GREATEST(c.`totaltime`, 1)
|
||||
* (c.`logout_time`-c.`createTime`)))) FROM `characters` c WHERE c.`guid`=`owner_guid`),
|
||||
UNIX_TIMESTAMP()
|
||||
);
|
||||
Reference in New Issue
Block a user