Bonaccorso
Member
I've got an idea to make a type of hirables based on BaseHire.cs (I'll make new CustomBaseHire.cs), who will work not for money but for something different.
Now I'm trying to figure out three cases:
1. How can they work for free? Now they are hired when given gold, so it's likely has something to do with changing "public override bool OnDragDrop(Mobile from, Item item) " and there it's hiring for gold, and adding hiring code to some other place - but here I'm confused for where can it be put?
2. For item; it seems to be easy in theory - I plan to try to remove the lines from new CustomBaseHire:
And - then how can I change the number of days in which he's gonna serve? For example, making it infinite?
Likely removing the part
and this check as well?
Did I miss something?
Now I'm trying to figure out three cases:
1. How can they work for free? Now they are hired when given gold, so it's likely has something to do with changing "public override bool OnDragDrop(Mobile from, Item item) " and there it's hiring for gold, and adding hiring code to some other place - but here I'm confused for where can it be put?
2. For item; it seems to be easy in theory - I plan to try to remove the lines from new CustomBaseHire:
C#:
// Is the item the payment in gold
if (item is Gold)
{
// Is the payment in gold sufficient
if (item.Amount >= Pay)
And - then how can I change the number of days in which he's gonna serve? For example, making it infinite?
Likely removing the part
C#:
NextPay = DateTime.UtcNow + PayTimer.GetInterval();
PayTimer.RegisterTimer(this);
C#:
protected override void OnTick()
{
var list = Hires.Where(v => v.NextPay <= DateTime.UtcNow).ToList();
for (int i = 0; i < list.Count; i++)
{
var hire = list[i];
hire.NextPay = DateTime.UtcNow + GetInterval();
int pay = hire.Pay;
if (hire.HoldGold <= pay)
{
hire.GetOwner();
hire.Say(503235, 0x3B2);// I regret nothing!
hire.Delete();
}
else
{
hire.HoldGold -= pay;
}
}
ColUtility.Free(list);
}
Did I miss something?