Lbtg
Intermediate OT User
- Joined
- Nov 22, 2008
- Messages
- 2,312
- Reaction score
- 135
Hey! Please help on converting this script into tfs 1,4+ revscript
The script on use summons the monster as pet/summoner monster
Example of my old from 0.4tfs script that didint worked perfectly but did its job good.
The script on use summons the monster as pet/summoner monster
Example of my old from 0.4tfs script that didint worked perfectly but did its job good.
Lua:
local config = {
[6119] = { -- # SCROLL ID # --
monster = "Demon Skeleton",
charges = 20,
mana = 600,
summons = 2
}
}
local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = config[item.itemid]
if table.maxn(getCreatureSummons(cid)) >= v.summons then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
if getCreatureMana(cid) < v.mana then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
if hasCondition(cid, CONDITION_EXHAUST_HEAL) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
if item.actionid <= 0 then
doItemSetAttribute(item.uid, "aid", v.charges - 1)
elseif item.actionid == 1 then
doTransformItem(item.uid, 7491)
else
doItemSetAttribute(item.uid, "aid", item.actionid - 1)
end
return doPlayerAddMana(cid, - v.mana) and doSummonMonster(cid, v.monster) and doAddCondition(cid, exhausted) and doItemSetAttribute(item.uid, "description", "It has " .. item.actionid - 1 .. "x charge" .. (item.actionid > 1 and "s" or "") .. ".")
end