Thalie http://thalie.pilsfree.cz/forum/ |
|
Poptávka - nástroj pro výpočet ceny předmětu http://thalie.pilsfree.cz/forum/viewtopic.php?f=1&t=5668 |
Page 1 of 1 |
Author: | kucik [ 16:46 31. Jan 2012 ] |
Post subject: | Poptávka - nástroj pro výpočet ceny předmětu |
Potřebujem vytvořit jednoduchý nástroj, který na základě vstupu z 2da souborů, obsahujících ceny předmětů, properties a jejich parametrů dynamicky spočítá cenu zadaného předmětu. Zároveň je třeba, aby bylo v nástroji možné měnit ceny jednotlivých předmětů a vlastností a tyto změny se okamžitě projevovaly na viditelné ceně předmětu. Nástroj by mohl být formou excelového dokumentu, do kterého se vloží potřebná data a bude je možno snadno měnit. Dovedu si i představit javovou aplikaci, nebo jinou možnost. Co to tedy znamená. * Nástroj přečte data z 2da tabulek, nebo je do něj bude možné jednoduše vložit. * Uživatel bude moci tyto data měnit. Jakákoliv změna se okamžitě projeví. * Bude možné poskládat libovolný předmět. Tzn. vybere se baseitem, a až pět item properties, včetně volby jejich síly (např. bonus do síly +5) * Nástroj podle toho spočítá cenu předmětu. Někdo komu by se chtělo něco takového vyrobit? |
Author: | zachy [ 11:31 01. Feb 2012 ] |
Post subject: | Re: Poptávka - nástroj pro výpočet ceny předmětu |
Postni sem příklad toho 2da souboru |
Author: | kucik [ 12:15 01. Feb 2012 ] |
Post subject: | Re: Poptávka - nástroj pro výpočet ceny předmětu |
Ty bych musel teprve vysosat z nwn. |
Author: | kucik [ 22:05 01. Feb 2012 ] | ||
Post subject: | Re: Poptávka - nástroj pro výpočet ceny předmětu | ||
Tady je balik 2da, mezi kterymi jsou i iprp, ze kterych se generuje cena. V podstate je to takhle: * Zakladni cena predmetu je stanovena v baseitems.2da * K tomu se pricte druha mocnina souctu cen properties nasoben 1000 * To cele se pak jeste vynasobi base multiplikatorem z baseitems.2da Jak ale ten vypocet funguje - to je potreba vyzkoumat ![]()
|
Author: | kucik [ 13:28 03. Feb 2012 ] |
Post subject: | Re: Poptávka - nástroj pro výpočet ceny předmětu |
http://social.bioware.com/%252520http:/ ... 20#6285176 Vypocet ceny predmetu. ItemCost = [BaseCost + 1000*(Multiplier^2 - NegMultiplier^2) + SpellCosts]*MaxStack*BaseMult + The Multiplier is the sum of the costs of all the Item Properties whose costs are positive. So now we need the formula to find the value of a Item Properties. Just Keep in mind that by the formula above all of the Item Properties values are going to be added together, Squared them multiplied by 1000 before being added to the value of the item. example an item with only one Item Properties with a value of 5. would end up adding 5^2 * 1000 = 2,500 to the value of the item. If the Item has 2 Item Properties with values of 5 it would add (5+5)^2 * 1000 = 100,000 to the value of the item. This is why most number you see for the cost will be low. Any way here is the formula : ItemPropertyCost = PropertyCost * SubtypeCost + CostValue PropertyCost In itempropdef.2da, get the floating point value in the Cost column, at the row indexed by the PropertyName Field of the ItemProperty Struct. If the Cost column value is ****, treat it as 0. This floating point value is the PropertyCost SubtypeCost If the PropertyCost obtained above from itempropdef.2da was 0, then get the ResRef in the SubTypeResRef column of itempropdef.2da, at the row indexed by the 2PropertyName Field of the ItemProperty Struct. This is the resref of the subtype table 2da. In the subtype 2da, get the floating point value in the Cost column at the row indexed by the Subtype Field of the ItemProperty Struct. This floating point value is the SubtypeCost. Only get the SubtypeCost if the PropertyCost was 0. If the PropertyCost was greater than 0, then the SubtypeCost is automatically 0 instead. CostValue In iprp_costtable.2da, get the string in the Name column at the row indexed by the CostTable Field in the ItemProperty Struct. This is the ResRef of the cost table 2da. In the cost table, get the floating point value in the Cost column in the row indexed by the CostValue Field in the ItemProperty Struct. This floating point value is the CostValue. I hope that helps. |
Page 1 of 1 | All times are UTC + 1 hour [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |