viewing paste Unknown #26674 | Text

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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
// Item and Monster search function (attached to item #12105) [Neviril]
 
function        script  F_Search        {
 
mes "This info kit fits right in your pocket!";
mes "What do you want to do?";
menu "- Search for a Monster",-,"- Search for an Item",L_Item;
next;
L_Mob2:
dispbottom "Initiating Monster Database...";
progressbar "0xRRGGBB",1;
mes "Database successfully loaded. What Monster do you want to learn about?:";
mes " ";
mes "Please ^ff0000only input the Monster's full name^000000 or there will be incorrect results!";
input .@mobname$;
.@amount = query_sql ("SELECT ID, HP, SP, ATK1, Race, Element, DEF, MDEF FROM mob_db WHERE kName = '"+ escape_sql(.@mobname$) +"'", @id, .@hp, .@sp, .@atk1, .@race, .@element, .@def, .@mdef);
        if (.@amount == 0) { //No mobs found
                next;
                mes "^ff0000Error 404^000000: The Monster '^ff0000"+.@mobname$+"^000000' does not exist in the official database!";
                mes "Please check your spelling or try the advanced Monster search option.";
                next;
                menu "Search for another Monster",L_Mob2,"Try advanced (Custom) Monster search",L_Adv,"Exit",L_later2;
        }
        for (.@i = 0; .@i < .@amount; .@i++) {
        next;
        mes "[Search Results: '"+.@mobname$+"' ]";                     
        mes "Name: "+.@mobname$;
        mes "ID: "+@id[.@i];
        mes "HP: "+.@hp[.@i];
        mes "SP: "+.@sp[.@i];
        mes "ATK: "+.@atk1[.@i];
        mes "DEF: "+getmonsterinfo(@id,7);
        mes "MDEF: "+getmonsterinfo(@id,8);
        mes "Base EXP: "+getmonsterinfo(@id[.@i],3);
        mes "Job EXP: "+getmonsterinfo(@id[.@i],4);
        mes "Race: "+getmonsterinfo(@id,19);
        mes "Element: "+.@element[.@i];
        mes "Size: "+getmonsterinfo(@id,18);
        }
                next;
                goto L_Menu;
               
// Searching in mob_db2
L_Adv:
.@amount4 = query_sql ("SELECT ID, HP, SP, ATK1, Race, Element, DEF, MDEF FROM mob_db2 WHERE kName = '"+ escape_sql(.@mobname$) +"'", @id, .@hp, .@sp, .@atk1, .@race, .@element, .@def, .@mdef);
        if (.@amount4 == 0) { //No mobs found
                next;
                mes "^ff0000Error 404^000000: The Monster '^ff0000"+.@mobname$+"^000000' does not exist in the custom database!";
                mes "Please check your spelling and try again.";
                next;
                menu "Search for another Monster",L_Mob2,"Exit",L_later2;
                }
               
        for (.@i = 0; .@i < .@amount4; .@i++) {
        next;  
        mes "[Custom Search Results: '"+.@mobname$+"' ]";                      
        mes "Name: "+.@mobname$;
        mes "ID: "+@id[.@i];
        mes "HP: "+.@hp[.@i];
        mes "SP: "+.@sp[.@i];
        mes "ATK: "+.@atk1[.@i];
        mes "DEF: "+getmonsterinfo(@id,7);
        mes "MDEF: "+getmonsterinfo(@id,8);
        mes "Base EXP: "+getmonsterinfo(@id[.@i],3);
        mes "Job EXP: "+getmonsterinfo(@id[.@i],4);
        mes "Race: "+getmonsterinfo(@id,19);
        mes "Element: "+.@element[.@i];
        mes "Size: "+getmonsterinfo(@id,18);
                }
                next;
                goto L_Menu6;
 
 
L_Menu:
menu "Where can I find '"+.@mobname$+"'?",L_find,"Try advanced (Custom) Monster search",L_Adv,"Search for another Monster",L_Mob2,"Exit",L_later;
 
L_Menu6:
menu "Where can I find '"+.@mobname$+"'?",L_find,"Search for another Monster",L_Mob2,"Exit",L_later;
 
L_find:
        atcommand "@whereis "+@id;
        dispbottom "[ Notice ] : The Information Kit search feature only locates the naturally spawned monsters!";
                next;
        goto L_Menu4;
 
L_Menu4:
        menu "Search for another Monster",L_Mob2,"Exit",L_later;
 
L_later:
        close;
 
// Start item search
 
L_Item:
        next;
L_Item2:
        dispbottom "Initiating Item Database...";
        progressbar "0xRRGGBB",1;
        mes "Database successfully loaded. What Item do you want to learn about?:";
        mes " ";
        mes "Please ^ff0000only input the Item's full name^000000 or there will be incorrect results!";
        input .@itemname$;
 
// Searching in item_db
.@amount2 = query_sql ("SELECT ID, weight, atk, defence, slots, equip_level_min FROM item_db WHERE name_japanese = '"+ escape_sql(.@itemname$) +"'", @iid, .@weight, .@attack, .@defence, .@slots, .@elvl);          
        if (.@amount2 == 0) { //No items found
                next;
                mes "^ff0000Error 404^000000: The Item '^ff0000"+.@itemname$+"^000000' does not exist in the official database!";
                mes "Please check your spelling or try the advanced Item search option.";
                next;
                menu "Search for another Item",L_Item2,"Try advanced (Custom) Item search",L_Adv2,"Exit",L_later2;
        }
        for (.@i = 0; .@i < .@amount2; .@i++) {
                        next;
                        mes "[Search Results: '"+.@itemname$+"' ]";
                        mes "Name: "+.@itemname$+" ["+.@slots[.@i]+"] ";
                        mes "ID: "+@iid[.@i];
                        mes "ATK: "+.@attack[.@i];
                        mes "DEF: "+.@defence[.@i];
                        mes "Lv Req: "+.@elvl[.@i];
                        mes "Weight: "+(.@weight[.@]/10);
                        mes "Buy Price: "+getiteminfo(@iid,0);
                        mes "Sell Price: "+getiteminfo(@iid,1);
                }
                next;
                goto L_Menu2;
 
// Searching in item_db2
L_Adv2:
.@amount3 = query_sql ("SELECT ID, weight, atk, defence, slots, equip_level_min FROM item_db2 WHERE name_japanese = '"+ escape_sql(.@itemname$) +"'", @iid, .@weight, .@attack, .@defence, .@slots, .@elvl);          
        if (.@amount3 == 0) { //No items found
                next;
                mes "^ff0000Error 404^000000: The Item '^ff0000"+.@itemname$+"^000000' does not exist in the custom database!";
                mes "Please check your spelling and try again.";
                next;
                menu "Search for another Item",L_Item2,"Exit",L_later2;
                }
               
        for (.@i = 0; .@i < .@amount3; .@i++) {
                        next;
                        mes "[Custom Search Results: '"+.@itemname$+"' ]";
                        mes "Name: "+.@itemname$+" ["+.@slots[.@i]+"] ";
                        mes "ID: "+@iid[.@i];
                        mes "ATK: "+.@attack[.@i];
                        mes "DEF: "+.@defence[.@i];
                        mes "Lv Req: "+.@elvl[.@i];
                        mes "Weight: "+(.@weight[.@]/10);
                        mes "Buy Price: "+getiteminfo(@iid,0);
                        mes "Sell Price: "+getiteminfo(@iid,1);
                }
                next;
                goto L_Menu3;
         
L_Menu2:
        menu "Which monster drops '"+.@itemname$+"'?",-,"Try advanced (Custom) Item search",L_Adv2,"Search for another Item",L_Item2,"Exit",L_later2;
        for (.@i = 0; .@i < .@amount2; .@i++) {
        atcommand "@whodrops "+@iid[.@i];
                }
                next;
        goto L_Menu5;
 
L_Menu3:
        menu "Which monster drops '"+.@itemname$+"'?",-,"Search for another Item",L_Item2,"Exit",L_later2;
                for (.@i = 0; .@i < .@amount3; .@i++) {
        atcommand "@whodrops "+@iid[.@i];
                }
                next;
        goto L_Menu5;
       
L_Menu5:
        menu "Search for another Item",-,"Exit",L_later2;
                goto L_Item;
       
L_later2:
        close;
}
Viewed 641 times, submitted by unknown.