Alternate Currency - Granted Hourly
Hello All,
Disclaimer: I am just getting set up with a server and am very new to this! I wanted to know if anyone could help me get some framework going for granting players an Alternate Currency at a defined time interval of being online. I am thinking this would be something that gets added to a global quest file rather than a zone specific quest file? Any thoughts or help would be appreciated. I can edit this heck out of some code to make it do what I want normally but I struggle with anything new and without framework. Any assistance would be huge... Thanks guys! |
You can achieve this like this.
Code:
sub EVENT_CONNECT { |
cant wait to afk on your server and become the best!
|
Quote:
Going to play with this a bit and will let you know if I have any questions! |
Quote:
Welcome to IdleQuest. |
Quote:
Any feedback as to why? Is it my client (UF)? I have added a new currency called Planar Crystals of which I will use instead of Radiant and Ebon Crystals, but this is not showing up in-game at all in the Alt Currency Inventory window... |
Quote:
I added this code to global_player.pl and I reduced the timer from 3600 to 10, for testing purposes, and nothing is happening. Can you confirm that plugin::commify($client->GetRadiantCrystals()) is correct? Specifically the "commify". Havent seen that before and cant find it listed here: http://wiki.eqemulator.org/p?Ultimat...rence&frm=Main Thanks for the help.. |
Can you confirm that plugin::commify($client->GetRadiantCrystals()) is correct? Specifically the "commify". Havent seen that before and cant find it listed here: http://wiki.eqemulator.org/p?Ultimat...rence&frm=Main
It is "explained" here: http://wiki.eqemulator.org/p?Perl_Pl...rence&frm=Main Here are the helpful comments on it: If you need an example for this, you need help Good luck.. |
Ebon/Radiant crystals are not the same as alternate currency. The clients that have them (I think SoF+) all treat them separately from alternate currency. If you try to add Ebon/Radiant crystals as an alternate currency, they will show up as unknown-dbstr unless you edit client files. Instead of having Ebon/Radiant Crystals in the Alt Currency tab of your inventory, they should have their own little boxes similar to plat/gold/silver/copper in your main inventory window.
The crystals are loaded from the player profile, which differs from alt currency that loads from a specific packet for that. And, crystals have their own update packets for changing the amount displayed in the inventory window. They also use different vendor classes that are specific for Ebon or Radiant crystals, where Alt Currency vendors can be set to use 1 of any of the 19ish different standard alt currencies. |
Quote:
Still cant get it working though. Tested some different code to make sure my currency and everything was working and it is. This appears to be an issue with the code in general or where I am putting it. I even tried switching from EVENT_CONNECT to EVENT_ZONE and it wont work. Hmmmmm, going to keep trying... |
Also, I switched from $client->AddCrystals to $client->AddAlternateCurrencyValue and cant get it to work with the timer...
Code:
sub EVENT_CONNECT { |
Quote:
Thanks all! |
Well, you are missing the ; at the end of this line:
Code:
$client->AddAlternateCurrencyValue(15, 1) Also, for general troubleshooting purposes, I always simplify my script down as much as possible to verify things are working as expected. My suggestion would be to remove/comment out all of that except for a shout/debug message like this: Code:
sub EVENT_CONNECT { Once you get that working, you can add your other stuff line by line and test as you go. Once it stops working, you will know where the issue is and just need to figure out why. One example might be that you could have a bad function name. Most likely in this case, your problem is probably due to you trying to use the $client variable inside EVENT_TIMER which does not export that variable and cannot support it properly. Alternatively, you could set an entity variable on the client and then loop through the client list and check each for the entity variable you set, and apply your currency that way. It is a bit more complex to do this properly, but it is probably the best way. You could probably set the entity variables to a unix timestamp using time(). Then, in the timer you would check if the current timestamp is 1 hour later than what the client's entity variable is. |
All times are GMT -4. The time now is 07:35 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.