• 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!

[TFS cryingdamson 0.3.6 (8.60) V5] Beginner skills and mlvl

lokatylokacz

New Member
Joined
Feb 26, 2011
Messages
58
Solutions
2
Reaction score
4
Location
P(r)oland
Hello,
I wanted to ask if it is possible to determine the begginer mlvlu and skills based on a character vocation.

I know that I can do something in config.lua like:
Code:
	newPlayerLevel = 65
	newPlayerMagicLevel = 5

But this is to all vocations ane idea that knight and sorcerer will have 5mlvl or 60mlvl is bad idea xDD
If u know what I mena pls try to help me ;)

Thx at all :)
LoK
 
creaturescript (type=login):
Lua:
local config = 
{
	-- [vocationId] = magicLevel
	[1] = 10,
	[2] = 11
}

function onLogin(cid)
	if (getPlayerLastLoginSaved(cid) == 0 and config[getPlayerVocation(cid)]) then
		doPlayerAddMagLevel(cid, config[getPlayerVocation(cid)])
	end
	return true
end

config.lua
Lua:
	newPlayerMagicLevel = 0
 
Hmm I made it but now when I'm loggin my sorcerer first time my mlvl reach 2 and stop when I logged palladin I reached 4 mlvl xD

Palladin [4mlvl not 20]:
14762185.jpg

Sorcerer, Druid [2 mlvl not 45]:
2222.JPG

Knight is ok [7 mlvl]:
1111.JPG

\data\creaturescripts\scripts\skill_mlvl.lua
Lua:
local config = 
{
	-- [vocationId] = magicLevel
	[1] = 45, --sorcerer
	[2] = 45, -- druid
	[3] = 20, --paladin
	[4] = 7, --knight
}
 
function onLogin(cid)
	if (getPlayerLastLoginSaved(cid) == 0 and config[getPlayerVocation(cid)]) then
		doPlayerAddMagLevel(cid, config[getPlayerVocation(cid)])
	end
	return true
end
\data\creaturescripts
XML:
<event type="login" name="skill_mlvl" event="script" value="skill_mlvl.lua"/>

Any ideas what is worng xD ?
 
Last edited:
This function (doPlayerAddMagLevel) add magic level. So I think there should be error.
 
doPlayerAddMagLevel
Lua:
function doPlayerAddMagLevel(cid, amount)
	for i = 1, amount do
		doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true) + 1) - getPlayerSpentMana(cid)) / getConfigInfo('rateMagic'))
	end
	return true
end

doPlayerAddSkill
Lua:
function doPlayerAddSkill(cid, skill, amount, round)
	if(skill == SKILL__LEVEL) then
		return doPlayerAddLevel(cid, amount, round)
	elseif(skill == SKILL__MAGLEVEL) then
		return doPlayerAddMagLevel(cid, amount)
	end

	return doPlayerAddSkillTry(cid, skill, (getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill)) / getConfigInfo('rateSkill'))
end

hmmm xD something is worng??
 
Last edited:
Back
Top