Jump to content
  • 0

Range/LoS Check workaround in LUA for casting creatures


cabfever

Question

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! :)

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

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

Link to comment
Share on other sites

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