Added code for locked doors, picking locks etc...
I dont know how to submit for CVS, so ill put it here (hope thats ok)
changes are to CVS code current as of june 11, 10pm CST
(/zone/doors.h) new code at line 33
//used_pawn
int16 GetKeyItem() {return keyitem;}
int16 GetLockpick() {return lockpick;}
//
(/zone/client_process.cpp) new code at line 4904
//used_pawn: Locked doors! Rogue friendly too =)
//TODO: add check for other lockpick items
if((currentdoor->GetKeyItem()==0) || (currentdoor->GetKeyItem()==this->GetItemAt(0)))
{
if(!currentdoor->IsDoorOpen())
{
currentdoor->HandleClick(this);
md->action = 0x02;
}
else
{
currentdoor->HandleClick(this);
md->action = 0x03;
}
}
else
{
if((this->GetItemAt(0)==13010)&&(this->GetSkill(35)>0))
{
if(rand()%100<2)this->SetSkill(35,this->GetSkill(35)+1);
if(rand()%currentdoor->GetLockpick()<=this->GetSkill(35))
{
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
(/zone/client_process.cpp) old code to be replaced at line 4904
if(!currentdoor->IsDoorOpen())
{
currentdoor->HandleClick(this);
md->action = 0x02;
}
else
{
currentdoor->HandleClick(this);
md->action = 0x03;
}
sorry, my tabs didnt copy/paste =(
it works very well,has chance of success if skill to low on pick locks, has messages (close as i remember to eqlive) and skill increases for pick locks (chance for increase is 1% per attempt, may need adjusted)
not sure if i need to check if client is a rogue/bard (it ignores picking locks if skill = 0 )
i dont know if i need to check for maxskill on pick locks or not (i assumed the setskill() handles this, please let me know if i assumed wrong)
Also, i dont remember what all items can be used for picking locks so only the basic lockpicks are valid
EDIT: edited to reflect errors i had made in the post
|