thealmightydude / avesta74111

Automatically exported from code.google.com/p/avesta74
0 stars 0 forks source link

NPCs Fatal Problem #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
They wont stop talking to you if you switch floors ;p

Original issue reported on code.google.com by owntibia...@googlemail.com on 15 Jul 2012 at 8:11

GoogleCodeExporter commented 8 years ago
fix:

    function NpcHandler:isInRange(cid)
           if (isPlayer(cid) == TRUE) then
         local distance = getDistanceBetween(getCreaturePosition(getNpcCid()), getCreaturePosition(cid)) or -1
                -- local direction = getCreatureLookDirection(getNpcCid())
              if(cid == self.focus) and (direction == EAST or direction == WEST) then
                 return (distance <= self.talkRadius+1)
          elseif (distance ~= -1) then
         return (distance <= self.talkRadius)
              end
           end
    end

Original comment by otclient...@gmail.com on 15 Jul 2012 at 6:24

GoogleCodeExporter commented 8 years ago
Avesta doesn't uses Jiddo NPC System.

FIX;

function getDistanceToCreature(id)
    if id == 0 or id == nil then
        return nil
    end

    local creaturePosition = getCreaturePosition(id)
    cx = creaturePosition.x
    cy = creaturePosition.y
    cz = creaturePosition.z
    if cx == nil then
        return nil
    end

    sx, sy, sz = selfGetPosition()
    if cz ~= sz then
        return 10000000
    end
    return math.max(math.abs(sx - cx), math.abs(sy - cy))
end

Original comment by owntibia...@googlemail.com on 15 Jul 2012 at 10:53

GoogleCodeExporter commented 8 years ago
No, it does. But probably you don't know how to do it.

Original comment by otclient...@gmail.com on 16 Jul 2012 at 12:39

GoogleCodeExporter commented 8 years ago
Might be fixed, didn't test it much.

Original comment by r...@ymail.com on 17 Jul 2012 at 6:25

GoogleCodeExporter commented 8 years ago
necro, how to make avesta work with jiddo's npc system??

Original comment by asyv.15....@gmail.com on 13 Jun 2014 at 11:07