Alright so I got a dialogue for max cape stand. Everything works except, anyone can buy the cape, for some reason the requirements dont work.
Heres the whole dialogue script:
Code:
package com.rs.game.player.dialogues;
import com.rs.Settings;
import com.rs.cache.loaders.ObjectDefinitions;
import com.rs.cores.CoresManager;
import com.rs.game.Animation;
import com.rs.game.ForceMovement;
import com.rs.game.Entity;
import com.rs.game.Graphics;
import com.rs.game.Hit;
import com.rs.game.World;
import com.rs.game.WorldObject;
import com.rs.game.WorldTile;
import com.rs.game.item.FloorItem;
import com.rs.game.item.Item;
import com.rs.game.player.content.*;
import com.rs.game.player.Skills;
import com.rs.game.tasks.WorldTask;
import com.rs.game.tasks.WorldTasksManager;
import com.rs.net.Session;
import com.rs.net.decoders.WorldPacketsDecoder;
import com.rs.net.encoders.WorldPacketsEncoder;
import com.rs.utils.*;
import com.rs.utils.Logger;
import com.rs.utils.SerializableFilesManager;
import com.rs.utils.Utils;
public final class MaxCapeStand extends Dialogue {
@Override
public void start() {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(), //This grabs your name and puts it at the top of the chat representing you talking to the npc
"It's the Max Cape Stand!" }, IS_PLAYER, //Watch your language!
player.getIndex(), 9827);
}
@Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
stage = 0;
sendDialogue(SEND_2_OPTIONS,
"Buy a Max Cape for 5m?",
"Yes!", "No.");
} else if (stage == 0) {
if (componentId == 1) {
if (player.getInventory().containsItem(995, 5000000)) {
player.getInventory().deleteItem(995, 5000000);
player.getInventory().addItem(20767, 1);
player.getInventory().addItem(20768, 1);
player.getPackets().sendGameMessage(
"<col=04B404>You just purchased a Max Cape!");
player.setNextAnimation(new Animation(2109));
}
end();
}
end();
}
}
@Override
public void finish() {
// TODO Auto-generated method stub
}
}
Please help, its a 667.