Jump to content
  • 0
Sign in to follow this  
ZeldaCodes

[317][PI] Skillcape Shop

Question

Ok, so it doesn't happen very often, but i need help again guys.
One of my players informed me that my skillcape shop wasnt working(this was yesterday). So i checked it out, and it doesnt let you buy the cape, regardless of whether or not you have the skill for it.

I looked over my coding for it and neither i nor Eclipse see anything wrong with it.

Maybe one of you can tell me whats wrong here?
Shopassistant.java(skillcape related part only.)
[CODE] public int[] skillCapes = { 9747, 9753, 9750, 9768, 9756, 9759, 9762, 9801,
9807, 9783, 9798, 9804, 9780, 9795, 9792, 9774, 9771, 9777, 9786,
9810, 9765 };

public int get99Count() {
int count = 0;
for (int j = 0; j < c.playerLevel.length; j++) {
if (c.getLevelForXP(c.playerXP[j]) >= 99) {
count++;
}
}
return count;
}

public void setupSkillCapes(int capes, int capes2) {
synchronized (c) {
c.getItems().resetItems(3823);
c.isShopping = true;
c.myShopId = 14;
c.getPA().sendFrame248(3824, 3822);
c.getPA().sendFrame126("Skillcape Shop", 3901);

int TotalItems = 0;
TotalItems = capes2;
if (TotalItems > ShopHandler.MaxShopItems) {
TotalItems = ShopHandler.MaxShopItems;
}
c.getOutStream().createFrameVarSizeWord(53);
c.getOutStream().writeWord(3900);
c.getOutStream().writeWord(TotalItems);
for (int i = 0; i < 23; i++) {
if (c.getLevelForXP(c.playerXP[i]) < 99)
continue;
c.getOutStream().writeByte(1);
c.getOutStream().writeWordBigEndianA(skillCapes[i] + 2);
}
c.getOutStream().endFrameVarSizeWord();
c.flushOutStream();
}
}

public void skillBuy(int item) {
int nn = get99Count();
if (nn > 1)
nn = 1;
else
nn = 0;
for (int j = 0; j < skillCapes.length; j++) {
if (skillCapes[j] == item || skillCapes[j] + 1 == item) {
if (c.getItems().freeSlots() > 1) {
if (c.getItems().playerHasItem(995, 99000)) {
if (c.getLevelForXP(c.playerXP[j]) >= 99) {
c.getItems().deleteItem(995,
c.getItems().getItemSlot(995), 99000);
c.getItems().addItem(skillCapes[j] + nn, 1);
c.getItems().addItem(skillCapes[j] + 2, 1);
} else {
c.sendMessage("You must have 99 in the skill of the cape you're trying to buy.");
}
} else {
c.sendMessage("You need 99k to buy this item.");
}
} else {
c.sendMessage("You must have at least 1 inventory spaces to buy this item.");
}
}
}
c.getItems().resetItems(3823);
}

public void openVoid() {
}

public void buyVoid(int item) {
}

}
[/CODE]
Thanks in advance,
Zelda

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0
Is there a sendMessage sent when they try to buy a cape, also post your shop in shops.cfg

Share this post


Link to post
Share on other sites
  • 0
