EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   TradeSkills Patch (https://www.eqemulator.org/forums/showthread.php?t=4480)

Edgar1898 12-28-2002 04:46 PM

TradeSkills Patch
 
Replace the "switch(combin->tradeskill)" switch in client_process.cpp with the following:
Code:

switch(combin->tradeskill)
{
case 0x10:        //Tailoring
        tradeskill = 61;
        break;
case 0x12:        //Fletching
        tradeskill = 64;
        break;
case 0x14:        //Jewelry Making
        tradeskill = 68;
        break;
case 0x0F: // Baking
        tradeskill = 60;
        break;
case 0x09: //Alchemy
        if ((this->class_==10) & (this->level >=25))
                tradeskill=59;
        else if (this->class_!=10)
                this->Message(4,"This tradeskill can only be used by the Shaman class.");       
        else if (this->level<25)
                this->Message(4,"You can use this tradeskill until you reach a level of 25.");
        break;       
case 0x11: //Blacksmithing
        tradeskill=63;
        break;       
case 0x16: //Pottery
        tradeskill=69;
        break;
case 0x0A: //Tinkering
        if (this->race==12)
                tradeskill = 57;
        else
                this->Message(4,"This tradeskill is only available to the Gnomish race.");
break;
case 0x1B: //Research
        tradeskill = 58;
        break;
case 0x0C: //Make Poison
        if (this->class_==9)
                tradeskill=56;
        else
                this->Message(4,"This tradeskill is only available to the Rogue class.");
        break;
case 0x2E: //Fishing
        tradeskill=55;
        break;
default:
        cout << combin->tradeskill;
        this->Message(4,"This tradeskill has not been implemented yet, if you get this message send a petition and let them know what tradeskill you were trying to use.");
}


After you do that. Change the following:
Code:

if ((pp.gm==1) || (chance > ((float)rand()/RAND_MAX*100))){
                                                                this->Message(4,"You have fashioned the items together to create something new!");
                                                                PutItemInInventory(0,product,1);
                                                                for (int k=0; k<10; k++)
                                                                        if (pp.containerinv[(((int16)combin->containerslot-22)*10) + k] != 0xFFFF)
                                                                                DeleteItemInInventory(((combin->containerslot-22)*10) + k + 250);
                                                        }

To this:

Code:

if ((pp.gm==1) || (chance > ((float)rand()/RAND_MAX*100))){
                                                                this->Message(4,"You have fashioned the items together to create something new!");
                                                                PutItemInInventory(0,product,1);
                                                                for (int k=0; k<10; k++)
                                                                        if (pp.containerinv[(((int16)combin->containerslot-22)*10) + k] != 0xFFFF)
                                                                                DeleteItemInInventory(((combin->containerslot-22)*10) + k + 250,TRUE);
                                                        }


We added a boolean of true to the deleteitem so that it would update the clients items so they couldnt keep making the item with the same components. Do the same to:

Code:

else
                                                        {
                                                                this->Message(4,"You lacked the skills to fashion the items together.");
                                                                for (int k=0; k<10; k++)
                                                                        if (pp.containerinv[(((int16)combin->containerslot-22)*10) + k] != 0xFFFF)
                                                                                DeleteItemInInventory(((combin->containerslot-22)*10) + k + 250);
                                                        }

to make it:

Code:

else
                      {
                                                                this->Message(4,"You lacked the skills to fashion the items together.");
                                                                for (int k=0; k<10; k++)
                                                                        if (pp.containerinv[(((int16)combin->containerslot-22)*10) + k] != 0xFFFF)
                                                                                DeleteItemInInventory(((combin->containerslot-22)*10) + k + 250,TRUE);
                                                        }


I think that is all the tradeskills, if you find one I dont have listed, let me know and Ill find it. -LethalEncounter

Trumpcard 12-29-2002 02:23 AM

Ive merged this in... Thanks for the update!

Drawde 12-29-2002 04:48 AM

Great work, that should improve the functionality of tradeskills a lot (now all we need is ovens, forges, etc in the cities).
Will this also fix quest containers, or do they use a seperate tradeskill?


All times are GMT -4. The time now is 09:54 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.