EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   New Waypoint Instance Code (https://www.eqemulator.org/forums/showthread.php?t=36712)

thepoetwarrior 04-01-2013 03:06 AM

New Waypoint Instance Code
 
I re-wrote the Waypoint Instance code and sharing for anyone else to use or modify. So feel free to use, edit, share, anything with this code. Some of it was copy/paste/edit from other peoples code.

The code is for global_player.pl and players don't need to have any npc target to use instance. Just say in chat commands.

Allows solo, raid, and guild instances. The leader of raid and guild instances may invite and remove people from the raid and guild instances. There will be a pop up window showing a list of who's been invited (pending / joined) and who's been removed.

There is code there for GM to find and goto players in any instanced or public zone at their last known XYZ which can be a pain without this tool if the player is assigned to several instances. This even works if the player is offline!

Feedback and suggestions welcome.

Its about 105k and 2800 lines of code, so using pastebin to share.

Still requires NPC to give money if you are going to charge the users.

See links for source code to use on your server, and screenshots below to get an idea of the menu, etc.

Special Thanks to Bamron, Hateborne, Natedog, Trevius, Akkadius, Secrets and a few other people

Waypoint 1.6 Code
http://pastebin.com/cjzXvDyb

Waypoint NPC
http://pastebin.com/uL8ZqeZ6

http://i49.tinypic.com/2d1h5w.png

http://i47.tinypic.com/4l3lzs.png

http://i47.tinypic.com/mkf981.png

http://i45.tinypic.com/34e68w4.png

thepoetwarrior 04-01-2013 03:07 AM

http://i49.tinypic.com/25ibv36.png

http://i45.tinypic.com/xp6lxy.png

http://i46.tinypic.com/3492d1c.png

thepoetwarrior 04-01-2013 03:12 AM

Note the instance code uses all qglobals, no DBI.

The GM tool for find/goto how ever does use DBI to get info from the character_ table so you would need to update your db name, user name, and password that is clearly labeled in the code.

The discussion during the creation on this code can be followed here:

http://ezserveronline.com/forums/index.php?topic=3631.0

vkrr 04-01-2013 11:19 AM

Wow. This is amazing work, poet.

thepoetwarrior 04-01-2013 06:13 PM

Seems crosszonesignalclientbyname() only works if you are in the same zone with the other player, would be nice if it worked across to a different zone.

Might need to use DBI to read the qglobals since sometimes the zone bugs and doesn't see them giving the Illusion of the instance disappeared. This is a known bug with qglobals for years.

Akkadius 04-01-2013 07:10 PM

Quote:

Originally Posted by thepoetwarrior (Post 220080)
Seems crosszonesignalclientbyname() only works if you are in the same zone with the other player, would be nice if it worked across to a different zone.

Might need to use DBI to read the qglobals since sometimes the zone bugs and doesn't see them giving the Illusion of the instance disappeared. This is a known bug with qglobals for years.

This sends a signal to all zones given you have provided the accurate name for the player. It is not limited to the same zone, that was the point of it. I've used it in my own implementations and it works for sure. Might need to debug what is getting sent to your arguements.

The packet is sent to all zones regardless of what zone the player is in.

thepoetwarrior 04-01-2013 09:12 PM

Ok, thats good to know, originally assumed and was hoping sent to all zones.

Now to find out why its not.

Is there any rule value to turn on?

thepoetwarrior 04-01-2013 09:40 PM

Well, I confirmed the crosszonesignal does work to any player in any zone.

So if the players were not able to invite someone into their instances from another zone, then its because they are not seeing the qglobals for the instance.

Current code to be in same zone name to work due to info being passed in the signal but you can be in your guild instance, then send signal to player in the public zone to join the instance, tested and working.

95% of players have no problem but sometimes there is the random issue that they don't see the qglobal that I can't pin point the problem.

Code is available for looking at.

Akkadius 04-01-2013 09:47 PM

Quote:

Originally Posted by thepoetwarrior (Post 220084)
Well, I confirmed the crosszonesignal does work to any player in any zone.

So if the players were not able to invite someone into their instances from another zone, then its because they are not seeing the qglobals for the instance.

Current code to be in same zone name to work due to info being passed in the signal but you can be in your guild instance, then send signal to player in the public zone to join the instance, tested and working.

95% of players have no problem but sometimes there is the random issue that they don't see the qglobal that I can't pin point the problem.

Code is available for looking at.

That goes back to the intermittent issue where a zone doesn't immediately update its qglobal memory for whatever reason.

thepoetwarrior 04-01-2013 10:12 PM

Yes, but don't know why.

Any way to force this to update in the quest code?

thepoetwarrior 04-02-2013 08:01 AM

Updated!

Version 1.8.4

http://pastebin.com/9B0hWVCC

Changes are listed on the top of the source code.

The biggest change is that the instances now use DBI.

Reading Qglobals now by using DBI to 100% guarantee seeing the values qglobals for credit balance, if instance is created, list of invited players etc. Still don't know why randomly 5% chance for zones to not refresh memory what the qglobals are. DBI fixes this, possibly at the cost of performance (so far haven't noticed any performance hit). The new sub for reading qglobals is small and simple, returns the value of the qglobal. Did a find/replace on all the $qglobal{$variable} with the new sub fuction name.

