Page 1 of 1

Coins in inventory

Posted: 10 Oct 2019, 07:25
by tonkepen
Hi, I have the trade on my server and I would like the players at birth to have some coins in the inventory.

Could someone explain to me how to do it?

Thank you.

Re: Coins in inventory

Posted: 12 Oct 2019, 19:08
by mazytus
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

Re: Coins in inventory

Posted: 12 Oct 2019, 19:17
by tonkepen
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

Posted: 13 Oct 2019, 02:30
by Nyuton
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.

Re: Coins in inventory

Posted: 13 Oct 2019, 19:12
by tonkepen
Well, you are right, but I would like to be able to deliver the bones and balls, so they can create the monument.

The problem is that the code he gave me doesn't work for me

Thank you

Re: Coins in inventory

Posted: 13 Oct 2019, 19:48
by Falkvard
go to your server FTP, there data/cm_createchar.xml. in that file you can edit what items each new character has in their inventory based on their race, quality is always 50.

Re: Coins in inventory

Posted: 13 Oct 2019, 19:59
by tonkepen
Ohhhhhhh, thank you very much I will try and tell you.

Re: Coins in inventory

Posted: 13 Oct 2019, 21:00
by tonkepen
It works perfectly.

Thank you very much I appreciate that a lot.