The vendor says it cannot afford anymore of that... why??

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Marzullo63
New User
Posts: 3
Joined: Tue Oct 07, 2008 4:41 am

The vendor says it cannot afford anymore of that... why??

Post by Marzullo63 »

How is this implemented?
I kept my pg selling platemail gloves for hours and now the vendor complains...
How is implemented this check?
How could I avoid it?
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: The vendor says it cannot afford anymore of that... why??

Post by CWO »

Likely you'd want to see what your AI script says. There's a point where your vendor waits for the sell speech event and responds to that event.
Marzullo63
New User
Posts: 3
Joined: Tue Oct 07, 2008 4:41 am

Re: The vendor says it cannot afford anymore of that... why??

Post by Marzullo63 »

Yes but isn't there a default implementation?
Maybe my server owners have changed it, I cannot have access to it...

Thanks.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: The vendor says it cannot afford anymore of that... why??

Post by CWO »

Nothing is done by default in POL especially when it comes to NPCs. The POL default is to stand there and do nothing no matter what happens. Every action is up to the scripts and how the scripts handle it. POL just passes the events that are happening to the AI script (ie: speech events "buy" and "sell") and the script picks it up and creates the NPC reaction to it.
User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am

Re: The vendor says it cannot afford anymore of that... why??

Post by Tritan »

The only way to see what is causing this is to look in the scripts that you do not have access to right now. If you want to see what is causing this you will have trace out the AI for the merchant to see what allows them to buy items.
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: The vendor says it cannot afford anymore of that... why??

Post by Yukiko »

From the reply I gave in Development Discussion to this question:

I didn't find any reference to merchants affording things in the 0.97 Distro but in the 0.95 Distro you will find the check of vendor's available gold in \pol\scripts\ai\merchant.src starting near line 78. Following is the section where that is handled. Note line 2 in the code snippet below if(GetObjProperty(inv_rs, "MyGold") >= 1000).

Code: Select all

                                    elseif(txt["sell"])
                                      if(GetObjProperty(inv_rs, "MyGold") >= 1000)
                                        TurnToward(ev.source);
                                        var count := ModifyPCSellList(merchant_type, (ev.source));
                                        if(count >= 1)
                                          var res := SendSellWindow(ev.source, me, inv_fs, inv_pb, inv_1c);
                                        else
                                          PrintTextAbovePrivate(me, "You dont have anything I would be interested in.", ev.source);
                                        endif
                                      else
                                        PrintTextAbovePrivate(me, "I cannot afford any more of that", ev.source );
                                      endif
 
This was implemented to make the game more "realistic" because in real life stores that buy second hand merchandise don't have unlimited funds. So someone has to buy stuff from the vendor to replenish her gold funds. I didn't check to see if the gold restocks itself like inventory does.
Post Reply