Page 1 of 1

All crafts HQ?

Posted: Fri Jun 13, 2014 3:35 pm
by Keldegar
How would one make it so you HQ all the time?

Re: All crafts HQ?

Posted: Fri Jun 13, 2014 3:49 pm
by atom0s
https://github.com/DarkstarProject/dark ... s.cpp#L438

For this line change the result to be hq, so it will look like this:

Code: Select all

result = SYNTHESIS_HQ;

// результат синтеза записываем в поле quantity ячейки кристалла.
PChar->CraftContainer->setQuantity(0, result);

Re: All crafts HQ?

Posted: Fri Jun 13, 2014 4:20 pm
by Keldegar
Thank you!

Hmm, that didn't seem to work. I recompiled and still getting NQs below and at cap.

Re: All crafts HQ?

Posted: Fri Jun 13, 2014 10:04 pm
by Keldegar
I figured out a way to do it by setting hqtier to 4 for all.

I also figured out a way to do NQs if you have Guild Synth Support. Since sometimes, you need an NQ (guild rank up, recipe for another synth)

//NQ if you have guild synth support
if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_SMITHING_IMAGERY))
hqtier = 0;
else if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_GOLDSMITHING_IMAGERY))
hqtier = 0;
else if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_WOODWORKING_IMAGERY))
hqtier = 0;
else if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_CLOTHCRAFT_IMAGERY))
hqtier = 0;
else if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_LEATHERCRAFT_IMAGERY))
hqtier = 0;
else if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_BONECRAFT_IMAGERY))
hqtier = 0;
else if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_ALCHEMY_IMAGERY))
hqtier = 0;
else if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_COOKING_IMAGERY))
hqtier = 0;

Re: All crafts HQ?

Posted: Wed Jun 18, 2014 8:16 pm
by whasf
that's an awful lot of code that can be in one statement

Re: All crafts HQ?

Posted: Thu Jun 19, 2014 1:49 pm
by Keldegar
whasf wrote:that's an awful lot of code that can be in one statement
You mean using OR? Sure =P

if ( (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_SMITHING_IMAGERY)) || (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_GOLDSMITHING_IMAGERY)) || (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_WOODWORKING_IMAGERY)) ...... )
hqtier = 0;

Is there a way to check for all imagery effects with one call?

Re: All crafts HQ?

Posted: Thu Jun 19, 2014 6:25 pm
by kjLotus
can't remember if i added a lambda function for status effects yet. either way, aren't all the imagery IDs right beside each other? if imagery >= smithing and imagery <= whatever the last one is

Re: All crafts HQ?

Posted: Fri Jun 20, 2014 4:31 pm
by Keldegar
But isn't HasStatusEffect a boolean? how could you do a greater than or less than?

Am i calling the wrong method?

Re: All crafts HQ?

Posted: Fri Jun 20, 2014 9:06 pm
by bluekirby0
The idea is to just use a loop to simplify the code...Assuming smithing is the first and cooking is the last, it'd look something like this:

Code: Select all

//NQ if you have guild synth support
for(auto i = EFFECT_SMITHING_IMAGERY; i <= EFFECT_COOKING_IMAGERY; i++)
{
    if (PChar->StatusEffectContainer->HasStatusEffect(i))
    {
        hqtier = 0;
        break;
    }
}

Re: All crafts HQ?

Posted: Mon Jun 23, 2014 1:03 pm
by Keldegar
Awesome, thank you :)