Originally Posted by
Luke132
The right click packet will send the variable of which NPC it is, you use that id instead (look how attack NPC works).
Show me the packet code for when you click the thieve button and i'll sort it
do you mean this?
Code:
case SECOND_CLICK:
c.npcClickIndex = c.inStream.readUnsignedWordBigEndianA();
c.npcType = NPCHandler.npcs[c.npcClickIndex].npcType;
if (c.goodDistance(NPCHandler.npcs[c.npcClickIndex].getX(),
NPCHandler.npcs[c.npcClickIndex].getY(), c.getX(),
c.getY(), 2)) {
c.turnPlayerTo(NPCHandler.npcs[c.npcClickIndex].getX(),
NPCHandler.npcs[c.npcClickIndex].getY());
NPCHandler.npcs[c.npcClickIndex].facePlayer(c.playerId);
c.getActions().secondClickNpc(c.npcType);
} else {
c.clickNpcType = 2;
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
if ((c.clickNpcType == 2)
&& NPCHandler.npcs[c.npcClickIndex] != null) {
if (c.goodDistance(c.getX(), c.getY(),
NPCHandler.npcs[c.npcClickIndex].getX(),
NPCHandler.npcs[c.npcClickIndex].getY(), 1)) {
c.turnPlayerTo(
NPCHandler.npcs[c.npcClickIndex].getX(),
NPCHandler.npcs[c.npcClickIndex].getY());
NPCHandler.npcs[c.npcClickIndex]
.facePlayer(c.playerId);
c.getActions().secondClickNpc(c.npcType);
container.stop();
}
}
if (c.clickNpcType < 2 || c.clickNpcType > 2)
container.stop();
}
@Override
public void stop() {
c.clickNpcType = 0;
}
}, 1);
}
break;