Aller au contenu

Photo

Merchant Script based on class/Alignment/Race


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
Badwater

Badwater
  • Members
  • 113 messages
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.

#2
Baragg

Baragg
  • Members
  • 271 messages
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.

#3
Baragg

Baragg
  • Members
  • 271 messages
Race:



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

#4
Baragg

Baragg
  • Members
  • 271 messages
Alignment:



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



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

#5
TheSpiritedLass

TheSpiritedLass
  • Members
  • 765 messages
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

#6
Baragg

Baragg
  • Members
  • 271 messages
~grins at the Lass~ Thanks sweetie.

#7
Badwater

Badwater
  • Members
  • 113 messages
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.

#8
Badwater

Badwater
  • Members
  • 113 messages
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!

#9
TheSpiritedLass

TheSpiritedLass
  • Members
  • 765 messages
*smiles* Glad it is working out for you Badwater.