September 21, 2019, 01:03:00 am
Username:

Password:

Topic: Snippet to get implants back while reroll  (Read 916 times)

Engardo

  • Posts: 13
    • View Profile
Snippet to get implants back while reroll
« on: May 21, 2018, 07:05:38 pm »
implement in main.fos

Code: [Select]
if(_CritCountItem(cr, PID_BOTTLE_CAPS)>=10000 && cr.Stat[ST_LEVEL]>1)
{
Map@ map = cr.GetMap();
Item@ hintbook = map.AddItem(cr.HexX, cr.HexY, PID_BOOK_OF_ACHIEVEMENT, 1);

hintbook.Val0 = cr.Stat[ST_LEVEL]-1;
hintbook.Val2 = cr.Stat[ST_LEVEL];

//Script expanded to get implants back while reroll @Engardo_SE_003

//SPECIAL
if(cr.Param[PE_IMP_STRENGTH] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_STRENGTH, 1);
}
if(cr.Param[PE_IMP_PERCEPTION] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_PERCEPTION, 1);
}
if(cr.Param[PE_IMP_ENDURANCE] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_ENDURANCE, 1);
}
if(cr.Param[PE_IMP_CHARISMA] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_CHARISMA, 1);
}
if(cr.Param[PE_IMP_INTELLIGENCE] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_INTELLIGENCE, 1);
}
if(cr.Param[PE_IMP_AGILITY] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_AGILITY, 1);
}
if(cr.Param[PE_IMP_LUCK] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_LUCK, 1);
}
//DERMAL
if(cr.Param[PE_DERMAL_IMPACT] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_DERMAL, 1);
}
if(cr.Param[PE_DERMAL_IMPACT_ENH] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_DERMAL, 1);
}
//PHOENIX
if(cr.Param[PE_PHOENIX_IMPLANTS] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_PHOENIX, 1);
}
if(cr.Param[PE_PHOENIX_IMPLANTS_ENH] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_PHOENIX, 1);
}
//NEMEAN
if(cr.Param[PE_NEMEAN_ARMOR] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_NEMEAN, cr.Param[PE_NEMEAN_ARMOR]);
}

}

Edit: Version 2 has been extended with Skillbook recover. Tested and executable.

Code: [Select]
if(_CritCountItem(cr, PID_BOTTLE_CAPS)>=10000 && cr.Stat[ST_LEVEL]>1)
{
Map@ map = cr.GetMap();
Item@ hintbook = map.AddItem(cr.HexX, cr.HexY, PID_BOOK_OF_ACHIEVEMENT, 1);

hintbook.Val0 = cr.Stat[ST_LEVEL]-1;
hintbook.Val2 = cr.Stat[ST_LEVEL];

//Script expanded to get implants back while reroll @Engardo_SE_003

//SPECIAL
if(cr.Param[PE_IMP_STRENGTH] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_STRENGTH, 1);
}
if(cr.Param[PE_IMP_PERCEPTION] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_PERCEPTION, 1);
}
if(cr.Param[PE_IMP_ENDURANCE] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_ENDURANCE, 1);
}
if(cr.Param[PE_IMP_CHARISMA] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_CHARISMA, 1);
}
if(cr.Param[PE_IMP_INTELLIGENCE] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_INTELLIGENCE, 1);
}
if(cr.Param[PE_IMP_AGILITY] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_AGILITY, 1);
}
if(cr.Param[PE_IMP_LUCK] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_LUCK, 1);
}
//DERMAL
if(cr.Param[PE_DERMAL_IMPACT] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_DERMAL, 1);
}
if(cr.Param[PE_DERMAL_IMPACT_ENH] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_DERMAL, 1);
}
//PHOENIX
if(cr.Param[PE_PHOENIX_IMPLANTS] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_PHOENIX, 1);
}
if(cr.Param[PE_PHOENIX_IMPLANTS_ENH] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_PHOENIX, 1);
}
//NEMEAN
if(cr.Param[PE_NEMEAN_ARMOR] > 0)
{
map.AddItem(cr.HexX, cr.HexY, PID_IMPLANT_NEMEAN, cr.Param[PE_NEMEAN_ARMOR]);
}

//Script expanded to get skillbooks back while reroll @Engardo_SE_003_1
//Note for Test-Client : Values ​​are set to zero after restoring a deleted client, unlike implants because it is not stored in Server/save/clients/*.client.

