Quote:
Originally Posted by Trumpcard
Post diffs if you can..
line33 in zone.h is around the zonepoint struct, im assuming you want these functions to be in the public section of the zone class...
And in client process, i cant tell if you replaced exisitng funcitons, or completely new..
Please post the changed .cpp files, or diffs, or EXACT instructions. I'll merge in what I see in COMMENTS.
Also, whats
int16 GetKeyItem() {return keyitem;}
int16 GetLockpick() {return lockpick;}
You dont define keyitem or lockpick anywhere, so until those are defined, those are unknown variables....
|
...keyitem and lockpick are variables in the doors header file.
(I think he ment doors.h instead of zone.h --- but maybe I am wrong)
*********************************************
EDIT
*********************************************
Please note give all credit to used_pawn for the initial code - I'm just bored right now and thought I'd add some to the code provided.
The following code takes his code where it checks for if the client is holding the key for the door/object on the cursor and checks if the skill of the client is greater than zero ... also the end of his code (your sniplet used_pawn ) opens the door anyways ... which should be enclosed inside a pair of {}'s where it checks for a successful lock pick or if the client actually has the key ... but here is the code ...
else if( this->GetClass() == 8 || this->GetClass() == 9 ) //: Check if the class is a bard or a rogue
{
int16 Cursor_Item = this->GetItemAt(0);
int16 Gloves_Item = this->GetItemAt(12); // Glove/hand slot
bool Has_LockPicks = false;
float Skill_Mod = 0.0f;
float Final_PickSkill = 0.0f;
if(Cursor_Item == 13010) // Normal Lockpicks - no skill mod
Has_LockPicks = true;
else if(Cursor_Item == 16865 ) // Mechanical(spelt Mechanized in the db) lockpicks ...3% skill mod
{
Skill_Mod = 0.03f;
Has_LockPicks = true;
}
if( Gloves_Item == 19702 ) // Gloves of the brood - 3% skill mod
Skill_Mod = 0.03f;
if( Has_LockPicks == true )
{
Final_PickSkill = Skill_Mod * (GetSkill(35));
if( Final_PickSkill > currentdoor->LockPick() )
{
this->Message(4, "You have successfully picked the pick!");
if(!currentdoor->IsDoorOpen())
{
currentdoor->HandleClick(this);
md->action = 0x02;
}
else
{
currentdoor->HandleClick(this);
md->action = 0x03;
}
int8 action = md->action;
entity_list.QueueClients(this,outapp,false);
delete outapp;
if(currentdoor->GetTriggerDoorID() != 0)
{
Doors* triggerdoor = entity_list.FindDoor(currentdoor->GetTriggerDoorID());
if(triggerdoor)
{
if(!triggerdoor->IsDoorOpen())
{
triggerdoor->HandleClick(this);
action = 0x02;
}
else
{
triggerdoor->HandleClick(this);
action = 0x03;
}
outapp = new APPLAYER(OP_MoveDoor, sizeof(MoveDoor_Struct));
MoveDoor_Struct* md=(MoveDoor_Struct*)outapp->pBuffer;
md->doorid = triggerdoor->GetDoorID();
md->action = action;
entity_list.QueueClients(this,outapp,false);
delete outapp;
}
}
}
// Chance to increase the skill if it is not maxxed
if( this->GetSkill(35) < this->MaxSkill(35) )
{
sint16 Chance = 1; // 1% chance to increase the skill (not sure if this is right..)
if (rand()%100 == Chance)
SetSkill(skillid,GetSkill(35)+1);
}
}
}