fodev.net
Other => FOnline:2238 Forum => Archives => General Game Discussion => Topic started by: Wallace on January 24, 2010, 01:30:21 pm
-
I'd like to know what is the excact repair formula
When i was improving my repair skill it seemed i was able to repair about 1/6 of my skill (or somewhat less)
But since my repair went above 200% it seems that max single repair is capped at max 32% deterioration...
That is a strange number and i'm wondering a bit if it works properly or it should be 1/6 as it were before 200% of rep. skill
If devs would give repair formula it would be much appreciated :)
-
over 170 views and still no info...
does anyone have an idea how repair works?
-
It's sad beacous not only one person wait for this info...
I (and i think not only I) will be very satisfied if some admin/gm/moderator give uss stright anwser.
-
I'd like to know what is the excact repair formula
Me to :-\
-
Yep, I'd sure like to get some figures here too.
And I'd also like to know what bonuses do the tools provide.
-
600 reads and still no answer??
Devs... please say something on that
-
// Author: cvet
#include "_macros.fos"
#include "_msgstr.fos"
bool TryRepairItem(Critter& cr, Item& item) // Export
{
if(not item.IsDeteriorable()) return true;
if(cr.Timeout[TO_BATTLE]>0)
{
cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_TIMEOUT_BATTLE_WAIT);
return true;
}
if(cr.Timeout[TO_SK_REPAIR]>0)
{
cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_SKILL_WEARINESS);
return true;
}
if(FLAG(item.BrokenFlags,BI_ETERNAL) || FLAG(item.BrokenFlags,BI_NOTRESC))
{
cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_DETERIORATION_NO_RESC);
return true;
}
// Repair
int repair=cr.Skill[SK_REPAIR];
uint8 mode=0;
uint16 activePid=cr.GetSlotProto(SLOT_HAND1,mode).ProtoId;
if(activePid==PID_MULTI_TOOL)
{
repair+=25;
if(Random(0,30)==0) cr.DeleteItem(PID_MULTI_TOOL,1);
}
else if(activePid==PID_SUPER_TOOL_KIT)
{
repair+=50;
if(Random(0,30)==0) cr.DeleteItem(PID_SUPER_TOOL_KIT,1);
}
// Repair
if(FLAG(item.BrokenFlags,BI_BROKEN))
{
if(FLAG(item.BrokenFlags,BI_HIGHBROKEN)) repair-=100; //áûëî 150
else if(FLAG(item.BrokenFlags,BI_NORMBROKEN)) repair-=75; //áûëî 100
else if(FLAG(item.BrokenFlags,BI_LOWBROKEN)) repair-=25; // áûëî 50
repair-=item.BrokenCount*50/MAX_BROKENS; //áûëî 100
repair=CLAMP(repair,6,95);
if(repair>=Random(1,100))
{
item.Deterioration=0;
UNSETFLAG(item.BrokenFlags,BI_BROKEN);
cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_DETERIORATION_REPAIR_SUCC);
cr.StatBase[ST_EXPERIENCE]+=40;
}
else
{
item.BrokenCount++;
if(item.BrokenCount>=MAX_BROKENS) SETFLAG(item.BrokenFlags,BI_NOTRESC);
cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_DETERIORATION_REPAIR_FAIL);
}
}
// Service
else
{
if(FLAG(item.BrokenFlags,BI_SERVICE)) repair-=25;
repair-=item.BrokenCount*50/MAX_BROKENS;
repair=CLAMP(repair,6,95);
if(repair>=Random(1,100))
{
SETFLAG(item.BrokenFlags,BI_SERVICE);
if(activePid==PID_OIL_CAN)
{
item.Deterioration=0;
cr.DeleteItem(PID_OIL_CAN,1);
}
else
{
int cnt=repair*MAX_DETERIORATION/100;
if(cnt>item.Deterioration) item.Deterioration=0;
else item.Deterioration-=cnt;
}
cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_DETERIORATION_SERVICE_SUCC);
cr.StatBase[ST_EXPERIENCE]+=20;
}
else
{
DeteriorateItem(cr,item,MAX_DETERIORATION/5);
cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_DETERIORATION_SERVICE_FAIL);
}
}
item.Update();
cr.TimeoutBase[TO_SK_REPAIR]=REPAIR_TIMEOUT(cr);
return true;
}
void DeteriorateItem(Critter& cr, Item& item, int deteriorationCount) // Export
{
if(deteriorationCount<=0 || not item.IsDeteriorable() || FLAG(item.BrokenFlags,BI_ETERNAL) || FLAG(item.BrokenFlags,BI_BROKEN)) return;
item.Deterioration+=deteriorationCount;
if(item.Deterioration>=MAX_DETERIORATION)
{
item.Deterioration=MAX_DETERIORATION;
item.BrokenCount++;
int brokenLvl=Random(0,item.BrokenCount/(MAX_BROKENS/4));
if(item.BrokenCount>=MAX_BROKENS || brokenLvl>=3) SETFLAG(item.BrokenFlags,BI_NOTRESC);
else if(brokenLvl==2) SETFLAG(item.BrokenFlags,BI_HIGHBROKEN);
else if(brokenLvl==1) SETFLAG(item.BrokenFlags,BI_NORMBROKEN);
else SETFLAG(item.BrokenFlags,BI_LOWBROKEN);
cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_DETERIORATION_WEAPON_BROKEN);
}
item.Update();
}
void SetDeterioration(Item& item, int deteriorationProcent) // Export
{
if(not item.IsDeteriorable()) return;
UNSETFLAG(item.BrokenFlags,BI_BROKEN);
deteriorationProcent=CLAMP(deteriorationProcent,0,100);
item.Deterioration=MAX_DETERIORATION*deteriorationProcent/100;
item.BrokenCount=MAX_BROKENS*deteriorationProcent/100;
if(deteriorationProcent==100) SETFLAG(item.BrokenFlags,BI_BROKEN);
item.Update();
}
int GetDeteriorationProcent(Item& item) // Export
{
if(not item.IsDeteriorable()) return 0;
if(FLAG(item.BrokenFlags,BI_BROKEN)) return 100;
int value=item.Deterioration*100/MAX_DETERIORATION;
return CLAMP(value,0,100);
}
From SDK. Have fun.
-
And that script might not even be what 2238 uses.
-
Don't know the exact formula - but this is what i think.
Also some from this page http://www.fo2238.fodev.net/wiki/Deterioration
-When a weapon isn't broken, you get a -50 skill modifier.
-You also get a -skill modifier depending on its break count
(The break count is invisible - but you can determine roughly depending on its price)
-"It's a little broken." -50
-"It's fairly broken." -100
-"It's almost falling apart." -150
-Chance to repair does NOT depend on the item. Minigun has same chances as a mauser.
-Having a Tool or Super Tool Kit in active slot will add 25% or 50% to repair skill
-Chance to repair an item is capped at 95%.
-Amount you repair depends on your Repair skill, and the break count of what your repairing.
-AND THE MOST IMPORTANT ONE: Repair skill.
Hope that helps some.
-
The thing is... i can't find any info on how many deterioration points can be fixed at a sigle time
(from my experience it's 1/6 of repair skill but it is capped at 32% - you can't repair more even if one has more than 200 skill in repair which should cause repairing more than 32%)
I want to know if the 32% cap is a feature or a BUG
PLUS how many times item can be fixed (when fixing NOT broken item)
-
I have a repair alt, and I don't know what you're talking about with the 32% thing. I'm pretty sure deterioration doesn't, or at least doesn't greatly, affect the chance to repair something; it has to do with its break counts.
A new weapon has 0 out of 10 break counts, meaning you can successfully repair it 9 times. 10th break count = Beyond Repair. Even a successful repair adds a break count, unless you get 40 xp from it. And weapons found in encounters already have multiple break counts on them, which is why they are always much harder to repair, and if you are trying to repair them multiple times, chances are they will go to Beyond Repair before you can get it down to 0%.
-
Forget about the break counts for a moment
For example let's have an armor (no break counts) which has 75% deterioration
I i'd repair it with my char (250 repair skill) it would only repair 32% so after using the repair skill that armor would have 43% deterio left and info "it has seen a few repairs"
For that kind of using repair skill you get 20 xp
-
Oh, I thought my meant that once it got to 32% deter, it wouldn't go more than that. 32% per each repair doesn't sound wrong.
-
Well the amount doesn't sound wrong...
But thet 32% is kinda weird number...
Why not 25, 33 or 50?
That's why it bothers me if it is a feature or bug...
-
10th break count = Beyond Repair
I remember item with just 8 breaks being beyond repair :/.
-
Sure could use some info from devs about that...