Forum

> > CS2D > General > Tibia bug?
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Tibia bug?

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Tibia bug?

Night Till Death
User Off Offline

Zitieren
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!

alt Re: Tibia bug?

Refresh
User Off Offline

Zitieren
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.

alt Re: Tibia bug?

Homer
User Off Offline

Zitieren
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?

alt Re: Tibia bug?

Refresh
User Off Offline

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

alt Re: Tibia bug?

Homer
User Off Offline

Zitieren
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.

alt Re: Tibia bug?

Refresh
User Off Offline

Zitieren
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
3× editiert, zuletzt 21.06.10 15:35:54
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht