|
[codes=这个是为了方便加的jass]globals
handle H
code C
trigger T
integer I
constant gamecache RGC=InitGameCache("|cffc5d43ecccty1l|r")
endglobals
//! define DEff(e) DestroyEffect(e)
//! define AEff(mod,x,y) AddSpecialEffect(mod,x,y)
//! define AEffT(mod,target,point) AddSpecialEffectTarget(mod,target,point)
//! define Eff(mod,x,y) DestroyEffect(AEff(mod,x,y))
//! define EffT(mod,target,point) DestroyEffect(AEffT(mod,target,point))
//! define SetInt(arr,s,val) StoreInteger(RGC,arr,s,val)
//! define SetInts(arr,s,val) StoreInteger(RGC,arr,s,val+GetStoredInteger(RGC,arr,s))
//! define SetBoolean(arr,s,val) StoreBoolean(RGC,arr,s,val)
//! define SetReal(arr,s,val) StoreReal(RGC,arr,s,val)
//! define SetString(arr,s,val) StoreString(RGC,arr,s,val)
//! define GetInt(arr,s) GetStoredInteger(RGC,arr,s)
//! define GetBoolean(arr,s) GetStoredBoolean(RGC,arr,s)
//! define GetIf(arr,s) if(GetStoredBoolean(RGC,arr,s))then
//! define GetOr(arr,s) elseif(GetStoredBoolean(RGC,arr,s))then
//! define GetReal(arr,s) GetStoredReal(RGC,arr,s)
//! define GetString(arr,s) GetStoredString(RGC,arr,s)
//! define FreeString(s) FlushStoredMission(RGC,s)
//! define Freei(arr,s) FlushStoredInteger(RGC,arr,s)
//! define Freer(arr,s) FlushStoredReal(RGC,arr,s)
//! define Frees(arr,s) FlushStoredString(RGC,arr,s)
//! define Freeb(arr,s) FlushStoredBoolean(RGC,arr,s)
//! define IsI(arr,s) HaveStoredInteger(RGC,arr,s)
//! define IsR(arr,s) HaveStoredReal(RGC,arr,s)
//! define IsS(arr,s) HaveStoredString(RGC,arr,s)
//! define IsB(arr,s) HaveStoredBoolean(RGC,arr,s)
//! define If(b) if(b)then
function SetHandle takes string arr,string s,handle val returns nothing
local integer I
local handle H=val
call SetInt(arr,s,I)
set I=0
endfunction
function SetCode takes string arr,string s,code val returns nothing
local integer I
local code C=val
call SetInt(arr,s,I)
set I=0
endfunction
function GetCode takes string arr,string s returns code
return GetInt(arr,s)
return null
endfunction
function GetUnit takes string arr,string s returns unit
return GetInt(arr,s)
return null
endfunction
function GetItem takes string arr,string s returns item
return GetInt(arr,s)
return null
endfunction
function GetDest takes string arr,string s returns destructable
return GetInt(arr,s)
return null
endfunction
function GetGroup takes string arr,string s returns group
return GetInt(arr,s)
return null
endfunction
function GetTimer takes string arr,string s returns timer
return GetInt(arr,s)
return null
endfunction
function GetTd takes string arr,string s returns timerdialog
return GetInt(arr,s)
return null
endfunction
function GetTrigger takes string arr,string s returns trigger
return GetInt(arr,s)
return null
endfunction
function GetTc takes string arr,string s returns triggercondition
return GetInt(arr,s)
return null
endfunction
function GetEffect takes string arr,string s returns effect
return GetInt(arr,s)
return null
endfunction
function GetLightning takes string arr,string s returns lightning
return GetInt(arr,s)
return null
endfunction
function GetBoolexpr takes string arr,string s returns boolexpr
return GetInt(arr,s)
return null
endfunction[/codes]
后面的Get各种的东西不是特别需要,我也没有添加全....
以下是模板。
[codes=jass]globals
trigger Damage_trigger
group Damage_group
endglobals
//! define Damage_maxN 750
function Damage_trg takes string s,conditionfunc c returns nothing
local trigger t
if(not IsI(s,"trigger"))then
set t=CreateTrigger()
call SetHandle(s,"trigger",t)
call SetHandle(s,"condition",c)
call SetHandle(s,"triggerc",TriggerAddCondition(t,c))
call SetHandle(s,"group",CreateGroup())
endif
set t=null
endfunction
function Damage_gro takes nothing returns nothing
local unit u=GetEnumUnit()
If(GetUnitState(u,UNIT_STATE_LIFE)>0)
call TriggerRegisterUnitEvent(Damage_trigger,u,EVENT_UNIT_DAMAGED)
call GroupAddUnit(Damage_group,u)
endif
set u=null
endfunction
function Damage_Remtrg takes string s returns nothing
local trigger T
local integer I=GetInt(s,"trigger")
If(I!=0)
call TriggerRemoveCondition(T,GetTc(s,"triggerc"))
call DestroyTrigger(T)
call DestroyGroup(GetGroup(s,"group"))
call FreeString(s)
endif
set I=0
endfunction
function Damage_trg1 takes string s,group g returns nothing
local trigger t=GetTrigger(s,"trigger")
call TriggerRemoveCondition(t,GetTc(s,"triggerc"))
call DestroyTrigger(t)
set Damage_trigger=CreateTrigger()
set Damage_group=CreateGroup()
call ForGroup(g,function Damage_gro)
call DestroyGroup(g)
call SetHandle(s,"triggerc",TriggerAddCondition(Damage_trigger,GetBoolexpr(s,"condition")))
call SetHandle(s,"trigger",Damage_trigger)
call SetHandle(s,"group",Damage_group)
set t=null
endfunction
function Damage_AddUnit takes string s,unit u returns nothing
local trigger T
local integer I=GetInt(s,"trigger")
local group g
local integer maxN
If(I!=0)
set g=GetGroup(s,"group")
If(not IsUnitInGroup(u,g) and g!=null)
set maxN=GetInt(s,"maxN")
call GroupAddUnit(g,u)
if(maxN<Damage_maxN)then
call TriggerRegisterUnitEvent(T,u,EVENT_UNIT_DAMAGED)
call SetInt(s,"maxN",maxN+1)
else
call Damage_trg1(s,g)
call SetInt(s,"maxN",0)
endif
endif
endif
set I=0
set g=null
endfunction[/codes]
没什么创新的地方。
演示里面有6个不同的技能,分别是
1,魅惑魔女     推进
2,熊猫喷后眩晕单位
3,隐形刺客     背刺
4,裂魂人       巨力重击
5,幻影长矛手   并列
6,WOW牧师    真言术:盾
当然,都是山寨的,使用的同一个模板,起码以后做这一类的技能可以简单一些。
编辑器是Wehepler,大家自己看看演示吧,觉得有用的同学就收着吧。
没什么详细的介绍,此贴我修改了多次,全都删了。 |
评分
-
查看全部评分
|