-
item wearing problem
I have 2 problems.
The first one can be explained by pictures.
First I put on my bandos kite shield as normal:
[Only registered and activated users can see links. Click Here To Register...]
But look what happens:
[Only registered and activated users can see links. Click Here To Register...]
This happens for all wield items. It does it in the order you put them on. So if you put on a sword then a platebody the platebody would be listed as the weapon in the attack tab.
And here is the second problem.
My server does not have any item requirements. I looked in boolean wear and there is no CLAttack or anything that has to do with levels. I looked else where in my server and I am still not able to find anything. Here is my current boolean wear code:
Code:
public boolean wear(int wearID, int slot)
{
int targetSlot=0;
if(playerItems[slot] == (wearID+1))
{
if(targetSlot == 3)
{
updateWeapon(playerEquipment[playerWeapon]);
}
if(itemType(wearID).equalsIgnoreCase("cape"))
{
targetSlot=1;
}
else if(itemType(wearID).equalsIgnoreCase("hat"))
{
targetSlot=0;
}
else if(itemType(wearID).equalsIgnoreCase("amulet"))
{
targetSlot=2;
}
else if(itemType(wearID).equalsIgnoreCase("arrows"))
{
targetSlot=13;
}
else if(itemType(wearID).equalsIgnoreCase("body"))
{
targetSlot=4;
}
else if(itemType(wearID).equalsIgnoreCase("shield"))
{
targetSlot=5;
}
else if(itemType(wearID).equalsIgnoreCase("legs"))
{
targetSlot=7;
}
else if(itemType(wearID).equalsIgnoreCase("gloves"))
{
targetSlot=9;
}
else if(itemType(wearID).equalsIgnoreCase("boots"))
{
targetSlot=10;
}
else if(itemType(wearID).equalsIgnoreCase("ring"))
{
targetSlot=12;
}
else targetSlot = 3;
int wearAmount = playerItemsN[slot];
if (wearAmount < 1)
{
return false;
}
if(slot >= 0 && wearID >= 0)
{
SendWeapon(wearID, GetItemName(wearID));
deleteItem(wearID, slot, wearAmount);
if (playerEquipment[targetSlot] != wearID && playerEquipment[targetSlot] >= 0)
addItem(playerEquipment[targetSlot],playerEquipmentN[targetSlot]);
else if (Item.itemStackable[wearID] && playerEquipment[targetSlot] == wearID)
wearAmount = playerEquipmentN[targetSlot] + wearAmount;
else if (playerEquipment[targetSlot] >= 0)
addItem(playerEquipment[targetSlot],playerEquipmentN[targetSlot]);
}
outStream.createFrameVarSizeWord(34);
outStream.writeWord(1688);
outStream.writeByte(targetSlot);
outStream.writeWord(wearID+1);
if (wearAmount > 254)
{
outStream.writeByte(255);
outStream.writeDWord(wearAmount);
} else
{
outStream.writeByte(wearAmount); //amount
}
outStream.endFrameVarSizeWord();
playerEquipment[targetSlot]=wearID;
playerEquipmentN[targetSlot]=wearAmount;
ResetBonus();
GetBonus();
WriteBonus();
updateRequired = true; appearanceUpdateRequired = true;
return true;
}
else
{
return false;
}
}
If anyone can help me add item requirements that would be great.
So if you know how to fix any of these 2 problems please let me know how to fix them.
-
Instead of the API, equalsIgnoreCase perhaps make it contains.
-
You can do this in item4.java, Just open item4.java, Search for shields, and at the end before the }; add the bandos kite id. You can do this for all things.
-
well roger I tryed it and it didn't work. Still the same problem
and haloking this is a 317 source not 377 so it just has item.java, itemhandler and itemlist and plus I already have that in item.java and that just has to do with which slot it goes into not what shows on the attack tab.
-
Are you sure that the method is called upon when someone wields something?
-
yes it is
Code:
case 41: // wear item
int wearID = inStream.readUnsignedWord();
int wearSlot = inStream.readUnsignedWordA();
//if(playerRights == 2){message("WearItem: "+wearID+" slot: "+wearSlot);}
wear(wearID, wearSlot);
SendWeapon(wearID, GetItemName(wearID));
break;