The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i_gold to Virtual gold
Author Message
ThatSide
Apprentice
*

Posts: 17
Likes Given: 5
Likes Received: 0 in 0 posts
Joined: Feb 2015
Reputation: 0



Post: #1
i_gold to Virtual gold
Hi, hello!

Haven't done anything with sphere scripts for years. I've been reading forum and sphere wiki to get the idea what has changed. Now I decided to fulfill my childhoods dream and started to convert my old scripts (from sphere 55i to 56b.)

What I want is to replace i_gold with virtual gold. (killing monsters gives the gold just like experience, karma etc. Something you have but can't see in your bag) Fist thing that crossed my mind was to create a tag.gold or somethin.. then i realized that it will make my life harder cos I will have to make dialogs for every vendor so I can sell and buy items and it affects only players tag.gold and doesn't require item i_gold.
Now I have discovered that I can change players gold amount with function .gold <amount>. I am able to buy items from vendors. Gold amount changes and it does not require actual item i_gold in my backpack or bankbox.
Is this safe way to do it? Any suggestions?
08-03-2015 06:43 AM
Find all posts by this user Like Post Quote this message in a reply
escribano
Journeyman
*

Posts: 170
Likes Given: 16
Likes Received: 32 in 23 posts
Joined: Nov 2012
Reputation: 2

Dragon Shard

Post: #2
RE: i_gold to Virtual gold
ThatSide, yes.. you can!

But it's a little hard.. you have to script a lot o things:

1) A event to handle the giving gold when kill a monster
2) A buy/sell packet re-script (u can use Skul base packet script posted on the forum) to consume this virtual gold from the player
3) You need to store this variable on a database, tag, ctag, memory, etc..
4) Verify all your scripts that use gold to consume from this virtual gold.

This can be done, but i don't have any script like this to share, sorry!
Good luck!

UltimaPHP - OpenSource Ultima Online Server v0.1-pre-alpha under development, we need help!
08-03-2015 06:48 AM
Find all posts by this user Like Post Quote this message in a reply
ThatSide
Apprentice
*

Posts: 17
Likes Given: 5
Likes Received: 0 in 0 posts
Joined: Feb 2015
Reputation: 0



Post: #3
RE: i_gold to Virtual gold
Thank you for the replay!

1) Ive got this one. If I can use .gold <amount> function I have to change only one line in my script and add this event in sphere.ini so all of my monsters have it.
2) If I do it this way I have to redo only sell packet. (and i probably will do it the easy way (with a dialog))
3) Don't see any need for a database if I do it this way...
08-03-2015 07:06 AM
Find all posts by this user Like Post Quote this message in a reply
escribano
Journeyman
*

Posts: 170
Likes Given: 16
Likes Received: 32 in 23 posts
Joined: Nov 2012
Reputation: 2

Dragon Shard

Post: #4
RE: i_gold to Virtual gold
That's right!

1) You can really use, set on .ini an event to all npcs, and in this event set on trigger @Death to give the gold
2) You can use a dialog, but i don't recommend... the buy/sell packet system from Skul isn't hard to edit and the results are awesome!
3) You can store the "real gold" in some layer so you will not need this.

Keep in mind that there is many funcionalitys needed to be overrided like the status dialog: Show money from BAG + BANK LAYER

UltimaPHP - OpenSource Ultima Online Server v0.1-pre-alpha under development, we need help!
08-03-2015 07:13 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #5
RE: i_gold to Virtual gold
I think your best and easier way to do so (even if it looks a little tricky) is to add attr=attr_invis|attr_newbie in the i_gold's @Create triggerand move it to player's bank once you assigned it's amount after a kill or so so they won't ever get the 'bounce' messages or a 'weird' count of items when clicking their backpacks showing more items than they can see. But this will short your work heavily.
08-03-2015 05:40 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 3 users Like XuN's post
ThatSide
Apprentice
*

Posts: 17
Likes Given: 5
Likes Received: 0 in 0 posts
Joined: Feb 2015
Reputation: 0



Post: #6
RE: i_gold to Virtual gold
(08-03-2015 05:40 PM)XuN Wrote:  I think your best and easier way to do so (even if it looks a little tricky) is to add attr=attr_invis|attr_newbie in the i_gold's @Create triggerand move it to player's bank once you assigned it's amount after a kill or so so they won't ever get the 'bounce' messages or a 'weird' count of items when clicking their backpacks showing more items than they can see. But this will short your work heavily.

I could agree with u. Only thing that Ive seen in other servers that are doing it this way is that sometimes when player opens a bank he can see the gold in there, when trying to pick it up it disappears. But anyhow probably ur right. And I will try to do it this way.

Thank You guys!
08-03-2015 07:41 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: i_gold to Virtual gold
I think it's safe to use gold function, but you will have to handle three problems

1-You have to redo things like "vendor train" and so on because they works on dropping money on the npc (should be easy i think ?)

2-A player want to give money to another player(You can do a sort of of "gold transfer" function)

3- The most important, when two or more players go to "hunt" together, you have to
handle "gold distribution" when killing npcs
08-03-2015 08:06 PM
Find all posts by this user Like Post Quote this message in a reply
ThatSide
Apprentice
*

Posts: 17
Likes Given: 5
Likes Received: 0 in 0 posts
Joined: Feb 2015
Reputation: 0



Post: #8
RE: i_gold to Virtual gold
(08-03-2015 08:06 PM)darksun84 Wrote:  I think it's safe to use gold function, but you will have to handle three problems

1-You have to redo things like "vendor train" and so on because they works on dropping money on the npc (should be easy i think ?)

2-A player want to give money to another player(You can do a sort of of "gold transfer" function)

3- The most important, when two or more players go to "hunt" together, you have to
handle "gold distribution" when killing npcs

1- Is it possible to avoid thing like training? For example setting all vendor skills to 0.0%? Cos vendors in my server are all invul. + I don't quite need players to get trained by them. If I do so, I could make a custom script for that.

2- For this I have planned to make a check or voucher system so players can make a check for limited amount of gold per day (to avoid players feeding their additional acc)

3- at the moment in my custom loot system the one who kills monster is the one who gets all the loot (except exp)

however u made me think about many things I have to work out...
08-03-2015 08:54 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #9
RE: i_gold to Virtual gold
For the first one, there is an .ini option

// Max level npc trainers can go
NPCTrainMax=300

Setting it to 0 should solve the problem.

For the third one, well you should find a way to avoid "steal killing", also what happens if a pet kills an monster?
08-03-2015 09:06 PM
Find all posts by this user Like Post Quote this message in a reply
ThatSide
Apprentice
*

Posts: 17
Likes Given: 5
Likes Received: 0 in 0 posts
Joined: Feb 2015
Reputation: 0



Post: #10
RE: i_gold to Virtual gold
(08-03-2015 09:06 PM)darksun84 Wrote:  For the third one, well you should find a way to avoid "steal killing", also what happens if a pet kills an monster?

That's a good point. The pet wouldn't be a problem, cos on a corpse I have a timer that forbids other players to loot it for about 1min and i could check if the killer was pet when dclicking corpse.
About 'steal killing'... Hmm i remember I tried to create a world boss event about 5 years ago and the idea was that the player who has dealt the most damage gets 100% reward, 2nd player 75% and third 50%.. I dont remember me completing it (lack of skill I guess) If I could do something like that with loot system....
Cos I know why I created killer=looter system - to avoid naked players hiding next to big monsters and looting them even if they didn't hit it once.
08-05-2015 08:20 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 4 Guest(s)