EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Script for LDoN/Adventure Merchant (https://www.eqemulator.org/forums/showthread.php?t=41595)

Movement 11-16-2017 12:43 AM

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 =/

Yard Dogg 11-16-2017 09:01 AM

Quote:

Originally Posted by Movement (Post 256357)
{4613}

I'm no expert, but are those supposed to be "{" curly brackets ?

Movement 11-16-2017 11:30 PM

Quote:

Originally Posted by Yard Dogg (Post 256364)
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).

Movement 11-17-2017 04:45 AM

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.


Yard Dogg 11-17-2017 11:54 AM

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.

Movement 11-18-2017 05:47 PM

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]});
            }
        }
    }
}



All times are GMT -4. The time now is 03:06 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.