PDA

View Full Version : Setting Item Cost?


Zengez
11-24-2004, 07:41 PM
Hey all, i have spent the last few hours trying to figure out how to change the cost of items on vendors using the newest PEQ Kunark DB, which is difficult in that most of the tools like Mangoo's item editor doesn't seem compatible with this version yet...

I found a nice formula and thought it'd work nicely to set prices for my vendors (making it basically so all items are buyable, but using the following formula good items get really expensive really fast, so the price is what curbs the accessibility)

Here's the base formula;


update items set cost = 1000*(1+reclevel+reqlevel+hp +ac+mana+aagi+acha+asta+astr+adex+awis+aint+hastep roclvl*100+(cr+dr+pr+mr+fr) *10+100*(spellid+5)/(spellid+5)) where bagtype=0 and cost=0 and nodrop=0 and damage=0 and delay=0


And for weapons


update items set cost = 1000*(1+reclevel+reqlevel+hp +ac+mana+aagi+acha+asta+astr+adex+awis+aint+hastep roclvl*100+(cr+dr+pr+mr+fr) *10+100*(spellid+5)/(spellid+5)) where and cost=0 and nodrop=0 and damage>0 and delay>0


I wanted them to apply to all items so i removed cost and nodrop requirements, plus i removed the spellid thing since it appears that it'd always be 1, changing it into;

update items set cost = 1000*(1+reclevel+reqlevel+hp +ac+mana+aagi+acha+asta+astr+adex+awis+aint+hastep roclvl*100+(cr+dr+pr+mr+fr) *10) where bagtype=0 and damage=0 and delay=0


And for weapons


update items set cost = 1000*(1+reclevel+reqlevel+hp +ac+mana+aagi+acha+asta+astr+adex+awis+aint+hastep roclvl*100+(cr+dr+pr+mr+fr) *10) where damage>0 and delay>0



Then i proceeded to source it in (after backing up my DB of course) and, much to my expectations it didn't work (post i got it from was over 10 months old, so i didn't have alota faith)

So grumbling and cursing i dug through the collums of the item table, and found merchantprice... so i tried the above replacing 'cost' with 'merchantprice' ... source it in and restarted my server, still no luck...

So, anyone got any idea what field controls an items price for buying from a merchant? Did i have the right idea, or was i just waaaay off track? Can't seem to find any info on just straight-up price changing, only on doing LDoN merchant stuff, which doesn't direct me to the correct fields unfortunatly...

Thanks for any/all help you can offer!
Edit: Fixed the 'and and' syntax error for clarificaton

Muuss
11-24-2004, 08:03 PM
update items set cost = 1000*(1+reclevel+reqlevel+hp +ac+mana+aagi+acha+asta+astr+adex+awis+aint+hastep roclvl*100+(cr+dr+pr+mr+fr) *10) where and and damage>0 and delay>0

syntax error : "'where and and damage" should be "where damage"

Zengez
11-25-2004, 02:36 AM
Doh that was actually me being an idiot at 2 in the morning, i did typed it correctly into my system and not into the thread, thanks for catching it...

Still no go tho, says it changes 36,000 items or whatever, but doesn't say it gets any errors... yet when i log onto the game it still has teh same prices... i look up 'merchantprice' and 'cost' fields on item table and they are correctly changed according to the equation, yet still showing up as old price on the merchants, anyone got any clues? am i just missing a step maybe?

Zengez
11-25-2004, 11:26 AM
Tried doing the commands with caps just in case that matters (didn't think it did, but i'm out of ideas) and no luck... confusing that it says it completes the command successfully with no errors, yet doesn't seem to do anything in the game but it does save teh effect... so i'm assuming it has to be a different field name in the items table... if anyone knows it or could help me out it'd be most appreciated!

wize_one
11-25-2004, 04:44 PM
i asked a couple of devs long ago about adding a cost field in the merchant setup, they dismissed it.

anyways, did you restart the server after making the changes?

Zengez
11-25-2004, 06:18 PM
Yea restarted the server and then tried created a new merchant with a pre-used merchant id afterwards too to see if there was some sorta stale item cost value somewhere on the merchants themselves... all no luck :(

Zengez
11-26-2004, 05:38 PM
So, i went around various servers in my free time, seeing what they did and getting ideas for my own server (Sha's Revenge has a really nice setup imo) but in most all teh servers i went to, i found at least one or more vendors with items that cost nothing, so you can buy them as a newbie that has no money, or lowered cost of 1cp after doing a quest to get a few plat....

Is this the same thing as what i'm trying to do? I.e. can i use the same method to increase item values instead of decrease?

Also, i see servers that are new, but using custom items... which means either they had an old server and upgraded it without losing items (i didn't need to but that strikes me as being difficult since the PEQ-Kunark DB redid the way items were laid out right?) Or they created them after the newer version... My question is, short of hand-entering them in and guessing at the still unknownfields, is there another way to do this? I know mangoo's editor isn't updated to this DB yet (no surprise, the DB is brand new and Mangoo prolly it's psychic) but i don't know any other item editors i can use....

If it helps/applies, i'm hosting off a linux box....

wize_one
11-27-2004, 03:47 AM
PEQ's items are farmed from lucy.