Jump to content

Winterfox

Members
  • Posts

    236
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by Winterfox

  1. 1 hour ago, Dolphin86 said:

    @Winterfox

    yeap still dont work, mybe the script reads different i meant it confused on reading my script ?

    it keeps reading BeginnerQuest3 part not bypass it and read the other part which is this 

    if(isequipped(40016)) { 
    new_1-3,105,59,6	script	Benimaru	483,{
    	switch(BeginnerQuest) {
    		case 0:
    			cutin "3rd_sura_master.bmp",2;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Welcome to Durengo Online";
    			mes "my name is ^ff9300 Benimaru ^000000.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Ok. let's get to the basics,";
    			mes "of Durengo Online.";
    			mes "This is no place for";
    			mes "a new survivor like you.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "That is why i am here,";
    			mes "to help you.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "There is still a lot of work to do, ";
    			mes "but lets begin with the basic stuff,";
    			mes "now then, are you ready?";
    			next;
    			if(select("- Yes, please help me!:- I need a minute..") == 2) {
    				mes "=== ^ff9300 Benimaru ^000000 ===";
    				mes "Come back when your ready";
    				close3;
    			}
    
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Great, now in this world, you will have";
    			mes "to gather materials for your tools and";
    			mes "craft your own equipment.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Unless you are skilled blacksmith,";
    			mes "you may only craft a limited number of equipments.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Also, monsters will not";
    			mes "drop any equipment, and npcs do not";
    			mes "sell any equipment as well..";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "We shall start with ^c90076 [ Stone Dagger ] ^000000.";
    			mes "A Stone Dagger is a gathering tool.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "It allows you to gather ^c90076 [ Stalk ] ^000000, ^c90076 [ Meat ] ^000000";
    			mes "and ^c90076 [ Bone ] ^000000, which later can be used to craft";
    			mes "better gear and tools.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Let's craft ^c90076 [ Stone Dagger ] ^000000";
    			mes "now. If you look around there should be";
    			mes "^2986cc A Pile Of Rocks ^000000.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Gather ^c90076 4 x [ Rocks ] ^000000";
    			mes "and come back to me when you have them.";
    			BeginnerQuest = 1;
    			close3;
    
    		case 1:
    			cutin "3rd_sura_master.bmp",2;			
    			if(countitem(40005) < 4 ) {
    				mes "=== ^ff9300 Benimaru ^000000 ===";
    				mes "I did say you need ^c90076 4 x [ Rocks ] ^000000.";
    				mes "Look around there should be";
    				mes "a ^2986cc Pile Of Rocks ^000000 nearby.";
    				close3;
    			}
    			
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Good, now if you take a look, next";
    			mes "to me should be a workbench.";
    			mes "You can start working on crafting";
    			mes "your own ^c90076 [ Stone Dagger ] ^000000 there.";
    			BeginnerQuest = 2;
    			close3;
    							
    		case 2:
    			cutin "3rd_sura_master.bmp",2;
    			if(!isequipped(40001)) {
    				mes "=== ^ff9300 Benimaru ^000000 ===";
    				mes "If you do have a ^c90076 [ Stone Dagger ] ^000000";
    				mes "equip it.";
    				mes "If you don't, go craft one."; 
    x				next;
    				mes "=== ^ff9300 Benimaru ^000000 ===";
    				mes "Remember you need the following to craft one:";
    				mes "^c90076 4 x [ Rocks ] ^000000";
    				close3;
    			}
    
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Great now you have your first";
    			mes "^c90076 [ Stone Dagger ] ^000000.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Now i will teach you how to craft";
    			mes "a ^c90076 [ Stone Axe ] ^000000.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "With a ^c90076 [ Stone Axe ] ^000000 you can gather logs";
    			mes "and some other stuff.";
    			mes "To make one we need ^c90076 8 x [ Stalk ] ^000000";
    			mes "^c90076 1 x [ Rock Chunk ] ^000000 and a ^c90076 [ Branch ] ^000000";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Out of the ^c90076 8 x [ Stalk ] ^000000 you can make ^c90076 2 x [ Ropes ] ^000000.";
    			mes "You can gather ^c90076 [ Stalk ] ^000000 from ^2986cc Tall Grass ^000000."; 
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "To make a ^c90076 [ Rock Chunk ]  ^000000 you need";
    			mes "^c90076 4 x [ Rocks ] ^000000, i assume you know where to find the ^c90076 [ Rocks ] ^000000?";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "The last item is a ^c90076 [ Branch ] ^000000, you can get from a ^2986cc Tree ^000000.";
    			mes "It is as simple as that.";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Remember you need the following to craft a ^c90076 [ Stone Axe ] ^000000:";
    			mes "^c90076 8 x [ Stalk ] ^000000 = ^c90076 2 x [ Ropes ] ^000000 (workbench)";
    			mes "^c90076 1 x [ Rock Chunk ] ^000000 = ^c90076 4 x [ Rock ] ^000000 (workbench)";
    			mes "^c90076 1 x [ Branch] ^000000";
    			next;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Come back to me when you have crafted one.";
    			BeginnerQuest = 3;
    			close3;
    
    		case 3:
    			cutin "3rd_sura_master.bmp",2;
    			if(!isequipped(40016)) {
    				mes "=== ^ff9300 Benimaru ^000000 ===";
    				mes "If you do have the Stone Axe";
    				mes "equip it.";
    				mes "===================";
    				mes "if you dont have it, go craft one"; 
    				next;
    				mes "=== ^ff9300 Benimaru ^000000 ===";
    				mes "Remember you need the following to craft one:";
    				mes "^c90076 8 x [ Stalk ] ^000000 = ^c90076 2 x [ Ropes ] ^000000 (workbench)";
    				mes "^c90076 1 x [ Rock Chunk ] ^000000 = ^c90076 4 x [ Rock ] ^000000 (workbench)";
    				mes "^c90076 1 x [ Branch] ^000000";
    				close3;
    			}
    
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Great work !";
    			next;
    			mes "....";
    			BeginnerQuest = 4;
    			close3;
    
    		case 4:
    			cutin "3rd_sura_master.bmp",2;
    			mes "=== ^ff9300 Benimaru ^000000 ===";
    			mes "Still needs to be implemented.."
    			close3;
    	}
    	end;
    
    	OnInit:
    		setunitdata(getnpcid(0), UNPC_GROUP_ID, 2);
    		setunittitle(getnpcid(0), "Newbies Trainer");
    }

     

  2. 1 hour ago, Dolphin86 said:

    @Winterfoxi can take the item now, but the text box Completed is still there

    1.png.564c8c71290facb4ad0a98ecfbf71cd7.png

    new_1-3,118,54,5	script	Workbench	665,{
    	if($wrkb_crafting_state == 1) {
    		mes "[" + .npc_name + "]";
    		mes "Please wait until the crafting process is finished. ";
    		close;
    	}
    
    	if($wrkb_crafting_state == 2) {
    		mes "[" + .npc_name + "]";
    		mes "Here are your products.";
    		for(.@i = 0; .@i < getarraysize($product); .@i += 2)
    			getitem($product[.@i], $product[.@i + 1]);
    
    		delwaitingroom;
    		$wrkb_crafting_state = 0;
    		close;
    	}
    
    	mes "[" + .npc_name + "]";
    	mes "What do you want to craft?";
    	next;
    	switch(select("Stone Dagger:Ropes:Cancel")) {
    		case 1:
    			if(countitem(40005) < 4) {
    				mes "[" + .npc_name + "]";
    				mes "^ff0000 You do not have enough rocks ^000000";
    				close;
    			}
    
    			delitem(40005, 4);
    			setarray($product, 40007, 1, 40009, 1);
    
    			goto OnCraftingStart;
    		case 2:
    			if(countitem(40008) < 8) {
    				mes "[" + .npc_name + "]";
    				mes "^ff0000 You do not have enough stalk ^000000";
    				close;
    			}
    
    			delitem(40008, 8);
    			setarray($product, 40007, 1, 40014, 1);
    
    			goto OnCraftingStart;
    		case 3:
    			mes "[" + .npc_name + "]";
    			mes "Crafting canceled.";
    			close;
    	}
    	end;
    
    	OnCraftingStart:
    		$wrkb_crafting_state = 1;
    		waitingroom("CRAFTING...", 0);
    		initnpctimer;
    		end;
    
    	OnTimer60000:
    		$wrkb_crafting_state = 2;
    		delwaitingroom;
    		waitingroom("COMPLETED!", 0);
    		end;
    
    	OnInit:
    		.npc_name = strnpcinfo(1);
    		if($wrkb_crafting_state == 1) goto OnCraftingStart;
    }

     

  3. 27 minutes ago, Dolphin86 said:

    1.png.558b60e0a347655c68ba6cdc4ba56b8e.png

    @Winterfox this happen when i try to take the completed item, there is no error and i did not get the item, the npc still showing completed and when i talk again with the npc, the only option i have i to craft again, but item was never received 

    new_1-3,118,54,5	script	Workbench	665,{
    	if($wrkb_crafting_state == 1) {
    		mes "[" + .npc_name + "]";
    		mes "Please wait until the crafting process is finished. ";
    		close;
    	}
    
    	if($wrkb_crafting_state == 2) {
    		mes "[" + .npc_name + "]";
    		mes "Here are your products.";
    		for(.@i = 0; .@i < getarraysize($product); .@i += 2)
    			getitem($product[.@i], $product[.@i + 1]);
    
    		$wrkb_crafting_state = 0;
    		close;
    	}
    
    	mes "[" + .npc_name + "]";
    	mes "What do you want to craft?";
    	next;
    	switch(select("Stone Dagger:Ropes:Cancel")) {
    		case 1:
    			if(countitem(40005) < 4) {
    				mes "[" + .npc_name + "]";
    				mes "^ff0000 You do not have enough rocks ^000000";
    				close;
    			}
    
    			delitem(40005, 4);
    			setarray($product, 40007, 1, 40009, 1);
    
    			goto OnCraftingStart;
    		case 2:
    			if(countitem(40008) < 8) {
    				mes "[" + .npc_name + "]";
    				mes "^ff0000 You do not have enough stalk ^000000";
    				close;
    			}
    
    			delitem(40008, 8);
    			setarray($product, 40007, 1, 40014, 1);
    
    			goto OnCraftingStart;
    		case 3:
    			mes "[" + .npc_name + "]";
    			mes "Crafting canceled.";
    			close;
    	}
    	end;
    
    	OnCraftingStart:
    		$wrkb_crafting_state = 1;
    		waitingroom("CRAFTING...", 0);
    		initnpctimer;
    		end;
    
    	OnTimer60000:
    		$wrkb_crafting_state = 2;
    		delwaitingroom;
    		waitingroom("COMPLETED!", 0);
    		end;
    
    	OnInit:
    		.npc_name = strnpcinfo(1);
    		if($wrkb_crafting_state == 1) goto OnCraftingStart;
    }

     

  4. new_1-3,118,54,5	script	Workbench	665,{
    	if($wrkb_crafting_state == 1) {
    		mes "[" + .npc_name + "]";
    		mes "Please wait until the crafting process is finished. ";
    		close;
    	}
    
    	if($wrkb_crafting_state == 2) {
    		mes "[" + .npc_name + "]";
    		mes "Here are your products.";
    		for(.@i = 0; .@i < getarraysize($product); .@i += 2)
    			getitem($product[.@i], $product[.@i + 1]);
    
    		$wrkb_crafting_state = 0;
    		close;
    	}
    
    	mes "[" + .npc_name + "]";
    	mes "What do you want to craft?";
    	next;
    	switch(select("Stone Dagger:Ropes:Cancel")) {
    		case 1:
    			if(countitem(40005) < 4) {
    				mes "[" + .npc_name + "]";
    				mes "^ff0000 You do not have enough rocks ^000000";
    				close;
    			}
    
    			delitem(40005, 4);
    			setarray($product, 40007, 1, 40009, 1);
    
    			goto OnCraftingStart;
    		case 2:
    			if(countitem(40008) < 8) {
    				mes "[" + .npc_name + "]";
    				mes "^ff0000 You do not have enough stalk ^000000";
    				close;
    			}
    
    			delitem(40008, 8);
    			setarray($product, 40007, 1, 40014, 1);
    
    			goto OnCraftingStart;
    		case 3:
    			mes "[" + .npc_name + "]";
    			mes "Crafting canceled.";
    			close;
    	}
    	end;
    
    	OnCraftingStart:
    		$wrkb_crafting_state = 1;
    		waitingroom("CRAFTING...", 0);
    		initnpctimer;
    		end;
    
    	OnTimer60000:
    		$wrkb_crafting_state = 2;
    		delwaitingroom;
    		waitingroom("COMPLETED!", 0);
    		end;
    
    	OnInit:
    		.npc_name = strnpcinfo(1);
    		if($wrkb_crafting_state == 1) goto OnCraftingStart;
    }

     

  5. 17 hours ago, Dolphin86 said:

    thanks, this is much more cleaner version

    Question: where is the timer part where i can set the time for waiting ? @Winterfox

    The script uses a npc timer, that calls labels based on their time suffix.
    In the case of this script, the label is OnTimer60000 the 60000 means 60 seconds, since the time is given in milliseconds so 1 second = 1000 milliseconds.

  6. 1 hour ago, friomixx said:

    Hi,

    Can anyone help me check my error?
    the goal of my script is to check if all members of the party are online and members of the same guild
    .
    as you can see in the screenshot
    , I'm able to reload the script, but whenever i tried to click the NPC, it now gives the error message.

     

    prontera,194,181,5	script	Room Manager	415,{
    	
    	.@partyId = getcharid(1);
    	.@guildId = getcharid(2);
    	.@partyMember = 2;
    	getpartymember(.@partyId,0);
    	getpartymember(.@partyId,1);
    	getpartymember(.@partyId,2);
    	
    	callsub S_GuildParty,.@guildId;
    	
    	dispbottom "You passed the checks.";
    	end;
    
    S_GuildParty:
    	for(.@i = 0; .@i < $@partymembercount; .@i++) {
    		if (isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] )) {
    			.@partyMemberOnline++;
    			if(getcharid(2,$@partymembername$[.@i] != getarg(0))) {
    				dispbottom $@partymembername$[.@i] +" is not a member of your guild.";
    				.@partyMemberNotInGuild++;
    			}
    		}
    	}
    	if (.@partyMemberNotInGuild || .@partyMemberOnline < $@partymembercount) {
    		dispbottom "All party members should be online and member of same guild";
    		end;
    	}
    return;
    }

    image.png.a024501b113d6631580e263b9f701a5f.png

    Another suggestion I have would be to improve readability by using continue, to jump to the next iteration of the loop to minimize nesting.

    for(.@i = 0; .@i < $@partymembercount; .@i++) {
        if(!isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) continue;
    
        .@partyMemberOnline++;
                                          
        if(getcharid(2, $@partymembername$[.@i]) != getarg(0)) {
        	dispbottom $@partymembername$[.@i] + " is not a member of your guild.";
         	.@partyMemberNotInGuild++;
        }
    }

     

  7. prontera,155,177,5	script	Request Notification NPC	100,{
        if($rn_crafting_state == 1) end;
    
        if($rn_crafting_state == 2) {
            mes .npc_name$;
            mes "Here is the crafting result.";
            getitem(.crafted_item[0], .crafted_item[1]);
            $rn_crafting_state = 0;
            delwaitingroom;
            close;
        }
    
        for(.@i = 0; .@i < getarraysize(.required_items); .@i += 2) {
            if(countitem(.required_items[.@i]) < .required_items[.@i + 1]) {
                mes .npc_name$;
                mes "You are missing " + .required_items[.@i + 1] + " x " + getitemname(.required_items[.@i]) + ".";
                close;
            }
        }
    
        for(.@i = 0; .@i < getarraysize(.required_items); .@i += 2)
            delitem(.required_items[.@i], .required_items[.@i + 1]);
    
        $rn_crafting_state = 1;
        waitingroom("CRAFTING", 0);
        initnpctimer;
        end;
    
        OnTimer60000:
            delwaitingroom;
            waitingroom("CRAFTING COMPLETED", 0);
            $rn_crafting_state = 2;
        end;
    
        OnInit:
            .npc_name$ = strnpcinfo(1);
            setarray(.required_items, 501, 1, 502, 1, 503, 1);
            setarray(.crafted_item, 504, 1);
    }

     

  8. -	script	MOB_DROP	FAKE_NPC,{
    	OnNPCKillEvent:
    		if(countitem(.required_item) < 1) end;
    
    		for(.@i = 0; .@i < getarraysize(.item_drops); .@i += 2)
    			getitem(.item_drops[.@i], .item_drops[.@i + 1]);
    	end;
    
    	OnInit:
    		.required_item = 13038;
    		setarray(.item_drops, 517, 1, 932, 1);
    }

     

  9. You could try to achieve this effect using autobonus by setting a short amount for the duration the script will last.

    *autobonus <bonus script>,<rate>,<duration>{,<flag>,{<other script>}};
    *autobonus2 <bonus script>,<rate>,<duration>{,<flag>,{<other script>}};
    *autobonus3 <bonus script>,<rate>,<duration>,<skill id>,{<other script>};
    *autobonus3 <bonus script>,<rate>,<duration>,"<skill name>",{<other script>};
    
    These commands are meant to be used in item scripts only! See 'petautobonus' for pet usage.
    
    What these commands do is 'attach' a script to the player which will get
    executed on attack (or when attacked in the case of autobonus2).
    
    Rate is the trigger rate of the script (1000 = 100%).
    
    Duration is the time in milliseconds that the bonus will last for since the script has triggered.
    
    Skill ID/skill name the skill which will be used as trigger to start the bonus. (autobonus3)
    
    The optional argument 'flag' is used to classify the type of attack where the script
    can trigger (it shares the same flags as the bAutoSpell bonus script):
    
    Range criteria:
    	BF_SHORT:  Trigger on melee attack
    	BF_LONG:   Trigger on ranged attack
    	Default:   BF_SHORT+BF_LONG
    Attack type criteria:
    	BF_WEAPON: Trigger on weapon skills
    	BF_MAGIC:  Trigger on magic skills
    	BF_MISC:   Trigger on misc skills
    	Default:   BF_WEAPON
    Skill criteria:
    	BF_NORMAL: Trigger on normal attacks
    	BF_SKILL:  Trigger on skills
    	default:   If the attack type is BF_WEAPON (only) BF_NORMAL is used,
    		   otherwise BF_SKILL+BF_NORMAL is used.
    
    The difference between the optional argument 'other script' and the 'bonus script' is that,
    the former one triggers only when attacking(or attacked) and the latter one runs on
    status calculation as well, which makes sure, within the duration, the "bonus" that get
    lost on status calculation is restored. So, 'bonus script' is technically supposed to accept
    "bonus" command only. And we usually use 'other script' to show visual effects.
    
    In all cases, when the script triggers, the attached player will be the one
    who holds the bonus. There is currently no way of knowing within this script
    who was the other character (the attacker in autobonus2, or the target in
    autobonus and autobonus3).
    
    //Grants a 1% chance of starting the state "all stats +10" for 10 seconds when
    //using weapon or misc attacks (both melee and ranged skills) and shows a special
    //effect when the bonus is active.
    	autobonus "{ bonus bAllStats,10; }",10,10000,BF_WEAPON|BF_MISC,"{ specialeffect2 EF_FIRESPLASHHIT; }";

     

  10. Poring Slot


    In this game, you can place bets on one of 5 slots. Each slot has a different chance to be picked, but also gives a higher reward, the lesser the chance. 
    After enough bets are placed, a player can pay a fee to spin the wheel. After a certain amount of time, one slot is picked and the winners can get their prize.

    This script is resistant to server restarts and script reloads. It always keeps track of all currently placed bets and prizes a player has.
    If the player is offline during a spin but wins, he gets a notification on the next login that he has pending prizes.

    The following things are customizable via config variables:

    • Price per spin.
    • Amount of bets before a spin can be started.
    • The item used as currency for the game.
    • The minimum amount for a bet.
    • The sprite, name, color, bonus on win and position of each slot selection.
    • The position and type of each slot.

    Updates and bug fixes are free and will be available here for all customers.
    Costumers can contact me via discord for support. My username there is hope2812.


    • Submitter
    • Submitted
      09/09/23
    • Category
    • Video
    • Content Author
      Winterfox

     

  11. You can use the time labels:

    OnClock<hour><minute>:
    OnMinute<minute>:
    OnHour<hour>:
    On<weekday><hour><minute>:
    OnDay<month><day>:
    
    This will execute when the server clock hits the specified date or time. Hours
    and minutes are given in military time. ('0105' will mean 01:05 AM). Weekdays
    are Sun,Mon,Tue,Wed,Thu,Fri,Sat. Months are 01 to 12, days are 01 to 31.
    Remember the zero.

    This would run the event every 24 hours at 14 o'clock:

    OnHour14:
      goto l_start;
      end;
  12. I think your problem is the falltrough after the call of an OnBarDead label. This leads to one OnBarDead label calling all succeeding setcell calls that make the cells walkable.

    If for example OnBarDead1 gets called, it falls through all labels until it hits the end command at the end of the file, effectivly making all non-walkable cells walkable instead of only the ones you targeted with your label.

  13. If you have logging enabled, you can check the picklog table for rows where type is S.

    // 0x00000010 - (S) Log NPC transactions (buy/sell)

    For details, check log_athena.conf. The logging part is directly at the beginning of the file.

  14. Autoplay


    This is a command that basically turns a character into a bot.
    Once a player with the proper permissions uses this command, the character will start to walk around the map and attack all mobs it sees automatically.
    Warps are ignored and most functions like chatting etc. are disabled while in autoplay mode.
    Autoplay is disabled automatically when the character dies while it is active.

    The following things are configurable:

    • The radius the character searches for mobs around itself.
    • The minimum path length the character walks per move.
    • The maximum path length the character walks per move.
    • The timeout when a character fails to attack a mob.
    • The timeout when a character fails to move.
    • The minimal group level to use the command.

    Updates and bug fixes are free and will be available here for all customers.
    Costumers can contact me via discord for support. My username there is hope2812.


    • Submitter
    • Submitted
      09/10/23
    • Category
    • Video
    • Content Author
      Winterfox

     

  15. 4 hours ago, jamesandrew said:

    Thanks for the explanation. Very helpful!
     

    So... If I want to use unlimited quantity for 1010 and 1011 can I use marketshop and change the quantity to -1 ?

    //=Ore Exchanger
    //============================================================
    -	marketshop	market_refine_prt_in	-1,1010:-1:-1,1011:-1:-1
    -	marketshop	market_refine_payon	-1,1010:-1:-1,1011:-1:-1
    -	marketshop	market_refine_morocc_in	-1,1010:-1:-1,1011:-1:-1
    -	marketshop	market_refine_alberta_in	-1,1010:-1:-1,1011:-1:-1
    -	marketshop	market_refine_yuno_in01	-1,1010:-1:-1,1011:-1:-1
    -	marketshop	market_refine_ein_in01	-1,1010:-1:-1,1011:-1:-1
    -	marketshop	market_refine_lhz_in02	-1,1010:-1:-1,1011:-1:-1
    
    prt_in,63,69,3	script	Dietrich#ns_prt	4_M_02,{
    	mes "[" + strnpcinfo(1) + "]";
    	mes "We sell and exchange various ores used in smelting.";
    	next;
    	switch( select( "View basic smelting ores", "View advanced smelting ores", "Cancel" ) ) {
    	case 1:
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Phracon and Emveretarcon are available for use in smelting low-level weapons.";
    		close2;
    		callshop "market_refine_" + strnpcinfo(4);
    		end;
    	case 2:
    		mes "[" + strnpcinfo(1) + "]";
    		mes "We are purifying Elunium Stone and Oridecon Stone, or exchanging Coins.";
    		close2;
    		callshop "barter_refine_1";
    		end;
    	case 3:
    		mes "[" + strnpcinfo(1) + "]";
    		mes "If you lack the materials used for smelting, come anytime.";
    		close;
    	}
    	end;
    
    OnInit:
    	setunittitle getnpcid(0), "<Ore Refiner>";
    	end;
    }

    Exactly.  npcshopupdate uses the same arguments for stocks as the marketshop itemlist, as it is also explained in the script documentation:

    "marketshop" can have limited quantity of an item in stock.
    Use -1 in the stock field to have unlimited stock in a marketshop.


     

    • Upvote 1
  16. If you want to update the stock programmatically, for example on a certain event, you can use npcshopupdate.

    *npcshopupdate "<name>",<item_id>,<price>{,<stock>}
    
    Update an entry from a shop. If the price is 0 it won't be changed. May also be used for
    marketshop to update the stock quantity. For unlimited stock, use -1.
    For other shop types, the stock value has no effect.

    Which means to reset the stock of item 1010 in the market_refine_prt_in shop, you would do it like this:

    npcshopupdate("market_refine_prt_in", 1010, 0, 999999);

    If you want to simply change the stock for testing purposes, you could edit the shop in the market table in the database.

    In your NPCs case, if you check line 588 in the file npc/merchants/refine.txt, you will see the NPC refine_barter_init.
    Which uses above-mentioned npcshopupdate to update the stocks of the NPCs in your post when the script gets loaded.

    So if you only care about resetting the stock of those, reloading only the script where the shops are defined should suffice.
    You can use this command to do this:

    @reloadnpcfile npc/merchants/refine.txt

     

    • Upvote 1
×
×
  • Create New...