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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-16-2008, 01:09 AM
James76
Sarnak
 
Join Date: Sep 2008
Location: Canada
Posts: 53
Default

ok I had some time to look at this... i disabled my code and I found I could click on the door for a while and it still wouldn't open. It looks like Client::Message_StringID(4,DOORS_LOCKED) has been hijacked with a flags check to unlock the door....

So one fix and one change.

In ./zone/doors.cpp it should look like:

Code:
		// a key is required or the door is locked but can be picked or both
		sender->Message(4,"This is locked...");		// debug spam - should probably go
		if (sender->GetGM())		// GM can always open locks - should probably be changed to require a key
		{
			sender->Message_StringID(4,DOORS_GM);
			if( !IsDoorOpen() || opentype == 58 )
			{ 
				md->action = OPEN_DOOR; 
			} 
			else
			{ 
				md->action = CLOSE_DOOR; 
			} 
		}
		else if (playerkey)
		{	// they have something they are trying to open it with
			if (keyneeded && keyneeded == playerkey)
			{	// key required and client is using the right key 
/*NEW*/				sender->KeyRingAdd(playerkey);
				sender->Message(4,"You got it open!");		// more debug spam
				if( !IsDoorOpen() || opentype == 58 )
				{ 
					md->action = OPEN_DOOR; 
				} 
				else
				{ 
					md->action = CLOSE_DOOR; 
				} 
			}
		}
		else if(lockpicks != NULL)
		{
			if(sender->GetSkill(PICK_LOCK))
			{
				if(lockpicks->GetItem()->ItemType == ItemTypeLockPick)
				{
					float modskill=sender->GetSkill(PICK_LOCK);
					sender->CheckIncreaseSkill(PICK_LOCK, 1);
#if EQDEBUG>=5
					LogFile->write(EQEMuLog::Debug,"Client has lockpicks: skill=%f", modskill);
#endif

					if(GetLockpick() <= modskill)
					{
						if(!IsDoorOpen())
						{ 
							md->action = OPEN_DOOR; 
						} 
						else
						{ 
							md->action = CLOSE_DOOR; 
						}
						sender->Message_StringID(4,DOORS_SUCCESSFUL_PICK);
					}
					else
					{
						sender->Message_StringID(4,DOORS_INSUFFICIENT_SKILL);
						return;
					}
				}
				else
				{
					sender->Message_StringID(4,DOORS_NO_PICK);
					return;
				}
			}
			else
			{
				sender->Message_StringID(4,DOORS_CANT_PICK);
				return;
			}
		}
		else
		{	// locked door and nothing to open it with
			//search for key on keyring
/*NEW*/			if(sender->KeyRingCheck(keyneeded)){
/*NEW*/				sender->Message(4,"You got it open!");		// more debug spam
/*NEW*/				if( !IsDoorOpen() || opentype == 58 )
/*NEW*/				{ 
/*NEW*/					md->action = OPEN_DOOR; 
/*NEW*/				} 
/*NEW*/				else
/*NEW*/				{ 
/*NEW*/					md->action = CLOSE_DOOR; 
/*NEW*/				} 
/*NEW*/			}
/*NEW*/			else 
/*NEW*/			{
				sender->Message_StringID(4,DOORS_LOCKED);
				return;
/*NEW*/			}
		}
	}

Then in ./zone/client.cpp add to very start of Client::KeyRingAdd()

Code:
if(0==item_id)return;
Now the PoI factory door works. The message is still FUNKY but whatever.
Reply With Quote
  #2  
Old 09-29-2008, 07:17 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Here's a fix for what I think were non working clicky-portals - what would happen is, for instance if I clicked on the zin to chariasis, I'd get the 'locked' message and zone anyways (any clicky zone that required a key would return 'locked' and port you anyway);

in doors.cpp at around line 287 replace this;
Code:
    if (opentype == 58 && strncmp(dest_zone,"NONE",strlen("NONE")) != 0 ){ // Teleport door!
        if ( strncmp(dest_zone,zone_name,strlen(zone_name)) == 0) {
  			//dunno why, but this dosent seem to work all the time:
            //sender->GMMove(dest_x,dest_y,dest_z);
           	sender->MovePC(dest_x, dest_y, dest_z, dest_heading);
        }
        else {
           	sender->MovePC(dest_zone, dest_x, dest_y, dest_z, dest_heading);
        }
    }
}
with this;

Code:
    if (opentype == 58 && strncmp(dest_zone,"NONE",strlen("NONE")) != 0 ){ // Teleport door! 
        if (( strncmp(dest_zone,zone_name,strlen(zone_name)) == 0) && (keyneeded && keyneeded == playerkey)) {
		sender->KeyRingAdd(playerkey);
           	sender->MovePC(dest_x, dest_y, dest_z, dest_heading);
	}
        if (( strncmp(dest_zone,zone_name,strlen(zone_name)) == 0) && (!keyneeded)) {
           	sender->MovePC(dest_x, dest_y, dest_z, dest_heading);
	}
       	else if (( !IsDoorOpen() || opentype == 58 ) && (keyneeded && keyneeded == playerkey)) {
             	sender->KeyRingAdd(playerkey);
		sender->MovePC(dest_zone, dest_x, dest_y, dest_z, dest_heading);
	}
       	if (( !IsDoorOpen() || opentype == 58 ) && (!keyneeded)) {  
    		sender->MovePC(dest_zone, dest_x, dest_y, dest_z, dest_heading);
  }
 }
}
I tested under many circumstances (PoK stone, Charasis, Paineel entrance, FrozenShadow mirrors, etc.) , seems to work ok.
You need '#gm off' to see keys work properly
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:31 PM.


 

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