Sigex - SoulScape 6.2 destroy item with interface and item on interface
Right some guy wanted the frameID for the item,
but he didn't know how to create an item with an option on it.
So i mite as well just realease mine? :woot:
Right keep in mind each item has a different message,
so for this im going to use a String Switch system to change the text for each item.
Its small and has a default text option for any item you miss or just don't want to do..
Details
WARNING, I will not help you with any errors!
Step 1: Back up your server, this means your going to compress a copy as *.rar,zip or any other you may like to use
Step 2: add this $hit
[PHP] public int publicDroppendItem = 0;
public int destroyItemList[] = {4151,1333,/* Add item ids' here*/};
public boolean destroyItem(int item) {
for(int i = 0; i < destroyItemList.length; i++) {
if(destroyItemList[i] == item)
return true;
}
return false;
}
public String getMessageA(int itemID){
switch(itemID){
case 10336: return "You can get another pair of Fancy boots from the Stronghold of";
}
return "Are you sure you want to destroy this item!";
}
public String getMessageB(int itemID){
switch(itemID){
case 10336: return "Security.";
}
return "";
}[/PHP]
Next replace your packet 87 with this
[PHP] case 87://drop item - sigex
int droppedItem = inStream.readUnsignedWordA();
somejunk = inStream.readUnsignedByte() + inStream.readUnsignedByte();
int slot = inStream.readUnsignedWordA();
if(destroyItem(droppedItem)) {
outStream.createFrameVarSizeWord(34);
outStream.writeWord(14171);
outStream.writeByte( 0);
outStream.writeWord(droppedItem + 1);
outStream.writeByte(255);
outStream.writeDWord(1);
outStream.endFrameVarSizeWord();
sendFrame126("Are you sure you want to destroy this object?", 14174);
sendFrame126("Yes.", 14175);
sendFrame126("No.", 141756);
sendFrame126(""+GetItemName(droppedItem), 14184);
sendFrame126(getMessageA(droppedItem),14182);
sendFrame126(getMessageB(droppedItem),14183);
sendFrame164(14170);
publicDroppendItem = droppedItem;
} else if(wearing == false && playerItems[slot] == droppedItem+1){
dropItem(droppedItem, slot);
}
break;[/PHP]
Making the buttons work on the destroy interface add this switch case's to your packet 185
[PHP]case 55095://yes (destroy item)
deleteItem(publicDroppendItem, GetItemSlot(publicDroppendItem), 1);
closeInterface();
break;
case 55096://no (destroy item)
closeInterface();
break;[/PHP]
[Only registered and activated users can see links. Click Here To Register...]
There is a picture, of what it will look like you can work out how to add each items message your self or just keep them default...
Mite want to add the new colourfull boots id to the array were the 4151,1333 is (whip and rune scim remove them!)