Forum

> > CS2D > General > Tibia bug?
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Tibia bug?

7 replies
To the start Previous 1 Next To the start

old Re: Tibia bug?

Night Till Death
User Off Offline

Quote
i had the same problem like that. Its not much of a bug but still does need fixin. Did you edit the monsters.lua? if yes check it there might be some ,.*")({} missing. or just redownload and reinstall the tibia mod like i did!

old Re: Tibia bug?

Refresh
User Off Offline

Quote
hmm I tried. The problem is at

addhook("attack", "MONSTERattack")
function MONSTERattack(id)
     if gettile(PLAYERS[id].x, PLAYERS[id].y).SAFE then
          return
     end
     if inarray({400, 401, 402, 403, 404}, PLAYERS[id].Equipment[7]) then
          message(id, "You may not attack on a horse.")
          return
     end
     local weapon, closest = player(id, 'weapontype')
     for _, m in ipairs(MONSTERS) do
          local x, y = player(id, 'x'), player(id, 'y')
          local dist = math.sqrt((m.x-x)^2+(m.y-y)^2)
          if dist <= (closest and closest[2] or (CONFIG.WEAPONRANGE[weapon] or CONFIG.WEAPONRANGE[50])) then
               local rot = player(id, 'rot')
               if math.abs(math.rad(rot) - math.atan2(y-m.y, x-m.x) + math.pi/2)%(2*math.pi) <= (CONFIG.WEAPONWIDTH[weapon] or CONFIG.WEAPONRANGE[50]) then
                    closest = {m, dist}
               end
          end
     end
     if closest then
          closest[1]:damage(id, math.ceil(20*((PLAYERS[id].Level+50)*PLAYERS[id].tmp.atk/closest[1].def)/math.random(60, 140)), weapon)
     end
end

But I dont know what is problem.

old Re: Tibia bug?

Homer
User Off Offline

Quote
It's in functions section, not monsters, so it would only occur if a function was called in that section, so it's probably something you edited, probably a bad function or improper name in it's occurence, I would suggest printing the line that it says has the error?

old Re: Tibia bug?

Refresh
User Off Offline

Quote
Error at line 5 at
addhook("attack", "MONSTERattack")
but I still dont know.

old Re: Tibia bug?

Homer
User Off Offline

Quote
Ah, the error occurs due to the fact that when you try to call the gettile function, it goes to functions.lua which has the gettile functiont here, and it tries to find the tilezone, I think though, that because there are some complications with the values and such that are exchanged to the table TILEZONE, it creates sometimes the problem to index a nil value. I would just ignore it, shouldn't change too much.

old Re: Tibia bug?

Refresh
User Off Offline

Quote
I just maked a bigger map and changed that the monsters can spawn everywhere. And it worked, I dont know why are it dont work now.

So I need what to do now?

Edit 2:
Cool. now it have bug with the original monsters lua too

Edit 3:
Bug fixed. I forgot to drop a } at a monster.
Thanks all
edited 3×, last 21.06.10 03:35:54 pm
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview