Jump to content

Harvin

Members
  • Posts

    39
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Harvin

  1. 11 hours ago, monyet said:

    bagaimana script saya yang ini apakah bisa di buat lebih sederhana lagi ?

     

     

    menurut saya dengan teknik dasar itu sudah cukup bagus, ya walau pengulangan yg harus anda lakukan adalah kelemahannya.

    Just now, Racaae said:

    Halo

    //===== rAthena Script =======================================
    //= Euphy's Quest Shop
    //===== By: ==================================================
    //= Euphy
    //===== Current Version: =====================================
    //= 1.6c
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= A dynamic quest shop based on Lunar's, with easier config.
    //= Includes support for multiple shops & cashpoints.
    //= Item Preview script by ToastOfDoom.
    //===== Additional Comments: =================================
    //= 1.0 Initial script.
    //= 1.2 Added category support.
    //= 1.3 More options and fixes.
    //= 1.4 Added debug settings.
    //= 1.5 Replaced categories with shop IDs.
    //= 1.6 Added support for purchasing stackables.
    //= 1.6a Added support for previewing costumes and robes.
    //= 1.6b Added 'disable_items' command.
    //= 1.6c Replaced function 'A_An' with "F_InsertArticle".
    //============================================================
    
    // Shop NPCs -- supplying no argument displays entire menu.
    //  callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}};
    //  ADD YOUR NPC HERE
    //============================================================
    prontera,152,180,5	script	NamaNPC	4_F_JPN2,{ callfunc "qshop",1; }
    
    //============================================================
    
    
    // Script Core - DO NOT DUPLICATE THIS NPC !!!!!!!!!!!!!
    //============================================================
    -	script	quest_shop	-1,{
    function Add; function Chk; function Slot;
    OnInit:
        freeloop(1);
    
    // -----------------------------------------------------------
    //  Basic shop settings.
    // -----------------------------------------------------------
    
        set .ShowSlot,1;    // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
        set .ShowID,0;      // Show item IDs? (1: yes / 0: no)
        set .ShowZeny,0;    // Show Zeny cost, if any? (1: yes / 0: no)
        set .MaxStack,100;  // Max number of quest items purchased at one time.
        .SkipShop = true;	// Ignore shop window
        .Chance = 80;		// Success chance
    
    // -----------------------------------------------------------
    //  Points variable -- optional quest requirement.
    //  setarray .Points$[0],"<variable name>","<display name>";
    // -----------------------------------------------------------
    
        setarray .Points$[0],
            "#CASHPOINTS", "Cash Points";
    
    
    //=====================================================================================
    // ------------------- ADD YOUR SHOPS NAME AND ITEMS SHOPS STARTING HERE --------------
    //=====================================================================================
    
    // -----------------------------------------------------------
    //  Shop IDs -- to add shops, copy dummy data at bottom of file.
    //  setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...};
    // -----------------------------------------------------------
    
        setarray .Shops$[1],
            "Food",    // Shop Named 1
            "Other";        // Shop Named 2
    
    // -----------------------------------------------------------
    //  Quest items -- do NOT use a reward item more than once!
    //  Add(<shop ID>,<reward ID>,<reward amount>,
    //      <Zeny cost>,<point cost>,
    //      <required item ID>,<required item amount>{,...});
    // -----------------------------------------------------------
    
    // Shop 1
        Add(1,12046,1,0,0,501,2,514,3);
        Add(1,12061,1,0,0,501,1,514,2,518,1);
        Add(1,12047,1,0,0,507,10,508,10,510,5);
        Add(1,12048,1,0,0,509,10,518,2,7452,1);
        Add(1,12044,1,0,0,507,3,508,2,511,3,568,1,517,5,7453,1);
        Add(1,12065,1,0,0,520,2,521,3,7100,10,7198,6,7453,1,7452,1);
        Add(1,12060,1,0,0,7006,20,520,10,507,10,1062,20,7482,1);
        Add(1,12055,1,0,0,553,20,508,10,511,20,7455,1,7456,1);
    
    // -----------------------------------------------------------
    
    //=====================================================================================
    // ------------------- YOUR SHOPS AND ITEMS SHOPS HAVE BEEN ADDED ---------------------
    //=====================================================================================
    
        freeloop(0);
        set .menu$,"";
        for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) {
            set .menu$, .menu$+.Shops$[.@i]+":";
            npcshopdelitem "qshop"+.@i,909;
        }
        end;
    
    OnMenu:
        set .@size, getarraysize(@i);
        if (!.@size) set @shop_index, select(.menu$);
        else if (.@size == 1) set @shop_index, @i[0];
        else {
            for(set .@j,0; .@j<.@size; set .@j,.@j+1)
                set .@menu$, .@menu$+.Shops$[@i[.@j]]+":";
            set @shop_index, @i[select(.@menu$)-1];
        }
        deletearray @i[0],getarraysize(@i);
        if (.Shops$[@shop_index] == "") {
            message strcharinfo(0),"An error has occurred.";
            end;
        }
        if (!.SkipShop) {
        	dispbottom "Select one item at a time.";
        	callshop "qshop"+@shop_index,1;
        	npcshopattach "qshop"+@shop_index;
        	end;
        }
        mes "[NamaNPC]";
        mes "Halo, Aku adalah NPC contoh.";
        mes "Apa yang ingin kamu buat?";
    	//for (.@i = 0;.@i < getarraysize(getd(".q_list_"+@shop_index));.@i++)
    	//	mes "- " + mesitemlink(getd(".q_list_"+@shop_index+"["+ .@i + "]"));
    	.@menu$ = "";
    	for (.@i = 0;.@i < getarraysize(getd(".q_list_"+@shop_index));.@i++)
    		.@menu$ += getitemname(getd(".q_list_"+@shop_index+"["+ .@i + "]")) + ":";
    	.@s = select(.@menu$) - 1;
       	setarray .@q[0],getd(".q_list_"+@shop_index+"["+ .@s + "]"),1;
       	copyarray .@q[3],getd(".q_"+@shop_index+"_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+@shop_index+"_"+.@q[0]));
       	clear;
    
    OnBuyItem:
        // .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... }
        if (!.SkipShop) {
        	setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]);
        	copyarray .@q[3],getd(".q_"+@shop_index+"_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+@shop_index+"_"+.@q[0]));
        }
        mes "[NamaNPC]";
        set .@q[2],.@q[1]*.@q[3];
        if (!.@q[2] || .@q[2] > 30000) {
            mes "You can't purchase that many "+getitemname(.@q[0])+".";
            close;
        }
        mes "Untuk membuat";
        //mes "^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000";
        mes "^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"") + mesitemlink(.@q[0]) + "^000000, kamu membutuhkan:";
        disable_items;
        if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000";
        if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000";
        if (.@q[6]) {
        	for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2) {
            	//mes (.@q[.@i+2]?"":"dan ") + Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000" + (.@q[.@i+2]?",":".");
            	mes (.@q[.@i+2]?"":"dan ") + Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+mesitemlink(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000" + (.@q[.@i+2]?",":".");
    		}
    	}
        setarray @qe[1], getiteminfo(.@q[0], ITEMINFO_LOCATIONS), getiteminfo(.@q[0], ITEMINFO_VIEW);
        if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT)))
            set .@preview,1;
        addtimer 1000, strnpcinfo(0)+"::OnEnd";
        while(1) {
            switch(select("Membuat ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+":^777777Membatalkan^000000")) {
            case 1:
            	mes "[NamaNPC]";
                if (@qe[0]) {
                    mes "Kamu tidak memiliki bahan yang cukup.";
                    close;
                }
                if (!checkweight(.@q[0],.@q[2])) {
                    mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0], ITEMINFO_WEIGHT))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
                    close;
                }
                if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]);
                if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]);
                if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
                    delitem .@q[.@i],.@q[.@i+1]*.@q[1];
                if (rand(100) >= .Chance) {
                	mes "Pembuatan " + getitemname(.@q[0]) + " gagal!";
                	close;
                }
                getitem .@q[0],.@q[2];
                mes "Berhasil membuat " + getitemname(.@q[0]) + "!";
                close;
            case 2:
                setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1;
                if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2];
                else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2];
                else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2];
                else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2];
                break;
            case 3:
                close;
            }
        }
    
    OnEnd:
        if (@qe[7]) {
            changelook LOOK_HEAD_BOTTOM, @qe[3];
            changelook LOOK_HEAD_TOP, @qe[4];
            changelook LOOK_HEAD_MID, @qe[5];
            changelook LOOK_ROBE, @qe[6];
        }
        deletearray @qe[0],8;
        end;
    
    function Add {
        if (getitemname(getarg(1)) == "null") {
            debugmes "Quest reward #"+getarg(1)+" invalid (skipped).";
            return;
        }
        setarray .@j[0],getarg(2),getarg(3),getarg(4);
        for(set .@i,5; .@i<getargcount(); set .@i,.@i+2) {
            if (getitemname(getarg(.@i)) == "null") {
                debugmes "Quest requirement #"+getarg(.@i)+" invalid (skipped).";
                return;
            } else
                setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1);
        }
        copyarray getd(".q_"+getarg(0)+"_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j);
        npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0);
        .@ii = getarraysize(getd(".q_list_"+getarg(0)));
        setarray getd(".q_list_"+getarg(0)+"["+.@ii+"]"),getarg(1);
        return;
    }
    
    function Chk {
        if (getarg(0) < getarg(1)) {
            set @qe[0],1;
            return "^FF0000";
        } else
            return "^00FF00";
    }
    
    function Slot {
        set .@s$,getitemname(getarg(0));
        switch(.ShowSlot) {
            case 1: if (!getitemslots(getarg(0))) return .@s$;
            case 2: if (getiteminfo(getarg(0), ITEMINFO_TYPE) == 4 || getiteminfo(getarg(0), ITEMINFO_TYPE) == 5) return .@s$+" ["+getitemslots(getarg(0))+"]";
            default: return .@s$;
        }
    }
    }
    
    function	script	qshop	{
        deletearray @i[0],getarraysize(@i);
        for(set .@i,0; .@i<getargcount(); set .@i,.@i+1)
            set @i[.@i],getarg(.@i);
        doevent "quest_shop::OnMenu";
        end;
    }
    
    
    // Dummy shop data -- copy as needed.
    //============================================================
    -	shop	qshop1	-1,909:-1
    -	shop	qshop2	-1,909:-1

    Temukan bagian ini untuk menambahkan lebih banyak item:

        Add(1,12046,1,0,0,501,2,514,3);
        Add(1,12061,1,0,0,501,1,514,2,518,1);
        Add(1,12047,1,0,0,507,10,508,10,510,5);
        Add(1,12048,1,0,0,509,10,518,2,7452,1);
        Add(1,12044,1,0,0,507,3,508,2,511,3,568,1,517,5,7453,1);
        Add(1,12065,1,0,0,520,2,521,3,7100,10,7198,6,7453,1,7452,1);
        Add(1,12060,1,0,0,7006,20,520,10,507,10,1062,20,7482,1);
        Add(1,12055,1,0,0,553,20,508,10,511,20,7455,1,7456,1);

     

    untuk teknik yg lebih advanced pengulangan code dapat di hilangkan seperti yg disebutkan di atas hanya butuh menambah beberapa line semua beres sebagain new entry.

    walau ada sedikit perbedaan jika langsung menggunakan equphy quest shop untuk script yg anda lampirkan di atas, anda akan kehilangan aspect chance.

  2. 11 hours ago, monyet said:

    Terimakasih banyak @hendra814 udah sangat terbantu 

    Apakah mungkin jika npcnya saya cloning dan npc yang lain bisa jual item yagn berbeda ?

     

    10 hours ago, hendra814 said:

    Dear @monyet

    setau saya tidak bisa, kalau mau pakai item lain harus dibuat ulang dan diganti item ID nya.

     

    ini bisa saja di lakukan dengan advanced script technique, anda bisa ambil referensi dari euphy script (quest shop) yg menggunakan dynamic variable setter dan getter dengan script command setd dan getd.
    memang agak sedikit sulit, jika anda ingin mencobanya bisa saja.

  3. On 4/16/2024 at 2:16 AM, monyet said:

    prontera,158,180,4    script    VRO Asisten    100,{
        // Inisialisasi
        setarray .price[0], 10, 20, 30; // Array harga yang mungkin
        mes "[VRO Asisten]";
        mes "Halo! Apakah kamu ingin menjual Jellopy padaku? Saya membayar harga yang berbeda tergantung waktu!";
        next;

        // Menetapkan harga acak dari array .price
        set .selected_price, .price[rand(getarraysize(.price))];

        // Tampilkan harga yang saat ini ditawarkan
        mes "Saat ini, saya akan membeli Jellopy seharga "+.selected_price+" Zeny per buah.";
        next;

        // Cek apakah pemain memiliki Jellopy
        if (countitem(909) > 0) {
            mes "Berapa banyak Jellopy yang ingin kamu jual?";
            input .amount;
            if (.amount > 0 && .amount <= countitem(909)) {
                // Hitung total zeny yang akan diterima pemain
                .total_price = .amount * .selected_price;
                mes "Kamu akan mendapatkan "+.total_price+" Zeny untuk "+.amount+" Jellopy.";
                next;
                if (select("Jual:Ya,Tidak") == 1) {
                    // Konfirmasi penjualan dan transaksi
                    delitem 909, .amount; // Hapus Jellopy dari inventory pemain
                    zeny += .total_price; // Berikan Zeny kepada pemain
                    mes "Terima kasih telah menjual Jellopy-mu!";
                } else {
                    mes "Mungkin lain waktu!";
                }
            } else {
                mes "Mohon masukkan jumlah yang valid!";
            }
        } else {
            mes "Tampaknya kamu tidak memiliki Jellopy!";
        }
        close;
    }

    1. Disini saya pengen NPC akan merubah harga setiap 15 menit sekali sesuai waktu server

    2. Di mapserv consol have error npc_event: event not found [VRO asisten: :OnTimerUpdatePrice]  Maksudnya ini apa ya dan apa disini maksudnya kita harus membuat npc_event kah ? atau bagaimana ?

    Atas perhatianya terimakasih

    gunakan code box formating untuk code agar lebih rapih dan text formating code tidak berubah, script engine pada emulator sensitive untuk tab dan space pada saat parsing code.
    saya telah meninggalkan beberapa catatan pada script silahkan di telaah.

    prontera,158,180,4    script    VRO Asisten    100,{
    	mes "[VRO Asisten]";
    	mes "Halo! Apakah kamu ingin menjual Jellopy padaku? Saya membayar harga yang berbeda tergantung waktu!";
    	next;
    	// Tampilkan harga yang saat ini ditawarkan
    	mes "Saat ini, saya akan membeli Jellopy seharga "+.selected_price+" Zeny per buah.";
    	next;
    	// Note 1:
    	// Kalau bisa jangan terlalu banyak membuat nesting if else
    	// buat script mudah di baca dan pahami dengan sekilas agar mudah dalam debuging.
    	// Cek apakah pemain memiliki Jellopy
    	if (countitem(909) < 1)
    	{
    		mes "Tampaknya kamu tidak memiliki Jellopy!";
    		close;
    	}
    	mes "Berapa banyak Jellopy yang ingin kamu jual?";
    	// Note 2:
    	// gunakan variable type yg tepat
    	// untuk user input seperti ini gunakan temporary script variable type ".@"
    	// Note 3:
    	// ".selected_price" dapat berubah ketika script dalam keadaan "suspended / pause" state
    	// script command yg dapat menyebabkan suspended / pause state,
    	// sleep, sleep2, next, progressbar, menu, select.
    	// sebaiknya preserve value ".selected_price" pada saat user akses time dan bandingkan nanti
    	// apakah value ".selected_price" berubah atau tidak (validasi).
    	.@selected_price = .selected_price;
    	input .@amount;
    	// *Note 1, prevent nesting if else
    	if (.@amount < 0 || .@amount > countitem(909))
    	{
    		mes "Mohon masukkan jumlah yang valid!";
    		close;
    	}
    	// *Note 3 validasi value ".selected_price"
    	if (.@selected_price != .selected_price)
    	{
    		mes "Harga telah berubah, silahkan coba lagi!";
    		close;
    	}
    	// Hitung total zeny yang akan diterima pemain
    	// *Note 2, use apt variable type.
    	.@total_price = .@amount * .selected_price;
    	mes "Kamu akan mendapatkan "+ .@total_price +" Zeny untuk "+ .@amount +" Jellopy.";
    	next;
    	// *Note 3 validasi value ".selected_price"
    	if (.@selected_price != .selected_price)
    	{
    		mes "Harga telah berubah, silahkan coba lagi!";
    		close;
    	}
    	.@s = select("Jual:Ya,Tidak");
    	if (.@s == 1)
    	{
    		// *Note 3 validasi value ".selected_price"
    		if (.@selected_price != .selected_price)
    		{
    			mes "Harga telah berubah, silahkan coba lagi!";
    			close;
    		}
    		// Konfirmasi penjualan dan transaksi
    		delitem 909, .@amount; // Hapus Jellopy dari inventory pemain
    		Zeny += .@total_price; // Berikan Zeny kepada pemain
    		mes "Terima kasih telah menjual Jellopy-mu!";
    	}
    	else
    	{
    		mes "Mungkin lain waktu!";
    	}
        close;
    
    OnInit:
        // Inisialisasi
        setarray .price[0], 10, 20, 30; // Array harga yang mungkin
    
    OnTimer900000: // ubah harga setiap 15 menit.
    	stopnpctimer();
        // Menetapkan harga acak dari array .price
        set .selected_price, .price[rand(getarraysize(.price))];
    	
    	// use initnpctimer() script command disini untuk membuat loop.
    	initnpctimer();
    	end;
    }

     

    • Upvote 1
  4. if you got an error and expecting help from other try to give detail of step to reproduce the error.

    iirc, this was happening if you use reloadnpcfile, the npc statue is not loaded yet, so it not set the value correctly, I usually change the place of the statue before the main script.

    if there is no statue usage just end the script early no need to run the timer.

    @@ -169,6 +169,10 @@ OnInit:
    	if (.counttopunish <= 1) .counttopunish = 0;
    	.maptriggersize = getarraysize(.maptrigger$);
    
    +	// just end if not using any statue!
    +	if (.showstatue == 0)
    +		end;
    +
    	sleep 1;
    OnTimer30000: // refresh every 30 seconds. Note the `char` table is unrealiable, player still need to perform certain task to save the character -> see 'save_settings' in conf\map-server.conf
    	.@query$ = "SELECT `char`.`char_id`, `char`.`name`, `char`.`guild_id`, `char`.`class`, `char`.`sex`, `char`.`hair`, `char`.`hair_color`, `char`.`clothes_color`, `char`.`body`, `char`.`head_top`, `char`.`head_mid`, `char`.`head_bottom`, `char`.`robe`, "

    move the statue if you use it to above main script. so it will be safe when using reloadnpcfile, also put safety check with unitexists script command so the console wouldn't even cry out if unit is not found.

    @@ -15,6 +15,34 @@
    //= add PVP Ladder statue due to popular demand
    //============================================================================
    
    +-	script	pvp_ladder_statue	FAKE_NPC,{
    +	.@id = getelementofarray(getvariableofnpc(.npcgid, "DOTAPVP"), getnpcid(0));
    +	mes "^996600[TOP "+ .@id +"]";
    +	mes "^006699Name : "+ getelementofarray(getvariableofnpc(.statue_name$, "DOTAPVP"), .@id);
    +	.@guildname$ = getelementofarray(getvariableofnpc(.statue_guild$, "DOTAPVP"), .@id);
    +	mes "^00AAAAGuild : "+((.@guildname$ == "null")? "^AAAAAANone": .@guildname$);
    +	mes "^00AA00Total Kills : ["+ getelementofarray(getvariableofnpc(.statue_kills, "DOTAPVP"), .@id) +"]";
    +	mes "^70AC11Highest Streaks : ["+ getelementofarray(getvariableofnpc(.statue_streaks, "DOTAPVP"), .@id) +"]";
    +	mes "^FF0000Deaths : <"+ getelementofarray(getvariableofnpc(.statue_deaths, "DOTAPVP"), .@id) +">";
    +	close;
    +OnInit:
    +	.@id = strnpcinfo(2);
    +	set getvariableofnpc(.statue[.@id], "DOTAPVP"), getnpcid(0);
    +	set getvariableofnpc(.npcgid[getnpcid(0)], "DOTAPVP"), .@id;
    +	end;
    +}
    +
    +//brasilis,191,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#1	1_F_MARIA
    +//brasilis,195,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#2	1_F_MARIA
    +//brasilis,200,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#3	1_F_MARIA
    +//brasilis,156,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#4	1_F_MARIA
    +//brasilis,158,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#5	1_F_MARIA
    +//brasilis,160,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#6	1_F_MARIA
    +//brasilis,162,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#7	1_F_MARIA
    +//brasilis,164,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#8	1_F_MARIA
    +//brasilis,166,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#9	1_F_MARIA
    +//brasilis,168,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#10	1_F_MARIA
    
    //	add all the maps that you want this script to trigger ... all pvp and event maps perhaps ?
    //	but if you already enable "all" maps, then can comment all these
    guild_vs1	mapflag	loadevent
    @@ -181,13 +209,17 @@ OnTimer30000: // refresh every 30 seconds. Note the `char` table is unrealiable,
    	.@nb = query_sql(.@query$, .@cid, .@name$, .@guild_id, .@class, .@sex$, .@hair, .@hair_color, .@clothes_color, .@body, .@head_top, .@head_mid, .@head_bottom, .@robe, .@kills, .@streaks, .@deaths);
    	if (.fix_custom_sprite) {
    		for (.@i = 0; .@i < .@nb; ++.@i) {
    +			if (unitexists(.statue[.@i +1] == false)
    +				continue;
    			setunitdata .statue[.@i +1], UNPC_HEADTOP, 0;
    			setunitdata .statue[.@i +1], UNPC_HEADMIDDLE, 0;
    			setunitdata .statue[.@i +1], UNPC_HEADBOTTOM, 0;
    			setunitdata .statue[.@i +1], UNPC_ROBE, 0;
    		}
    	}
    	for (.@i = 0; .@i < .@nb; ++.@i) {
    +		if (unitexists(.statue[.@i +1] == false)
    +			continue;
    		setunitdata .statue[.@i +1], UNPC_CLASS, .@class[.@i];
    		setunitdata .statue[.@i +1], UNPC_SEX, (.@sex$[.@i] == "F")? SEX_FEMALE:SEX_MALE;
    		setunitdata .statue[.@i +1], UNPC_HAIRSTYLE, .@hair[.@i];
    @@ -206,7 +238,11 @@ OnTimer30000: // refresh every 30 seconds. Note the `char` table is unrealiable,
    		.statue_deaths[.@i +1] = .@deaths[.@i];
    	}
    	for (.@i = .@nb; .@i < .showstatue; ++.@i)
    +	{
    +		if (unitexists(.statue[.@i +1] == false)
    +			continue;
    		setunitdata .statue[.@i +1], UNPC_CLASS, HIDDEN_WARP_NPC;
    +	}
    	initnpctimer;
    	end;
    
    @@ -605,31 +641,3 @@ brasilis,209,169,5	script	PvP-StatsViewer	857,{
    		}
    	}
    }
    -
    --	script	pvp_ladder_statue	FAKE_NPC,{
    -	.@id = getelementofarray(getvariableofnpc(.npcgid, "DOTAPVP"), getnpcid(0));
    -	mes "^996600[TOP "+ .@id +"]";
    -	mes "^006699Name : "+ getelementofarray(getvariableofnpc(.statue_name$, "DOTAPVP"), .@id);
    -	.@guildname$ = getelementofarray(getvariableofnpc(.statue_guild$, "DOTAPVP"), .@id);
    -	mes "^00AAAAGuild : "+((.@guildname$ == "null")? "^AAAAAANone": .@guildname$);
    -	mes "^00AA00Total Kills : ["+ getelementofarray(getvariableofnpc(.statue_kills, "DOTAPVP"), .@id) +"]";
    -	mes "^70AC11Highest Streaks : ["+ getelementofarray(getvariableofnpc(.statue_streaks, "DOTAPVP"), .@id) +"]";
    -	mes "^FF0000Deaths : <"+ getelementofarray(getvariableofnpc(.statue_deaths, "DOTAPVP"), .@id) +">";
    -	close;
    -OnInit:
    -	.@id = strnpcinfo(2);
    -	set getvariableofnpc(.statue[.@id], "DOTAPVP"), getnpcid(0);
    -	set getvariableofnpc(.npcgid[getnpcid(0)], "DOTAPVP"), .@id;
    -	end;
    -}
    -
    -//brasilis,191,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#1	1_F_MARIA
    -//brasilis,195,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#2	1_F_MARIA
    -//brasilis,200,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#3	1_F_MARIA
    -//brasilis,156,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#4	1_F_MARIA
    -//brasilis,158,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#5	1_F_MARIA
    -//brasilis,160,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#6	1_F_MARIA
    -//brasilis,162,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#7	1_F_MARIA
    -//brasilis,164,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#8	1_F_MARIA
    -//brasilis,166,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#9	1_F_MARIA
    -//brasilis,168,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#10	1_F_MARIA

     

  5.  

    image.png.378026e35a91671fac3ec402756f04a6.png

    Update on this:

    • item will be separated into it own item category type
    • only listed item type can be auctioned
    • fixed overflow in vending unique id
    • the current one almost follow the old auction system completely
    • with limitation of vending item entry is only MAX_VENDING (default 12) if the vending is full, the next one will be in queue, if any item in vending expired or has been buyout the next item will enter vending list.
    • more fine details has been added ...

    Settings

    	// Item minimum sell price
    	.auction_minimumprice = 1;
    
    	// Item maximum sell price
    	.auction_maximumprice = 500000000;
    
    	// Item minimum duration
    	.auction_minhour = 1;
    
    	// Auctioned Item maximum duration
    	.auction_maxhour = 12;
    
    	// Fee per hour. Default is 12000
    	.auction_feeperhour = 12000;
    
    	// Item with bound can be auctioned?
    	// Default is false
    	.auction_item_bound_allow = false;
    
    	// Currency with bound can be used for auction?
    	// Default is false
    	.auction_currency_bound_allow = false;
    
    	/*
    	 * AddCurrencyExchange(<item id>,<value>,<variable>,<variable display name>,<variable limit>);
    	 */
    	function AddCurrencyExchange;
    
    	AddCurrencyExchange(673, 1000000, "Zeny", "Zeny", MAX_ZENY);
    	AddCurrencyExchange(675, 10000000, "Zeny", "Zeny", MAX_ZENY);
    	AddCurrencyExchange(671, 100000000, "Zeny", "Zeny", MAX_ZENY);
    	AddCurrencyExchange(677, 500000000, "Zeny", "Zeny", MAX_ZENY);
    	AddCurrencyExchange(7227, 100, "#CASHPOINTS", "Cash Point", MAX_CASHPOINT);
    
    	/*
    	 * AddAuctionHouse(<npc name>,<item type>{,<item location>{,...}});
    	 *
    	 * For <npc name>:
    	 *   please use display name with out hidden or unique name.
    	 *   if you have hidden or uniqe name it would appear weird on purchase list on vending auction npc.
    	 * For <item location>:
    	 *   When has locations set it before the other of the same <item type>
    	 *   so when there is <item location> filter it would go to the one without filter.
    	 *   or fail if other has filter too but the <item location> is not listed.
    	 */
    
    	function AddAuctionHouse;
    
    	// When has locations set it before the other
    	AddAuctionHouse(
    		"Auction Costume", IT_ARMOR,
    		EQP_COSTUME_HEAD_TOP,
    		EQP_COSTUME_HEAD_MID,
    		EQP_COSTUME_HEAD_LOW,
    		EQP_COSTUME_GARMENT
    	);
    
    	// When no locations set, all item with this type goes in here.
    	AddAuctionHouse("Auction Card", IT_CARD);
    	AddAuctionHouse("Auction Armor", IT_ARMOR);
    	AddAuctionHouse("Auction Weapon", IT_WEAPON);
    	AddAuctionHouse("Auction Shadow", IT_SHADOWGEAR);

     

    • Upvote 2
  6. Why are you editing NPC_PETRIFYATTACK instead MG_STONECURSE?

    find

    	case MG_STONECURSE:
    		{
    			if (status_has_mode(tstatus,MD_STATUSIMMUNE)) {
    				if (sd)
    					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
    				break;
    			}
    			if(status_isimmune(bl) || !tsc)
    				break;
    
    			int32 brate = 0;
    
    			if (sd && sd->sc.getSCE(SC_PETROLOGY_OPTION))
    				brate = sd->sc.getSCE(SC_PETROLOGY_OPTION)->val3;
    
    			if (sc_start2(src, bl, type, (skill_lv * 4 + 20) + brate, skill_lv, src->id, skill_get_time2(skill_id, skill_lv), skill_get_time(skill_id, skill_lv)))
    				clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
    			else if(sd) {
    				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
    				// Level 6-10 doesn't consume a red gem if it fails [celest]
    				if (skill_lv > 5)
    				{ // not to consume items
    					map_freeblock_unlock();
    					return 0;
    				}
    			}
    		}
    		break;

    change to

    	case MG_STONECURSE:
    		{
    			if (status_has_mode(tstatus,MD_STATUSIMMUNE)) {
    				if (sd)
    					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
    				break;
    			}
    			if(status_isimmune(bl) || !tsc)
    				break;
    
    			int32 brate = 0;
    
    			if (sd && sd->sc.getSCE(SC_PETROLOGY_OPTION))
    				brate = sd->sc.getSCE(SC_PETROLOGY_OPTION)->val3;
    
    			brate += 20 + (skill_lv - 1) * 10;
    
    			if (sc_start2(src, bl, type, brate, skill_lv, src->id, skill_get_time2(skill_id, skill_lv), skill_get_time(skill_id, skill_lv)))
    				clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
    			else if(sd) {
    				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
    				// Level 6-10 doesn't consume a red gem if it fails [celest]
    				if (skill_lv > 5)
    				{ // not to consume items
    					map_freeblock_unlock();
    					return 0;
    				}
    			}
    		}
    		break;

     

    • MVP 1
  7. 2 hours ago, alexander03 said:

    Sir do i need to diff enable the custom aura limit for this to work? Because i use 2018-06-21 ragna exe renewal but it didnt work,i try nemo warp and newest nemo but didnt read by newst nemo diff and if i use nemo warp allot of diff error and i cannot activated it even the enable custom aura limit,i try just only 1 aura and id it 3000 but it dfrrent effect show ,i put it in script on my custom garment but dfrrent effect show not the aura,any suggest sir how to make it work?

    old client, idk from when to when has hardcoded limitation on client side for hat effect, so  you need to lift the hardcoded limit, so far I only know Frost who can patch it, other maybe can but I don't know. you can try contact frost to ask about it.

  8. rAthena developer has provide us with tools that can convert yml to sql, if you in windows just build/rebuild all of project rAthena Solution, then run yml2sql.bat there you need some input what to convert and what not by pressing Y or N key on your keyboard, you will have ready sql file to import in sql-files folder

    image.png.86348d98bc5951e543460d70122442c2.png

  9. It would be stupid for the owner to bid its own item by him self or another account, for whatever reason (usually for increasing it final price) since if there is case happen no one out bid him, he would be paying for his own item that same as not auctioning / selling it haha.

  10. KQL61O6dtf.png.d8655a6bcf2eaa57979634d373c87854.png

    Since Auction Feature has been removed long time ago, I re-created another way to bring back Auction with an Alternative Method. Using Vending System albeit with some limitation.

    Known Limitation:

    - You can't purchase the item that auctioned on vending if you has not engough zeny (Client Limitation), to work around this create item to be used as placement of currency equivalent to the real currency, in example if you want to use Zeny as currency of the payment method, by default
    maximum zeny is capped to by defined in MAX_ZENY (usually 2 Billion), but how if the auctioner want to by pass that limit? this is where curency placement come to play.

    - Only one item should be auctioned at once, Auctioning multiple item can be done but because UI / Display limitation info about auctioned item can't be verbose enough to be known / understood at glance if each item has different currency.

     

    • Upvote 3
    • Like 1
  11. try edit directly the world name into your server name that in char_athena.conf if it isn't correct then you should adjust the char set on that column table, idk which one suit for your language.

    image.thumb.png.7c930ec1ebc6b55378d863c8e13be120.png

    Or take look at when your map-server console is ready there is status text like

    Map-server connected to char-server '????' (whispername: Server).

    where  ???? is your server name where you put in char_athena.conf is it spelled correctly?

  12. log detail of boss monster you need on function mob_setdelayspawn, do not forget to check if it boss monster (md->spawn->state.boss)

    on where monster (in this case  boss monster) spawn script parsed (npc_parse_mob) before it spawned look up from sql table
    detail that you saved and modify what you want it to be modified let's say the spawn time.

    check if it greater or same or passed of current tick state where it should be still tomb or has been respawned.

    if yet spawned copy or modify function of mob_setdelayspawn and spawn tomb (mvptomb_create) then if it should has been spawned
    run as it should

    the important part where the monster spawned is in function npc_parse_mob2, with this it would spawn like natural spawn

    I didn't look deep enought to get working mod, but it should be close enough

  13. 799e6B5nnx.gif.5ffd75c07d978eaf431325aabdb5c9fe.gif

    Yet another Mining System Inspired by Mir4 Mining, I have worked the details to be as close to the source found in internet.

    Player can't mine a Mine that another Player is already mining.
    Progress of Mining can be canceled by trying to walk away.
    Progress of Mining while be canceled when Player received damage.
    Progress of Mining while be canceled when Player can't carry the item gained from Mine.
    When The Mine is exhausted it will hide away and move / re-spawn in different place.

    The default drop item (Dark Steel) replaced by Phracon

    Common Mine (Gray/White): 25-30 Dark Steel
    Uncommon (Green): 35-40 Dark Steel
    Rare (Blue): 45-60 Dark Steel
    Epic (Red): 100-150 Dark Steel
    Legendary (Yellow): 150-200 Dark Steel

    Script configuration has been made easy to understand and modify

    .mine_drop = 1010; // Phracon
    
    .miner_distance = 2;
    .mine_distance = 7;
    
    /*
     * minetype(<index>,"<Name>",<MaxHP>,<Drop Min Amount>,<Drop Max Amount>);
     */
    
    minetype(0, "Common", 3, 25, 30);
    minetype(1, "Uncommon", 200, 35, 40);
    minetype(2, "Rare", 300, 45, 60);
    minetype(3, "Epic", 400, 100, 150);
    minetype(4, "Legendary", 500, 150, 200);
    
    /*
     * minespawn("<map name>",<Common Amount>);
     * minespawn("<map name>",<Common Amount>,<Uncommon Amount>);
     * minespawn("<map name>",<Common Amount>,<Uncommon Amount>,<Rare Amount>);
     * minespawn("<map name>",<Common Amount>,<Uncommon Amount>,<Rare Amount>,<Epic Amount>);
     * minespawn("<map name>",<Common Amount>,<Uncommon Amount>,<Rare Amount>,<Epic Amount>,<Legendary Amount>);
     *
     * Example:
     *   minespawn("anthell01", 50, 25, 12, 5, 2);
     *   - this will spawn listed Mine below in map "anthell01":
     *       - 50 Common Mine
     *       - 25 Uncommon Mine
     *       - 12 Rare Mine
     *       - 5 Epic Mine
     *       - 2 Legendary Mine
     */
    
    minespawn("anthell01", 50, 25, 12, 5, 2);

    In Game Record ...

    Spoiler

     

     

     

    Can be expanded further like, Reduction Timer or Drop amount bonus when using certain equip or like setting different item, rate and amount that can be set in configuration..

    • Upvote 3
    • Love 2
    • MVP 1
  14. Deposit System

    Do your server has so many headgear? Usually after new headgear is released especially when the new one has better benefit, Previous Headgear used by Player is now useles right?

    This System is inspired on the ROM Adventure Book, Where Player can Deposit un-used Item, but Player will be still has benefited from it, instead lying around somewhere uselessly.

    Spoiler
    ###########################################################################
    # Deposit Database
    ###########################################################################
    #
    # Settings
    #
    ###########################################################################
    # - StorageId               Storage Id.
    #   Bound                   if storage shared by account or not. (Default: true)
    #   Withdraw                If item in this storage can be withdrawed after deposited. (Default: true)
    #   WithdrawFee             Price to withdraw any item from this storage. (Default: 0)
    #   Items:                  List of possible items.
    #     - Item                Item name.
    #       Amount              Item amount. (Default: 1)
    #       Refine              Item refine. (Default: 0)
    #       Withdraw            If this item can be withdrawed after deposited. (Default: true)
    #       WithdrawFee         Price to withdraw this item from this storage. (Default: 0)
    #       Script              Script to execute when the item successfully deposited. (Default: null)
    ###########################################################################
    
    Header:
      Type: DEPOSIT_DB
      Version: 1
    
    Body:
      - StorageId: 10
        Withdraw: true
        Items:
         - Item: Poring_Card
           Script: |
             bonus bInt,100;
         - Item: Fabre_Card
           Amount: 3
           Script: |
             bonus bStr,100;
      - StorageId: 11
        Items:
         - Item: Sword
           Script: |
             bonus bAgi,100;
         - Item: Sword_
           Refine: 7
           Script: |
             bonus bDex,100;

     

    Video

    • Upvote 2
    • Love 2
    • MVP 1
  15. 13 hours ago, Thanna20 said:

    Thank you for maintaining and updating it. can I ask, does it support GRF encryption?

     

    afaik, GRF Encryption is not supported, since roBrowser using web client, not usual client ragexe.exe, so its not loading cps.dll which usually used as encryption logic. CMIIW

    • Love 1
×
×
  • Create New...