Hi.
When the mobile reaches stam=1 running it´s not allowed.
I have been seraching but i couldn´t find where is this defined in the code.

I would like to change this to my own conditions, also i don´t know how to allow/disallow running or movement in general.

Thanks in advance.
 
Hi, i still can´t find where is this defined, no one knows??

I searched for speedcontrol packets, but didn´t found when it allows only walking when stam < 1 or = 0.
 
Sorry, don't know for sure. Try searching for Throttle in the code. Seems to me you will find it in Mobile.cs in the Server core, but again, I could be wrong. If you want to prevent someone from dropping down to a walk, you could possibly change the get{ } code of Stam so that if Stam is less than 2 it automatically goes up to 2.
 
Scripts/Misc/WeightOverloading.cs

Code:
public static void EventSink_Movement(MovementEventArgs e)
  {
  Mobile from = e.Mobile;
  if (!from.Alive || from.IsStaff())
  return;
  if (!from.Player)
  {
  // Else it won't work on monsters.
  Spells.Ninjitsu.DeathStrike.AddStep(from);
  return;
  }
  int maxWeight = GetMaxWeight(from) + OverloadAllowance;
  int overWeight = (Mobile.BodyWeight + from.TotalWeight) - maxWeight;
  if (overWeight > 0)
  {
  from.Stam -= GetStamLoss(from, overWeight, (e.Direction & Direction.Running) != 0);
  if (from.Stam == 0)
  {
  from.SendLocalizedMessage(500109); // You are too fatigued to move, because you are carrying too much weight!
  e.Blocked = true;
  return;
  }
  }
  if (((from.Stam * 100) / Math.Max(from.StamMax, 1)) < 10)
  --from.Stam;
  if (from.Stam == 0)
  {
  from.SendLocalizedMessage(500110); // You are too fatigued to move.
  e.Blocked = true;
  return;
  }
  if (from is PlayerMobile)
  {
  int amt = (from.Mounted ? 48 : 16);
  PlayerMobile pm = (PlayerMobile)from;
  if ((++pm.StepsTaken % amt) == 0)
  --from.Stam;
  }
  Spells.Ninjitsu.DeathStrike.AddStep(from);
  }
  public static int GetStamLoss(Mobile from, int overWeight, bool running)
  {
  int loss = 5 + (overWeight / 25);
  if (from.Mounted)
  loss /= 3;
  if (running)
  loss *= 2;
  return loss;
  }

sorry about all the numbers, if I copy in Raw format from github it won't have all the indentations
edit: it got squashed anyway... >_<
 
Last edited:
There are two checks there to block movement 1) If you're overweight and IF your Stam = 0; 2) Just checks if Stam = 0

The rest of it is just checking if you're over limit on the max weight you can can carry, then if you're walking, running, or mounted and calculates Stam loss on movement basd on those conditions.
 
Sorry, don't know for sure. Try searching for Throttle in the code. Seems to me you will find it in Mobile.cs in the Server core, but again, I could be wrong. If you want to prevent someone from dropping down to a walk, you could possibly change the get{ } code of Stam so that if Stam is less than 2 it automatically goes up to 2.

Hi Lokai, i searched for "Throttle" in the code, but i dind´t found this.
Doing what you said, will work ( change the get code of Stam ) but it´s not the more
appropriate thing, and also is not what i want because i want the Stam to go 0.

But thanks anyway!
 
There are two checks there to block movement 1) If you're overweight and IF your Stam = 0; 2) Just checks if Stam = 0

The rest of it is just checking if you're over limit on the max weight you can can carry, then if you're walking, running, or mounted and calculates Stam loss on movement basd on those conditions.

Hi zerodowned i had already check this code, also i have entirely modified it.
But that´s not the check i´m searching, that´s only for overloading and the "block" makes that the mobile can´t move, that´s not restricting the speedmove to walk when stam is = 0.

Thanks for your response, im still working on it, but didn´t found it.
 
To clarify:
I modified this script (WeightOverloading.cs)
I deleted the sentence that check if Stam == 0 that 'blocks' the move.
But this is not the solution, because in another part of the code, ( that i couldn´t find ) there´s another check that makes the speedmove WALK to the mobile when Stam == 0 or < 1.
 
Back