|
主要是想来GA发帖了.所以发一下我写的渣代码....好吧..如果是新人看不懂,没有关系..只要知道我正面说明的马甲特效.改一下ID就可以了.重要的参数已经说明了.
需要 ydwe编辑器..不然的话不支持zinc的语法..
[jass]
//技能
constant integer ABILITY ='A004';
//马甲单位特效
Type[0]='u000';
Type[1]='u001';
Type[2]='u002';
Type[3]='u003';
Type[4]='u004';
//持续时间
life=10;
//随机大小的上下限
real dis=GetRandomReal(100,400);
[/jass]
[jass]
//! zinc
library FivePointedStar requires YDWETimerSystem
{
constant integer ABILITY ='A004';
string Linght[];
integer Type[];
function action()
{
unit m;
unit u=GetTriggerUnit();
real x=GetUnitX(u);
real y=GetUnitY(u);
real la,ax,ay,ox[],oy[],height,life;
real dis=GetRandomReal(100,400);
integer indx;
real Rindx;
boolean bl=true;
integer a,b;
string linght=Linght[GetRandomInt(0,12)];
integer typ=Type[GetRandomInt(0,4)];
lightning l;
life=10;
for(la=6;la<=360;la+=6)
{
ax=x+dis*Cos(la*3.14159/180.0);
ay=y+dis*Sin(la*3.14159/180.0);
m=CreateUnit(GetOwningPlayer(u),typ,ax,ay,0);
UnitApplyTimedLife(m,'bhwe',life);
//BJDebugMsg(R2S(la));
Rindx=la/72;
if (Rindx==1||Rindx==2||Rindx==3||Rindx==4||Rindx==5)
{
indx=R2I(Rindx);
ox[indx]=ax;
oy[indx]=ay;
BJDebugMsg(I2S(indx));
}
}
a=1;b=3;
height=GetUnitFlyHeight(m);
while(bl)
{
BJDebugMsg(I2S(a));
l=AddLightningEx(linght,true,ox[a],oy[a],height,ox,oy,height);
YDWETimerDestroyLightning(life,l);
if (b-a<3)
{b+=1;
}
else
{
a+=1;
if (a==3)
{
l=AddLightningEx(linght,true,ox[a],oy[a],height,ox[5],oy[5],height);
YDWETimerDestroyLightning(life,l);
bl=false;
}
}
}
u=null;
m=null;
}
function condition()->boolean
{
return GetSpellAbilityId() == ABILITY;
}
function onInit()
{trigger t=CreateTrigger();
TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT);
TriggerAddAction(t,function action);
TriggerAddCondition(t,function condition);
t=null;
Linght[0] = "CLPB" ;
Linght[1] = "CLSB" ;
Linght[2] = "DRAB" ;
Linght[3] = "DRAM" ;
Linght[4] = "AFOD" ;
Linght[5] = "FORK" ;
Linght[6] = "HWPB" ;
Linght[7] = "HWSB" ;
Linght[8] = "CHIM" ;
Linght[9] = "LEAS" ;
Linght[10] = "MBUR" ;
Linght[11] = "MFPB" ;
Linght[12] = "SPLK";
Type[0]='u000';
Type[1]='u001';
Type[2]='u002';
Type[3]='u003';
Type[4]='u004';
}
}
//! endzinc
[/jass] |
评分
-
查看全部评分
|