Shawak
Intermediate OT User
Hello,
here a litle script to summon a monster on a ground .
Testet with TFS 0.3.4.
How to Install?
Create a summon_item.lua in
data/actions/scripts and paste..
Then go to..
data/actions/actions.xml
And paste..
Script FINISH
How it works?
-> I use this item for the script:
But you can change the ID, to whatever you want :thumbup:.
-> WARNING:
You can ONLY summon a monster on the grounds,
that you have set.
Here:
Example to set more tiles
I added this:
So you can add more and more.
I hope you like it .
Regards,
Shawak
here a litle script to summon a monster on a ground .
Testet with TFS 0.3.4.
How to Install?
Create a summon_item.lua in
data/actions/scripts and paste..
PHP:
--[[
Summon monster with Item
- by Shawak
]]--
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
grounds = { -- grounds // only on it you can summon a monster
407, -- black marbe tile // Example
},
monster = "Demon", -- monster that will be summoned
removeItem = 1, -- "1" or "0" // 1 = yes, 2 = no
articleOfMonster = "a", -- article of the monster // Example: "a" Demon
}
if isInArray(config.grounds,itemEx.itemid) == TRUE then
if getTilePzInfo(fromPosition) == FALSE then
if getTilePzInfo(toPossition) == FALSE then
if config.removeItem >= 1 then
doRemoveItem(item.uid,1)
end
doSendMagicEffect(toPosition, 10)
doSummonCreature(config.monster, toPosition)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You summoned "..config.articleOfMonster.." "..config.monster..".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You can't summon a monster in a projection zone.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You can't summon a monster while you are in a projection zone.")
end
else
doSendMagicEffect(toPosition, CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You can't summon a monster there.")
end
return TRUE
end
Then go to..
data/actions/actions.xml
And paste..
PHP:
<action itemid="4869" script="summon monster.lua"/>
Script FINISH
How it works?
-> I use this item for the script:
PHP:
<item id="4869" article="a" name="botanist's container">
<attribute key="description" value="it is empty."/>
<attribute key="weight" value="1800"/>
</item>
-> WARNING:
You can ONLY summon a monster on the grounds,
that you have set.
Here:
PHP:
local config = {
grounds = { -- grounds // only on it you can summon a monster
407, -- black marbe tile // Example
},
Example to set more tiles
PHP:
local config = {
grounds = { -- grounds // only on it you can summon a monster
407, -- black marble tile // Example
406, -- white marble tile
},
PHP:
406, -- white marble tile
I hope you like it .
Regards,
Shawak
Last edited: