silveralol
Advanced OT User
- Joined
- Mar 16, 2010
- Messages
- 1,480
- Solutions
- 9
- Reaction score
- 211
hello folks, as the title says I'm requesting a function in c++ that set the spawn positions, I need it to handle with some world changes ...
to be possible to create monsters by scripts and set their spawn positions to them spawn normal as the others monsters...
also I need a function that set skills in items...
exemple:
/attr skillname, value
I have some code for exemple..
to be possible to create monsters by scripts and set their spawn positions to them spawn normal as the others monsters...
also I need a function that set skills in items...
exemple:
/attr skillname, value
I have some code for exemple..
Lua:
function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
local t = param:split(" ", 1)
local attr = t[1]
local value = (t[2])
local position = player:getPosition()
position:getNextPosition(player:getDirection())
local tile = position:getTile()
if not tile then
player:sendCancelMessage("Object not found.")
return false
end
local thing = tile:getTopVisibleThing(player)
if not thing then
player:sendCancelMessage("Thing not found.")
return false
end
if thing:isItem() then
if attr == "skillfist" then
thing:setAttribute('skillfist', value)
else
player:sendCancelMessage("Bad Attribute.")
return true
end
end
position:sendMagicEffect(CONST_ME_MAGIC_RED)
return false
end
Last edited by a moderator: