summaryrefslogblamecommitdiff
path: root/npc/craft/tweak.txt
blob: ba5a4b2bb255f40efafa9a61aad25aa4fe084798 (plain) (tree)
1
2
3
4
5
6
7
8







                                                          


















                                                                         






                                                                            

                                        




                                                           



                            

                            

                     


                          
                        
                            
                                                        



                                       




                                       
                                                                  

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

// Usage: SmithTweakReset ()
// Asks if player wants to remove an item options. And remove them.
function	script	SmithTweakReset	{
    mesc l("Note: This action cannot be undone."), 1;
    mes l("Drag and drop here the item you want to remove the options.");

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

    // Ask player to confirm
    mesc l("Are you sure?"), 1;
    mesc l("Note: This action cannot be undone."), 1;
    if (!csys_Confirm(.@id))
        return;

    csys_Check();
    return;
}

// 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));

    mes l("Which item will you tweak?");
    mesc l("Note: You may fail to write skills to it."), 1;
    mesc l("Operation Cost: 600 GP"), 3;

    if (Zeny < 600)
        return false;

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

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

    // Take the money away
    Zeny-=600;

    // Check if you fail
    if (!csys_Check(.@id)) {
        mesc l("YOU FAIL! It is a simple item now."), 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! Congratulations, the item was improved!"), 3;
    return true;
}