viewing paste ToastofDoom - Item Previe | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
//============================================================
//= Preview Item Script
//===== By: ==================================================
//= iHeart
//===== Current Version: =====================================
//= 1.01
//===== Description: =========================================
//= A method to allow headgear sprites to be previewed without
//= being 'stolen'
//===== Changelog: ===========================================
//= 1.01
//=   -Modified so it dynamically gets npc name for the timer
//= 1.00
//=   -Initial Release
//============================================================
 
prontera,155,156,5      script  PreviewStuff    813,{
 
    //save current look for later
    set @bottomview, getlook(3);
    set @topview, getlook(4);
    set @midview, getlook(5);
 
    //doesn't actually execute until just before a 'close' statement, or when the char leaves the npc's control
    addtimer 1000, strnpcinfo(3)+"::On_Leave";
 
INTRO:
 
    mes "Welcome to the preview NPC";
 
    mes "Please input an itemID you would like to preview";
 
    input @itemid;
 
    //modifies char's look based on item
    set @equip, getiteminfo(@itemid, 5);
    set @view, getiteminfo(@itemid, 11);
 
    if(@equip != -1 && @view > 0) {
            //note: yes...i'm using atcommand here cause for some reason
            //      'setlook' has permanent effects...last time i checked at least
            if(@equip & 1)
                atcommand "@changelook 3 " + @view;
            if(@equip & 256)
                atcommand "@changelook 1 " + @view;
            if(@equip & 512)
                atcommand "@changelook 2 " + @view;
    }
 
    next;
    mes "Would to like to preview something else?";
    if(select("Yes", "No") == 1) {
        goto INTRO;
    }
       
    //*preview wears off automatically here due to delayed timer*//
 
    close;  
 
 
 
On_Leave:
    atcommand "@changelook 1 " + @topview;
    atcommand "@changelook 2 " + @midview;
    atcommand "@changelook 3 " + @bottomview;
    close;
}
Viewed 275 times, submitted by unknown.