-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Guildhalls and guild bank. #2214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@djarek I would like for this to get into the TFS 1.3 milestone if possible (If we manage to finish it up before then). I don't think the changes are so major that we need to stall it for 2.0. |
@Znote |
1.3 still has some 2 or 3 months to maturate before release, FYI. |
@Znote migration requires rename. |
as of 10.7 update we have Receipts: Receipt (Fail) - a receipt of a failed transaction [source] |
piece of guild bank code from the user jlcvp from Otserver global I guess: |
These functions were added in order for the upcoming sample `Banker` NPC #2934 and in the future for the guild balance feature #2214 - function getPlayerDatabaseInfo(name_or_guid) TFS 1.3 function that queries for player information from the database, returns a table of useful information if success, false if player doesn't exist. - function isNumber(str) used in several distros but wasn't there on compat.lua yet - function Player.transferMoneyTo(self, target, amount) - function Player.withdrawMoney(self, amount) - function Player.depositMoney(self, amount) - function isValidMoney(money) - function getMoneyCount(string) - function getMoneyWeight(money) Co-authored-by: Znote <stefan_brannfjell@live.no>
Based on feedback from ranisalt Changed to_guild_id to to_guild as the reference guild_id is implicit. Changed from_guild_id to from_guild as the reference guild_id is implicit. Changed guild_transactions.type from tinyint to enum to make the meaning more implicit. Changed houses.type from tinyint to enum to make the meaning more implicit. Also made the migration itself more human-readable by using Lua multi-line string declaration.
oops, there is still the !sellhouse command missing xD |
sellhouse.lua only initiates a house trade between players, what I had to fix was |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are all set to leave the draft phase, so more people can see and test this awesome PR
Please merge these database migrations into one |
It is only one, I just git stashed and applied it between rebase to catch up to otland/master migration version. What was previously 25.lua is now 27.lua, because another merged PR snagged 25.lua |
WIP Known issues / todo:
|
@Znote oops. github notifications pranked me |
WIP #2213 Click on issue link for further description.
Edit: 13. Jul 2020: Feature implementation complete!
Edit: 15. Nov 2020: Rebase with master to continue testing
Schema changes
2527data folder changes
Engine/C++/Lua changes
house:getType()
return house type enums. 1 = HOUSE_TYPE_NORMAL, 2 = HOUSE_TYPE_GUILDHALLhouses
table with house typeguild_transactions
and give player receipts for their deposits and withdrawals.WIP Known issues / todo:
Transfer funds between guildsFixed 29.06.2020guild_transaction table was a bit too ambigious, want to rename the guild columnsFixed 29.06.2020!buyhouse: account for guild:getBankBalance() and only for guild leadersFixed 12.07.2020sell house account for guildhallsFixed 13.07.2020Postoned for later PR/skipped: