1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public int gainGachaponItem(int id, int quantity) {
return gainGachaponItem(id, quantity, c.getPlayer().getMap().getStreetName() + " - " + c.getPlayer().getMap().getMapName());
}
public int gainGachaponItem(int id, int quantity, final String msg) {
try {
if (!MapleItemInformationProvider.getInstance().itemExists(id)) {
return -1;
}
final IItem item = MapleInventoryManipulator.addbyId_Gachapon(c, id, (short) quantity);
if (item == null) {
return -1;
}
final byte rareness = GameConstants.gachaponRareItem(item.getItemId());
if (rareness > 0) {
World.Broadcast.broadcastMessage(MaplePacketCreator.getGachaponMega("[" + msg + "] " + c.getPlayer().getName(), " : 從轉蛋機轉到了!", item, rareness,c.getChannel()-1).getBytes());
}
return item.getItemId();
} catch (Exception e) {
e.printStackTrace();
}
return -1;
}