if(GetLocalVar(LVAR_Book_Science, cr.Id).GetValue() > 0 )
{
map.AddItem(cr.HexX, cr.HexY, PID_BIG_BOOK_OF_SCIENCE, GetLocalVar(LVAR_Book_Science, cr.Id).GetValue());
}
if(GetLocalVar(LVAR_Book_Repair, cr.Id).GetValue() > 0 )
{
map.AddItem(cr.HexX, cr.HexY, PID_DEANS_ELECTRONICS, GetLocalVar(LVAR_Book_Repair, cr.Id).GetValue());
}
if(GetLocalVar(LVAR_Book_Outdoorsman, cr.Id).GetValue() > 0 )
{
map.AddItem(cr.HexX, cr.HexY, PID_SCOUT_HANDBOOK, GetLocalVar(LVAR_Book_Outdoorsman, cr.Id).GetValue());
}
if(GetLocalVar(LVAR_Book_Barter, cr.Id).GetValue() > 0 )
{
map.AddItem(cr.HexX, cr.HexY, PID_BARTER_BOOK, GetLocalVar(LVAR_Book_Barter, cr.Id).GetValue());
}
if(GetLocalVar(LVAR_Book_FirstAid, cr.Id).GetValue() > 0 )
{
map.AddItem(cr.HexX, cr.HexY, PID_FIRST_AID_BOOK, GetLocalVar(LVAR_Book_FirstAid, cr.Id).GetValue());
}
if(GetLocalVar(LVAR_Book_SmallGuns, cr.Id).GetValue() > 0 )
{
map.AddItem(cr.HexX, cr.HexY, PID_GUNS_AND_BULLETS, GetLocalVar(LVAR_Book_SmallGuns, cr.Id).GetValue());
}
}

Edit: Version 3 Code length reduced and simplified to add new objects
Code: [Select]
if(_CritCountItem(cr, PID_BOTTLE_CAPS)>=10000 && cr.Stat[ST_LEVEL]>1)
{
Map@ map = cr.GetMap();
Item@ hintbook = map.AddItem(cr.HexX, cr.HexY, PID_BOOK_OF_ACHIEVEMENT, 1);

hintbook.Val0 = cr.Stat[ST_LEVEL]-1;
hintbook.Val2 = cr.Stat[ST_LEVEL];

//Script expanded to get implants back while reroll @Engardo_SE_003

array<int> implantParam = {PE_IMP_STRENGTH,PE_IMP_PERCEPTION,PE_IMP_ENDURANCE,PE_IMP_CHARISMA,PE_IMP_INTELLIGENCE,PE_IMP_AGILITY,PE_IMP_LUCK,PE_DERMAL_IMPACT,PE_DERMAL_IMPACT_ENH,PE_PHOENIX_IMPLANTS,PE_PHOENIX_IMPLANTS_ENH,PE_NEMEAN_ARMOR};
array<int> implantPID ={PID_IMPLANT_STRENGTH,PID_IMPLANT_PERCEPTION,PID_IMPLANT_ENDURANCE,PID_IMPLANT_CHARISMA,PID_IMPLANT_INTELLIGENCE,PID_IMPLANT_AGILITY,PID_IMPLANT_LUCK,PID_IMPLANT_DERMAL,PID_IMPLANT_DERMAL,PID_IMPLANT_PHOENIX,PID_IMPLANT_PHOENIX,PID_IMPLANT_NEMEAN};
for(uint i=0;i<implantParam.length();i++)
{
if(cr.Param[implantParam[i]] > 0)
{
map.AddItem(cr.HexX, cr.HexY, implantPID[i], cr.Param[implantParam[i]]);
}
}

//Script expanded to get skillbooks back while reroll @Engardo_SE_003_1

array<int> bookread = {GetLocalVar(LVAR_Book_Science, cr.Id).GetValue(),GetLocalVar(LVAR_Book_Repair, cr.Id).GetValue(),GetLocalVar(LVAR_Book_FirstAid, cr.Id).GetValue(),GetLocalVar(LVAR_Book_Outdoorsman, cr.Id).GetValue(),GetLocalVar(LVAR_Book_Barter, cr.Id).GetValue(),GetLocalVar(LVAR_Book_SmallGuns, cr.Id).GetValue()};
array<int> bookPID= {PID_BIG_BOOK_OF_SCIENCE,PID_DEANS_ELECTRONICS,PID_FIRST_AID_BOOK,PID_SCOUT_HANDBOOK,PID_BARTER_BOOK,PID_GUNS_AND_BULLETS};
for(uint i=0;i<bookread.length();i++)
{
if(bookread[i] > 0)
{
map.AddItem(cr.HexX, cr.HexY, bookPID[i], bookread[i]);
}
}

}
« Last Edit: May 25, 2018, 05:18:37 pm by Engardo »

Parabellum

  • Supporter
  • Posts: 182
  • "Some Men Just Want to Watch the World Burn"
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #1 on: May 22, 2018, 06:27:56 am »
Wow this would be sick, if working as intended.
For casual player's (or those whom wish to be lol) especially.
But Kilgore doesn't want the game to become easier for all I know, though, a second command "reroll with implants" for a higher bottlecap cost might be an option, no ?

On the other hand I mean.. implants are something you need to gain first. It's not like you are getting anything for free either way. So this would be dope either way I think.
« Last Edit: May 22, 2018, 06:31:00 am by Parabellum »


cthulchu

  • Supporter
  • Posts: 203
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #2 on: May 22, 2018, 02:48:50 pm »
the confusing part is why nemean's code is different? why using the cr.Param[PE_NEMEAN_ARMOR] as a quantifier? What, in case there are two nemeans, they just stack into one perk? Unlike dermals/phoenix?

