Como funciona?
Clique e sumone um Training monk
OBS: Só funciona no chão.
Script:
data/actions/scripts/trainer_eqq.lua
Adicione a linha do script em Actions.xml
Funciona em TFS 0.3 +
Clique e sumone um Training monk
OBS: Só funciona no chão.
Script:
data/actions/scripts/trainer_eqq.lua
Code:
local config = {
summonName = "Training Monk",
cost = 10000 -- in gp, put 0 to disable
remove = "yes" -- should egg by removed after use?
}
config.remove = getBooleanFromString(config.remove)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = getCreaturePosition(cid)
if(pos.x == CONTAINER_POSITION) then
doPlayerSendCancel(cid, "Put item on the floor first.")
return TRUE
end
if(config.cost > 0 and getPlayerMoney(cid) < config.cost) then
doPlayerSendCancel(cid, "Not enought money, trainer cost " .. config.cost .. " gp's.")
return TRUE
end
local ret, effect = doSummonMonster(cid, config.summonName), CONST_ME_MAGIC_RED
if(ret ~= RETURNVALUE_NOERROR) then
effect = CONST_ME_POFF
doPlayerSendDefaultCancel(cid, ret)
else
if(config.cost > 0) then
doPlayerRemoveMoney(cid, config.cost)
end
if(config.remove == TRUE) then
doRemoveItem(item.uid)
end
end
doSendMagicEffect(pos, effect)
return TRUE
end
Funciona em TFS 0.3 +