Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetDistanceBetweenPositions (X1, Y1, Z1, X2, Y2, Z2)
- return math.sqrt(math.pow(X2 - X1, 2) + math.pow(Y2 - Y1, 2) + math.pow(Z2 - Z1, 2));
- end
- local icon_eff_smart = "Interface\\Icons\\inv_misc_herb_talandrasrose"
- NeP.Actions:Add("CastEfflorescenceAuto", function(eval)
- eval.exe = function(eva)
- if not NeP.DSL:Get("toggle")(nil, "EffloAuto") or NeP.DSL:Get('area.friendly')("player",'40') ==1 then return false end
- local tempTable = {}
- for _, Obj in pairs(NeP.OM:Get('Friendly')) do if NeP.DSL:Get('exists')(Obj.key) and NeP.DSL:Get("inRange")(Obj.key) and NeP.DSL:Get("alive")(Obj.key) then
- tempTable[#tempTable+1] = {
- key = Obj.key,
- MostUnits = NeP.DSL:Get('area.friendly')(Obj.key,'10')
- }
- end end
- table.sort( tempTable, function(a,b) return a.MostUnits > b.MostUnits end)
- local counter = 0
- for index in pairs(tempTable) do
- counter = counter + 1 end
- if counter > 1 then
- local X5,Y5,Z5 = ObjectPosition("player")
- local X1,Y1,Z1 = ObjectPosition(tempTable[1].key)
- local X2,Y2,Z2 = ObjectPosition(tempTable[2].key)
- local X3,Y3,Z3 = ObjectPosition(tempTable[3].key)
- local X4,Y4,Z4 = ObjectPosition(tempTable[4].key)
- if GetDistanceBetweenPositions(X1,Y1,Z1,X4,Y4,Z4) <10 and GetDistanceBetweenPositions(X1,Y1,Z1,X5,Y5,Z5 ) <40 then
- CastBetweenUnits(tempTable[1].key,tempTable[4].key,"Efflorescence")
- NeP.ActionLog:Add("Auto Ground Cast", "Casting Efflorescence near", icon_eff_smart, tempTable[4].key) elseif
- GetDistanceBetweenPositions(X1,Y1,Z1,X3,Y3,Z3) <10 and GetDistanceBetweenPositions(X1,Y1,Z1,X5,Y5,Z5) <40 then
- CastBetweenUnits(tempTable[1].key,tempTable[3].key,"Efflorescence")
- NeP.ActionLog:Add("Auto Ground Cast", "Casting Efflorescence near", icon_eff_smart, tempTable[3].key) elseif
- GetDistanceBetweenPositions(X1,Y1,Z1,X2,Y2,Z2) <10 and GetDistanceBetweenPositions(X1,Y1,Z1,X5,Y5,Z5) <40 then
- CastBetweenUnits(tempTable[1].key,tempTable[2].key,"Efflorescence")
- NeP.ActionLog:Add("Auto Ground Cast", "Casting Efflorescence near", icon_eff_smart, tempTable[2].key)
- return true end end end return true end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement