Re: Coins in inventory

2
I use trigger In MySQL: character_after_insert

CREATE DEFINER=`root`@`%` TRIGGER `character_after_insert` BEFORE INSERT ON `character` FOR EACH ROW BEGIN
-- f_insertNewItemInventory()
-- INSERT INTO items(`ContainerID`, `ObjectTypeID`, `Quality`, 1, 20000, 20000, NULL)
SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 44, 50, 1, 20000, 20000, NULL, 0, NULL, NULL, NULL, NULL); /* mallet */

END
A practitioner will always shoot a theorist ...
P.S. Russia, Siberia

Re: Coins in inventory

3
Thanks for you interest but..

Code: Select all

DELIMITER $$

CREATE DEFINER=`root`@`%` TRIGGER `character_after_insert` BEFORE INSERT ON `character` FOR EACH ROW BEGIN
-- f_insertNewItemInventory()
-- INSERT INTO items(`ContainerID`, `ObjectTypeID`, `Quality`, 1, 20000, 20000, NULL)
SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 44, 50, 1, 20000, 20000, NULL, 0, NULL, NULL, NULL, NULL); /* mallet */

END

DELIMITER ;
But...

Query: CREATE DEFINER=`root`@`%` TRIGGER `character_after_insert` BEFORE INSERT ON `character` FOR EACH ROW BEGIN -- f_insertNewItemInv...

Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DELIMITER' at line 7

Execution Time : 0 sec
Transfer Time : 0 sec
Total Time : 0.055 sec

Re: Coins in inventory

4
Keep in mind that such mechanic can be exploited easily.
People could create a new character, drop or transfer coins, delete the character, create a new one, repeat ...

Though of course it depends on how many coins you're giving to players. For low amounts it won't be worthwhile to exploit it I guess.
cron