Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #16  
Old 06-17-2008, 04:52 PM
erde
Sarnak
 
Join Date: Sep 2006
Location: Germany
Posts: 82
Default

I think "diff -Nur ..." is the right command
__________________
"Yes, the artwork is awful. I am an engineer, not an artist " - David H. Eberly
Reply With Quote
  #17  
Old 06-18-2008, 10:52 AM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default

This will be in version 1113.
__________________
Maybe I should try making one of these servers...
Reply With Quote
  #18  
Old 07-10-2008, 12:16 AM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

i am looking at new sell prices after thsi patch and it seems to me than vendor now pays you way to much.

with only amiable faction and 100 cha i am geting back like 95% item price, while on most items 50% shoudl be best what you can get.

is it posible to change fixed 1.27 vendor modifier into an X variable and put into rules, so we can customly adjust how much extra vendor will charge/pay?

curent buy back prices way to high - you should only get to 95% buy back with Ally faction and 500 CHA

PS may as well include a rule on MAX % of item price vendor will ever pay regardless your faction
Reply With Quote
  #19  
Old 07-26-2008, 12:44 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

To go along with the above post, there is a problem with this patch... It can happen that with faction/CHA modifiers, the price the merchant buys an item from a player can actually be HIGHER than they sell it for. A quick example, a player sells an item to a merchant for 300pp, the merchant then sells that item back to the player for 280pp, the player can buy/sell over and over making 20pp per each hand in. Of course, the player needs really high CHA and very good faction for this to work, but it is possible as it was done on TGC.
Reply With Quote
  #20  
Old 09-28-2008, 11:41 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

OK I have been looking at this for a bit, and I belive the reason players can sell back for more than they pay is couse vendors mark up price is not high enough to counter the bonuses you get faction and charisma.


On top of that there is STILL a problem that money you get back from NPC do not match up with price shown.
Npc tells you : i will pay 1 plat, you click sell, it says - you sold for 1 plat, but if you looking at your invetory you only getting 9 gold and change.

But this problem is BEYOND my understanding of code.

So I will try to fix the issue with general price scaling.

Thsi is the code I dig up from client.cpp

Quote:

float Client::CalcPriceMod(Mob* other, bool reverse)
{
float chaformula = 0;

if (GetCHA() > 100)
{
chaformula = (GetCHA() - 100)*-0.1;
if (chaformula < -5)
chaformula = -5;
}
else if (GetCHA() < 75)
{
chaformula = (75 - GetCHA())*0.1;
if (chaformula > 5)
chaformula = 5;
}
if (other)
{
int factionlvl = GetFactionLevel(CharacterID(), other->CastToNPC()->GetNPCTypeID(), GetRace(), GetClass(), GetDeity(), other->CastToNPC()->GetPrimaryFaction(), other);
switch (factionlvl)
{
case 9: //Apprehensive
chaformula += 10;
break;
case 4: //Amiable
chaformula -= 3;
break;
case 3: //Warmly
chaformula -= 4;
break;
case 2: //Kindly
chaformula -= 5;
break;
case 1: //Ally
chaformula -= 6;
break;
}
}
if (reverse)
chaformula *= -1; //For selling
//Now we have, for example, 10
chaformula /= 100; //Convert to 0.10
chaformula += 1; //Convert to 1.10;
return chaformula; //Returns 1.10, expensive stuff!
}
the problem with this code IMHO are insignificant returns form both faction and CHA. Specialy CHA- with accordance to this function more than 150 CHA complitly useless

determiend here: if (chaformula < -5) chaformula = -5;

The formula may have been created with pre-kunark EQ in midn when 150 CHA was UBER, but in days of PoP my level 1 bazar mule was runing around 200 CHA on him wearing junk i obtained for less than 100 plat a peace
ANd whats important there was definite benefit from going even over 250 CHA

