Jump to content
  • 0

Cart overweight problem


TiMz

Question


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  192
  • Reputation:   9
  • Joined:  05/08/13
  • Last Seen:  

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?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   1
  • Joined:  06/10/14
  • Last Seen:  

 

 

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;
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   1
  • Joined:  06/10/14
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  192
  • Reputation:   9
  • Joined:  05/08/13
  • Last Seen:  

 

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
Link to comment
Share on other sites

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.

×
×
  • Create New...