PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
Skill lock

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095)
Display posts from previous:   

Author Message
Pumpkins



Joined: 22 Jan 2007
Posts: 25

PostPosted: Tue Aug 28, 2007 8:59 am    Post subject: Skill lock Reply with quote

Hello,

i have a question.. how i get working the skill lock?

i use the .skills from zulu hotel distro and it dont work, the classic skills menu from the papeldoll dont work too..


there is a way to get it working in pol095? thanks.

i know the 095 is no longer supported.. but 095 still in use in SOME shards.. this old problem should be fixed..


Last edited by Pumpkins on Mon Feb 11, 2008 5:17 am; edited 1 time in total

Author Message
Pumpkins



Joined: 22 Jan 2007
Posts: 25

PostPosted: Wed Aug 29, 2007 8:08 am    Post subject: Reply with quote

i love the pol support.. Mad

Author Message
Yukiko



Joined: 02 Feb 2006
Posts: 1094
Location: Southern Central USA

PostPosted: Wed Aug 29, 2007 2:33 pm    Post subject: Reply with quote

Pumpkins here's a link to skill locks for POL 0.96. Maybe this will help you with doing it in POL 0.95.

http://forums.polserver.com/viewtopic.php?t=292&highlight=lock

Author Message
CWO



Joined: 04 Feb 2006
Posts: 699
Location: Chicago, IL USA

PostPosted: Wed Aug 29, 2007 8:26 pm    Post subject: Reply with quote

Thats for packet hooks though. Packet hooks aren't supported on 095.

Author Message
Yukiko



Joined: 02 Feb 2006
Posts: 1094
Location: Southern Central USA

PostPosted: Thu Aug 30, 2007 2:38 am    Post subject: Reply with quote

Yep. You're right CWO. Sorry Pumpkins. Maybe this will make up for my mistake. Did you replace the CheckSkillCap function in AttributeCore.src with the following one?

Code:

function CheckSkillCap(who, ev)
  var attributeid := ev.skid;
  var priorValue;
  var theId;
  var lowerholder;
  var lockArray := GetObjProperty(who, "SkLockArray");

  priorValue := GetAttributeBaseValue(who, attributeid);

  if(priorValue < 1000)
    if (ev.base > priorValue)  // Adding Skill, check for lock set to up
      if ((!lockArray) ||
          (lockArray[GetSkillIdByAttributeId(attributeid) + 1] == 0))
        SetAttributeBaseValue(who, attributeid, Cint(ev.base));
      endif
    elseif (ev.base < priorValue) // Lowering Skill, check for lock set to down
      if ((lockArray != error) &&
          (lockArray[GetSkillIdByAttributeId(attributeid) + 1] == 1))
        SetAttributeBaseValue(who, attributeid, Cint(ev.base));
      endif
    endif
  endif

  if(GetAttributeBaseValue(who, attributeid) > 1000)
    priorValue := 1000;
    SetAttributeBaseValue(who, attributeid, 1000);
  endif

  var skillarray := GetObjProperty(who,"SkillArray");
  var skilltotal := 0;
  var skillval := 0;
  var check := 0;
  var loops := 0;
  var holder, newval, final;
  var base, mods, true;
  while(check == 0)
    if(loops >= 6)
      if (priorValue < GetAttributeBaseValue(who, attributeid))
        SetAttributeBaseValue(who, attributeid, priorValue);
      endif
      break;
    endif
    skilltotal := 0;
    lowerholder := -1;

    for (theId := 0; theID < SKILLID__HIGHEST; theID := theID + 1)
      true := GetBaseSkillBaseValue(who, theID);
      base := Cint(true - GetAttributeIntrinsicMod(who, GetAttributeIdBySkillId(theId)));
      skilltotal := skilltotal + base;

      if ( (base > 0) &&
           (lockarray != error) &&
           (lockarray[theId + 1] == 1) )
        lowerholder := theId;
      elseif (base > 0)
        holder := theId;
      endif

      if ((lowerholder >= 0) && (skilltotal > CONST_SKILLCAP))
        break;
      endif
    endfor

    if (lowerholder >=0)
      holder := lowerholder;
    endif

    if(skilltotal > CONST_SKILLCAP)
      newval := GetBaseSkillBaseValue(who, holder);
      final := (newval - 1);
      SetBaseSkillBaseValue(who, holder, final);
    else
      check := 1;
    endif
    loops := loops + 1;
  endwhile
  return 1;
endfunction


If not then open AttributeCore.src found in \pkg\foundations\hooks and replace the CheckSkillCap function in there with the one above. I believe it is what you need to make the skill locks work. Be sure to make a backup of the AttributeCore.src file just in case this causes undesireable results. I can't help with support for this. It is provided as is. I dug it out of my "script mines" but I think it is what you need.

Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095) All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty