- Joined
- Jan 4, 2010
- Messages
- 123
- Reaction score
- 9
Hello I am in the process of making a Boss Gachapon System, credits to 'Cure' for the idea.
I have the script complete and it is working great.
One of the players in my community alerted me that they had one item and pulled the item again, but did not receive a duplicate of the same item. I noticed that since some of the items are boss/end game equips that they are "one of a kind", thus you are only allowed to have one in your inventory or equipped.
Can someone please help me add a check to make sure they don't already have the item equipped or in their inventory.
By this I mean not checking for a specific item, but checking if an item is "one of a kind" or not in general .
Also I am using HeavenMS Source
I believe the check will need to be made on status 1 selection 0
Thank you for any tips!~
I have the script complete and it is working great.
One of the players in my community alerted me that they had one item and pulled the item again, but did not receive a duplicate of the same item. I noticed that since some of the items are boss/end game equips that they are "one of a kind", thus you are only allowed to have one in your inventory or equipped.
Can someone please help me add a check to make sure they don't already have the item equipped or in their inventory.
By this I mean not checking for a specific item, but checking if an item is "one of a kind" or not in general .
Also I am using HeavenMS Source
I believe the check will need to be made on status 1 selection 0
PHP:
} else if (status == 1) {
name = cm.getPlayer().getName();
if (selection == 0 && (cm.haveItem(currency, 1))) {
if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.EQUIP).isFull(weaponAmount)) {
var weaponStr = "";
for(var i = 0; i < weaponAmount; i++) {
var weapon = prizes[Math.floor(Math.random() * prizes.length)];
cm.gainItem(weapon, 1, true, true);
cm.gainItem(currency, -1);
cm.gainExp(10000000);
cm.sendOk("You have successfully did a Gachapon Pull\r\n\r\n#fUI/UIWindow.img/QuestIcon/4/0#\r\n#rYou've pulled a \r\n\r\n#v"+weapon+"#\r\n\r\n#kI hope you enjoy your prize!!");
cm.dispose();
cm.worldMessage(6, "[Boss Gach] WOW "+name+" Just got a prize from the Boss Gachapon!! ");
}
} else {
cm.sendOk("Please make sure you have enough space to hold the items!");
cm.dispose();
}
Thank you for any tips!~
Last edited: