Newbie Spellweaver
- Joined
- May 24, 2017
- Messages
- 57
- Reaction score
- 1
Something that the internet cafe in MSEA did? Basically, if you were connected to internet cafe you had temp 'internet cafe' items which would disappear once you log out.
Easier to do if you just don't actually give the item to the player and it's only a visual.oh yeah and make sure they can't escape the map by using a telerock or some sort (exploiting it).
Yeah. I coded something quite similar to this, using a item flag was never used for anything, this was in v117 though. So, basically all you need to do is make a npc that gives an item with a certain flag, add one from the normal ones or code one, then once they leave, prefer doing it though a NPC, and it possible to only leave through that NPC, it will delete all items that have that flag in your inventory, and/or equipped. If you want to do a safety check, add a check in to see if they have any equipped while logging in, deleting them, of course.
poop, I sort of want to code this myself now, haha.
I'm not sure I understand what you mean by giving them a visual and not actually the item.Easier to do if you just don't actually give the item to the player and it's only a visual.
Ignore some checks while in xx map, ezpz no item gen/dupe exploits.
How you properly remove it once they leave is up to you. Can do some extra checks or something, resend SetField, etc
This is the simplest solution, in my opinion.Do you mean like make it so every equip gained from that NPC has a custom name tag and just remove every item gained with that name tag when they leave the map?
This is the simplest solution, in my opinion.
Setting the item owner to a specific tag, maybe something like "tmp" (so that you don't risk legit name tags to be mistaken by the server and accidentally deleted), and then having the server remove any player item with that very nametag, upon map change, disconnection, or channel change.
This is the simplest solution, in my opinion.
Setting the item owner to a specific tag, maybe something like "tmp" (so that you don't risk legit name tags to be mistaken by the server and accidentally deleted), and then having the server remove any player item with that very nametag, upon map change, disconnection, or channel change.
Is there a guide that would be helpful for this example?This is the incorrect solution, Arnah's is better.
Pure visual is the way to go. You can craft packets that display the items you want without actually modifying their inventory objects. (This is what I did on ArcticMS)
I actually think that would be abused since players could packet edit to travel to another map and skip the NPC that removes the item.
Is there a guide that would be helpful for this example?
private static void addInventoryInfo(final OutPacket packet, User user) {
for (byte i = 1; i <= 5; i++) {
packet.encode1(user.getInventory(InventoryType.getByType(i)).getSlotLimit());
}
packet.encode8(getTime(-2));
Inventory iv = user.hasFakeInventory() ? user.getFakeInventory() : user.getInventory(InventoryType.EQUIPPED);
private static void addCharEquips(final OutPacket packet, User user) {
Inventory equip = !user.hasFakeInventory() ? user.getInventory(InventoryType.EQUIPPED) : user.getFakeInventory();
public Inventory buildFakeEquipped(User base, int... items) {//maybe other stuff later..
generateFakeInventoryObject(base);
Inventory fake = getFakeInventory();
ItemInformationProvider mi = ItemInformationProvider.getInstance();
List<Pair<Equip, Short>> eq = new ArrayList<>();
if(base != null) {//copy all eq from a user
public void checkFakeEquip(boolean keep, boolean silent) {
if(!keep && hasFakeInventory()) {
cleanFakeInventory(false);//just incase?
styleCopy(this);//this is either genius or stupid
if(!silent) dropMessage(5,"Your trial equipment has been reverted.");
this.fakeInventory=null;//fkk
map.broadcastMessage(this, ArcticPacket.updateCharLook(this), false);
}
}
But you'd have no NPC to remove the item; simply remove, from the player inventory, any item with tag "tmp", upon player cc, relog, map change.I actually think that would be abused since players could packet edit to travel to another map and skip the NPC that removes the item.
I'm willing to pay to anyone who has the full code to this feature, please PM me or reply here.
You must be registered to see links
It seems that Ronan added a command that can fit your exact needs. Haha. Was commited like a day ago.