PLease help titleCheck.src

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
Trike
Journeyman Poster
Posts: 62
Joined: Mon Aug 19, 2019 7:55 pm

PLease help titleCheck.src

Post by Trike » Fri Aug 30, 2019 10:08 am

Hi everyone, please tell me, I can’t adjust the titles, it is necessary that at 50 skills the Beginner skill should give, at 65 skill the Student
PR 90 Journeyman
PR 105 Expert
At 115 Adept
At 125 Master
At 150 Grandmaster

I understand it like that

use uo;
use os;
use cfgfile;

include "include/attributes";

program TitleCheck(who)
var current;
var highskill := Cint(GetObjProperty(who, "HighSkill"));
var max_skill := 0;
var holder := highskill;
if(highskill)
max_skill := GetBaseSkillBaseValue(who, highskill);
endif
foreach attributeid in GetAttributeIdsWithoutStatIds()
current := GetAttributeBaseValue(who, attributeid);
if( current > max_skill )
max_skill := current;
holder := GetSkillIdByAttributeId(attributeid);
endif
endforeach
SetObjProperty(who, "HighSkill", holder);
var title := "";
var fame := Cint(GetObjProperty(who, "Fame"));
if((max_skill >= 300) and (fame > 5000))
var cfg := ReadConfigFile(":*:skills");
var elem := FindConfigElem(cfg, holder);;
title := CStr(elem.Title);
if(max_skill < 400 )
title := ", Neophyte " + title;
elseif(max_skill < 500 )
title := ", Novice " + title;
elseif(max_skill < 650 )
title := ", Apprentice " + title;
elseif(max_skill < 900 )
title := ", Journeyman " + title;
elseif(max_skill < 105 )
title := ", Expert " + title;
elseif(max_skill < 1150 )
title := ", Adept " + title;
elseif(max_skill < 1250 )
title := ", Master " + title;
elseif(max_skill <150)
title := ", Grandmaster " + title;
endif
else
title := "";
endif
who.title_suffix := title;
endprogram

Yukiko
Distro Developer
Posts: 2781
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: PLease help titleCheck.src

Post by Yukiko » Fri Aug 30, 2019 11:28 am

Try replacing the title checks with this:

Code: Select all

if(max_skill < 500)
    title := ", Neophyte " + title;
elseif(max_skill < 650)
    title := ", Novice " + title;  // Beginner
elseif(max_skill < 900)
    title := ", Apprentice " + title;  // Student
elseif(max_skill < 1050)
    title := ", Journeyman " + title;
elseif(max_skill < 1150)
    title := ", Expert " + title;
elseif(max_skill < 1250 )
    title := ", Adept " + title;
elseif(max_skill < 1500 )
    title := ", Master " + title;
elseif(max_skill >= 1500)
    title := ", Grandmaster " + title;
endif
I think that will work for you. If you do not want a title for a skill below 50 then change this line:

Code: Select all

    title := ", Neophyte " + title; 
to

Code: Select all

    title := "" + title; 

Trike
Journeyman Poster
Posts: 62
Joined: Mon Aug 19, 2019 7:55 pm

Re: PLease help titleCheck.src

Post by Trike » Fri Aug 30, 2019 12:34 pm

Thanks, it finally works correctly

Post Reply