View Single Post
  #59  
Old 08-26-2017, 03:09 PM
hayward6
Forum Guide
 
Join Date: Jul 2005
Posts: 468
Default

So this is working perfectly for giving skills to players, what's the best way to provide spell scribing in here? I want it to just happen at skill-up. I chopped up what was posted earlier in an npc and I couldn't get it working. I understand lua is probably great, but I had a hard enough time with perl


Code:
function event_level_up(e)
	local skills = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 48, 49, 50, 51, 52, 53, 54, 56, 62, 66, 67, 70, 71, 72, 73, 74 };
	for i, curskill in ipairs(skills) do
		local maxskill = e.self:MaxSkill(curskill);
		if (e.self:CanHaveSkill(curskill) == false) then
			--Do nothing...
		elseif (maxskill <= e.self:GetRawSkill(curskill)) then
			--Do nothing...
		else
			--Train!
			e.self:SetSkill(curskill, maxskill);
		end
	end
end
__________________
Sayin Silverwolf
Server Op of The Sandbox (Non-Legit)
Reply With Quote