Author Topic: Lvl based shop?  (Read 1011 times)

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Lvl based shop?
« on: August 16, 2010, 02:54:43 pm »


               Hello there, anyone wanna help me with me with making a script for shops that unlocks items based on level? Its basically shows more things in the shops inventory to buy when the pc raises a few levels.
Am a pretty green in writing scripts so if anyoen want to help me with this then I really, really REALLY appreciate it.

I am at my wits end here, please help me!
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Lvl based shop?
« Reply #1 on: August 16, 2010, 05:15:16 pm »


               The easiest way to do this would be create a blueprint of the store  with all the items you want to have.  Then when the PC talks to the shop keep to open the store create an instance of the store,  In the on open event of the store remove the items of over x value based on the PC’s level from the store.  In the on closed event of the store destroy the store.   Disadvantage here is that the store will always have the same stock. Anything sold to the store also will not be there the next time the a PC opens the store.  There are other ways to do it they just get a little more complex.   IF you need more help just let me know.



L8

               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Lvl based shop?
« Reply #2 on: August 16, 2010, 05:40:32 pm »


               Why would it matter if the PCs can buy the item or not if you have Item Level Restriction on?  Even if they bought the item they couldn't use it till they had the proper level....

Also in The CEP, you can up the level requirements for the item by increasing the cost, which is achieved by adding the property Increased Value +1 through + 20, and you can naturally increase the value as well, though it's limited to 32,000 in additional cost.

That's the easiest way to control items in your module...

I suppose you could create multiple stores that the PC's could'nt access till they were the appropriate level, however any smart player will just have a friend or their other character buy it for them, and believe me, It will happen!

There really is no point in a Level Based Shop, and many players do NOT like level item based restriction, so if your building for only your module, then I'd recommend that you put the shop somewhere, where only  higher levels can reach it, but like I said, they will just have a friend buy it, or once they are high enough to buy it, they may just transfer it to their other characters.  (Unless your preventing this, which would be tough to do & annoying to players)

Obviously it's much easier to use Item level Restrictions rather than "try" to prevent players from cheating, because they will, and it's a lot of work to stop them from doing it..(sometimes)
               
               

               


                     Modifié par Genisys, 16 août 2010 - 04:48 .
                     
                  


            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Lvl based shop?
« Reply #3 on: August 16, 2010, 08:31:35 pm »


               I don't like using the standard lvl restriction thing, due that I have to redo most of the items I have made so yeah
               
               

               


                     Modifié par Who said that I, 16 août 2010 - 07:32 .
                     
                  


            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Lvl based shop?
« Reply #4 on: August 16, 2010, 09:25:25 pm »


               what are the other ways? I would like to know more about it '<img'>
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Lvl based shop?
« Reply #5 on: August 16, 2010, 09:31:00 pm »


               It sounds like a good Idea to me.   You Could just say that a merchant will not bring out his good stuff for a begger to look at. He would not want it to go missing.  



Any way your question was about How to do what you wanted to do, Not why you should not do  it.  



Another way to do it other then the one I posted above.  Would be to create a master store and move the items to the other child stores as the PC open them.  One of the porblems you need to look at with this method is if more then one PC has a store open at a time.  You could easily end up with a situation where, in moving items back and forth. you either doup the items or drain them out of a store while a PC is still shopping.  



I am not  sure what your scripting level is.  Did you need more help then just Ideas on how to pull it off?
               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Lvl based shop?
« Reply #6 on: August 16, 2010, 09:41:18 pm »


               yes, as I stated before am I just a simple scripter/builder. I can do the basic but with this I have never done something like this before so I have no clue were to start, learned my ways through teaching by error So don't expect too much '<img'>
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Lvl based shop?
« Reply #7 on: August 16, 2010, 09:47:47 pm »


               Again, it would be much easier to create multiple stores, and disallow the PC to open certain stores till they reach the right level, yet, players will just have their higher level characters to get the items for their lower level characters, so the point of this whole system would be rather mute, though, for the sake of helping you, here is a Starting Conditional script to check the level of the PC...

//Set this to the Level the PC Needs to See the Line in the Conversation
const int LEVEL_NEEDED = 10; //Default = 10 (PC Must be Level 10 or higher to see the line)

//Note this line in the conversation does NOT show if the PC isn't High Enough In Total Levels
int StartingConditional()
{
   int iResult = FALSE;
   object oPC = GetPCSpeaker();
   int nLvl = GetHitDice(oPC);
   if(nLvl >= LEVEL_NEEDED)
   { iResult = TRUE; }
   return iResult;
}
               
               

               


                     Modifié par Genisys, 16 août 2010 - 08:48 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Lvl based shop?
« Reply #8 on: August 16, 2010, 11:26:42 pm »


               Ok lets narrow down what you are looking for a little.

Are you wanting the Items limited by the standard level restriction? (the Standard Level restriction GP value can be found in itemvalue.2da under the MAXSINGLEITEMVALUE column.)
 
Did you want the price of the items in the store to very per the clients appraise skill?
 
