Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Submissions

Quests::Submissions This is where you submit your quests for review

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-01-2009, 11:42 AM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 506
Default Group Teleport in ToFS.

Sadly, I couldn't mirror the functionality of checking one's cursor for a key item at initial entry. Code should be like this:
$client->CastToClient()->GetInv().GetItem(30) == 20033
However, the method GetInv() was returning perl runtime errors. This is nearly an exact replica of the code found in doors.cpp line 211
Code:
const ItemInst *lockpicks = sender->GetInv().GetItem(SLOT_CURSOR);
What does this mean? until resolved, this code will teleport group members only if the key is inside your key ring. (this occurs after you use the key the first time). Once the above is resolved, it will teleport when you first use from cursor, or via key ring.
I use a 40 meter range verification from the location of the player who has the key (mainly because getting the door's location was kind of annoying via script).

Put this in your quests\frozenshadow\player.pl file (probably will have to create it).

Code:
#Tower of Frozen Shadow Group-Based Teleporting on key usage by Shin Noir.
sub EVENT_CLICKDOOR {
    if ($client->IsGrouped()) { #This code is purely for grouped members teleporting.
        my $destx = 0;
        my $desty = 0;
        my $destz = 0;
    	my $d_id = ($doorid % 256);
        if ($d_id == 2 || $d_id == 166) { #First Floor Door
            if ($client->KeyRingCheck(20033)) { # || $client->CastToClient()->GetInv().GetItem(30) == 20033) {
                $destx = 660;
                $desty = 100;
                $destz = 40;
            }
        }
        if  ($d_id == 4 || $d_id == 167) { #Second Floor Door
            if ($client->KeyRingCheck(20034)) {
                $destx = 670;
                $desty = 750;
                $destz = 75;
            }
        }
        if  ($d_id == 16 || $d_id == 165) { #Third Floor Door
            if ($client->KeyRingCheck(20035)) {
                $destx = 170;
                $desty = 755;
                $destz = 175;
                $desth = 0;
            }
        }
        if  ($d_id == 27 || $d_id == 169) { #Fourth Floor Door
            if ($client->KeyRingCheck(20036)) {
                $destx = -150;
                $desty = 160;
                $destz = 217;
            }
        }
        if  ($d_id == 34 || $d_id == 168) { #Fifth Floor Door
            if ($client->KeyRingCheck(20037)) {
                $destx = -320;
                $desty = 725;
                $destz = 12;
            }
        }
        if  ($d_id == 1) { #Sixth Floor Door
            if ($client->KeyRingCheck(20039)) {
                $destx = 20;
                $desty = 250;
                $destz = 355;
            }
    	}
    	if ($destx != 0) { #Key trigger found. Teleport nearby group members.
            my $tmpclient = 0;
        	for ($i = 0; $i < 2000; $i++) { #I would use a cycle of $client->GetGroup()->members[] but was having issues with it!
                $tmpclient = $entity_list->GetClientByID($i);
                if (defined($tmpclient)) {
                    if ($tmpclient->GetGroup()->IsGroupMember($client) #Grouped with key holder?
                        && $tmpclient->CalculateDistance($client->GetX(), $client->GetY(), $client->GetZ()) < 40) {
                        $tmpclient->CastToClient()->MovePC(111, $destx, $desty, $destz, 0);
                    }
               }
               undef($tmpclient);
            }
        }
   }
}
__________________

~Shin Noir
DungeonEQ.com
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 08:59 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3