Aller au contenu

Photo

How do I add items to an existing merchant?


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

#1
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages
Since I've been look for an answer to this for a while and had no luck, I figured I might as well ask.

Does anyone know how to add an item to a merchant, for example adding a Grandmaster Spell Resist rune or a custom item to Bodahn?

#2
Phaenan

Phaenan
  • Members
  • 315 messages
Hmm, by simply creating the object inside the store inventory :

oNearestStores = GetNearestObjectByTag(GetHero(), "store_camp_bodahn", OBJECT_TYPE_STORE, TRUE);
if(GetArraySize(oNearestStores) == 0) return;
oNearbyStore = oNearestStores[0];
if(oNearbyStore == OBJECT_INVALID) return;
CreateItemOnObject(R"gen_im_upg_cry_gdm_dwe.uti", oNearbyStore, 1);

Or something-ish, in case I forgot something while copy-pasting. :o

Modifié par Phaenan, 10 décembre 2009 - 11:50 .


#3
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages
O.O Thank you! I'm going to try it now!

Edit: Follow-up: How do you add to a mob's droplist?

Modifié par KigenBarzhad, 10 décembre 2009 - 11:56 .


#4
Phaenan

Phaenan
  • Members
  • 315 messages
No idea, haven't work on that part yet. ^_~

#5
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages
Not quite sure how to fix this but I just get a mismatched type compiling error.

#6
Phaenan

Phaenan
  • Members
  • 315 messages
Well, that was excerpts from my own store overhaul code, glued together on the fly so I pretty much forgot the declarations.

There are included in that pastie.



And if that's not the issue at hand, well, won't be able to guess much without a look at the very code rejected by the compiler. ^_~

#7
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages
*handbang* I didn't realize it was object[] -.-; it's been a while since I've coded.
Thank you =)

Say for instance I want to add an item to another store's NPC... say one of the dwarves in Orzammar what do I do?

Modifié par KigenBarzhad, 11 décembre 2009 - 12:50 .


#8
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages
Hmmm so it only half works at the moment meaning

That my module/addin/wtvr has to load on that map to take effect other wise it fails (sorta).

#9
Phaenan

Phaenan
  • Members
  • 315 messages

KigenBarzhad wrote...
Say for instance I want to add an item to another store's NPC... say one of the dwarves in Orzammar what do I do?


Basically you need its tag, and probably the area tag/ID in order to properly choose when to look for the store tag.
For instance store_orz200cr_figor for the "Figor's Imports" store in the area orz220ar_shop/1340.

You can get those details by using a few utility scripts while in-game (like a simple GetNearestObject and a displayfloatymessage) or - I suppose - by digging through the SP campaign ERF packages.



That my module/addin/wtvr has to load on that map to take effect other wise it fails (sorta).

Yep. But a script can't do much outside the current area : only the objects from the current area are loaded in the memory at a given time. Hopefully. ^_^

Modifié par Phaenan, 11 décembre 2009 - 01:09 .


#10
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages
Now to both make DisplayFloaty and somehow figure out how to correctly target figor.

#11
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages

Modifié par KigenBarzhad, 12 décembre 2009 - 03:09 .


#12
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages

Modifié par KigenBarzhad, 12 décembre 2009 - 03:09 .


#13
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages
Just an FYI for anyone interested, the best thing I could come up with to always add to a merchant... say for example Figor and Bodhan is to create a separate function (calling the merchant you're looking for and the item you want to give it) doing the code described above (to find the merchant then place the item) as long as a certain plot/var-thing is not met or set - in my example there should be 2 seperate plots looking for if you've seen bodhan or if you've seen figor. If anyone has a better solution let me know.

Edit: Accidently triple post... my internet is finicky

Modifié par KigenBarzhad, 12 décembre 2009 - 03:09 .


#14
LaughingDragon

LaughingDragon
  • Members
  • 211 messages
Can anyone give me a link to a good tutorial for creating custom items and placing them in game?

I just downloaded the toolset and am a newbie and this code below doesn't mean anything to me yet =)


Phaenan wrote...


oNearestStores = GetNearestObjectByTag(GetHero(), "store_camp_bodahn", OBJECT_TYPE_STORE, TRUE);
if(GetArraySize(oNearestStores) == 0) return;
oNearbyStore = oNearestStores[0];
if(oNearbyStore == OBJECT_INVALID) return;
CreateItemOnObject(R"gen_im_upg_cry_gdm_dwe.uti", oNearbyStore, 1);