Author Topic: Merchant Script based on class/Alignment/Race  (Read 479 times)

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Merchant Script based on class/Alignment/Race
« on: October 27, 2010, 07:20:29 am »


               I'm interested in creating some merchants that will sell only to PCs that have a specific class, race, or alignment.

Can anyone suggest a basic script that will accomplish the task (or at least point me in the right direction)?

Thanks in advance for any advice.
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Merchant Script based on class/Alignment/Race
« Reply #1 on: October 27, 2010, 02:29:48 pm »


               This should determine if the char has one or more levels in the required class and open  the store.



if(GetLevelByclass(class_TYPE, OBJECT_CREATURE) >= 1)OpenStore(STORE, OBJECT_CREATURE);



Of course you would have to fill in the class type, the object which is usally oPC, the store tag, and critter again.
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Merchant Script based on class/Alignment/Race
« Reply #2 on: October 27, 2010, 02:31:19 pm »


               Race:



if(GetRacialType(OBJECT_CREATURE) == RACIAL_TYPE) OpenStore(STORE, OBJECT_CREATURE);
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Merchant Script based on class/Alignment/Race
« Reply #3 on: October 27, 2010, 02:33:35 pm »


               Alignment:



if(GetAlignmentGoodEvil(OBJECT_CREATURE) == ALIGNMENT_EVIL) OpenStore(STORE, OBJECT_CREATURE);



Could use GetAlignmentLawChaos instead of the good/evil on also.
               
               

               
            

Legacy_TheSpiritedLass

  • Hero Member
  • *****
  • Posts: 1118
  • Karma: +0/-0
Merchant Script based on class/Alignment/Race
« Reply #4 on: October 27, 2010, 03:07:39 pm »


               Huh, the vault is being odd and not displaying the pages I was looking for.  So hopefully these links will work for you.



Bedlamson's Dynamic Merchants System by Bedlamson

http://nwvault.ign.c...361276850.shtml



That one has some very neat stuff in it plus it will "clean" out the shop inventory.  I don't honestly remember if it does all three that you are looking for and I can't check cause the vault is being wonky for me right now.



Alignment, class and Level Based Generic Shop Script

http://nwvault.ign.c...d=20023&id=3770



This one won't do the racial stuff, but it will handle class and alignment.  The script is reusable across multiple shop merchants.  If you know how to script, the code is fairly well documented so you could add in the racial restriction as well.



*grins and noogies Baragg*



Good luck Badwater.



-- Mistress
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Merchant Script based on class/Alignment/Race
« Reply #5 on: October 27, 2010, 04:24:40 pm »


               ~grins at the Lass~ Thanks sweetie.
               
               

               
            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Merchant Script based on class/Alignment/Race
« Reply #6 on: October 27, 2010, 05:37:47 pm »


               Many thanks to both of you. I will noodle around with this tonight and tomorrow and post the scripting that I come up with after testing.
               
               

               
            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Merchant Script based on class/Alignment/Race
« Reply #7 on: December 01, 2010, 09:45:22 am »


               I like the Dynamic merchants very much and I'm putting them to good use. I'm also using them in conjunction with Baragg's suggestions in conversation, which adds some nice nuances. Thanks again!
               
               

               
            

Legacy_TheSpiritedLass

  • Hero Member
  • *****
  • Posts: 1118
  • Karma: +0/-0
Merchant Script based on class/Alignment/Race
« Reply #8 on: December 17, 2010, 12:04:15 pm »


               *smiles*  Glad it is working out for you Badwater.