Jump to content

avoid falling damage


kergudu
 Share

Recommended Posts

Some classes has spells to avoid falling damage. For example, priest has "Levitate". Problem is to detect when this spell required

1) declare global LUA variable in additional C# code 

string fallTime=Lua.LuaDoString("fallTime=nil","fallTime");

2) add spell "Levitate", with options:

Can move during cast = Yes; Cast if mounted = true; Cast spell on = player; Combat only = false

3) add conditions for this spell:

- Buff (Name=Levitate, Need=false)

- Lua script, with return var "falling" and return value research "ok"

falling="no"
if(IsFalling()) then
  if (fallTime==nil) then
    fallTime=GetTime()
  elseif (GetTime()-fallTime>=1) then
    falling="ok" 
  end
else
  fallTime=nil
end

Thats all. When priest falls more than 1 second, bot automatically buffs him. Now you can queue Arathi Basin and go def LM :smile:

But not all

Spoiler

Other classes has chance too. Go to Gatzetdan and buy a lot of Noggenfogger Elixir. And now is time to hack it

1) first step is the same

2) Instead "Levitate" add LUA code, with the same options and timer=3000

UseItemByName("Noggenfogger Elixir")

3) Use the same conditions, and 1 more. This is LUA script with return var "need" and return value research "y":

need="y"
for i=1,40 do
 local n,_,_,_,_,_,x,_,_,_,id=UnitBuff("player",i)
 if n and id==16593 and x>1 then
  need="n"
  fallTime=nil
  break
 end
end

Now you have 33% chance to survive. Or acquare strange look. Or both :wacko:

Link to comment
Share on other sites

52 minutes ago, camelot10 said:

 ObjectManager.Me.IsFallingFar

It would be nice to have C# conditions in fight class editor, but for now there is only LUA. Of course, in C# fight class ObjectManager.Me.IsFallingFar is the best choice

Link to comment
Share on other sites

1 hour ago, ivanra said:

It would be nice to have C# conditions in fight class editor, but for now there is only LUA. Of course, in C# fight class ObjectManager.Me.IsFallingFar is the best choice

You can use C# with the condition name "C Sharp Code"

Link to comment
Share on other sites

11 hours ago, Droidz said:

You can use C# with the condition name "C Sharp Code"

Indeed. So, no need for 1), and for 3) C# conditions are

ObjectManager.Me.IsFallingFar && !Me.HaveBuff("Levitate") // for levitate or some other levitate spells/trinkets

ObjectManager.Me.BuffTimeLeft(new List<uint> {16593}) < 1000 // for Noggenfogger Elixir

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...