OK.. got my groove on now..here is the 'final' version
complete with lockpick items suggested by zern and their skill mods
again, sorry about my original post, guess i shouldn't do that when im up past my bed time, hehe
(/zone/doors.h) new code at line 33
//used_pawn
int16 GetKeyItem() {return keyitem;}
int16 GetLockpick() {return lockpick;}
//
(/zone/client_process.cpp) line 4904
REPLACE this section:
if(!currentdoor->IsDoorOpen())
{
currentdoor->HandleClick(this);
md->action = 0x02;
}
else
{
currentdoor->HandleClick(this);
md->action = 0x03;
}
with this:
//used_pawn: Locked doors! Rogue friendly too =)
if((currentdoor->GetKeyItem()==0) || (currentdoor->GetKeyItem()==this->GetItemAt(0)))
{
//door not locked, or door is locked & client is using key
if(!currentdoor->IsDoorOpen())
{
currentdoor->HandleClick(this);
md->action = 0x02;
}
else
{
currentdoor->HandleClick(this);
md->action = 0x03;
}
}
else
{
//door is locked, client is NOT using key
if(this->GetSkill(35)>0) //no need to check for class, only bard/rogue will (should) have picklocks skill > 0, allows GM's to picklocks also
{
bool has_lockpicks=false;
float modskill=0.0f;
if(this->GetItemAt(0)==13010) //lockpicks
{
modskill=this->GetSkill(35); //no skill mod
has_lockpicks=true;
}
if ((this->GetItemAt(0)==16865)||(this->GetItemAt(12)==19702)) //mechanized lockpicks and gloves of the brood
{
modskill=0.3f*this->GetSkill(35)+this->GetSkill(35); //3% skill mod
has_lockpicks=true;
}
if(has_lockpicks)
{
if(rand()%100<2)this->SetSkill(35,this->GetSkill(35)+1); //1% chance skill increase
if((float)(rand()%currentdoor->GetLockpick())<=modskill)
{
if(!currentdoor->IsDoorOpen())
{
currentdoor->HandleClick(this);
md->action = 0x02;
}
else
{
currentdoor->HandleClick(this);
md->action = 0x03;
}
Message(4,"You picked the lock!");
}
else
{
Message(4,"Your skill is not high enough for this door.");
}
}
else
{
Message(4,"It's locked and you don't have the key!");
}
}
}
//end used_pawn
|