Jump to content
  • 0

Repair All NPC.


Eyjafjallajokull

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  01/09/13
  • Last Seen:  

I know it's been in existence since forever and there are a few other ones posted online, but I'm trying to make one from scratch.

I know it's no big dealz and a lame script or whatever, but If anyone could help me out that would be sweeet and greatly appreciated. :')


Pretty much what I want is for it to require 1 steel per repair. But it will do it all in one swoop with a repairall; instead of a menu or one by one.

It will display the amount of broken IDs in your inventory.

And from there it will delete the correct amount of steel needed for repairs.

My problem is (basically, I'm still a noob at all this) that I can't seem to set arrays right or whatever.

Or maybe I'm going about this in a totally wrong way.

 

Here's what I have so far:

 

        set .@id, 999;
        set .@repaircount, countitem(getbrokenid(1));
        set .@steelcount, countitem(999);
        mes "[ ^0065DFBlair^000000 ]";
        mes "To repair gears; I need ^666666steel^000000.";
        mes "That's one steel per repair.";
        mes " ";
        mes "You have ^FF0000"+.@repaircount+"^000000 broken items.";
        mes "You have ^FF0000"+.@steelcount+"^000000 steel.";
        menu "Continue.",-,"Nevermind.",norepair;
        next;
        if(getbrokenid(1) == NULL) goto allgood;
        if(!countitem(.@id)) goto needsteel;
        delitem .@id,.@repaircount;
        while (getbrokenid(1)) 
    {
        repairall;
        set .@i, .@i +1;
    }
        if (.@i) dispbottom .@i + " items have been successfully repaired.";
        specialeffect2 101;
        end;
allgood:
        next;
        mes "[ ^0065DFBlair^000000 ]";
        mes "All your items are ^669933intact^000000.";
        end;
        
needsteel:
        next;
        mes "[ ^0065DFBlair^000000 ]";
        mes "You ^FF0000don't have^000000 steel.";
        end;
        
norepair:
        end;

 

 
I'm thinking the reds are my problem areas. Like, maybe I can't just count items of the broken IDs, and rather should be using some inventory list script instead.
I've looked at some getinventorylist scripts but I can't seem to grasp it. :0
 
Anyway, any input is super appreciated. Thanks a bunch in advance if anyone helps. :)
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  01/09/13
  • Last Seen:  

You forgot(?) to add the delete part but I figured that out easily based off everything else.

 

But I'm not complaining. It works and it's beautiful. Thank you, almighty Emistry. :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...