Its set up to send a message, but it doesn't. The shop opens fine, but its as if there just pictures with options, but the options don't work...
Shops.cfg(Bear in mind, the skillcape shop in there is a temp i made so players can at least get them for now...)
[CODE]//-----ShopID---ShopName----------------------------------------Sell----Buy-----Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount
shop = 1 General_Store 1 1 590 100 1755 100 2347 100 952 100 946 100 228 10000 1540 30 1523 100 7947 10000 385 100000 386 100000 314 10000 2368 3
shop = 2 Aubury's_Magic_Store 2 2 554 50000 555 500000 556 50000 557 50000 558 50000 559 50000 562 50000 563 500000 565 10000 561 35000 560 500000
shop = 7 Stall_Items 2 2 1897 1 1898 1 950 1 951 1 1635 1 1636 1 7650 1 7651 1 1613 1 1614 1
shop = 3 Archer_Store 2 2 882 50000 884 50000 886 50000 888 50000 890 50000 892 50000 841 200 843 200 849 200 853 200 857 200 861 200 1129 200 1095 200 1135 200 1099 200 1065 200 2499 200 2493 200 2487 200 2501 200 2495 200 2489 200 9185 200 9140 10000 9141 10000 9142 10000
shop = 4 Armour_Store 2 2 1153 100 1115 100 1067 100 1191 100 1157 100 1119 100 1069 100 1193 100 1165 100 1125 100 1077 100 1195 100 1159 100 1121 100 1071 100 1197 100 1161 100 1123 100 1073 100 1199 100 1163 100 1127 100 1079 100 1201 100 3749 100 3751 100 3753 100 3755 100 10828 100 5574 100 5575 100 5576 100
shop = 5 Weapon_Store 2 2 1323 200 1325 200 1327 200 1329 200 1331 200 1333 200 4587 200 1215 200 1309 200 1311 200 1313 200 1315 200 1317 200 1319 200 1305 200 1434 200 1203 200 1207 200 1217 200 1209 2000 1211 200 1213 200 3204 200
shop = 6 Supply_Store 2 2 544 200 542 200 1035 200 1033 200 7534 200 2428 200 113 200 2432 200 6109 200 6111 200 6107 200 6108 200 6110 200 6106 200 3105 200 1725 200 1731 200 5574 200 5575 200 5576 200 656 200 658 200 660 200 662 200 664 200 579 200 1017 200 7458 200 7459 200 7460 200
shop = 8 Skilling_Store 2 2 590 100 1755 100 2347 100 946 100 1349 100 1359 100 1267 100 1275 100 228 100000 1437 100000 5291 100 5292 100 5293 100 5294 100 5295 100 5296 100 5297 100 5298 100 5299 100 5300 100 5301 100 5302 100 5303 100 5304 100 1623 10000 1621 10000 1619 10000 1617 10000 1631 10000 1745 10000 2505 10000 2507 10000 2509 10000 1733 1000 303 1000 311 1000 301 1000
shop = 17 Mage_Arena_Store 2 2 6889 1 6914 1 6920 1 6918 1 6916 1 6924 1 6922 1
shop = 18 Pest_Control_Shop 2 2 8839 1 8840 1 11663 1 11664 1 11665 1 10551 1 10499 1 8842 1 8845 1 8846 1 8847 1 8848 1 8849 1 8850 1 7462 1
shop = 19 Zaff's_Staves 2 2 1379 1000 1381 1000 1383 1000 1385 1000 1387 1000 1389 1000 1391 1000 1393 1000 1395 1000 1397 1000 1399 1000
shop = 9 @[email protected]_Outfits! 2 2 3057 1000 3058 1000 3059 1000 3060 1000 3061 1000 6184 1000 6185 1000 6186 1000 6187 1000 6188 1000 6180 1000 6181 1000 6182 1000 7592 1000 7593 1000 7594 1000 7595 1000 7596 1000 775 1000 1837 1000
shop = 10 @[email protected]_Store 2 2 11730 100 11694 100 11696 100 11698 100 11700 100 11718 100 11720 100 11722 100 11724 100 11726 100 11728 100 11732 100 11716 100 1053 100 1055 100 1057 100 1038 100 1040 100 1042 100 1044 100 1046 100 1048 100 1050 100 989 100 11284 100
shop = 11 @[email protected]_Shop 2 2 7455 100 7456 100 7457 100 7458 100 7459 100 7460 100 7461 100 7462 100 4151 100 4153 100 10551 100
shop = 12 @[email protected]_Shop 2 2 9747 100 9753 100 9750 100 9768 100 9756 100 9759 100 9762 100 9801 100 9807 100 9783 100 9798 100 9804 100 9780 100 9795 100 9792 100 9774 100 9771 100 9777 100 9786 100 9810 100 9765 100
shop = 13 @[email protected]_Shop 2 2 6585 1000 4151 1000 6571 10000 3140 1000 4087 1000 1149 1000 1187 1000 2615 1000 2617 1000 2619 1000 2621 1000 2623 1000 2625 1000 2627 1000 2629 1000 537 100000
[ENDOFSHOPLIST][/CODE]

Share this post


Link to post
Share on other sites
  • 0
You realize what a bump is? Wait 24 hours. You've waited 10. Learn to count.

Share this post


Link to post
Share on other sites
  • 0
i didnt realize there was a time limit... sorry... i thought once it went off the side bar u could bump

Share this post


Link to post
Share on other sites
  • 0
Ahh. Well next time read the rules :P (if it's in there). But yeah gl finding.

Share this post


Link to post
Share on other sites
  • 0
[code]
if(!shopSellsItem(itemID) && c.myShopId != 12)
return false;
[/code]
Try adding this into shopassistant

You should have this somewhere, replace it with that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×