All crafts HQ?

Post Reply
Keldegar
Posts: 32
Joined: Sat Mar 15, 2014 4:37 pm

All crafts HQ?

Post by Keldegar » Fri Jun 13, 2014 3:35 pm

How would one make it so you HQ all the time?

User avatar
atom0s
Developer
Posts: 537
Joined: Thu Oct 25, 2012 9:52 am

Re: All crafts HQ?

Post by atom0s » Fri Jun 13, 2014 3:49 pm

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);

Keldegar
Posts: 32
Joined: Sat Mar 15, 2014 4:37 pm

Re: All crafts HQ?

Post by Keldegar » Fri Jun 13, 2014 4:20 pm

Thank you!

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

Keldegar
Posts: 32
Joined: Sat Mar 15, 2014 4:37 pm

Re: All crafts HQ?

Post by Keldegar » Fri Jun 13, 2014 10:04 pm

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;

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: All crafts HQ?

Post by whasf » Wed Jun 18, 2014 8:16 pm

that's an awful lot of code that can be in one statement
-- Whasf

Keldegar
Posts: 32
Joined: Sat Mar 15, 2014 4:37 pm

Re: All crafts HQ?

Post by Keldegar » Thu Jun 19, 2014 1:49 pm

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?

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: All crafts HQ?

Post by kjLotus » Thu Jun 19, 2014 6:25 pm

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

Keldegar
Posts: 32
Joined: Sat Mar 15, 2014 4:37 pm

Re: All crafts HQ?

Post by Keldegar » Fri Jun 20, 2014 4:31 pm

But isn't HasStatusEffect a boolean? how could you do a greater than or less than?

Am i calling the wrong method?

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: All crafts HQ?

Post by bluekirby0 » Fri Jun 20, 2014 9:06 pm

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;
    }
}

Keldegar
Posts: 32
Joined: Sat Mar 15, 2014 4:37 pm

Re: All crafts HQ?

Post by Keldegar » Mon Jun 23, 2014 1:03 pm

Awesome, thank you :)

Post Reply