So this is changes proposed by me. The intent is to slightly improve the effect from faction bonus and MASSIVLY increase scaling of CHA (note that I am reducing gain increment6s from each 10 CHA above 100, to each 25 CHA but allow it to scale all way up to 400 CHA before CHA becomes useless.

I am also increasing penalty for CHA less than 75, per each 5 points all way down to 0.

With new formulas the max bonus you can obtain with Ally faction and 400 CHA is 26%, and max penalty with Apprehensive faction and 0 CHA is -25% (from original 10 and 10) (Idealy and realisticly you want faction bonsu to scale in accordance with EXACT numeric value of your curent faction - like 115, rather than just Amiable, then rather than havign price junp by 5 ranks, it woudl scale smoothly, but atm I am not sure how to retrive this value so I am working with what allready in the function (it is probobly GetFactionLevel but I am not sure)

the new code

Quote:

float Client::CalcPriceMod(Mob* other, bool reverse)
{
float chaformula = 0;

if (GetCHA() > 100)
{
chaformula = (GetCHA() - 100)*-0.04;
if (chaformula < -16)
chaformula = -16;
}
else if (GetCHA() < 75)
{
chaformula = (75 - GetCHA())*0.2;
if (chaformula > 15)
chaformula = 15;
}
if (other)
{
int factionlvl = GetFactionLevel(CharacterID(), other->CastToNPC()->GetNPCTypeID(), GetRace(), GetClass(), GetDeity(), other->CastToNPC()->GetPrimaryFaction(), other);
switch (factionlvl)
{
case 9: //Apprehensive
chaformula += 10;
break;
case 4: //Amiable
chaformula -= 2;
break;
case 3: //Warmly
chaformula -= 4;
break;
case 2: //Kindly
chaformula -= 7;
break;
case 1: //Ally
chaformula -= 10;
break;
}
}
if (reverse)
chaformula *= -1; //For selling
//Now we have, for example, 10
chaformula /= 100; //Convert to 0.10
chaformula += 1; //Convert to 1.10;
return chaformula; //Returns 1.10, expensive stuff!
NOW looking at the previous fixed staff. In order to get new price scalign to work as I intented I need to change the logic beyodn how vendor pricing is handled.

By default vendor uses +27% mark up when selling and gives 88% when buying basing of scaled price.
To easy calculation (and pricing of items) I want to alter thsi approach.
The mark up becomes +100%, and buy back is 100% (since ist adjusted by new scalign formulas anyway and fact that mark up price now HUGE)


Goign by dif changes made by Greggg, here are my alternatives:

Line 3717 of zone/client_packet.cpp should be changed from:

Quote:
mco->rate = 1/(.884*Client::CalcPriceMod(tmp,true));
to:
Quote:
mco->rate = (1*Client::CalcPriceMod(tmp,true));
line 3842 of zone/client_packet.cpp should be changed from
Quote:
mpo->price = (item->Price*(1/.884)*Client::CalcPriceMod(tmp,false))*mp->quantity;
to:
Quote:
mpo->price = (item->Price*(2)*Client::CalcPriceMod(tmp,false))*mp->quantity;
line 3947 of zone/client_packet.cpp should be changed from:
Quote:
price=(int)((item->Price*mp->quantity)*.884*Client::CalcPriceMod(vendor,true)+ 0.5); // need to round, because client does it automatically when displaying price
to:
Quote:
price=(int)((item->Price*mp->quantity)*1*Client::CalcPriceMod(vendor,true)+0.5 ); // need to round, because client does it automatically when displaying price
line 4001 of zone/client_packet.cpp should be changed from:
Quote:
inst2->SetPrice(item->Price*(1/.884)*Client::CalcPriceMod(vendor,false));
to:
Quote:
inst2->SetPrice(item->Price*(2)*Client::CalcPriceMod(vendor,false));
line 831 of zone/client_process.cpp should be changed from:
Quote:
inst->SetPrice((item->Price*(1/.884)*Client::CalcPriceMod(merch,false)));
to:
Quote:
inst->SetPrice((item->Price*(2)*Client::CalcPriceMod(merch,false)));
line 862 of zone/client_process.cpp should be changed from:
Quote:
inst->SetPrice((item->Price*(1/.884)*Client::CalcPriceMod(merch,false)));
to:
Quote:
inst->SetPrice((item->Price*(2)*Client::CalcPriceMod(merch,false)));

Overall: I replaced all 0.884 with 1 and all 1/0.884 with 2. (i left *1 in code on purpose for easier tracking) (idealy 1 and 2 can later be repalced by DB Rule variables to give custom server admins chance to make them even more specific)

The logic is following: the merchants now will have *2 times mark up when they selling to players, but are 100% of default item price when buying.

So a player with 100 cha and indifirent faction vs a Item X with default Db price of 1 plat:
will buy it from vendor for: 2 plat
will sell it to vendor for: 1 plat (imho this is great cuase this makes item pricing in Db very easy - sicne ist excatly the price player will get)

and then the actul price will be adjusted by faction and cha.

A player with Ally faction and 400 cha: (-26% total bonus)
will buy item from vendor for: 1.48 plat
will sell item to vendor for: 1.26 plat

so there is a decent margins left in between to prevent the problem cavedude curently described (of course given my assumtions for cuases for the problem are correct)

Now.. All modification are based purely on COMMON LOGIC of calculation statements - no actual C code function and calls have been altered.

I also cannot test this atm, since I have no compiler. Hopefuly someone can, and tell me if result of my alteration is anything close to what I have predicted
Reply With Quote
  #21  
Old 09-28-2008, 11:48 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

few corrections:

the line # for first chunk of code is line 2475 in client.cpp

also - i left out } at the end of my replacement code
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:18 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3