- 0
This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
xbarel
Πως μπορώ να βάλω μια if ώστε μετά τον έλεγχο που κάνει στο inventory να κάνει και έλεγχο εάν ο player έχει αγοράσει το skill ?
server h5
if (event.startsWith("regalarSkillsFighter1"))
{
StringTokenizer st = new StringTokenizer(event, " ");
st.nextToken(); // regalarSkills
try
{
if (player.getInventory().getItemByItemId(ITEMD_ID).getCount() < ITEM_COUNT)
{
player.sendMessage("You don't have enough items! I need" + " " + ITEM_COUNT +" " + ITEM_NAME + " Per Skill");
}
else
{
player.addSkill(SKILLSFIGHTER1.get(Integer.parseInt(st.nextToken())).getSkill(), true);
player.destroyItemByItemId("consume", ITEMD_ID, ITEM_COUNT, player, true);
player.broadcastStatusUpdate();
player.broadcastUserInfo();
player.sendPacket(new UserInfo(player));
player.sendPacket(new ExBrExtraUserInfo(player));
player.sendMessage("Page1: You have learned a new Fighter skill!");
return GenerateHtmlRegalosFighter1(player);
}
}
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now