![]() |
i_gold to Virtual gold - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: i_gold to Virtual gold (/Thread-i-gold-to-Virtual-gold) Pages: 1 2 |
i_gold to Virtual gold - ThatSide - 08-03-2015 06:43 AM 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? RE: i_gold to Virtual gold - escribano - 08-03-2015 06:48 AM 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! RE: i_gold to Virtual gold - ThatSide - 08-03-2015 07:06 AM 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... RE: i_gold to Virtual gold - escribano - 08-03-2015 07:13 AM 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 RE: i_gold to Virtual gold - XuN - 08-03-2015 05:40 PM 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. RE: i_gold to Virtual gold - ThatSide - 08-03-2015 07:41 PM (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! RE: i_gold to Virtual gold - darksun84 - 08-03-2015 08:06 PM 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 RE: i_gold to Virtual gold - ThatSide - 08-03-2015 08:54 PM (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- 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... RE: i_gold to Virtual gold - darksun84 - 08-03-2015 09:06 PM 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? RE: i_gold to Virtual gold - ThatSide - 08-05-2015 08:20 PM (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. |