Jump to content

Haruka Mayumi

Members
  • Posts

    477
  • Joined

  • Last visited

  • Days Won

    27

Posts posted by Haruka Mayumi

  1. prontera,155,181,5	script	One-Click-Buy	94,{
    
          if(Zeny < .Price){
              message strcharinfo(0),"Not enough zeny"; end;
          }
          if(!checkweight(.Item,.Amount)){
              message strcharinfo(0),"Not enough weight"; end;
          }
          Zeny -= .Price;
          getitem2 .Item,.Amount,1,.Upgrade,0,0,0,0,0;
    end;
    
    OnInit:
          set .Item,1201;
          set .Amount,1;
          set .Upgrade,7;
          set .Price,10000;
          waitingroom ((.Amount>1) ? .Amount+"x ":"")+((.Upgrade) ? "+"+.Upgrade+" ":"")+""+getitemname(.Item)+" "+.Price+"z",0;
    end;
    }

     

    • Upvote 1
  2. First IN First OUT rule.

    first i took the dummy shop above. so this will load the dummy shops first instead of adding the items to non-existing shops because they are loaded last.. 

    // Dummy shop data -- copy as needed.
    //============================================================
    -	shop	qshop1	-1,909:-1
    -	shop	qshop2	-1,909:-1
    -	shop	qshop3	-1,909:-1
    -	shop	qshop4	-1,909:-1
    -	shop	qshop5	-1,909:-1

    Next is this line.. as specific as the script says.. npc shop delete item.. it will delete the id 909 - which is jellopy once loaded.. before, you added the items on the delete list so you don't find them and leaving the jellopy alone..

    	set .menu$,"";
    	for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) {
    		set .menu$, .menu$+.Shops$[.@i]+":";
    		npcshopdelitem "qshop"+.@i,909;
    	}

     

  3. //===== 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
    //============================================================
    ra_temsky,102,147,5	script	Misc	848,{ callfunc "qshop"; }
    // prontera,165,203,6	script	Quest Shop#2	998,{ callfunc "qshop",1,2; }	// call the shop 1 and 2 defined below
    // etc.. Add your Shop NPCs 'Quest Shop#XXX' here
    //============================================================
    
    // Dummy shop data -- copy as needed.
    //============================================================
    -	shop	qshop1	-1,909:-1
    -	shop	qshop2	-1,909:-1
    -	shop	qshop3	-1,909:-1
    -	shop	qshop4	-1,909:-1
    -	shop	qshop5	-1,909:-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 .Announce,1;	// Announce quest completion? (1: yes / 0: no)
    	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.
    
    // -----------------------------------------------------------
    //  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],
    		"Eden Weapons",	// Shop Named 1
    
    // -----------------------------------------------------------
    //  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,4320,1,0,0,671,10);
    	Add(1,4285,1,0,0,671,10);
    	Add(1,40190,1,0,0,671,20);
    	Add(1,40191,1,0,0,671,20);
    	Add(1,40192,1,0,0,671,20);
    	Add(1,40193,1,0,0,671,20);
    	Add(1,40194,1,0,0,671,20);
    	Add(1,40195,1,0,0,671,20);
    	Add(1,2629,1,0,0,671,50);
    
    
    // -----------------------------------------------------------
    
    //=====================================================================================
    // ------------------- 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;
    	}
    	dispbottom "Select one item at a time.";
    	callshop "qshop"+@shop_index,1;
    	npcshopattach "qshop"+@shop_index;
    	end;
    
    OnBuyItem:
    	// .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... }
    	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]));
    	set .@q[2],.@q[1]*.@q[3];
    	if (!.@q[2] || .@q[2] > 30000) {
    		message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+".";
    		end;
    	}
    	mes "[Quest Shop]";
    	mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000";
    	mes "Requirements:";
    	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 " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000";
    	next;
    	setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11);
    	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(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
    		case 1:
    			if (@qe[0]) {
    				mes "[Quest Shop]";
    				mes "You're missing one or more quest requirements.";
    				close;
    			}
    			if (!checkweight(.@q[0],.@q[2])) {
    				mes "[Quest Shop]";
    				mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+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];
    			getitem .@q[0],.@q[2];
    			if (.Announce) announce strcharinfo(0)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):callfunc("F_InsertArticle",getitemname(.@q[0])))+"!",0;
    			specialeffect2 EF_FLOWERLEAF;
    			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);
    	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),2) == 4 || getiteminfo(getarg(0),2) == 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;
    }

    Use the Code box when pasting some codes. tabs become space when not on a code box. it also takes time to scroll down.

    • MVP 1
  4. 5 minutes ago, Skits said:

        freeloop(0);
        set .menu$,"";
        for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) {
            set .menu$, .menu$+.Shops$[.@i]+":";
            npcshopdelitem "qshop"+.@i,4320,4285,40190,40191,40192,40193,40194,40195,2629;
        }
        end;

    you just deleted the items after adding them... as the script says. npcshopdelitem.. this is 909.
     

    	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;

     

  5. you can use @reloadscript once you added it. but the best way to do it is put the dummy shops above and use @reloadnpcfile.

    //===== 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
    //============================================================
    ra_temsky,102,147,5	script	Misc	848,{ callfunc "qshop"; }
    // prontera,165,203,6	script	Quest Shop#2	998,{ callfunc "qshop",1,2; }	// call the shop 1 and 2 defined below
    // etc.. Add your Shop NPCs 'Quest Shop#XXX' here
    //============================================================
    
    // Dummy shop data -- copy as needed.
    //============================================================
    -	shop	qshop1	-1,909:-1
    -	shop	qshop2	-1,909:-1
    -	shop	qshop3	-1,909:-1
    -	shop	qshop4	-1,909:-1
    -	shop	qshop5	-1,909:-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 .Announce,1;	// Announce quest completion? (1: yes / 0: no)
    	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.
    
    // -----------------------------------------------------------
    //  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],
    		"Eden Weapons",	// Shop Named 1
    
    // -----------------------------------------------------------
    //  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,5022,1,0,0,7086,1,969,10,999,40,1003,50,984,2);
    	Add(1,5032,1,0,0,1059,250,2221,1,2227,1,7063,600);
    	Add(1,5027,1,0,0,2252,1,1036,400,7001,50,4052,1);
    	Add(1,5045,1,0,0,2252,1,1054,450,943,1200);
    
    
    // -----------------------------------------------------------
    
    //=====================================================================================
    // ------------------- 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,4320,4285,40190,40191,40192,40193,40194,40195,2629;
    	}
    	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;
    	}
    	dispbottom "Select one item at a time.";
    	callshop "qshop"+@shop_index,1;
    	npcshopattach "qshop"+@shop_index;
    	end;
    
    OnBuyItem:
    	// .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... }
    	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]));
    	set .@q[2],.@q[1]*.@q[3];
    	if (!.@q[2] || .@q[2] > 30000) {
    		message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+".";
    		end;
    	}
    	mes "[Quest Shop]";
    	mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000";
    	mes "Requirements:";
    	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 " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000";
    	next;
    	setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11);
    	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(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
    		case 1:
    			if (@qe[0]) {
    				mes "[Quest Shop]";
    				mes "You're missing one or more quest requirements.";
    				close;
    			}
    			if (!checkweight(.@q[0],.@q[2])) {
    				mes "[Quest Shop]";
    				mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+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];
    			getitem .@q[0],.@q[2];
    			if (.Announce) announce strcharinfo(0)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):callfunc("F_InsertArticle",getitemname(.@q[0])))+"!",0;
    			specialeffect2 EF_FLOWERLEAF;
    			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);
    	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),2) == 4 || getiteminfo(getarg(0),2) == 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;
    }
    
    

     

  6. prontera,155,181,5	script	YmirCoin	757,{
    
    	mes "[Ymir Coin Exchanger]";
    	mes "Just give me the required items and ill give you Coin of Ymir.";
    	mes "Required Mats per ^FF0000"+getitemname(.GiveItem)+"^000000:";
    	for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
    		mes "- ^FF0000"+.Item[.@i+1]+" "+getitemname(.Item[.@i]);
    	next;
    	if( select("Make ^FF0000"+getitemname( .GiveItem )+"^000000:Cancel") == 2 ) end;
    	mes "[Ymir Coin Exchanger]";
    	mes "How many would you like to make?";
    	next;
    	input .@amount,1,999;
    	mes "[Ymir Coin Exchanger]";
    	mes .@amount+"x ^FF0000"+getitemname(.GiveItem)+"^000000, is this correct?";
    	next;
    	if( select("Yes, Make ^FF0000"+.@amount+" "+getitemname( .GiveItem )+"^000000:Cancel") == 2 ) end;
    	for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
    		if( countitem( .Item[.@i] ) < .Item[.@i+1]*.@amount ){
    			mes "[Ymir Coin Exchanger]";
    			mes "Insufficient Materials";
    			for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
    				mes "- Need ( "+countitem(.Item[.@i])+"/"+.Item[.@i + 1]*.@amount+" ) "+getitemname( .Item[.@i] );
    			end;
    		}
    	if(!checkweight(.GiveItem,.@amount)){
    		mes "Insufficient inventory space or weight.";
    		end;
    	}
    	for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
    		delitem .Item[ .@i ],.Item[ .@i + 1 ]*.@amount;
    	getitem .GiveItem,.@amount;
    	mes "[Ymir Coin Exchanger]";
    	mes "You have Made ^FF0000"+.@amount+"x "+getitemname( .GiveItem )+"^000000";
    	announce "["+strcharinfo(0)+"] has made "+.@amount+"x ["+getitemname( .GiveItem )+"]",0;
    close;
    
    OnInit:
    	// What Item you want to Make ?
    	set .GiveItem,7539;
    	// Item Requirements + Amounts
    	setarray .Item[0],
    	607,1,
    	608,1,
    	512,1;
    end;
    }

    It's much better to check the requirement before giving the item, instead of before selecting MAKE. also added checkweight if ever that the given item is heavier than required materials.

    • MVP 1
  7. On 11/26/2019 at 5:41 AM, Amauri Melo said:

    When the seller has 2kkk or 2kkk (Cash), the sale is made and completed! Shouldn't the buying player receive a message saying that the store owner has a maximum of Zeny or Cash? And so he could not buy.

    conf/battle/item.conf
    vending_over_max: yes (set to no)

    • Upvote 3
  8. custom class with the same body of super novice. but attack animation of BOW and PISTOL. you will need to use changebase script when using those weapons..
    for the custom sprite of the custom class. either you ask from Graphic Request Forums..

    lot of custom sprite probably like
    - Super_Novice_SwordDagger
    - Super_Novice_BowPistol
    - Super_Novice_SpearBook
    - etc.

  9. as far as i know. the client reads the animation first before sending another action from the player. so you need to remove the animation of hiding skill.. there are times that skill_db.txt wont solve your problems.

    clif.cpp

    bool clif_skill_nodamage(struct block_list *src,struct block_list *dst, uint16 skill_id, int heal, t_tick tick)
    {
    	unsigned char buf[17];
    #if PACKETVER < 20130731
    	const int cmd = 0x11a;
    #else
    	const int cmd = 0x9cb;
    #endif
    	int offset = 0;
    	bool success = ( tick != 0 );
    
    	nullpo_ret(dst);
    	
    +	if( skill_id == TF_HIDING ) return success;

     

  10. you dont use commands outside a script.. you use it like this

    -	script	control	-1,{
    
    OnMon1246:
    	enablenpc "npc";
    end;
    
    OnMon1247:
    	disablenpc "npc";
    end;
    
    }
    
    prontera,153,181,4	script	npc	94,{
    
    npctalk "Hello There";
    end;
    
    OnInit:
    disablenpc strnpcinfo(0);
    end;
    
    }

    but i prefer to use the command gettime() for days which is much more flexible since OnDay command only works at the given time..
    Sample:
     

    prontera,153,181,4	script	npc	94,{
    
    npctalk "Hello There";
    end;
    
    }
    
    -	script	control	-1,{
    
    OnInit:
    OnHour00:
    if(gettime(DT_DAYOFWEEK)==MONDAY)
    	enablenpc "npc";
    else
    	disablenpc "npc";
    end;
    
    }

    As you can see here. whenever the server/script loads again. it will check if the npc should show or hide.. not like the OnDay, it only triggers on certain time.

    • Upvote 1
  11. in skill_db.txt
     

    289,9,6,1,0,0x1,0:0:0:0:0:-1,5,1,yes,0,0xE00,0,magic,0,0x10020,	SA_DISPELL,Dispell

    change the inf3 into

    289,9,6,1,0,0x1,0:0:0:0:0:-1,5,1,yes,0,0xE00,0,magic,0,0x20,	SA_DISPELL,Dispell

    removing this 
    //    0x010000 - skill that affects hidden targets

    • Upvote 3
  12. 		case KO_ZANZOU: {
    				int c = 0;
    
    				i = map_foreachinmap(skill_check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, MOBID_ZANZOU, skill_id, &c);
    				if( c >= skill_get_maxcount(skill_id,skill_lv) || c != i) {
    					clif_skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0);
    					return false;
    				}
    			}
    			break;
    +		case MO_EXTREMITYFIST:
    +				if( !sd->spiritball || !sd->sc.data[SC_EXPLOSIONSPIRITS]){
    +					clif_skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0);
    +					return false;
    +				}
    +			break;
    	}

    in skill.cpp

    • Love 1
  13. You must declare the shop first because on the script. it read the V4P manager first and run the OnInit first..
    although its okay if you use @reloadscript to show the items. but its not the case on @reloadnpcfile.

    -	shop	votepoints_shop	-1,512:-1
    vip_lounge,140,243,4	script	V4P Manager	62,{
    function getPoints;
    
    	set .@n$, 			"[VFP Manager]";
    	set .@settings, 	1;		// 0 = item, 1 = shop
    	set .@itemReward, 	501;	// if settings is set to item
    	set .@convertRate, 	2;		// 2 Vote Points for 1 Red Potion
    	set .vp, 			getPoints(getcharid(3));
    	
    	switch (.@settings) {
    		case 0:
    			mes .@n$;
    			mes "Would you like to convert your "+ .vp +" Vote Points?";
    			mes "^ff0000The current convert rate is "+ .@convertRate +" Vote Points for 1 "+ getitemname(.@itemReward) +".";
    			next;
    			menu "Yes", L_Convert, "No", -;
    			mes .@n$;
    			mes "Bye, then.";
    			break;
    		case 1:
    			mes .@n$;
    			mes "You have ^ff0000"+ .vp +"^000000 Vote Points.";
    			mes "Would you like to go shopping?";
    			next;
    			menu "Yes", -, "No", L_Goodbye;
    			mes .@n$;
    			mes "Have fun shopping!";
    			callshop "votepoints_shop",1;
    			npcshopattach "votepoints_shop";
    			end;
    	}
    	
    	L_Goodbye:
    		mes .@n$;
    		mes "Goodbye, then.";
    		close;
    	
    	L_Convert:
    		if (.vp < .@convertRate)
    			goto L_VotePointsTooLow;
    		mes .@n$;
    		mes "How much Vote Points would you like to convert?";
    		next;
    		menu "All", L_ConvertAll, "Input Amount", L_ConvertAmount;
    	
    	L_ConvertAmount:
    		input .@convert;
    		
    		if (.@convert > .vp)
    			goto L_VotePointsTooLow;
    		
    		set .vp, ((.vp - .@convert) + (.@convert % .@convertRate));
    		set .@convert, (.@convert / .@convertRate);
    		getitem .@itemReward, .@convert;
    		query_sql("UPDATE cp_createlog SET votepoints = "+ .vp +" WHERE account_id = "+ getcharid(3));
    		
    		mes .@n$;
    		mes "You have received "+ .@convert +"x "+ getitemname(.@itemReward) +".";
    		mes "Your current Vote Points is "+ .vp;
    		close;
    		
    	L_ConvertAll:
    		set .@convert, (.vp / .@convertRate);
    		set .vp, (.vp % .@convertRate);
    		getitem .@itemReward, .@convert;
    		query_sql("UPDATE cp_createlog SET votepoints = "+ .vp +" WHERE account_id = "+ getcharid(3));
    		
    		mes .@n$;
    		mes "You have received "+ .@convert +"x "+ getitemname(.@itemReward) +".";
    		mes "Your current Vote Points is "+ .vp;
    		close;
    	
    	L_VotePointsTooLow:
    		mes .@n$;
    		mes "Your Vote Points is too low. Come back when you have the minimum amount of Vote Points.";
    		close;
    	
    	function getPoints {
    		set .@account_id, getarg(0);
    		
    		set .@count, query_sql("SELECT votepoints FROM cp_createlog WHERE account_id = "+ .@account_id, .@votepoints);
    		
    		return .@count ? .@votepoints : 0;
    	}
    	
    	OnBuyItem:
    		set .@cost,0;
    		for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1)
    			for(set .@j,0; .@j<getarraysize(.itemShop); set .@j,.@j+2)
    				if (@bought_nameid[.@i] == .itemShop[.@j]) {
    					set .@cost, .@cost+(.itemShop[.@j+1]*@bought_quantity[.@i]);
    					break;
    				}
    		mes .@n$;
    		if (.@cost > .vp) mes "You don't have enough Vote Points.";
    		else {
    			for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1) {
    				getitem @bought_nameid[.@i], @bought_quantity[.@i];
    				dispbottom "Purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+".";
    			}
    			set .vp, .vp - .@cost;
    			query_sql("UPDATE cp_createlog SET votepoints = votepoints - "+ .@cost +" WHERE account_id = "+ getcharid(3));
    			mes .@n$;
    			mes "Deal completed.";
    			mes "You now have ^ff0000"+ .vp +"^000000 Vote Points.";
    			emotion et_money;
    		}
    		set .@cost,0;
    		deletearray @bought_nameid[0], getarraysize(@bought_nameid);
    		deletearray @bought_quantity[0], getarraysize(@bought_quantity);
    		close;
    	
    	OnInit:
    		setarray .itemShop[0],	501,2,607,5; // <ITEM_ID>,<PRICE>,...
    		
    		npcshopdelitem "votepoints_shop",512;
    		for(set .@i, 0; .@i < getarraysize(.itemShop); set .@i, .@i+2)
    			npcshopadditem "votepoints_shop", .itemShop[.@i], .itemShop[.@i+1];
    	end;
    }
    • Upvote 1
×
×
  • Create New...