PDA

View Full Version : 317 Crafting [DELTA] - 22 lines of code



-V.
July 13th, 2010, 12:45
Ctrl + F for

case 53:

Should find some shit like:

// Use item on item
int usedWithSlot = inStream.readUnsignedWord();
int itemUsedSlot = inStream.readUnsignedWordA();
int useWith = playerItems[usedWithSlot] - 1;
int itemUsed = playerItems[itemUsedSlot] - 1;
if (!playerHasItem(itemUsed) || !playerHasItem(useWith)) {
break;
}

After the curly bracket at the end, add:

int chisel = 1755;

int[] uncut = {1623, 1621, 1619, 1617, 1631};
int[] cut = {1607, 1605, 1603, 1601, 1615};
int[] craftxp = {200, 400, 619, 1000, 2500};
int[] craftlvl = {1, 20, 40, 60, 80};

if((itemUsed == chisel) || (useWith == chisel))
{
for(int C = 0; C < uncut.length; C++)
{
if((itemUsed == uncut[C]) || (useWith == uncut[C]))
{
if(playerLevel[12] >= craftlvl[C])
{
deleteItem(uncut[C], getItemSlot(uncut[C]), 1);
addItem(cut[C], 1);
addSkillXP(craftxp[C], 12);
setAnimation(885);
}
}
}
}

I did it this way because I didn't understand/couldn't be fucked to do it whatever other ways there are ):

Suggest adding this if you're working with DeltaClean, or another blank delta source.

PS - I don't want fags ranting to me about how delta sucks.

KoRn
July 14th, 2010, 08:51
=) First tutorial that i needed and liked today. Good Job!

Charlie`
July 14th, 2010, 09:00
Yeah, Good Tutorial Nice.

trob
April 10th, 2011, 01:16
what does it actually do though?

totalpk
April 29th, 2011, 01:49
what does it actually do though?

He created 4 arrays and a for loop that cycles through the arrays until it finds an uncut gem that the player has, and since he placed the type of gem uncut, cut, level required, and xp gained in the same spot. EX sapphire first in cut and uncut, and sapphire xp and level first in craftlvl and craftxp. C is equal to the type of gem the player has along with the corresponding gem you get from cutting, experience gained, and level required the player is given the correct rewards for crafting.