1 mesaj
  • Mesaje: 7
  • Reacții: 71
  • Mesaje utile: 0
  • Status: Tax's
  • Server: Mine
  • Regat: Chunjo
  • Medalii

    Hey everyone,
    So, the /ipurge command with window selection (inv, equip, ds, belt) has been floating around for a while... Nothing new there. But I always found it a bit annoying that if you wanted to clear just one inventory page, you couldn't. It's either nuke everything or nothing.

    So I extended it.
    Now you can do /ip inv 2 and only page 2 gets wiped. Small thing, but handy when you're testing stuff and don't want to lose that one page where you keep your "don't delete these" items.
    We've all been there, ig.


    See it here:
    GIF


    What's new here
    Code:
    /ip inv 1  → clears only page 1 (slots 0-44)
    /ip inv 2  → clears only page 2 (slots 45-89)
    /ip inv 3  → clears only page 3 (slots 90-134)
    /ip inv 4  → clears only page 4 (slots 135-179)
    The slot calculation is straightforward. Each page has INVENTORY_PAGE_SIZE slots (45 by default for me: 5 columns × 9 rows), so:
    Code:
    startSlot = (page - 1) * INVENTORY_PAGE_SIZE;
    endSlot = page * INVENTORY_PAGE_SIZE;
    Nothing fancy, just math.
    The page count depends on whether you're running extended inventory or not (INVENTORY_PAGE_COUNT will be 2, 4 or more. It depends how many you have).


    Find do_item_purge and replace it with ((in game/src/cmd_gm.cpp)):

    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


    Registering the command
    In cmd.cpp, make sure these entries exist in the command table (they should.. If not, you made something weird before or your files are questionable):

    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.

    Quick reference
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.

    Technical notes for dummies
    - SyncQuickslot is called after each removal to clean up any quickslot references.. Otherwise you'd end up with ghost slots pointing to deleted items.
    - ComputePoints() runs at the start and end to recalculate character stats properly. Removing equipped items affects bonuses, so this keeps everything in sync (safety ig).
    - The #define ENABLE_CMD_IPURGE_EX wraps the extended version. If you ever need to fall back to the basic "delete everything" behavior, just comment it out.
    Final note
    I've taken a lot from this forum, so figured I'd contribute back. Not sharing this elsewhere myself.
    If you do, just add credits... That's it, there's no big deal about a simple improvement anyway.

    Cum descarc de pe TeraBox?

    Afișează detalii Ascunde detalii
    • Este asemănător cu Mega.nz
    • Instalați-vă clientul lor de Download de aici
    • Faceți-vă un cont (vă puteți loga cu Facebook / Google / etc)
    • Dacă nu vreți să descărcați clientul de Download, folosiți acest site
    • Gata! Acum puteți descărca resursele

    De ce folosim TeraBox?

    • Este gratuit
    • Primești 1TB de spațiu gratuit la orice cont creat!
    • Este ușor de folosit și varianta premium este foarte ieftină
    • Fișierele nu sunt șterse niciodată
    TeraBox logo

    📢 Resurse Metin2 Premium!

    Zeci de resurse Metin2 Premium - exclusive și 100% funcționale începând cu 15.99€!.

    Vezi resursele Cumpără premium
    Premium
    Premium
    Anunț

    Creează-ți un cont sau autentifică-te pentru a participa la discuție

    Trebuie să fii membru pentru a răspunde

    Creează-ți un cont

    Membrii pot crea subiecte noi și pot descărca resurse Metin2 Gratuit!


    Te poți înregistra sau conecta rapid utilizând contul tău de Discord, Github sau Google.

    Înregistrare

    Autentifică-te

    Înapoi la “Îmbunătățiri”

    Informații

    Utilizatori ce navighează pe acest forum: madaliniulian, Ramir și 3 vizitatori

    Discord ID copiat: