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(part2)

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(part2) Empty
Bài gửiTiêu đề: Cách tạo 1 số skill trong dota(part2)   Cách tạo 1 số skill trong dota(part2) EmptyMon Apr 11, 2011 12:15 pm

2)Ice path

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

//******************************************************************************************
//*
//* Ice Path - By hotboy14795(Admin [You must be registered and logged in to see this link.] - Original seen in DotA Allstars
//*
//* Creates a path of ice in front of the caster, which promptly explodes, freezing
//* units nearby.
//*
//* Requires:
//* - "TT", "ABC" and "ABCT" triggers copied to your map, if not already there
//* - The "Ice Path" ability copied to your map
//* - The "Ice Path" unit copied to your map
//* - A vJASS Preprocessor
//*
//******************************************************************************************

globals
private constant integer abil_id = 'A004' // Ice Path ability rawcode
private constant integer dummy_id = 'e001' // Ice Path unit rawcode
private constant real space = 100. // Space between each ice block
private constant real life = .75 // Duration of each created ice block (seconds)
private constant integer counter = 2 // How many timer runs must pass before a new ice block is created, added this in since with TT you cannot specificy dynamically timer speed, and speed is not a physical value in the spell, so this allows you to create blocks at multiples of your TT_PERIOD
private constant string create_sfx = "Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl" // Effect on ice blocks when created
private constant string death_sfx = "Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathMissile.mdl" // Effect during ice blocks death

private location L = null
private unit Dum = null
private integer Lvl
private group G = CreateGroup()
public trigger Trigger = null // Output trigger will be IcePath_Trigger, which can be used publically
endglobals
private function Number takes integer lvl returns integer
return 10 // Ice blocks created/lvl
endfunction
private function Area takes integer lvl returns real
return 175. // Stun area/lvl
endfunction
private function Duration takes integer lvl returns real
return .5*lvl // Stun duration/lvl
endfunction

private struct data
unit u
player p
real x
real y
real xl
real yl
real ang
real cos
real sin
integer count = 0
integer total
integer lvl

group grp
endstruct

private function Conditions takes nothing returns boolean
return GetSpellAbilityId()==abil_id
endfunction
private function Movement takes nothing returns boolean
local data d = TT_GetData()
local real x
local real y

set d.count = d.count + 1
if d.count>(d.total*counter)+counter then
call d.destroy()
return true
endif

if ModuloInteger(d.count,counter)!=1 or d.count/counter==0 then
return false
endif

set x = d.x+((d.count/counter)*space)*d.cos
set y = d.y+((d.count/counter)*space)*d.sin
set Dum = CreateUnit(d.p,dummy_id,x,y,GetRandomReal(0.,360.))
call UnitApplyTimedLife(Dum,'BTLF',life)
call SetUnitUserData(Dum,d.lvl)
call DestroyEffect(AddSpecialEffect(create_sfx,x,y))

return false
endfunction
private function Actions takes nothing returns nothing
local data d = data.create()
set L = GetSpellTargetLoc()

set d.u = GetTriggerUnit()
set d.p = GetOwningPlayer(d.u)
set d.x = GetUnitX(d.u)
set d.y = GetUnitY(d.u)
set d.xl = GetLocationX(L)
set d.yl = GetLocationY(L)
set d.ang = Atan2(d.yl - d.y, d.xl - d.x)
set d.cos = Cos(d.ang)
set d.sin = Sin(d.ang)
set d.lvl = GetUnitAbilityLevel(d.u,abil_id)
set d.total = Number(d.lvl)
call TT_Start(function Movement,d)

call RemoveLocation(L)
endfunction

private function Death_Conditions takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit())==dummy_id
endfunction
private function Filt takes nothing returns boolean
return not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))
endfunction
private function UnStun_Child takes nothing returns nothing
call PauseUnit(GetEnumUnit(),false)
endfunction
private function UnStun takes nothing returns boolean
local data d = ABCT_GetData()

call ForGroup(d.grp,function UnStun_Child)
call DestroyGroup(d.grp)
call d.destroy()
return true
endfunction
private function Stun takes nothing returns nothing
call PauseUnit(GetEnumUnit(),true)
endfunction
private function Death_Actions takes nothing returns nothing
local data d = data.create()

set Dum = GetTriggerUnit()
set Lvl = GetUnitUserData(Dum)
call GroupClear(G)
call GroupEnumUnitsInRange(G,GetUnitX(Dum),GetUnitY(Dum),Area(Lvl),Condition(function Filt))
call ForGroup(G,function Stun)

set d.grp = CreateGroup()
call GroupAddGroup(G,d.grp)
call ABCT_Start(function UnStun,d,Duration(Lvl))
call DestroyEffect(AddSpecialEffect(death_sfx,GetUnitX(Dum),GetUnitY(Dum)))
endfunction

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

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

call TriggerRegisterAnyUnitEventBJ(trig , EVENT_PLAYER_UNIT_DEATH)
call TriggerAddAction(trig , function Death_Actions)
call TriggerAddCondition(trig , Condition(function Death_Conditions))
endfunction

endscope
Về Đầu Trang Go down
https://huongdan.forumvi.com
 
Cách tạo 1 số skill trong dota(part2)
Về Đầu Trang 
Trang 1 trong tổng số 1 trang
 Similar topics
-
» Cách tạo 1 số skill trong dota(part1)
» Cách tạo 1 số skill passive trong dota
» 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