Looks like a bug. Either here, or in the engine. lol.

Engardo

  • Posts: 13
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #3 on: May 22, 2018, 06:00:18 pm »
@cthulchu Well observed the Nemean stack on the same Param unlike dermal and phonenix.

@Parabellum It's more thought for late game if the enemy has perfect counterattack build against your team and because of it's to cheap you lose alredy 1.3mio caps and 13 Combat Armor if you had all implants i think it's enough punishment.

cthulchu

  • Supporter
  • Posts: 203
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #4 on: May 23, 2018, 01:58:40 am »
yeah. This code can (and should) be extended:

* Make it work if the user has 500k caps rather than 10k.
* Add other perks too to avoid boring crawling for support perks for 1M. Exploitable, but not influences fights. May be a good way to get unavailable otherwise support perks. I would pay for my main crafter to have all the support perks just for fun/convenience.

*sighs*: I get excited about neat coding solutions too. Unfortunately some of our admins are afraid of implementing cool stuff. :(
« Last Edit: May 23, 2018, 03:53:33 am by cthulchu »

Engardo

  • Posts: 13
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #5 on: May 23, 2018, 06:28:50 am »
The 500k cost would be unfair for ordinary reroller and making a separate query with 500k would just confusing the Player.
Im not sure you unterstood the implants aren't saved in the hintbook they spawn on the ground you must pay again 100k caps +1 CA for each reimplant, i think that scales the cost better as a static 500k caps requirement.

Your suggestion to recover Support Perks is very exploitable and has influence in fights: Demolition Expert, Light Step ect.
But here a solution to recover without exploiting and "boring crawling".
If you use the hintbook first time the script save the Player id in Val1 from the hintbook. //that's alredy implemented
Make a Dialoge with a query that tests has the player a hintbook in the invetory with correct id to give access for another dialog they has all support perks with the current requierment.

I just share a snippet that already work on my testserver if you want modification feel free to make a own version.

POWERPUFF

  • Supporter
  • Posts: 177
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #6 on: May 23, 2018, 11:09:40 am »
Implants are end game content and should be used by players who know what they are doing.

If they screw up then the price has to be paid.. In this case price is lost implants.

It's the same as if someone suggested that skill books (small guns, science books etc.) should be recovered upon reroll. Now, the cost and rarity of implants are somewhere else in opposite to skill books, but if you consider noobs who never get to ie 100k caps then the situation is equal for them.
Armageddon Army going for ya


cthulchu

  • Supporter
  • Posts: 203
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #7 on: May 23, 2018, 02:46:09 pm »
ok, folks, just a friendly reminder: we don't have implants in s3. I hope they return the implants at some point, but yeah :)

Parabellum

  • Supporter
  • Posts: 182
  • "Some Men Just Want to Watch the World Burn"
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #8 on: May 23, 2018, 04:42:39 pm »
Yes they aren't.
But they may return.
And since a ton of players crave for them, probably as much, or even more, than for T4 equipment, it's really a hot topic.
A veteran (2238 afaik) even expected the player numbers to go back up into the 100s if these things return, might be overly optimistic, but sheds some light onto the desire people have for these things imo.

And I'm neutral on it, I just return what I caught up and I catch up alot. Just for the "good to know"/desire for wisedome reasons.

Having said that, I didn't catch up the "they drop onto the ground, like a book" part and have to be paid, to be implanted again Engardo.
I think that makes a lot of sense.

Regarding the support perks and all - yeah, they are a big dump for (RL) time and the point PP had can be applied here, I think a much much more convinient and legit solution could be allowing "test builds", don't ask me this would look like.. but.. it reminds me on that shitty MMO skyforge, where you had some sorta "test room" for all classes ingame.

A place like hinkley, where you can enter, naked, with a lvl 1 char and level him to lvl 999 (TEMPORARLY - and return back to lvl 1 upon leaving) and testing him on for example.. Hinkley arenas vs others AND some seperate mini PvE zone with all kinds of diffrent mobs, like a few mutants, centaurs and other common PvE opponents would be a good "final solution" imo.
But sry. for the OT anyways, I think the implants topic is important enough on its own.


Engardo

  • Posts: 13
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #9 on: May 25, 2018, 04:45:20 am »
Yes, the poor noobs almost always build finesse critters with laser weapons in the hope that the malus only deals normal damage. And then (off).  ;D

Guillermi

  • Posts: 2
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #10 on: July 19, 2018, 08:31:23 am »
The guidelines tell you that we have been part of the problem is already the clear increase ever.

Parabellum

  • Supporter
  • Posts: 182
  • "Some Men Just Want to Watch the World Burn"
    • View Profile
Re: Snippet to get implants back while reroll
« Reply #11 on: July 19, 2018, 09:50:31 am »
The guidelines tell you that we have been part of the problem is already the clear increase ever.

Fucking bot.