• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Help] Talkaction

jubix

New Member
Joined
Aug 7, 2007
Messages
21
Reaction score
0
I was made that script:
Code:
-StArT-
function onSay(cid, words, param) 
-SeTtInGs-
local mana = 10
local voce = 1
local lvl = 30
local voc = 2
local vocTime = 6000
local pacc = 0
local pacce = 0
local outfit = {lookType=7,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0}
local outfitTime = 6000
local napis = "Transformation!"
-CoDe-
if(getPlayerMana(cid) >= mana and getPlayerVocation(cid) == voce and getPlayerLevel(cid) >= lvl and isPremium(cid) == pacc or isPremium(cid) == pacce and getPlayerVocation(cid) < voc )then 
doPlayerSetVocation(cid, voc, vocTime) 
doPlayerAddMana(cid,-mana) 
doSetCreatureOutfit(cid, outfit, outfitTime) 
doPlayerSay(cid,napis,16) 
else 
doPlayerSendCancel(cid,"You are too weak.") 
end 
return 1 
end 
-EnD-
The vocation are not changing. What is wrong? Pleae reply.
 
You did your comments wrong:

try this:

Code:
--StArT--
function onSay(cid, words, param) 

	--SeTtInGs--
	local mana = 10
	local voce = 1
	local lvl = 30
	local voc = 2
	local vocTime = 6000
	local pacc = 0
	local pacce = 0
	local outfit = {lookType=7,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0}
	local outfitTime = 6000
	local napis = "Transformation!"
	
	--CoDe--
	if(getPlayerMana(cid) >= mana and getPlayerVocation(cid) == voce and getPlayerLevel(cid) >= lvl and isPremium(cid) == pacc or isPremium(cid) == pacce and getPlayerVocation(cid) < voc )then
	
		doPlayerSetVocation(cid, voc, vocTime) 
		doPlayerAddMana(cid,-mana) 
		doSetCreatureOutfit(cid, outfit, outfitTime) 
		doPlayerSay(cid,napis,16) 
		
	else 
	
		doPlayerSendCancel(cid,"You are too weak.") 
		
	end 
	
	return 1 
end 
--EnD--
 
Still doesn't work. Maybe anybody got better script to changing vocation and outfit for a some time. I'm using B-Fox 6.8 .
 
Ok... Man using this script must have 30lvl and write "transform", and his vocation change form "1" to "2". With every second he loses 5 mana. It change his outfit and give him all skills +10 (without lvl ofc).Transformation will shut down, when he log out, his mana goes to 0 or he write "revert" (I have already working revert script). After "reverting" his vocation back from "2" to "1" , his outfit and skill back to normal.
 
I was thinked about 2 kind of transforms...

Not-revertable
  • changing vocation
  • 2k hp more
  • 2k mana more
  • changing outfit
  • stronger magical and physical hits
  • For ever, after relog you are still a "second form"

revertable
  • NOT changing vocation
  • changing outfit
  • much stronger hits than "not revertable" form
  • NOT for ever, it shut down after relog, "revert" or when mana goes to 0

Yes, It is possible...
I was played on server with this script
 
Last edited:
For logout issue, just add storage value to player when he is in "tranformation" form, and onLogin script which ckeck, is player tranformed, if yea, then make him back...
 
Code:
-- Transform
-- Config:
local config = {
	lvl = 30,
	newVoc = 2,
	delay = 1, -- in minutes
	extraHp = 2000,
	extraMp = 2000,
	drainMana = 5,
	timeDrain = 5, -- in seconds
	timeOutfit = 6, -- in minutes
	storage = 5000,
	oldVocStorage = 5001,
	msg = "Transformation."
	}
	
-- Script:
function onSay(cid, words, param)
	if getPlayerLevel(cid) >= config.lvl then
		if getPlayerStorageValue(cid, config.storage) ~= 1 then
			setPlayerStorageValue(cid, config.storage, 1)
			setPlayerStorage(cid, config.oldVocStorage, getPlayerVocation(cid))
			doPlayerSetVocation(cid, newVoc)
			addEvent(revert, config.delay * 60 * 1000, cid)
			addEvent(manaDrain, 1, cid)
			setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + config.extraHp)
			setCreatureMaxMana(cid, getPlayerMaxMana(cid) + config.extraMp)
			doSetCreatureOutfit(cid, { lookType = 7, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0 }, -1)
		else
			doPlayerSendTextMessage(cid, 17, "You are already transformed.")
		end
	else
		doPlayerSendTextMessage(cid, 17, "Only players of level "..config.lvl.." and above may use this spell.")
	end
end

function revert(cid)
	setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - config.extraHp)
	setCreatureMaxMana(cid, getPlayerMaxMana(cid) - config.extraMp)
	doPlayerSetVocation(cid, getPlayerStorageValue(cid, config.oldVocStorage))
	doRemoveCondition(cid, CONDITION_OUTFIT)
        setPlayerStorageValue(cid, config.storage, 0)
	stopEvent(manaDrain)
end

function manaDrain(cid)
	repeat
		addEvent(doPlayerAddMana, config.timeDrain * 1000, cid, config.drainMana)
	until getPlayerMana(cid) < 5
        addEvent(revert, 1, cid)
end

Not tested, first time tried repeat thing.

You have to add check in login.lua:
Code:
if getPlayerStorageValue(cid, 5000) == 1 then
    setPlayerStorageValue(cid, 5000, 0)
    doPlayerSetVocation(cid, getPlayerStorageValue(cid, 5001)
    setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 2000)
    setCreatureMaxMana(cid, getPlayerMaxMana(cid) - 2000)
    doRemoveCondition(cid, CONDITION_OUTFIT)
end
 
Last edited:
Back
Top