Hey guys. So to test the marriages ring effect I wanted to create a command that'll add a ring to both of the characters and the ring to the database. This is my code:
Now for some odd reason, it keeps adding the same ring for both of the characters.. and I am trying to figure out why, so I hope you guys can help me with that.Code:Item i = MapleItemInformationProvider.getInstance().getEquipById(1112803); Equip item = (Equip) i; int ringid = MapleRing.createRing(i.getItemId(), chr, partner); item.setRingId(ringid); chr.getInventory(MapleInventoryType.EQUIP).addItem(item); chr.getClient().announce(MaplePacketCreator.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, item)))); chr.addMarriageRing(MapleRing.loadFromDb(ringid)); chr.dropMessage("Loaded ring " + MapleRing.loadFromDb(ringid).getRingId() + " " + MapleRing.loadFromDb(ringid).getPartnerName()); chr.getClient().disconnect(false, false); Equip ring = (Equip) i; ring.setSN(item.getSN()); item.setRingId((ringid+1)); partner.getInventory(MapleInventoryType.EQUIP).addItem(ring); partner.getClient().announce(MaplePacketCreator.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, ring)))); partner.addMarriageRing(MapleRing.loadFromDb((ringid+1))); chr.dropMessage("Loaded ring " + MapleRing.loadFromDb(ringid+1).getRingId() + " " + MapleRing.loadFromDb(ringid+1).getPartnerName());
UPDATE:
Fixed the issue, but now I can't wear the rings, when I double click them it just stays there and I have to dispose to be able to click items again. Any solution for that?
Regards,
Matt


Reply With Quote


