Jump to content
  • 0

Cart overweight problem


Question

Posted

Can someone help me brainstorm. I can't think of a script idea to remove excess cart weight.

 

Initially the max cart weight of my server was set to 50k. And now it's down to 8k. So, players who played before the change already have items reaching to 50k. So as of today their carts display something like 49000/8000, which is a huge problem since it boosts cart termi damage by thousands. 

 

Any ideas?

3 answers to this question

Recommended Posts

  • 0
Posted

 

 

You could go into the sources and max out the weight bonus there..

battle.c in Map source

 

if(sd && sd->cart_weight)
    skillratio += 100 * sd->cart_weight / sd->cart_weight_max; // +1% every 1% weight

to

 

if (sd && sd->cart_weight)
{
  double cwr = sd->cart_weight / sd->cart_weight_max;
  if (cwr > 1.0)
    cwr = 1.0;
  skillratio += 100 * cwr; // +1% every 1% weight
}

 

This can actually work, as it seems you capped it, brilliant. Although huge apologies for the effort, I was referring to cart termination skill. Hoping for your response.

 

I'll be using your code and test if this will work.

 

map/battle.c OLD

			i = 10 * (16 - skill_lv);
			if (i < 1) i = 1;
			//Preserve damage ratio when max cart weight is changed.
			if (sd && sd->cart_weight)
				skillratio += sd->cart_weight / i * 80000 / battle_config.max_cart_weight - 100;
			else if (!sd)
				skillratio += 80000 / i - 100;
			break;

TO

			i = 10 * (16 - skill_lv);
			if (i < 1) i = 1;
			//Preserve damage ratio when max cart weight is changed.
			if (sd && sd->cart_weight)
			{
  			double cwr = sd->cart_weight / sd->cart_weight_max;
 			if (cwr > 1.0)
    			cwr = 1.0;
				skillratio += sd->cwr / i * 80000 / battle_config.max_cart_weight - 100;
			}
			else if (!sd)
				skillratio += 80000 / i - 100;
			break;

In that case use this:

            i = 10 * (16 - skill_lv);
            if (i < 1) i = 1;
            //Preserve damage ratio when max cart weight is changed.
            if (sd && sd->cart_weight)
            {
                double cw;
                if (sd->cart_weight > battle_config.max_cart_weight)
                    cw = battle_config.max_cart_weight;
                 else
                    cw = sd->cart_weight;
                skillratio += cw / i * 80000 / battle_config.max_cart_weight - 100;
            }
            else if (!sd)
                skillratio += 80000 / i - 100;
            break;
  • 0
Posted (edited)

You could go into the sources and max out the weight bonus there..
battle.c in Map source
 

if(sd && sd->cart_weight)
    skillratio += 100 * sd->cart_weight / sd->cart_weight_max; // +1% every 1% weight

to
 

if (sd && sd->cart_weight)
{
  double cwr = sd->cart_weight / sd->cart_weight_max;
  if (cwr > 1.0)
    cwr = 1.0;
  skillratio += 100 * cwr; // +1% every 1% weight
}
Edited by Kamii
  • Upvote 1
  • 0
Posted (edited)

 

You could go into the sources and max out the weight bonus there..

battle.c in Map source

 

if(sd && sd->cart_weight)
    skillratio += 100 * sd->cart_weight / sd->cart_weight_max; // +1% every 1% weight

to

 

if (sd && sd->cart_weight)
{
  double cwr = sd->cart_weight / sd->cart_weight_max;
  if (cwr > 1.0)
    cwr = 1.0;
  skillratio += 100 * cwr; // +1% every 1% weight
}

 

This can actually work, as it seems you capped it, brilliant. Although huge apologies for the effort, I was referring to cart termination skill. Hoping for your response.

 

I'll be using your code and test if this will work.

 

map/battle.c OLD

			i = 10 * (16 - skill_lv);
			if (i < 1) i = 1;
			//Preserve damage ratio when max cart weight is changed.
			if (sd && sd->cart_weight)
				skillratio += sd->cart_weight / i * 80000 / battle_config.max_cart_weight - 100;
			else if (!sd)
				skillratio += 80000 / i - 100;
			break;

TO

			i = 10 * (16 - skill_lv);
			if (i < 1) i = 1;
			//Preserve damage ratio when max cart weight is changed.
			if (sd && sd->cart_weight)
			{
  			double cwr = sd->cart_weight / sd->cart_weight_max;
 			if (cwr > 1.0)
    			cwr = 1.0;
				skillratio += sd->cwr / i * 80000 / battle_config.max_cart_weight - 100;
			}
			else if (!sd)
				skillratio += 80000 / i - 100;
			break;
Edited by Isaiah

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...