Cần giúp WE

Dark_DragonKing

Mr & Ms Pac-Man
Khi tôi lam spell Scatter shot(Dward Sniper) vói Burowed Strike(sand king),trong may phiên bản củ thì
kô viêc gi.Nhưng đến phiên bản footmen kingdom 6.6 thì khi cast spell ở khoảng cách xa sẻ bị bugs.Khi cast gẩn,giết unit thì nhận được tiền đuợc tiền,còn khi tôi cast chưởng ơ khoảng cách xa thì lại kô nhận được tiền.Tôi cho rằng đây kô phải là bugs cua code JASS,mà là bugs cua chương trinh WE tui dang sử dụng.
Ai có thể giúp tôi khắc phuc bugs náy thi tôi xin cảm ơn nhiều

Bản 5.9 ko bugs http://epicwar.com/maps/64364/ cast chuong scatter shot(Dward Sniper) hoặc burowed strike(sand king) thì vẫn nhận được tiền.
Còn đây la bản 6.6 http://epicwar.com/maps/67773/ cast chuong scatter shot(Dward Sniper) hoặc burowed strike(sand king) thì kô được tiền.
 
CODE JASS
scope ScatterShot

globals
private integer abil_id = 'Shot' // ScatterShot ability rawcode
private integer dum_id = 'ehBN' // ScatterShot unit rawcode
private integer dum2_id = 'eXXZ' // ScatterShot (Effect) unit rawcode
endglobals
private function GetShots takes integer lvl returns integer
return 1+3*lvl // Number of shots/lvl
endfunction
private function Distance takes nothing returns real
return GetRandomReal(0.,360.) // Min to max distance for area
endfunction

private function Conditions takes nothing returns boolean
return GetSpellAbilityId()==abil_id
endfunction
private function Actions takes nothing returns nothing
local location l = GetSpellTargetLoc()
local real xl = GetLocationX(l)
local real yl = GetLocationY(l)
local real dist
local real ang
local location m
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local integer i = GetShots(GetUnitAbilityLevel(u,abil_id))
local player p = GetOwningPlayer(u)
local unit dum

loop
exitwhen i<=0
set dum = CreateUnit(p,dum_id,x,y,0.)
set dist = Distance()
set ang = GetRandomReal(0.,360.)*bj_DEGTORAD
set m = Location(xl+dist*Cos(ang),yl+dist*Sin(ang))
call IssuePointOrderLoc(dum,"attackground",m)
call UnitApplyTimedLife(dum,'BTLF',.5)
call RemoveLocation(m)
set i = i-1
endloop
set dum = CreateUnit(p,dum2_id,GetUnitX(u),GetUnitY(u),0.)
call SetUnitTimeScale(dum,1.75)
call PolledWait2(.9)
call RemoveUnit(dum)

call RemoveLocation(l)
set l = null
set dum = null
endfunction

//===========================================================================
public function InitTrig takes nothing returns nothing
local trigger trig = CreateTrigger( )

call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction( trig, function Actions )
call TriggerAddCondition(trig,Condition(function Conditions))
endfunction

endscope


scope Burrowstrike

globals
private integer abil_id = 'ASTR' // Burrowstrike ability rawcode
private integer dum1_id = 'ABUR' // BSImaple (1) ability rawcode
private integer dum2_id = '2STR' // BSImaple (2) ability rawcode
private integer dum3_id = '3STR' // BSImaple (3) ability rawcode
private integer dum4_id = '4STR' // BSImaple (4) ability rawcode
private integer dum5_id = '5STR' // BSImaple (5) ability rawcode
private integer dum6_id = '6STR' // BSImaple (6) ability rawcode
private integer dum7_id = '7STR' // BSImaple (7) ability rawcode
endglobals

private function Conditions takes nothing returns boolean
return GetSpellAbilityId()==abil_id
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer lvl = GetUnitAbilityLevel(u,abil_id)
local location l = GetSpellTargetLoc()
local location lu = GetUnitLoc(u)
local real ang = AngleBetweenPoints(lu,l)
local unit dum = CreateUnitAtLoc(GetOwningPlayer(u),CasterUnitId,lu,ang)
local integer id

if lvl==1 then
set id = dum1_id
elseif lvl==2 then
set id = dum2_id
elseif lvl==3 then
set id = dum3_id
elseif lvl==4 then
set id = dum4_id
elseif lvl==5 then
set id = dum5_id
elseif lvl==6 then
set id = dum6_id
else
set id = dum7_id
endif

call UnitAddAbility(dum,id)
call SetUnitAbilityLevel(dum,id,R2I(DistanceBetweenPoints(lu,l))/100)
call IssuePointOrderByIdLoc(dum,OrderId("impale"),l)
call UnitApplyTimedLife(dum,'BTLF',1.)
call PolledWait2((DistanceBetweenPoints(lu,l)/4000.))
call SetUnitX(u,SafeX(GetLocationX(l)))
call SetUnitY(u,SafeY(GetLocationY(l)))
call SetUnitAnimation(u,"morph ALTERNATE")

call RemoveLocation(l)
set l = null
call RemoveLocation(lu)
set lu = null
set dum = null
endfunction

//===========================================================================
public function InitTrig takes nothing returns nothing
local trigger trig = CreateTrigger( )

call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction( trig, function Actions )
call TriggerAddCondition(trig,Condition(function Conditions))
call PreLoadAbil(dum1_id)
call PreLoadAbil(dum2_id)
call PreLoadAbil(dum3_id)
call PreLoadAbil(dum4_id)
call PreLoadAbil(dum5_id)
call PreLoadAbil(dum6_id)
call PreLoadAbil(dum7_id)
endfunction

endscope
 
call PolledWait2(.9)
call RemoveUnit(dum)
Có khi nào remove unit trước khi nó do dmg thì sẽ ko nhận được credit? Bác thử dùng BTLF như bt mọi người vẫn dùng xem :D.
 
Có khi nào remove unit trước khi nó do dmg thì sẽ ko nhận được credit? Bác thử dùng BTLF như bt mọi người vẫn dùng xem :D.

Nhưng mà ơ những phiên bản cũ,spell hoạt động rất tốt,dù cast xa hay gần.

Mai tui sẽ gưi map demo với chiêu scatter shot bugs.Các bạn co thể vào war test luôn.Sau đó có thể xai WE helper save lai và test lần 2.Nếu kô bugs thì attach map đó lên gium tui,Thanks

Còn nếu kô được thì tui còn bân 6.6zxcv hình như kô bugs.Mà rất lạ là save vao sau đó chơi lại vẫn hoàn hảo.Nhưng mỗi cái là làm lại rất lâu do mỗi phiên bản tui sửa rất nhiều bugs.

Có thể là bugs khi save WE làm hỏng mất map.
 
Back
Top