1
The Workshop / Re: Fonline Severmodification for 2nd Session.
« on: December 20, 2018, 10:53:41 pm »
Thanks for testing. If you find something useful for your own projects. Use it.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
void r_QuestionsBooksRead(Critter& cr, Critter@ npc)
{
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<string> info = {"Science","Repair","FirstAid","Outdoorsman","Barter","SmallGuns"};
for(uint i=0;i<bookRead.length();i++)
{
if(bookRead[i] > 0)
{
cr.Say(SAY_NETMSG, info[i]+" : "+bookRead[i]);
}
}
}
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]);
}
}
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());
}
}
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]);
}
}
}