- Joined
- Nov 7, 2007
- Messages
- 8
Hi, ok i get the Axes code from Dota and i want to use this spell using the handle vars or cs_cache , tables. Can anyone help me with this? please
JASS:
// A0O1 = Wild Axes
function Trig_Beastmaster_Spell_WildAxes_Conditions takes nothing returns boolean
if(GetSpellAbilityId()=='A0O1')then
return true
endif
return false
endfunction
function kdkd takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
// A04R = Marker
// A0O1 = Wild Axes
function kDkD takes unit Emm,real x,real y,group kee returns nothing
local group fAA=CreateGroup()
local unit fzz
local rect kEE=Rect(x-150,y-150,x+150,y+150)
call GroupEnumUnitsInRange(fAA,x,y,150,null)
loop
set fzz=FirstOfGroup(fAA)
exitwhen fzz==null
if(IsUnitInGroup(fzz,kee)==false and IsUnitEnemy(fzz,GetOwningPlayer(Emm)) and IsUnitVisible(fzz,GetOwningPlayer(Emm)))then
if(GetUnitAbilityLevel(fzz,'A04R')!=1 and GetUnitState(fzz,UNIT_STATE_LIFE)>0 and IsUnitType(fzz,UNIT_TYPE_STRUCTURE)==false)then
call GroupAddUnit(kee,fzz)
call UnitDamageTarget(Emm,fzz,60+GetUnitAbilityLevel(Emm,'A0O1')*30,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_METAL_HEAVY_SLICE)
call AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl",fzz,"overhead")
endif
endif
call GroupRemoveUnit(fAA,fzz)
endloop
call EnumDestructablesInRect(kEE,null,function kdkd)
call RemoveRect(kEE)
call DestroyGroup(fAA)
endfunction
function kfkf takes nothing returns nothing
local string fTT=H2S(GetExpiredTimer())
local unit kFF=GetStoredDTAXUnit(fTT,"Axe")
local unit fyy=GetStoredDTAXUnit(fTT,"Hero")
local real Axx=GetStoredDTAXReal(fTT,"Ax")
local real Ayy=GetStoredDTAXReal(fTT,"Ay")
local real Cxx=GetStoredDTAXReal(fTT,"Cx")
local real Cyy=GetStoredDTAXReal(fTT,"Cy")
local real Bxx=GetStoredDTAXReal(fTT,"Bx")
local real Byy=GetStoredDTAXReal(fTT,"By")
local real a=GetStoredDTAXReal(fTT,"a")
local real b=1-a
local boolean kgg=GetStoredDTAXBoolean(fTT,"FirstPass")
local group kee=GetStoredDTAXGroup(fTT,"AlreadyDamaged")
call SetUnitX(kFF,IsXInPlayeableArea(Axx*a*a+Bxx*2*a*b+Cxx*b*b))
call SetUnitY(kFF,IsYInPlayeableArea(Ayy*a*a+Byy*2*a*b+Cyy*b*b))
call kDkD(fyy,GetUnitX(kFF),GetUnitY(kFF),kee)
if(kgg)then
call StoreDTAXReal(fTT,"a",a-.02)
else
call StoreDTAXReal(fTT,"a",a+.02)
call StoreDTAXReal(fTT,"Ax",GetUnitX(fyy))
call StoreDTAXReal(fTT,"Ay",GetUnitY(fyy))
endif
if(a<0 and kgg)then
call StoreDTAXBoolean(fTT,"FirstPass",false)
call StoreDTAXReal(fTT,"Bx",Axx+300*Cos(Atan2(Cyy-Ayy,Cxx-Axx)+GetStoredDTAXReal(fTT,"AngleOffset")))
call StoreDTAXReal(fTT,"By",Ayy+300*Sin(Atan2(Cyy-Ayy,Cxx-Axx)+GetStoredDTAXReal(fTT,"AngleOffset")))
endif
if(a>1 and kgg==false)then
call PauseTimer(GetExpiredTimer())
call DestroyGroup(kee)
call FlushStoredMissionShell(fTT)
call RemoveUnit(kFF)
call PolledWait(.1)
call DestroyTimer(GetExpiredTimer())
endif
endfunction
// e01T = Boomerang
// Amrf = Crow Form
function Trig_Beastmaster_Spell_WildAxes_Actions takes nothing returns nothing
local unit Emm=GetTriggerUnit()
local real Axx=GetUnitX(Emm)
local real Ayy=GetUnitY(Emm)
local real Cxx=GetLocationX(GetSpellTargetLoc())
local real Cyy=GetLocationY(GetSpellTargetLoc())
local unit khh=CreateUnit(GetOwningPlayer(Emm),'e01T',Axx,Ayy,270.)
local unit kHH=CreateUnit(GetOwningPlayer(Emm),'e01T',Axx,Ayy,270.)
local string kii
local string kII
local timer kjj=CreateTimer()
local timer kJJ=CreateTimer()
call UnitAddAbility(khh,'Amrf')
call UnitRemoveAbility(khh,'Amrf')
call SetUnitFlyHeight(khh,150,0)
call UnitAddAbility(kHH,'Amrf')
call UnitRemoveAbility(kHH,'Amrf')
call SetUnitFlyHeight(kHH,150,0)
set kii=H2S(kjj)
call StoreDTAXObject(kii,"Hero",Emm)
call StoreDTAXObject(kii,"Axe",khh)
call StoreDTAXObject(kii,"AlreadyDamaged",CreateGroup())
call StoreDTAXReal(kii,"Ax",Axx)
call StoreDTAXReal(kii,"Ay",Ayy)
call StoreDTAXReal(kii,"Cx",Cxx)
call StoreDTAXReal(kii,"Cy",Cyy)
call StoreDTAXReal(kii,"Bx",Axx+300*Cos(Atan2(Cyy-Ayy,Cxx-Axx)+45))
call StoreDTAXReal(kii,"By",Ayy+300*Sin(Atan2(Cyy-Ayy,Cxx-Axx)+45))
call StoreDTAXReal(kii,"a",1)
call StoreDTAXReal(kii,"AngleOffset",-45)
call StoreDTAXBoolean(kii,"FirstPass",true)
set kII=H2S(kJJ)
call StoreDTAXObject(kII,"Hero",Emm)
call StoreDTAXObject(kII,"Axe",kHH)
call StoreDTAXObject(kII,"AlreadyDamaged",CreateGroup())
call StoreDTAXReal(kII,"Ax",Axx)
call StoreDTAXReal(kII,"Ay",Ayy)
call StoreDTAXReal(kII,"Cx",Cxx)
call StoreDTAXReal(kII,"Cy",Cyy)
call StoreDTAXReal(kII,"Bx",Axx+300*Cos(Atan2(Cyy-Ayy,Cxx-Axx)-45))
call StoreDTAXReal(kII,"By",Ayy+300*Sin(Atan2(Cyy-Ayy,Cxx-Axx)-45))
call StoreDTAXReal(kII,"a",1)
call StoreDTAXReal(kII,"AngleOffset",45)
call StoreDTAXBoolean(kII,"FirstPass",true)
call TimerStart(kjj,.035,true,function kfkf)
call TimerStart(kJJ,.035,true,function kfkf)
endfunction
function StartTrigger_Beastmaster_Spell_WildAxes takes nothing returns nothing
set gg_trg_Beastmaster_Spell_WildAxes=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Beastmaster_Spell_WildAxes,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Beastmaster_Spell_WildAxes,Condition(function Trig_Beastmaster_Spell_WildAxes_Conditions))
call TriggerAddAction(gg_trg_Beastmaster_Spell_WildAxes,function Trig_Beastmaster_Spell_WildAxes_Actions)
endfunction
function InitTrig_Beastmaster_Spell_WildAxes takes nothing returns nothing
endfunction