set DwCost true Character.inc

01/01/2015 16:19 raventh1984#1
Hi elitepvpers,

First of all happy new year and all the best luck in 2015...

second.

Is it possible to set the dwCost of an item true character.inc with the AddShopItem. Example

AddShopItem( 0, ITEM_ID, ITEM_PRICE ).

What i did first was adding
pVendorItem->m_dwCost = dwCost;

So that was setup i only dont know how to set it up from there.

Could someone point me in the right direction?

With kind regards
01/01/2015 19:29 Sedrika#2
Why don't you change the price via spec_item/propitem?
01/01/2015 21:12 raventh1984#3
Plain and simple i like simplicity. But at this point its an pain in the ...!
I just want to add some items to character.inc true AddShopItem without opening spec_item to change the price.
01/02/2015 00:13 Sedrika#4
I'll add later how you have to edit the source
01/02/2015 00:42 Drabur#5
Quote:
Originally Posted by Sedrika View Post
I'll add later how you have to edit the source
ja sago du musst daran denken dann auch die sachen im client zu laden. Weil da ja die preise angezeigt werden
01/02/2015 00:57 Mognakor#6
If you define the price in more than one file it may lead to incosistency and possibly create issues like being able to sell an item for more than the price it was bought for.
01/02/2015 11:14 Avalion#7
Inconsistency? It honestly depends how it is actually coded. If wanted, a player could literally make the sell price of each item based on a lua that can be reloaded into the worldserver at any given point and time, and updated on the client end, or else price would be equal to one. There are a multitude of ways to change the source to better personal preference, and when doing so, they person would create their own type of consistency through observation.

You could add a price to the shop vector, and grab it mainly from the worldserver, and update it client side through that, so players could not just edit character.txt. However, if you do most of the calculations on the world side, re-grabbing the price, it could just be as well effective. You could make a new shop thingy like what __ADDSHOPITEM was to test.
01/02/2015 14:08 Mognakor#8
I said may

Just an example: I have 2 shops selling the same item for 2 different prices, now i allways have to edit both shops if i want to change the price of the item.

The selling price however is not based on the shop price and so it may be that an item costs 1p in the shop but can be sold for 1m é voila you have an easy and fast way to crash the entire economy of a server.
01/02/2015 14:59 raventh1984#9
Thank you all for the explanations i have thought about such things and i decided to leave it as it is. Just like Mognakor is saying in the end you just need to do more things then how it is now.
01/02/2015 15:19 Sedrika#10
If you want to change the cost of an item for each shop then you have to tell the server always the new item price and the server have to tell this to the client.
But if you want to change it only once then this should help you since the client and server's loading the same file.

Code:
#ifdef __ADDSHOPITEM
			else if (script.Token == "AddShopItem")
			{
				script.GetToken(); // (
				int nSlot = script.GetNumber();
				script.GetToken(); // ,
				DWORD dwId = script.GetNumber();
				script.GetToken(); // , or )
				if (script.Token == ",")
				{
					DWORD dwCost = script.GetNumber();
					script.GetToken(); // )
					ItemProp* pItem = prj.GetItemProp(dwId);
					if (pItem)
						pItem->dwCost = dwCost;
				}

				LPVENDOR_ITEM pVendorItem = new VENDOR_ITEM;
				pVendorItem->m_dwItemId = dwId;
				lpCharacter->m_venderItemAry3[nSlot].Add(pVendorItem);
			}
#endif // __ADDSHOPITEM