zxmatzx
Advanced OT User
Hi,
I added this commit the part that is related to
This is my code to do summon go to position:
What happens when i use the action:
I tested this function with Creatures(Monsters, Npcs and Players) and works well. The only problem is with summons...
Thanks for attention.
I added this commit the part that is related to
creature:moveTo
function. Im using this function to players move their summons. But the summon can't go to location because the natural behaviour of summon is stay close to master, i think i need to edit my onThink in monster.cpp, but don't know what i need to change. I want to summon move to position and stay there, if the player move, the summon back to near(natural behaviour).This is my code to do summon go to position:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local playerPet = cid:getSummonedPet()
if playerPet then
--functions before try move
--MOVE
if playerPet:getPathTo(toPosition) then
if Tile(toPosition):isWalkable(true) then--Edited isWalkable to check if have creatures in the tile too
playerPet:moveTo(toPosition)
cid:say("Go there!", MESSAGE_EVENT_ORANGE)
return true
end
end
--can't reach destination
return true
else
--don't have pet
end
return true
end
I tested this function with Creatures(Monsters, Npcs and Players) and works well. The only problem is with summons...
Thanks for attention.