Jump to content
  • 0

Setlook Disguise NPC


xG000000

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.01
  • Content Count:  16
  • Reputation:   0
  • Joined:  10/07/20
  • Last Seen:  

I've shorten the script for better viewing, how can I make this script choose what is on my inventory instead of choosing in the menu. Also Instead of paying coin(20000) i would like to change the requirement on what i choose on my inventory, for example, i choose Anniversary Hat on my inventory therefore the item will be deleted after its done.

Quote

 

L_top:    // Top Headgears
    mes "[Premium Disguise]";
    mes "Which one do you want?";
    menu "1. 2nd Anniversary Hat",t1,"Nevermind",L_end;
        next;
L_mid:    // Middle Headgears
    mes "[Premium Disguise]";
    mes "Which one do you want?";
    menu "Nevermind",L_end;
        next;
L_lower:    // Lower Headgears
    mes "[Premium Disguise]";
    mes "Which one do you want?";
    menu "Nevermind",L_end;
        next;
        
t1:        callsub S_GetHeadgear,"top",500, "2nd Anniversary Hat",109;

L_reset:
    set hastop,0;
    set hasmid,0;
    set haslow,0;
    mes "[Premium Disguise]";
    mes "Options have been reset.";
L_end:
    close;

S_GetHeadgear:
// getarg(0) = type ("top", "mid", or "low")
// getarg(1) = cost in Reward Coins
// getarg(2) = "item name"
// getarg(3) = view_id
    if (getd("#"+getarg(0)+getarg(3)) < 1) {
        mes "[Premium Disguise]";
        mes "Sorry, you have not yet purchased or unlocked this headgear.";
        mes "Would you like to purchase access to it for "+getarg(1)+" Reward Coins?";
        next;
        if (select("Yes:No")==2) close;
        else if (countitem(20000) < getarg(1)) {
        mes "[Premium Disguise]";
        mes "Sorry, you don't have enough coins. Come back when you do!";
        close; 
        }
        mes "[Premium Disguise]";
        mes "Alright, thank you! You can now access the "+getarg(2)+" headgear.";
        delitem 20000,getarg(1);
        setd "#"+getarg(0)+getarg(3),1;
    }
    setd "has"+getarg(0),1;
    setd "premium"+getarg(0),getarg(3);
         if (getarg(0) == "top") changelook 4,getarg(3); // LOOK_HEAD_TOP
    else if (getarg(0) == "mid") changelook 5,getarg(3); // LOOK_HEAD_MID
    else if (getarg(0) == "low") changelook 3,getarg(3); // LOOK_HEAD_BOTTOM
    mes "[Premium Disguise]";
    mes "New disguise applied to "+getarg(0)+" headgear.";
    close;

OnPCLoginEvent:
    if (hastop) changelook 4,premiumtop; 
    if (hasmid) changelook 5,premiummid; 
    if (haslow) changelook 3,premiumlow;
    end;
}

 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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

What is the point of create a npc just to preview an item that already exists in your inventory? You can just right away equip the item that exists in your inventory to preview it.

Preview feature should be implemented for something that currently doesn't exists.

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...