Jump to content

Range/LoS Check workaround in LUA for casting creatures


cabfever

Recommended Posts

Posted

Hey everybody,

I talked with Antz and we got an idea how the range/LoS problem could be fixed by a workaround in lua until we get a propper fix in c++.

It should look something like this:

If {npc}:IsWithinLoS({player}) = false

{npc}:StopSpellCast()

{npc}:MoveChase({player})

But I can't speak LUA so I cant attach this to all creatures.

So I need your help! :)

Posted

Maybe something like this?

function all_creatures(pUnit, Event)
if unit:IsWithinLoS == false then
unit:StopSpellCast()
unit:MoveChase(Player)
end
end

function CREATURE_MoveInLOS(event, creature, unit)
if (unit:IsWithinLoS == false)  then
if (unit:GetUnitType() == "Player" and creature:IsWithinDistInMap(unit, 15) and unit:IsInAccessiblePlaceFor(creature)) then
creature:MoveChase(Player)
end
end
end

  • 2 months later...
Posted

This wouldn't necessarily work as the methods are simply exposed core functions. If those core functions do not work by default, then this probably won't either. What exactly is the said issue though?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use