Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-16-2017, 12:43 AM
Movement
Sarnak
 
Join Date: Sep 2011
Posts: 77
Default Script for LDoN/Adventure Merchant

Can anyone tell me what the perl script would be for turning in a stack of items to an adventure merchant and adding LDoN points based on the amount in the stack? ie. 1 unit or item = 1 point. But a stack of 1000 would equal 1000 points.

I have a script but its not working.. Here is my script.

Code:
sub EVENT_ITEM {
if ($itemcount{4613} >0) {
quest::UpdateLDoNPoints(1 * $itemcount{4613}, 1);
}
}
I have also tried this variant:

Code:
sub EVENT_ITEM {
if ($itemcount{4613} >0) {
quest::addldonpoints(1 * $itemcount{4613}, 1);
}
}
What the code above is supposed to do is give 1 point per item turned in. The "items" stack to 1000. Turn in a stack of 500 of them, get 500 points added.

The problem is its not "awarding" the points. Maybe I need to zone to check (havent checked this to see) but its not updating immediately if thats the case.

Any way, if anyone has insight into why this isnt working it would be greatly appreciated.

I have scoured google, this forum, and the wiki but coming up empty on this.

Thanks in advance!

Edit: zoning isnt working =/
Reply With Quote
  #2  
Old 11-16-2017, 09:01 AM
Yard Dogg's Avatar
Yard Dogg
Sarnak
 
Join Date: Jul 2017
Posts: 32
Default

Quote:
Originally Posted by Movement View Post
{4613}
I'm no expert, but are those supposed to be "{" curly brackets ?
Reply With Quote
  #3  
Old 11-16-2017, 11:30 PM
Movement
Sarnak
 
Join Date: Sep 2011
Posts: 77
Default

Quote:
Originally Posted by Yard Dogg View Post
I'm no expert, but are those supposed to be "{" curly brackets ?
Wait... You might be on to something.

curly brackets didnt work :(

gonna try some other stuff and will post back here with progress made (if any).
Reply With Quote
  #4  
Old 11-17-2017, 04:45 AM
Movement
Sarnak
 
Join Date: Sep 2011
Posts: 77
Default

Looks like I am just going to have to use the in game way of adding LDoN points (by selling items to adventure merchants). I am wondering if there is a script that will just look at all the "ldon point worthy" items in your inventory and remove them by clicking a "sell" or "exchange" keyword/link instead of having to do it manually. I suspect in order to do this I would need a script that could:
1. see what items, if any - you had in your inventory that had a LDoN point value to them
2. remove those items from your inventory
3. credit you with points associated to whatever items were removed.
4. tell you how many points it credited to you.

Does anyone know if this would even be possible?

Edit:

Theres THIS that could be used to facilitate that but how would you use it to add points?

Code:
quest::collectitems(item_id, remove) 
# Returns number of item_id that exist in inventory. If remove is true, items are removed as they are counted.
Reply With Quote
  #5  
Old 11-17-2017, 11:54 AM
Yard Dogg's Avatar
Yard Dogg
Sarnak
 
Join Date: Jul 2017
Posts: 32
Default

The one thing I do remember seeing somewhere on these forums, was
someone changing all the adventure merchants to regular (41) with an
sql query that used a formula to price everything with a value somewhat
equivalent to the ldon points. (buying the items with plat).
As for where that thread is, I have no idea. I remember seeing it though.
It's another option, if you can find it.
Reply With Quote
  #6  
Old 11-18-2017, 05:47 PM
Movement
Sarnak
 
Join Date: Sep 2011
Posts: 77
Default

I got it working. Natedog (actually thinking of calling him NateGod instead! :P) helped me. Theres no way I could have gotten it working with out him and no way I could have figured out the code below. I am posting here to give him credit and thanks and going to post the code below so that it may help others in the future!

Code:
sub EVENT_SAY {
    my %stuff = (
        #itemID->POINTS->THEME
        4613 => [1, 1], # Some item, Deepest Guk Theme
        1234 => [1, 2], # some item, Miraguls Menagerie Theme
        2345 => [1, 3], # some item, Mistmoore Catacombs Theme
        3456 => [1, 4], # some item, Rujarkian Hills Theme
        13006 => [1, 5], # some item, Takish-Hiz Theme   --- WATER FLASK for example..
    );
    
    my %themes = (
        1 => "Deepest Guk Theme",
        2 => "Miraguls Menagerie Theme",
        3 => "Mistmoore Catacombs Theme",
        4 => "Rujarkian Hills Theme",
        5 => "Takish-Hiz Theme"
    );
    
    my $collected = 0;
            
    if ($text=~/Hail/i) {
        plugin::Whisper("You can hand in your " . quest::saylink("stuff",1));
    } elsif ($text=~/stuff/i) {
        plugin::Whisper("Collecting all LDON items...");
        foreach my $key (keys %stuff) {
            $collected = quest::collectitems($key, 1);
            if($collected) {
                quest::addldonpoints($stuff{$key}[0]*$collected, $stuff{$key}[1]);
                $client->Message(315, "Added " . $stuff{$key}[0]*$collected . " points to " . $themes{$stuff{$key}[1]});
            }
        }
    }
}
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:53 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3