EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   Custom Teleporter. (https://www.eqemulator.org/forums/showthread.php?t=38277)

Kingly_Krab 05-10-2014 03:41 PM

Custom Teleporter.
 
I wrote a custom teleporter and I thought I'd share it, for an example of its use you can check out Valcarona. This teleporter lists out an array of zones defined in a plugin that you will have to make a file for.

This is a screenshot of the teleporter and how it works, Valcarona's is older, so it lists as short name. This new version lists them as their long name.
http://i.imgur.com/mFdSDlm.png

Here are the plugins necessary for the script to work: Plugins
Here's the Teleporter: Teleporter

vithmiris 06-15-2014 06:16 PM

Thanks for this Kingly.

I've got it working with the exception of the "list them alphabetically" option.
If I type the zone short name with the NPC targeted, I do indeed zone.

If I type "A", I get nothing from the NPC.

The plugin that was linked was named "Zones.pl", but it mentions in the post "Plugins", is this two plugins in one file?

Currently, I'm using one plugin file named "Zone.pl" in my server/plugins folder.
And the teleporter code on an NPC in PoK.

Edit: Additionally, if I have the NPC targetted and enter numbers, I do get the "...must search with alphabetic characters",
so it seem he is listening, just can't get the output.

Thanks!

Kingly_Krab 06-15-2014 11:41 PM

The problem is I released this and forgot that I didn't give out the plugin::Message part of it.

Add this to your plugin file and tell me if it works:
Code:

sub Message {
    my $client = plugin::val('client');
    my $Message = $_[0];
   
    if($client) {
        $client->Message(315, "$Message");
    }
}


vithmiris 06-16-2014 05:42 PM

Quote:

Originally Posted by Kingly_Krab (Post 231276)
The problem is I released this and forgot that I didn't give out the plugin::Message part of it.

Add this to your plugin file and tell me if it works:
Code:

sub Message {
    my $client = plugin::val('client');
    my $Message = $_[0];
   
    if($client) {
        $client->Message(315, "$Message");
    }
}


Works beautifully! Thanks again!

Kingly_Krab 06-16-2014 09:24 PM

You're welcome.

Anon.GM 05-07-2018 07:50 AM

Great porter script. Anon server thanks you.

Quote:

Originally Posted by Kingly_Krab (Post 230405)
I wrote a custom teleporter and I thought I'd share it, for an example of its use you can check out Valcarona. This teleporter lists out an array of zones defined in a plugin that you will have to make a file for.

This is a screenshot of the teleporter and how it works, Valcarona's is older, so it lists as short name. This new version lists them as their long name.
http://i.imgur.com/mFdSDlm.png

Here are the plugins necessary for the script to work: Plugins
Here's the Teleporter: Teleporter


Kingly_Krab 05-07-2018 12:14 PM

You’re welcome. I’m sure the code could use some TLC being it has been 4 years since I wrote it.

Bots 08-27-2018 11:40 PM

was trying to put something together for a porter that charged for ports just like that whisper script for buffs. any tips?

Kingly_Krab 08-28-2018 05:29 PM

Try this, currently $client->TakeMoneyFromPP() only checks if they have at least 1 Platinum, the value is number of Platinum times 1000 to convert it to Copper.
Just change the price to your discretion and this should work.
Untested, compiles fine using 'perl -c':

Code:

sub EVENT_SAY {
        my @zone_array = plugin::NonCustomZoneArray();
        my $count = 0;
        if ($text=~/hail/i) {
                plugin::Whisper("If there is a zone you would like to go to, just tell me the short name of it and I will see if I have a spell to send you there. I may " . quest::saylink("list", 1) . " them if you like. It will cost 1 Platinum to teleport.");
        } elsif($text=~/list/i) {
                plugin::Whisper("I may list them alphabetically, just say a letter from 'A' to 'Z'.");
        } elsif($text=~/[a-zA-Z]/ && length($text) == 1) {
                foreach $zone (@zone_array) {
                        if(substr($zone, 0, 1)=~/$text/i) {
                                $count++;
                                plugin::Message("$count: " . quest::saylink($zone, 1, plugin::Zone("SN", "LN", $zone)));
                        }
                }
                plugin::Message("There are $count zones that begin with $text!");
        } elsif($text!~/[a-zA-Z]/) {
                plugin::Whisper("You must search with alphabetic characters, try again.");
        } elsif($text!~/hail/i && $text!~/list/i && length($text) != 1) {
                foreach $zone (@zone_array) {
                        if ($client->TakeMoneyFromPP(1000, 1)) {
                                if($text eq $zone) {
                                        quest::zone($text);
                                }
                        } else {
                                plugin::Whisper("You do not have enough Platinum to teleport.");
                        }
                }
        }
}


Bots 08-29-2018 05:48 AM

thank you kind sir it was very appreciated!

Kingly_Krab 08-29-2018 04:52 PM

You're welcome.


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

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