• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Transform

Tairens

Member
Joined
Sep 23, 2007
Messages
90
Reaction score
5
In config is template how add trasformation for new vocation.
Code:
local transform = 
{
--[voc_id_before_trans] = {voc_id_after_trans, addedhealth, addedmana, outfit, required_level, required_mana}
}
local texts = 
{
level = "You don\'t have enough level.",
mana = "You don\'t have enough mana.",
transform = "You transform to "
}
function onSay(cid, param, words)
	local Player = transform[getPlayerVocation(cid)]
	if (Player == nil) then
		return true
	end
	if (getPlayerLevel(cid) < Player.reqLevel) then
		doPlayerSendTextMessage(cid, 22, texts.level)
		return true
	end
	if (getCreatureMana(cid) < Player.reqMana) then
		doPlayerSendTextMessage(cid, 22, texts.mana)
		return true
	end
	doPlayerSetVocation(cid, Player.vocId)
	doCreatureAddMana(cid, -Player.reqMana)
	doSetCreatureOutfit(cid, Player.outfit, -1)
	setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + Player.addHealth)
	setCreatureMaxMana(cid, getCreatureMaxMana(cid) + Player.addMana)
	doPlayerSendTextMessage(cid, 22, ""..texts.transform..""..getVocationInfo(Player.vocId).name..".")
	return true
end
Code:
<talkaction words="!transform" hide="yes" event="script" value="transform.lua"/>
 
Last edited:
<.< again, wrong section, this is for releases

Lua:
vocId = 2
i suppose that's the vocationID(2 is supposed to be non-promoted sorcerer)
 
Back
Top