• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How to make new accounts start with chosen magic level

Boyegas

New Member
Joined
Jan 27, 2009
Messages
159
Reaction score
1
Hello, I want to know how to edit the magic level that chars have when they log in. But i want it to be diferent for each vocation, for example druids and sorcerer start with magic level 20. paladins withs 10 and knights with 5. Please help
rep ++
 
make one lua and put
:
function onLogin(cid)
local playerVoc = getPlayerVocation(cid)
local reqTries = getPlayerRequiredSkillTries
local skillStor = 56364
local gotSkills = getPlayerStorageValue(cid, 56364)


if playerVoc == 1 and gotSkills == -1 then
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,80)))
doPlayerAddMagLevel(cid, 9)
setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 2 and gotSkills == -1 then
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,80)))
doPlayerAddMagLevel(cid, 9)
setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 3 and gotSkills == -1 then
doPlayerAddSkillTry(cid, SKILL_DISTANCE, reqTries(cid, SKILL_DISTANCE, 99))
doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 99))
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,30)))
doPlayerAddMagLevel(cid, 9)
setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 4 and gotSkills == -1 then
doPlayerAddSkillTry(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 99))
doPlayerAddSkillTry(cid, SKILL_SWORD, reqTries(cid, SKILL_SWORD, 99))
doPlayerAddSkillTry(cid, SKILL_CLUB, reqTries(cid, SKILL_CLUB, 99))
doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 99))
doPlayerAddMagLevel(cid, 9)
setPlayerStorageValue(cid, skillStor, 1)

end
return TRUE
end
 
then go to data\creaturescripts\creaturescripts.xml and put this
<event type="login" name="StartSkills" event="script" value="startskills.lua"/>
 
Back
Top