summaryrefslogblamecommitdiff
path: root/npc/craft/tweak.txt
blob: d46a80db65e48b0007f2ddab7937ea2347a9982f (plain) (tree)






















                                                                            

                            

                     
                        
                            




                                                    




                                       


                          
// TMW2 Script
// Author:
//  Jesusalva
// Description:
//  Smith System (Player, Guild, NPC)
// Notes:
//  It's like smithing, but it only change an item options

// Usage: SmithTweakSystem ({scope})
// Scopes: CRAFT_PLAYER, CRAFT_NPC
// Returns true on success, false on failure
function	script	SmithTweakSystem	{
    // Set .scope, .knowledge and .success
    .scope=getarg(0, CRAFT_PLAYER);
    copyarray(.knowledge,RECIPES_EQUIPMENT,getarraysize(RECIPES_EQUIPMENT));
    .success=false;

    mes l("Which item will you tweak?");
    mesc l("WARNING, ITEM MAY BREAK"), 1;

    .@id=requestitemindex();
    mes "";

    // Ask player to confirm
    if (!csys_Confirm(.@id))
        return false;

    // Check if you fail
    if (!csys_Check(.@id)) {
        mesc l("ITEM BREAKS, ALL OPTIONS LOST!"), 1;
        return false;
    }

    // Eh, apply some stuff for testing
    if (is_gm() && !CRAFTSYS_CURRENT) {
        CRAFTSYS_CURRENT=CRGROUP_BASE;
        CRAFTSYS[CRGROUP_BASE]=10;
    }
    csys_Apply(.@id);
    mesc l("SUCCESS!"), 3;
    return true;
}