GigaStar
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.


______________________________
 
Trang ChínhLatest imagesTìm kiếmĐăng kýĐăng Nhập

 

 Cách tạo 1 số skill trong dota(part1)

Go down 
Tác giảThông điệp
Admin
Admin



Tổng số bài gửi : 9
Join date : 11/04/2011

Cách tạo 1 số skill trong dota(part1) Empty
Bài gửiTiêu đề: Cách tạo 1 số skill trong dota(part1)   Cách tạo 1 số skill trong dota(part1) EmptyMon Apr 11, 2011 12:13 pm

1)blackhole[rand][/rand][/b]

[You must be registered and logged in to see this link.]
scope BlackHole

//******************************************************************************************
//*
//* Blackhole - By hotboy14795(Admin [You must be registered and logged in to see this link.] , Original seen in DotA Allstars
//*
//* Summon a black hole from the darkest abyss, which sucks enemy units into
//* its center, dealing damage over time.
//*
//* Requires:
//* - "TT" trigger copied to your map, if not already there
//* - The "Black Hole" ability copied to your map
//* - The "Black Hole (Dummy)" ability copied to your map
//* - The "Black Hole" buff copied to your map, set as the previous abilities buff
//* - The "Black Hole" unit copied to your map, with the "Black Hole (Dummy)" ability added to it
//* - A vJASS Preprocessor
//*
//******************************************************************************************

globals
// Config. Globals:
private constant integer abil_id = 'A002' // Black Hole ability rawcode
private constant integer dummy_id = 'u000' // Black Hole unit rawcode
private constant real pull = 1.75 // Distance pulled/interval
private constant boolean fight = false // Whether units can fight against the pull
private constant string sfx = "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" // Effect created on pulled units

// Needed Globals:
public trigger Trigger = null // Output trigger will be BlackHole_Trigger, which can be used publically
private group G = CreateGroup()
private player P = null
private real X
private real Y
endglobals
// Config. Functions:
private function Range takes integer lvl returns real
return 400. // Area for pull/lvl
endfunction
// Damage is found on the Black Hole (Dummy) ability

private struct data
unit hole
unit u
player p
integer lvl
real x
real y
endstruct

private function Conditions takes nothing returns boolean
return GetUnitTypeId(GetSummonedUnit())==dummy_id
endfunction
private function Filt takes nothing returns boolean
return GetWidgetLife(GetFilterUnit())>.405 and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitEnemy(GetFilterUnit(),P)
endfunction
private function Effects takes nothing returns nothing
local real x
local real y
local real ang

set bj_ghoul[25] = GetEnumUnit()
set x = GetUnitX(bj_ghoul[25])
set y = GetUnitY(bj_ghoul[25])
set ang = Atan2(Y-y,X-x)
if fight then
call SetUnitX(bj_ghoul[25],x+pull*Cos(ang))
call SetUnitY(bj_ghoul[25],y+pull*Sin(ang))
else
call SetUnitPosition(bj_ghoul[25],x+pull*Cos(ang),y+pull*Sin(ang))
endif
call DestroyEffect(AddSpecialEffectTarget(sfx,bj_ghoul[25],"origin"))
endfunction
private function Movement takes nothing returns boolean
local data d = TT_GetData()

if GetWidgetLife(d.hole)<.405 then
call d.destroy()
return true
endif

call GroupClear(G)
set P = d.p
set X = d.x
set Y = d.y
call GroupEnumUnitsInRange(G,d.x,d.y,Range(d.lvl),Condition(function Filt))
call ForGroup(G,function Effects)
return false
endfunction
private function Actions takes nothing returns nothing
local data d = data.create()

set d.hole = GetSummonedUnit()
set d.x = GetUnitX(d.hole)
set d.y = GetUnitY(d.hole)
set d.u = GetSummoningUnit()
set d.p = GetOwningPlayer(d.u)
set d.lvl = GetUnitAbilityLevel(d.u,abil_id)
call TT_Start(function Movement,d)
endfunction

//===========================================================================
public function InitTrig takes nothing returns nothing
set Trigger = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( Trigger, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( Trigger, Condition( function Conditions ) )
call TriggerAddAction( Trigger, function Actions )
endfunction

endscope
Về Đầu Trang Go down
https://huongdan.forumvi.com
 
Cách tạo 1 số skill trong dota(part1)
Về Đầu Trang 
Trang 1 trong tổng số 1 trang
 Similar topics
-
» Cách tạo 1 số skill passive trong dota
» Cách tạo 1 số skill trong dota(part2)
» Cách tạo 1 số skill trong dota(part3)
» CÁC CÁCH SỬA MOVINAND CHO NHỮNG AI LÀ NẠN NHÂN CỦA H1DROID

Permissions in this forum:Bạn không có quyền trả lời bài viết
GigaStar :: Huong dan :: Huong dan ve game :: Game offline-
Chuyển đến