Did you want the items shown to the PC to vary by anything other then level? (ex. If you have PC known as nobles do they get a better selection for there level. Or a PC who has a high appraise or persuade skill get a better selection then a pc with a low skill. )
 
Some thought also need to go into what happens when two players (if it is a multiplayer game) try to open the same store at the same time. The two simplest options would be to leave the store in the state it is in when the first player opened it for the second player. Or to stop the second player from being able to shop until the first player is finished shopping.
 
Is the store also going to buy items.? ( if they do what happens if you end up with more items then will fit in the shop.)
 
If you are wanting the store limited in in items in 1 level increments. I doubt you want to create 40 stores for every store you have in the game. That brings another Question:
 
Is this going to be for every store in the game or just a select few.
 
****
 
Basic Idea: create Two stores with Tags built off of the Shopkeepers tag. (ex. Shopkeeper Tag = ShopKeep; The Show Room Store tag = ShopKeep_SR; Then the WareHouse stores tag= ShopKeep_WH)
 
When A PC wants to open the store move the Items from the WareHouse store to the ShowRoom that the merchant is willing to show to him. when the store is closed move them back to the WareHouse.
 
You just need to be careful and either track how many PC have the store open or limit it to one having it open at a time.
 
I can really see you getting fancy with this idea and taking it to different levels. Such a secrete fence that Show stolen items to gang members or thieves only. Or a cleric shop that will not show the holy items to the heathen. Just thoughts. Getting a little ahead of the game here one step at a time.
 
 

Edit: Cut and Past is hit a miss here. Sometimes it doubles your blank lines. other times it removes them.  LOL.
               
               

               


                     Modifié par Lightfoot8, 16 août 2010 - 10:30 .
                     
                  


            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Lvl based shop?
« Reply #9 on: August 17, 2010, 02:28:13 am »


               okay here is how I basically want to see it:

1. I want it to have the standard NWN lvl restriction
2.I do want to price of the items vary depending on their appraise skill
3. I did fancy the idea of making nobles/charismatic or PC's with a high appraise skill get a better selection of goods then people of normal  "stock " or having lower  appraise skill.
4. Store is going to buy items from the PC but then depending on what kind of shop it is. 
5. This is going to be for every store in the server, though I need to add that I was also planning on making differences in in the quality of goods they sell. Also race and location and maybe allignment or deity of the owner of the store is deciding what is going to end up being sold by the shop owner.

so yeah that is basically my idea and you know exactly how I want it Lightfoot8! 
'<img'>:D:D:D:D
               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Lvl based shop?
« Reply #10 on: August 17, 2010, 06:54:53 am »


               We have an Rp server so I want to make it as realistic as possible
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Lvl based shop?
« Reply #11 on: August 17, 2010, 02:08:41 pm »


               

Who said that I wrote...

okay here is how I basically want to see it:

1. I want it to have the standard NWN lvl restriction
2.I do want to price of the items vary depending on their appraise skill
3. I did fancy the idea of making nobles/charismatic or PC's with a high appraise skill get a better selection of goods then people of normal  "stock " or having lower  appraise skill.
4. Store is going to buy items from the PC but then depending on what kind of shop it is. 
5. This is going to be for every store in the server, though I need to add that I was also planning on making differences in in the quality of goods they sell. Also race and location and maybe allignment or deity of the owner of the store is deciding what is going to end up being sold by the shop owner.

so yeah that is basically my idea and you know exactly how I want it Lightfoot8! 
'<img'>:D:D:D:D


1)  That's simple, just turn on IRL in the ini file..
2)  You have to set the script to use appraise when you open the store...
3)  As far as the Appraise goes, you will HAVE to make multiple stores for this, and use the starting conditional to determine which store they see based upon their appraise skill level...
4)  When you set up the store you can determine what the store buys and what it will not buy, how much it buys it for, based upon the current GP Value of the item, and because your using multipel stores you have greater control over this.
5) You should make one template store and then copy and adjust the template for every store after that, this will save some time, but you will still need to place items in each store individually, therefore you will need to make your items in a seperate module, paint down all the stores, then copy the stores to your module, this will of course reduce the # of items on your palette TREMENDOUSLY!...  (Good advice here)

You copy the stores by highlighting them, pressing Control (ctrl) + C, then open the other module and click on the area you wish to paint them and press Control + V... simple enough... (don't forget to save the module..)

Hope this helps some...
               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Lvl based shop?
« Reply #12 on: August 17, 2010, 02:53:35 pm »


               What I do wonder though, since its basicly only Appraise check, would it also like lock for example holy items from heathens? Making sure that only thieves or gangs can buy stolen goods?
               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Lvl based shop?
« Reply #13 on: August 17, 2010, 02:59:55 pm »


               and where should I turn the IRL on in the ini file? its not there....
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Lvl based shop?
« Reply #14 on: August 17, 2010, 03:04:53 pm »


               in the nwnplayer.ini file...



change this:    ItemLevelRestrictions=0



To this:  ItemLevelRestrictions=1