Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-12-2010, 01:59 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by KLS View Post
Code:
    $grp = $client->GetGroup();
    $grp_id = 0;
    if($grp)
    {
        $grp_id = $grp->GetID();
    }
Please explain how this is worse before it can be considered for submission.
I've tried many variations, and it works great if you are checking for a group inside of a zone, but you can't store the Group_id that is actually in the database with it. I've gotten every other time of instance working just fine other than raid ID storing.

Let's say I grab an isntance with a person using the same format, if I zone and they are the only one in the zone, doing a group check fails before I can even grab ID.

With the code below I can store the group ID in a qglobal with the above .diff and recall that same Group_ID at any given zone, npc etc if I wanted to assign them consistently to the same instance. With the other method I will get a fail if no one else is in the zone, it can't reach a Group_ID. Nor does it output the ID.

Code:
sub EVENT_SAY
{
if($text=~/enter/i){
		my $GID = quest::getgroupidbychar($charid);
		if ($GID > 0)
		{
            if (defined($qglobals{"HalasWere_$GID"}))
            {
                my $QGlobalValue = $qglobals{"HalasWere_$GID"};
                quest::AssignToInstance($qglobals{"HalasWere_$GID"});
                quest::MovePCInstance(29, $QGlobalValue, 0, 0, 0);
            }
            else
            {
                my $instanceID = quest::CreateInstance("halas", 1, 7201);
                quest::AssignToInstance($instanceID); 
                quest::setglobal("HalasWere_$GID",$instanceID,7,"H2");
                quest::MovePCInstance(29, $instanceID, 0, 0, 0);
            }
        }
		else
		{
			quest::popup("Requirements","You need to have a group to enter this instance",0,0);
		}
}
}
If I use the below code, I do not get a variable back from the group call that you had originally suggested I tried, which worked, just not completely.

You can store the group ID in the global value this way. And if we had a raid ID call you could do it the same way here. Got instances working with group very flexibly here.

And once again, thank you for your great work with instances.

Code:
if($text=~/grouptest/i)
{

    $grp = $client->GetGroup();
	my $GID = quest::getgroupidbychar($charid);
    $grp_id = 0;
    if($grp)
    {
        $grp_id = $grp->GetID();
		quest::say("$grp_id");
		quest::say("$GID");
		}
    }
Reply With Quote
 


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 04:19 AM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3