economy+coins

Place for sharing your game modifications for Life is Feudal: Your Own

Neverlamer7
 
Posts: 49
Joined: 04 Aug 2017, 07:23

economy+coins

Post by Neverlamer7 » 07 Sep 2018, 17:08

Come check site feudal.tools for trade addon (only for contributors).

Here is event (using Navicat events) i used in 1.3.6.0, couple month ago, to spawn coins via DB in Navicat once a hour, to those who online, using livemap:

Code: Select all
INSERT INTO
containers(containers.ParentID, containers.ObjectTypeID, containers.Quality)
SELECT
`character`.RootContainerID,
1059,
100
FROM
nyu_online_players
INNER JOIN `character` ON nyu_online_players.CharacterID = `character`.ID


Hovewer user must to log off and connect again to see it on inventory. Also there was a problem to stuck coins properly, player must give coin to someone via trade window.

May not work in 1.4.0.2 and current version of livemap/TT mod eth.

Plz test. :friends:

User avatar
Arzin
Beta Tester
 
Posts: 33
Joined: 01 Oct 2015, 15:18

Re: economy+coins

Post by Arzin » 10 Oct 2018, 15:35

Your version is outdated and could i ask why you used containers instead of items table?

This code works with 1.4.4.5

Code: Select all
CREATE DEFINER=`root`@`localhost` EVENT `200Cc`
   ON SCHEDULE
      EVERY 10 MINUTE STARTS '2018-10-10 18:20:00'
   ON COMPLETION PRESERVE
   ENABLE
   COMMENT 'Will reward players who are online with 200Cc in every 10m'
   DO INSERT INTO
items(items.ContainerID, items.ObjectTypeID, items.Quality, items.Quantity, items.Durability, items.CreatedDurability)
SELECT
`character`.RootContainerID,
1059,
100,
200,
0,
0
FROM
nyu_ttmod_tokens
INNER JOIN `character` ON nyu_ttmod_tokens.CharID = `character`.ID


This event gives out 200Cc every 10 minutes.
Change values if needed:
1059 = Copper coins ID
100 = Quality
200 = Quantity

User avatar
KuraiSeraph
 
Posts: 39
Joined: 27 Mar 2017, 12:30

Re: economy+coins

Post by KuraiSeraph » 17 Oct 2018, 14:13

I run your Query on Heidisql, but after 20 minute online with my char there is no new row in the item tabel. Its the Database when you creat a world in LiF. TTmod is installed.

Arzin wrote:Your version is outdated and could i ask why you used containers instead of items table?

This code works with 1.4.4.5

Code: Select all
CREATE DEFINER=`root`@`localhost` EVENT `200Cc`
   ON SCHEDULE
      EVERY 10 MINUTE STARTS '2018-10-10 18:20:00'
   ON COMPLETION PRESERVE
   ENABLE
   COMMENT 'Will reward players who are online with 200Cc in every 10m'
   DO INSERT INTO
items(items.ContainerID, items.ObjectTypeID, items.Quality, items.Quantity, items.Durability, items.CreatedDurability)
SELECT
`character`.RootContainerID,
1059,
100,
200,
0,
0
FROM
nyu_ttmod_tokens
INNER JOIN `character` ON nyu_ttmod_tokens.CharID = `character`.ID


This event gives out 200Cc every 10 minutes.
Change values if needed:
1059 = Copper coins ID
100 = Quality
200 = Quantity

User avatar
Arzin
Beta Tester
 
Posts: 33
Joined: 01 Oct 2015, 15:18

Re: economy+coins

Post by Arzin » 17 Oct 2018, 16:36

Enable even in your mysql

Code: Select all
event_scheduler=ON


You can run it in query or add that line to your my.ini file located in mariadb/data/ folder

User avatar
KuraiSeraph
 
Posts: 39
Joined: 27 Mar 2017, 12:30

Re: economy+coins

Post by KuraiSeraph » 17 Oct 2018, 19:22

Ok works. Thank you

Kurai

Return to Game mods