//I Created xe dummy by Vexorian in your Object, Just create trigger and copy this in your trigger: //! runtextmacro RunXeUnit()
//! textmacro RunXeUnit
//! external ObjectMerger w3u ewsp xeca unam "xe unit" uhpm 1 uabi Aloc,Aeth, umdl "war3mapImported\dummy.mdx" uico "ReplaceableTextures\CommandButtons\BTNtemp.blp" usid 1 usin 1 unsf "(Caster System?)" uble 0.00 ucbs 0.00 umxp 0.00 umxr 0.00 uimz 0.00 ulpz 0.00 uprw 1.00 uspa "" udty Divine umvs 522 ucol 0.00 ufoo 0 uhom 1 umpi 1000 umpm 1000 umpr 1.00 urac Commoner utyp "" ubui "" upgr "" utub "http://wc3campaigns.net/vexorian-External By Elphis" utip ""
//! endtextmacro
//---------------------------------------------
//
//
//! zinc
//
//
//---------------------------------------------
//
library DestructableHurt requires TimerUtils
{
public struct D
{
real dur;
real damage;
real w;
real l;
destructable d;
effect e;
//
static method Loop()
{
thistype this = GetTimerData(GetExpiredTimer());
if(GetWidgetLife(d) > 0.425)
{
if(w > 0)
w = w - l;
else
{
dur = dur - l;
SetDestructableLife(d,GetDestructableLife(d) - damage);
if (dur <= 0)
{
ReleaseTimer(GetExpiredTimer());
DestroyEffect(e);
d = null;
destroy();
}
}
}
else
{
ReleaseTimer(GetExpiredTimer());
DestroyEffect(e);
d = null;
destroy();
}
}
//
static method DesHurt (real wait,destructable p,real dura,real dam,real ls,string ef)
{
thistype this;
if (GetWidgetLife(p) > 0.425)
{
this = allocate();
dur = dura;
damage = dam;
d = p;
l = ls;
w = wait;
e = AddSpecialEffect(ef,GetDestructableX(d),GetDestructableY(d));
TimerStart(NewTimerEx(this),l,true,function thistype.Loop);
}
}
}
}
//
library SJS requires TimerUtils,AaD
{
constant real time = .032;
public struct J
{
real Fly;
real Dis;
real ins;
boolean kill;
unit U;
real High;
real d;
real Highsettings;
real Timer;
boolean Ag;
real ag;
boolean Jumpag;
boolean rem;
string EfEnd;
//
real savehigh;
boolean blockhig;
real timeblocking;
//
static method onLoopJ()
{
thistype this = GetTimerData(GetExpiredTimer());
if(GetWidgetLife(U) > 0.425)
{
if(d > 0)
d = d - time;
else
{
if (Fly > 0)
{
if(Fly >= savehigh)
{
Timer = Timer + 180/(Dis / 30.);
Fly = Sin(Timer*bj_DEGTORAD)*Highsettings*1.3;
if(blockhig && Fly > savehigh)
savehigh = Fly;
if (Ag == false)
SetUnitFlyHeight(U,Fly,0.);
else
SetUnitFlyHeight(U,Fly/ag,0.);
}
else
{
if(timeblocking > 0)
timeblocking = timeblocking - .032500000;
else
{
blockhig = false;
savehigh = 0.;
}
}
}
else
if (Jumpag == true)
{
Ag = true;
ag = ag + 1;
Fly = 1.;
Timer = 1.;
if (ag > 3.)
{
if(kill && !rem)
KillUnit(U);
if(!kill && rem && ins <= 0)
RemoveUnit(U);
if(!kill && rem && ins > 0)
Dum.Remove(U,ins);
UnitAddAbility(U,'Amrf');
UnitRemoveAbility(U,'Amrf');
SetUnitFlyHeight(U,0.,GetUnitDefaultFlyHeight(U));
DestroyEffect(AddSpecialEffect(EfEnd,GetUnitX(U),GetUnitY(U)));
U = null;
EfEnd = null;
ReleaseTimer(GetExpiredTimer());
destroy();
}
}
else
{
if(kill && !rem)
KillUnit(U);
if(!kill && rem && ins <= 0)
RemoveUnit(U);
if(!kill && rem && ins > 0)
Dum.Remove(U,ins);
UnitAddAbility(U,'Amrf');
UnitRemoveAbility(U,'Amrf');
SetUnitFlyHeight(U,0.,GetUnitDefaultFlyHeight(U));
DestroyEffect(AddSpecialEffect(EfEnd,GetUnitX(U),GetUnitY(U)));
U = null;
EfEnd = null;
ReleaseTimer(GetExpiredTimer());
destroy();
}
}
}
else
{
if(kill && !rem)
KillUnit(U);
if(!kill && rem && ins <= 0)
RemoveUnit(U);
if(!kill && rem && ins > 0)
Dum.Remove(U,ins);
UnitAddAbility(U,'Amrf');
UnitRemoveAbility(U,'Amrf');
SetUnitFlyHeight(U,0.,GetUnitDefaultFlyHeight(U));
U = null;
EfEnd = null;
ReleaseTimer(GetExpiredTimer());
destroy();
}
}
//
static method Jumping(real delay,boolean blockhe,real pauhe,unit wunit,real hei,string XJ,string EJ,boolean jumpags,boolean rems,boolean kills,real inss)
{
thistype this;
if(GetWidgetLife(wunit) > 0.425 && GetUnitFlyHeight(wunit) <= GetUnitDefaultFlyHeight(wunit)+10)
{
this = allocate();
U = wunit;
Timer = 0.;
Fly = 1.;
blockhig = blockhe;
timeblocking = pauhe;
ins = inss;
d = delay;
rem = rems;
kill = kills;
Dis = hei;
savehigh = 0.;
Jumpag = jumpags;
Ag = false;
ag = 0.5;
EfEnd = EJ;
DestroyEffect(AddSpecialEffect(XJ,GetUnitX(U),GetUnitY(U)));
High = 0.4;
Highsettings = Dis*High;
UnitAddAbility(U,'Amrf');
UnitRemoveAbility(U,'Amrf');
TimerStart(NewTimerEx(this),.032500000,true,function thistype.onLoopJ);
}
}
}
}
//
library AaD
{
public function Distance(real xa,real ya,real xb,real yb) -> real
{
real dx = xb - xa;
real dy = yb - ya;
return SquareRoot(dx * dx + dy * dy);
}
//
public function Angle(real xa,real ya,real xb,real yb) -> real
{
return bj_RADTODEG * Atan2(yb - ya, xb - xa);
}
}
//
library DummRemove requires TimerUtils
{
public struct Dum
{
unit u;
//
static method Loop()
{
thistype this = GetTimerData(GetExpiredTimer());
RemoveUnit(u);
u = null;
ReleaseTimer(GetExpiredTimer());
destroy();
}
//
static method Remove(unit whatunit,real dura) -> unit
{
thistype this = allocate();
u = whatunit;
TimerStart(NewTimerEx(this),dura,false,function thistype.Loop);
return whatunit;
}
}
}
//
library Linked requires TimerUtils
{
public struct LL
{
unit u;
unit tg;
lightning l;
boolean linked;
real time;
real x;
real y;
real w;
//
static method Loop()
{
thistype this = GetTimerData(GetExpiredTimer());
if(GetWidgetLife(u) > 0.425)
{
if(w > 0)
w = w - .04;
else
{
if(!linked)
MoveLightningEx(l,true,GetUnitX(u),GetUnitY(u),GetUnitFlyHeight(u),x,y,0.);
else
MoveLightningEx(l,true,GetUnitX(u),GetUnitY(u),GetUnitFlyHeight(u),GetUnitX(tg),GetUnitY(tg),GetUnitFlyHeight(tg));
//
if(time > 0)
time = time - .04;
else
{
DestroyLightning(l);
ReleaseTimer(GetExpiredTimer());
u = null;
destroy();
}
}
}
else
{
DestroyLightning(l);
ReleaseTimer(GetExpiredTimer());
u = null;
destroy();
}
}
//
static method LLSU(real wait,unit us,unit tgs,string ls,real times)
{
thistype this = allocate();
u = us;
tg = tgs;
time = times;
w = wait;
linked = true;
l = AddLightning(ls,true,GetUnitX(u),GetUnitY(u),x,y);
TimerStart(NewTimerEx(this),.04,true,function thistype.Loop);
}
}
}
//
library CheckRawcodeAvailable
{
public struct Check
{
//This system check rawcode unit available in your object
static method RawcodeUnit(integer i) -> unit
{
unit u;
//
u = CreateUnit(Player(15),i,0,0,0);
if(u != null)
{
RemoveUnit(u);
debug BJDebugMsg("This rawcode not null");
}
else
debug BJDebugMsg("This rawcode is null");
return u;
}
}
}
//! endzinc