Jump to content
  • 0

GoldPC Shop


mizanyan

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.01
  • Content Count:  9
  • Reputation:   0
  • Joined:  06/11/23
  • Last Seen:  

Hello. It's there a way to make the GoldPC button open the shop directly instead of spawning a npc besides the player?

 

hourly.png

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

3 hours ago, mizanyan said:

Hello. It's there a way to make the GoldPC button open the shop directly instead of spawning a npc besides the player?

 

hourly.png

It would be nice if you post your script . If you are asking if you want a NPC that will show in certain place

 

mapname,x,y,facing[TAB]Script[TAB]NPCID,{


	mes "[ Simple NPC]";
	mes "This is the paragraph";
		end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.01
  • Content Count:  9
  • Reputation:   0
  • Joined:  06/11/23
  • Last Seen:  

Hello @Poring King. The npc already spawn besides me if I click on Goldpc button on the top of the screen. I want to know if theres a way to make the shop window open up directly instead of having to spawn a npc and click on him.

I've posted 2 videos, first one is how it is right now and second one is what I want to be.
 

prontera,156,181,5	script	Hourly Point Manager::GOLDPCCAFE	10380,{
    cutin("ep18_merchant.png", 2);
    callshop("hourly_shop", 1);
    npcshopattach("hourly_shop");
    end;

    OnBuyItem:
        mes("[Hourly Point Manager]");
        if (!checkweight2(@bought_nameid, @bought_quantity)) {
            mes("Sorry, you can't carry all these items!");
            close3;
        }
        
        for (.@i = 0; .@i < getarraysize(@bought_nameid); .@i++){
            .@itemIndex = inarray(.Shop, @bought_nameid[.@i]);
            .@costs += (.Shop[.@itemIndex + 1] * @bought_quantity[.@i]);
        }

        if (.@costs > Goldpc_Points) {
            mes("You don't have enough Hourly Points.");
            close3;
        }

        Goldpc_Points -= .@costs;
        for(.@i = 0; .@i < getarraysize(@bought_nameid); .@i++) {
            getitem(@bought_nameid[.@i], @bought_quantity[.@i]);
            dispbottom("Purchased " + @bought_quantity[.@i] + " x " + getitemname(@bought_nameid[.@i]) + ".");
        }

        mes("Purchased successfully!");
        mes("You have ^0000ff" + Goldpc_Points + "^000000 points remaining.");
        close3;

    OnInit:
        setarray(.Shop[0], 13534, 1, 13810, 1, 14532, 1, 14606, 1, 12211, 1, 7776, 25);
        npcshopitem("hourly_shop", 13534, 1, 13810, 1, 14532, 1, 14606, 1, 12211, 1, 7776, 25);
}

 

Edited by mizanyan
Typo
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

There is nothing in that script that would make it spawn near your character. It sounds like you use duplicate_dynamic which spawns a copy of a NPC near your character.
Also it doesn't make sense for a NPC that you don't want to be visible to have data about the map and sprite.
 

-	script	Hourly Point Manager::GOLDPCCAFE	FAKE_NPC,{
    cutin("ep18_merchant.png", 2);
    callshop("hourly_shop", 1);
    npcshopattach("hourly_shop");
    end;

    OnBuyItem:
        mes("[Hourly Point Manager]");
        if (!checkweight2(@bought_nameid, @bought_quantity)) {
            mes("Sorry, you can't carry all these items!");
            close3;
        }
        
        for (.@i = 0; .@i < getarraysize(@bought_nameid); .@i++){
            .@itemIndex = inarray(.Shop, @bought_nameid[.@i]);
            .@costs += (.Shop[.@itemIndex + 1] * @bought_quantity[.@i]);
        }

        if (.@costs > Goldpc_Points) {
            mes("You don't have enough Hourly Points.");
            close3;
        }

        Goldpc_Points -= .@costs;
        for(.@i = 0; .@i < getarraysize(@bought_nameid); .@i++) {
            getitem(@bought_nameid[.@i], @bought_quantity[.@i]);
            dispbottom("Purchased " + @bought_quantity[.@i] + " x " + getitemname(@bought_nameid[.@i]) + ".");
        }

        mes("Purchased successfully!");
        mes("You have ^0000ff" + Goldpc_Points + "^000000 points remaining.");
        close3;

    OnInit:
        setarray(.Shop[0], 13534, 1, 13810, 1, 14532, 1, 14606, 1, 12211, 1, 7776, 25);
        npcshopitem("hourly_shop", 13534, 1, 13810, 1, 14532, 1, 14606, 1, 12211, 1, 7776, 25);
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.01
  • Content Count:  9
  • Reputation:   0
  • Joined:  06/11/23
  • Last Seen:  

54 minutes ago, Winterfox said:

There is nothing in that script that would make it spawn near your character. It sounds like you use duplicate_dynamic which spawns a copy of a NPC near your character.
Also it doesn't make sense for a NPC that you don't want to be visible to have data about the map and sprite.
 

-	script	Hourly Point Manager::GOLDPCCAFE	FAKE_NPC,{
    cutin("ep18_merchant.png", 2);
    callshop("hourly_shop", 1);
    npcshopattach("hourly_shop");
    end;

    OnBuyItem:
        mes("[Hourly Point Manager]");
        if (!checkweight2(@bought_nameid, @bought_quantity)) {
            mes("Sorry, you can't carry all these items!");
            close3;
        }
        
        for (.@i = 0; .@i < getarraysize(@bought_nameid); .@i++){
            .@itemIndex = inarray(.Shop, @bought_nameid[.@i]);
            .@costs += (.Shop[.@itemIndex + 1] * @bought_quantity[.@i]);
        }

        if (.@costs > Goldpc_Points) {
            mes("You don't have enough Hourly Points.");
            close3;
        }

        Goldpc_Points -= .@costs;
        for(.@i = 0; .@i < getarraysize(@bought_nameid); .@i++) {
            getitem(@bought_nameid[.@i], @bought_quantity[.@i]);
            dispbottom("Purchased " + @bought_quantity[.@i] + " x " + getitemname(@bought_nameid[.@i]) + ".");
        }

        mes("Purchased successfully!");
        mes("You have ^0000ff" + Goldpc_Points + "^000000 points remaining.");
        close3;

    OnInit:
        setarray(.Shop[0], 13534, 1, 13810, 1, 14532, 1, 14606, 1, 12211, 1, 7776, 25);
        npcshopitem("hourly_shop", 13534, 1, 13810, 1, 14532, 1, 14606, 1, 12211, 1, 7776, 25);
}

 

I've tried your method but it doesn't spawn anything and it says in chat that already exist a npc in the map so I assume the goldpc button calls a invisible npc. Maybe it needs to modify in the source for it to work? This is the patch I applied btw: https://github.com/rathena/rathena/pull/7410

I wanted it to call the shop window directly without the need of the npc at all.

Edited by mizanyan
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

The changed clif.cpp uses npc_duplicate_npc_for_player when you click the button. That function is what spawns the NPC near your character.
So that is not a scripting issue, but one you will have to solve via modifying the source code so that the NPC gets called instead of being spawned near the character.

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  318
  • Reputation:   13
  • Joined:  11/21/11
  • Last Seen:  

On 7/17/2023 at 11:53 PM, mizanyan said:

Hello. It's there a way to make the GoldPC button open the shop directly instead of spawning a npc besides the player?

 

hourly.png

 

Bro, how i can activate GoldPC , i searched but i don't find the option 😕

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  99
  • Reputation:   19
  • Joined:  05/01/12
  • Last Seen:  

44 minutes ago, williamII said:

Bro, how i can activate GoldPC , i searched but i don't find the option 😕

https://github.com/rathena/rathena/pull/7410

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...