Writing to the Qglobals table works the same way as before with setglobal command.

Fixed minor bug that players needed to be in the same public zone to invite each other into raid or guild instances. Now the leader can invite any player that is in any zone public or instance etc.

Also can now remove a player from the invite even if the player is in a different zone. When removing a player, it will zone them to the public version of the current zone the player is in if they are in the same zone name as the instance they were removed from. Else if they are in a completely different zone, then they will get the message but won't be teleported to the public version since there is no need. You can re-invite players after they have been removed/banned from the instance.

Players without guild can no longer create a guild instance with id of -1 and it will tell them that they have no guild if trying to create.

Enjoy!

vkrr 04-02-2013 09:36 PM

Just got the new version , went to use it and I cannot figure out how to make it work. I have a free and paid token, but whenever i say instance it just gives me the " X waypoint menu" and "--------------" - - I'm sure im missing something... Im just not sure what it is

thepoetwarrior 04-02-2013 09:56 PM

You can change the item id of your Waypoint click, just search for "hasitem" to quickly find the lines where you can change item ID.

In case you don't want to use clickie to summon pet for adjust prices, then just ignore that and edit the prices in sub SOLO_PRICE, sub RAID_PRICE, and sub GUILD_PRICE for example at line 1690 for else $new_price = 0;

Most likely, the user name and password are either missing or wrong in this part of the code:

Starts on line 2787

Code:

### Establish a Connection with password from Config File
sub LoadMySQLConnection
{
        use DBI;
        use DBD::mysql;
        my $DATABASE_NAME              = "XXXXXXXXXXXX";
        my $DATABASE_USER              = "XXXXXXXXXXXX";
        my $DATABASE_PASSWORD  = "XXXXXXXXXXXX";
        my $dsn = "DBI:mysql:database=$DATABASE_NAME;host=localhost";
        my $connect = DBI->connect($dsn, $DATABASE_USER, $DATABASE_PASSWORD);
        return $connect;
} # End LoadMySQLConnection()

Be sure to replace XXXXXXXXXXXX with your database name, user, and password.

Sorry for any confusion.

Working on a new version today and just about done that will allow people in your raid group to enter raid without needing to be invited manually, will post it when soon within a day here.

thepoetwarrior 04-02-2013 10:04 PM

I'm going to add some error check for people that try this for the first time and forget change the password, will look something like this when I put out the next source:

http://i49.tinypic.com/2i21qma.png

thepoetwarrior 04-03-2013 03:13 AM

Updated to version 1.9.9

http://pastebin.com/jbWpGkL3

Now automatically gets your password to log into your database via your config file that you already have in your server directory. Alternate login / connect function available via renaming function name.

Anti Spam (Set to 5 message limit per 10 seconds)

Allow group to join leaders solo instance.

Allow raid group to join raid instance without having to be invited.

Anyone in raid group in raid instance can view the list of players invited via /say raid list

Anyone with guild tag can join guild raid without having to be invited.

Anyone with guild tag in guild instance say view invited players via /say guild list

Only raid instance leader can invite/remove players

Anyone with guild tag can invite others into guild instance

Bug fixed where qglobal name started with instance id and qglobal name started with guild id, if either were same, could zone into wrong zone, so those qglobals were renamed to avoid that problem.

Other qglobals got renamed. Easier to see them all in the quest_globals table now by searching qglobal names that contain "RaidI", "GuildI", or "SoloI".

Prices were adjusted to free for testing purposes.

Due to the testing from the players on EZ Server, most of the bugs are worked out and fixed now, and they are really enjoying the new system.


All times are GMT -4. The time now is 05:58 AM.

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