viewing paste enchant system | 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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
-   shop    ENsystem_hat    -1,909:-1
-   shop    ENsystem_ear    -1,909:-1
-   shop    ENsystem_mou    -1,909:-1
 
new_1-1,54,115,4    script  Enchant Cash#1  63,{
    goto EN_main;
    OnInit:
        set .EN_Active,0;
 
        // ระบบ Cash = 0 , Item = 1 ขึ้นไป
        set .EN_system,0; // Cash
        //set .EN_system,501; // Red Potion
 
        // ชื่อ Npc
        set .EN_namenpc$,"[ Enchant Cash ]";
 
        // ห้อง NPC
        waitingroom "Enchant Cash",0;
        
        // ชื่อ Shop ที่ใช้งาน
        setarray .EN_ennpc$[0],"ENsystem_hat","ENsystem_ear","ENsystem_mou";    // หมวก,หู,ปาก
 
        // ประเภทหมวก (พยายามอย่าเกิน 120 ชิ้น)
        setarray .EN_enhatid[0],4001,4002;  // รหัสไอเทมคุณสมบัติ Enchant
        setarray .EN_enhatpr[0],100,110;    // ราคาที่ใช้ Enchant
 
        // ประเภทหู (พยายามอย่าเกิน 120 ชิ้น)
        setarray .EN_enearid[0],4003,4004;  // รหัสไอเทมคุณสมบัติ Enchant
        setarray .EN_enearpr[0],50,60;  // ราคาที่ใช้ Enchant
 
        // ประเภทปาก (พยายามอย่าเกิน 120 ชิ้น)
        setarray .EN_enmouid[0],4005,4006;  // รหัสไอเทมคุณสมบัติ Enchant
        setarray .EN_enmoupr[0],70,80;  // ราคาที่ใช้ Enchant
 
        // System Stop!!
        sleep2 300;
        npcshopitem ""+.EN_ennpc$[0]+"",909,1;
        npcshopdelitem ""+.EN_ennpc$[0]+"",909;
        npcshopitem ""+.EN_ennpc$[1]+"",909,1;
        npcshopdelitem ""+.EN_ennpc$[1]+"",909;
        npcshopitem ""+.EN_ennpc$[2]+"",909,1;
        npcshopdelitem ""+.EN_ennpc$[2]+"",909;
        for(set .@i,0; .@i < getarraysize(.EN_enhatid); set .@i,.@i+1)
            npcshopadditem ""+.EN_ennpc$[0]+"",.EN_enhatid[.@i],.EN_enhatpr[.@i];
        for(set .@i,0; .@i < getarraysize(.EN_enearid); set .@i,.@i+1)
            npcshopadditem ""+.EN_ennpc$[1]+"",.EN_enearid[.@i],.EN_enearpr[.@i];
        for(set .@i,0; .@i < getarraysize(.EN_enmouid); set .@i,.@i+1)
            npcshopadditem ""+.EN_ennpc$[2]+"",.EN_enmouid[.@i],.EN_enmoupr[.@i];
        set .EN_Active,1;
        end;
 
        EN_main:
            mes .EN_namenpc$;
            if (!.EN_Active) {
                mes "ระบบกำลังเตรียมพร้อม";
                mes "โปรดรอ 10 วินาที";
                close;
            }
            if (.EN_system && getitemname(.EN_system) == "null") {
                mes "ระบบ Enchant Item ทำงานผิดพลาด";
                mes "กรุณาแจ้ง GM";
                close;
            }
            mes "ยินดีต้อนรับสู่ระบบ Enchant";
            mes "โปรดเลือกเมนู";
            next;
            switch(select("- ทำการ Enchant","- รายละเอียด","- ยกเลิก")) {
                case 1:
                    deletearray @bought_nameid[0],255;
                    deletearray @bought_quantity[0],255;
                    mes .EN_namenpc$;
                    mes "กรุณาเลือกของที่ต้องการ Enchant";
                    set @equip,select(""+(getequipisequiped(1)?"หมวก - ["+getequipname(1)+"]":"")+":"+(getequipisequiped(9)?"หู - ["+getequipname(9)+"]":"")+":"+(getequipisequiped(10)?"ปาก - ["+getequipname(10)+"]":"")+"");
                    close2;
                    if (@equip == 1) set @equip,1;
                    else if (@equip == 2) set @equip,9;
                    else if (@equip == 3) set @equip,10;
                    else set @equip,0;
                    mes .EN_namenpc$;
                    switch (getiteminfo(getequipid(@equip),5)) {
                        case 512:
                        case 513:
                        case 2048:
                            mes "คุณเลือก : "+getequipname(9)+"";
                            mes "กรุณาเลือกคุณสมบัติเสริม";
                            callshop ""+.EN_ennpc$[1]+"",1;
                            npcshopattach ""+.EN_ennpc$[1]+"";
                            break;
                        case 256:
                        case 768:
                        case 769:
                        case 1024:
                            mes "คุณเลือก : "+getequipname(1)+"";
                            mes "กรุณาเลือกคุณสมบัติเสริม";
                            callshop ""+.EN_ennpc$[0]+"",1;
                            npcshopattach ""+.EN_ennpc$[0]+"";
                            break;
                        case 1:
                        case 4096:
                            mes "คุณเลือก : "+getequipname(10)+"";
                            mes "กรุณาเลือกคุณสมบัติเสริม";
                            callshop ""+.EN_ennpc$[2]+"",1;
                            npcshopattach ""+.EN_ennpc$[2]+"";
                            break;
                        default:
                            mes "พบข้อพกพร่องกรุณาแจ้งทีมงาน";
                            close;
                    }
                    end;
                case 2:
                    mes .EN_namenpc$;
                    mes "ระบบ Enchant สามารถ Enchant ได้เฉพาะ หมวก หู ปาก";
                    mes "ไม่มีโอกาศเสียหายใดๆทั้งสิ้น";
                    mes "และสามารถ Enchant ใส่ช่องการ์ดที่ 4 เท่านั้น !!";
                    mes "^FF0000การ์ดและตีบวกทั้งหมดจะหายเมื่อ Enchant^000000";
                    if (.EN_system < 1)
                        mes "ระบบ Enchant นี้ใช้ Cash ในการใช้งาน";
                    else
                        mes "ระบบ Enchant นี้ใช้ "+getitemname(.EN_system)+" ในการใช้งาน";
                    break;
                case 3:
                    close;
            }
            close;
 
    // System Enchant
    OnBuyItem:
        set .@EN_EE,getequipid(@equip);
        set .@EN_EB,0;
        set .@EN_EC,0;
        set .@EN_EA,0;
        set .@EN_ER,0;
        set .@EN_ED,0;
        // การคงอยู่ไว้ของการ์ดและตีบวก
        //set .@EN_EB,getequiprefinerycnt(@equip);  // ตีบวกเดิม
        //set .@EN_EC,getequipcardid(@equip,0); // ช่องการ์ด 1 เดิม
        //set .@EN_EA,getequipcardid(@equip,1); // ช่องการ์ด 2 เดิม
        //set .@EN_ER,getequipcardid(@equip,2); // ช่องการ์ด 3 เดิม
        set .@EN_ED,getequipcardid(@equip,3);
        if (countitem(.@EN_EE) > 1) {
            mes .EN_namenpc$;
            mes "กรุณาพก "+getitemname(.@EN_EE)+" เพียงชิ้นเดียว";
            mes "เพื่อป้องกันความผิดพลาดที่จะเกิด";
            close;
        }
        if (.@EN_ED) {
            mes .EN_namenpc$;
            mes "คุณมีอะไรอยู่ใน ช่องการ์ดที่ 4";
            mes "กรุณาไปถอดออกแล้วมาใหม่";
            close;
        }
        switch (getiteminfo(.@EN_EE,5)) {
            case 512:
            case 513:
            case 2048:
                for(set .@i,0; .@i < getarraysize(.EN_enearid); set .@i,.@i+1)
                    if (.EN_enearid[.@i] == @bought_nameid) {
                        set .@price,.EN_enearpr[.@i];
                        break;
                    }
                break;
            case 256:
            case 768:
            case 769:
            case 1024:
                for(set .@i,0; .@i < getarraysize(.EN_enhatid); set .@i,.@i+1)
                    if (.EN_enhatid[.@i] == @bought_nameid) {
                        set .@price,.EN_enhatpr[.@i];
                        break;
                    }
                break;
            case 1:
            case 4096:
                for(set .@i,0; .@i < getarraysize(.EN_enmouid); set .@i,.@i+1)
                    if (.EN_enmouid[.@i] == @bought_nameid) {
                        set .@price,.EN_enmoupr[.@i];
                        break;
                    }
                break;
            default:
                mes .EN_namenpc$;
                mes "พบข้อพกพร่องกรุณาแจ้งทีมงาน";
                close;
        }
        if (@bought_quantity > 1) set @bought_quantity,1;
        mes .EN_namenpc$;
        mes "คุณต้องการ Enchant : "+getitemname(.@EN_EE)+"";
        mes "โดยใช้ : "+getitemname(@bought_nameid)+"";
        mes "แต่ฉันต้องการค่าใช้จ่ายในการ Enchant";
        mes "จำนวน : "+.@price+" "+(.EN_system < 1?"Cash":""+getitemname(.EN_system)+"")+"";
        mes "^FF0000การ์ดและตีบวกทั้งหมดจะหายเมื่อ Enchant^000000";
        next;
        if (select("- ตกลง, ดำเนินการต่อ","- ยัง, ฉันมีไม่พอ") == 2)
            close;
        query_sql "SELECT `id` FROM `gjz_enchant_block` WHERE `id`='"+.@EN_EE+"'",.@EN_BLOCK;
        if (.@EN_BLOCK) {
            mes .EN_namenpc$;
            mes ""+getitemname(.@EN_BLOCK)+" นี้";
            mes "ห้ามนำมา Enchant เข้าใจนะ";
            close;
        }
        if (.EN_system < 1) {
            if (#CASHPOINTS < .@price) {
                mes .EN_namenpc$;
                mes "คุณมี Cash ไม่พอ";
                mes "กรุณามาใหม่อีกครั้ง";
                close;
            }
            mes .EN_namenpc$;
            mes "Cash ปัจจุบัน : "+#CASHPOINTS+"";
            mes "ถูกใช้ไป : "+.@price+"";
            mes "คงเหลือ : "+(#CASHPOINTS-.@price)+"";
            set #CASHPOINTS,#CASHPOINTS - .@price;
        }
        else if (.EN_system > 0) {
            if (countitem(.EN_system) < .@price) {
                mes .EN_namenpc$;
                mes "คุณมี "+getitemname(.EN_system)+" ไม่พอ";
                mes "กรุณามาใหม่อีกครั้ง";
                close;
            }
            mes .EN_namenpc$;
            mes ""+getitemname(.EN_system)+" ปัจจุบัน : "+countitem(.EN_system)+"";
            mes "ถูกใช้ไป : "+.@price+"";
            mes "คงเหลือ : "+(countitem(.EN_system)-.@price)+"";
            delitem .EN_system,.@price;
        }
        mes "Enchant Success !!";
        delitem2 getequipid(@equip),1,1,getequiprefinerycnt(@equip),0,getequipcardid(@equip,0),getequipcardid(@equip,1),getequipcardid(@equip,2),getequipcardid(@equip,3);
        getitem2 .@EN_EE,1,1,.@EN_EB,0,.@EN_EC,.@EN_EA,.@EN_ER,@bought_nameid;
        deletearray @bought_nameid[0],255;
        deletearray @bought_quantity[0],255;
        set @equip,0;
        close;
}
 
Viewed 649 times, submitted by Guest.