Page 2 of 2

Re: help zuly fix on paknpcsell

PostPosted: Mon Nov 06, 2017 9:21 pm
by hoegarden31
Hmmm

I tried on multiple lines (like in the code of PurpleYouko) --> No success.
I tried to make it in a single line (same has the client code) --> No sucess.
The price is still not correct... I have to put the 102 on 150 to get something pretty close. But then when I test with a total other item, bam it is all broken again... I must miss something.

  1. price = (int) (basePrice *
  2.                                (40+thisitem.refine) *
  3.                                (200+ thisitem.durability) *
  4.                                (150) *
  5.                                (1 + skillValue * 0.01f) / 1000000.f *
  6.                                ( (4000+thisitem.lifespan) / 14000.f ) +
  7.                                (thisitem.appraised * gemValue * 0.2f)
  8.                                );

skillValue = thisclient->cskills[i].thisskill->value2[0]
gemValue = (EquipList[7].Index[thisitem.gem]->price
basePrice = EquipList[thisitem.itemtype].Index[thisitem.itemnum]->price

Re: help zuly fix on paknpcsell

PostPosted: Wed Nov 08, 2017 4:13 pm
by PurpleYouko
note that "thisitem.appraised" is a boolean in our servers so can't be directly used in a mathematical equation.

It's also possible that something has changed in the client since the client source code that came from version 137. If that is the case then it's going to be difficult to get it exactly right without using a client that we can control completely.

Next time I get the time I will fire up my servers and see if i can get to the bottom of it.

Re: help zuly fix on paknpcsell

PostPosted: Wed Nov 08, 2017 7:35 pm
by hoegarden31
You can use Boolean in equations. It will be 1 or 0.
Problem is the durability i think. On dropped items it is above 100000...
And yes, I tried this on the REV 4... so probably something has changed in the client. We will never know :(

Re: help zuly fix on paknpcsell

PostPosted: Wed Nov 08, 2017 11:07 pm
by PurpleYouko
I thought so to but It refused to compile when I tried it.
Gave me an error saying that I couldn't multiply by a boolean. that's why I put it in a conditional.
Maybe I have a weird compiler setting :?

Re: help zuly fix on paknpcsell

PostPosted: Thu Nov 09, 2017 8:29 am
by hoegarden31
Hehe, anyways, AnimalCrackerz found out that if you do 0.4 x Base price, you get the correct amount.
(but that only works for items bought from an npc.)