Topic hỏi đáp (tập 4) về cách làm map

Status
Không mở trả lời sau này.
^^: Về cơ bản cách làm là đúng. Giờ chỉ việc chuyển phần đầu xuống phần Timer là xong.

^: Tham khảo cái System Extended Inventory System c?a Tom Jones. Và nếu đang dùng patch 1.24 thì phải thay đổi phần code trong library ExtendedInventorySystem bằng:
[spoil]
Mã:
library ExtendedInventorySystem 
//#######################################################################################
//#Extended Inventory System v1.5c - By Tom Jones.
//#######################################################################################
//#Requirements:
//#1) NewGen Editor with JassHelper v0.9.G.1
//#
//#Implementation:
//#1) Copy/paste this trigger from this map to your map.
//#
//#Usage:
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call ExtendUnitInventory(unit,size) returns boolean
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   This will extends a unit's inventory with the size given. Returns true if
//#   succesful, false if the unit already has extended inventory. Size should be
//#   divisable by six.
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call InventoryDisable(unit,boolean)
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call InventoryDisabled(unit) returns boolean
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call InventoryAutomove(unit,boolean) 
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   This will enable automoving of items from the main inventory to the extended
//#   inventory.
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call InventoryAutomoves(unit) returns boolean
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call InventoryAddItem(unit,item,integer) returns item 
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   Sends an item to or removes an item from the extended inventory. Integer determines 
//#   which page the item should be added to. Note that adding an item to a hidden page
//#   will remove the given item and the item returned can't be seen by UnitHasItem(...), 
//#   UnitItemInSlot(...), etc.
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call InventoryGetItemById(unit,integer) returns item
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   Returns the first item in the inventory that meets the integer argument.
//#   Note that the integer can be either a slot id ranging from 0 to the size of the 
//#   extended inventory or an item rawcode.
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call InventoryHasItemById(unit,integer) returns boolean
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   Integer argument can be both a slot id ranging from 0 to the size of the extended
//#   inventory or an item rawcode.
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call InventoryHasItem(unit,item) returns boolean
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call InventoryDisplayPage(unit,integer)
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   Displays the page equal to the integer argument. Each page has six slots and 
//#   their id range from 1 to size of the extended inventory. Page ids not in this range
//#   will display the main inventory, page id 1 displays the main inventory.
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call InventoryGetPage(unit) returns integer
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   Returns the id of the currently displayed page.
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call SetMaxStackById(integer id,integer value) 
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   Requires Extended Inventory Item Stack module.
//#
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   call SetMaxStackById(integer,integer) 
//#   ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//#   Requires Extended Inventory Item Stack module.
//#
//#Notes:
//#1) This system wont require you to predefine any items. It does however rely on 
//#   bug, and should thus be used with care. 
//#2) The bug: UnitAddItemToSlotById(...) is able to take a negative value as argument.
//#   The interesting part is that items added this way wont appear on the hero, however
//#   their effects will. Also note that not all negative values can be used. Values -1
//#   to -12 will cause a memeory reference error on exit. Values below -21 will cause a
//#   critical error.
//#3) Please report any bugs or errors by PM'ing me on [url]www.TheHelper.net[/url] or posting them
//#   in this thread:
//#
//#Changelog:
//#   v1.00a - Initial draft.
//#   v1.2b  - Release.
//#   v1.5a  - Changes to the source code.
//#            Added Extended Inventory Stack v1.1
//#            Added Extended Inventory IconTag v1.1
//#            Changed Example B.
//#   v1.5c  - Changed InventoryAddItem(unit,item,boolean) to InventoryAddItem(unit,item,integer)
//#            Changes to the source code to accomodate the above change.
//#            Added Extended Inventory Item Stack v.1.2
//#
//#######################################################################################

//#######################################################################################
//#Extended Inventory System API.
//#######################################################################################
private keyword inventory

function UnitExtendInventory takes unit u, integer size returns boolean
    if u:inventory > 0 then
        return false
    endif
    call inventory.extend(u,size)
    return true
endfunction

function InventoryDisable takes unit u, boolean flag returns nothing
    call u:inventory.disable(flag)
endfunction

function InventoryDisabled takes unit u returns boolean
    return u:inventory.disabled
endfunction

function InventoryAutomove takes unit u, boolean flag returns nothing
    set u:inventory.automove = flag
endfunction

function InventoryAutomoves takes unit u returns boolean
    return u:inventory.automove
endfunction

function InventoryAddItem takes unit u, item whichitem, integer page returns item
    return u:inventory.additem(whichitem,page)
endfunction

function InventoryGetItemById takes unit u, integer id returns item 
    return u:inventory.getitem(id)
endfunction

function InventoryHasItemById takes unit u, integer id returns boolean
    local inventory this = u:inventory
    local integer i = 0
    
    loop
        exitwhen this.getitem(id) != null or i == this.size
        set i = i+1
    endloop
    return i < this.size
endfunction

function InventoryHasItem takes unit u, item whichitem returns boolean
    local inventory this = u:inventory
    local integer i = 0
    
    loop
        exitwhen this.getitem(i) == whichitem or i == this.size
        set i = i+1
    endloop
    return i < this.size
endfunction

function InventoryDisplayPage takes unit u, integer page returns nothing
    call u:inventory.turnpage(page)
endfunction

function InventoryGetPage takes unit u returns integer
    return u:inventory.page
endfunction

function SetMaxStackById takes integer id, integer max returns nothing
    call inventory.setstack(id,max)
endfunction

function GetMaxStackById takes integer id returns integer
    return inventory.getstack(id)
endfunction

//#######################################################################################
//#Hashing.
//#######################################################################################
globals
    private constant integer DEDUCT = 0x100000
    private constant integer HASH = 8192
endglobals

//#######################################################################################
//#Slot type.
//#######################################################################################
public struct slot 
    static slot last = 0
    slot next
    inventory current
    item thisitem
    integer itemid
    integer charges
    integer page
    integer id
    boolean free

    method operator item= takes item whichitem returns nothing
        if whichitem != null and .last == this then
            set .last = 0
            set .thisitem = whichitem
        elseif whichitem == null and .last != this then
            set .thisitem = null
            set .itemid = 0
            set .charges = 0
            set .free = true
        elseif whichitem != null then
            set .itemid = GetItemTypeId(whichitem)
            set .charges = GetItemCharges(whichitem)
            set .last = this
            call RemoveItem(whichitem)
            if .current.page == .page   then
                call UnitAddItemToSlotById(.current.u,.itemid,.id-(6*(.page-1)))
            else
                call UnitAddItemToSlotById(.current.u,.itemid,-13)
            endif
            call SetItemCharges(.thisitem,.charges)
        endif
        set .free = .item == null
    endmethod
    method operator item takes nothing returns item
        return .thisitem
    endmethod
    
    method update takes nothing returns nothing
        set .thisitem = UnitItemInSlot(.current.u,.id-(6*(.page-1)))
        set .itemid = GetItemTypeId(.thisitem)
        set .free = .thisitem == null
    endmethod
endstruct

//#######################################################################################
//#Inventory type.
//######################################################################################
private struct modules
    method itemstack takes item whichitem returns integer
        return 0
    endmethod
    static method setstack takes integer id, integer max returns nothing
    endmethod
    static method getstack takes integer id returns integer
        return 0
    endmethod
    
    method icontag takes item whichitem, integer id returns nothing
    endmethod
endstruct

private struct inventory 
    private static integer index
    private static integer array value
    private trigger trig
    integer pages
    slot first
    slot last
    unit u
    player p
    integer page
    boolean automove 
    boolean disabled
    integer size
    delegate modules addons

    implement optional ItemStack
    implement optional IconTag
        
    static method operator []= takes unit u, inventory value returns nothing
        set .index = GetHandleId(u)-DEDUCT
        set .value[.index-(.index/HASH)*HASH] = value
    endmethod
    static method operator [] takes unit u returns inventory
        set .index = GetHandleId(u)-DEDUCT
        return .value[.index-(.index/HASH)*HASH]
    endmethod
    
    static method Delegator takes nothing returns boolean 
        local inventory this = GetTriggerUnit():inventory
        
        if .disabled then
        elseif GetTriggerEventId() == EVENT_UNIT_PICKUP_ITEM then 
            call inventory.onAquire.execute()
        elseif GetTriggerEventId() == EVENT_UNIT_DROP_ITEM then 
            call inventory.onDrop.execute()
        endif
        return false
    endmethod
    
    private method updatepage takes integer page returns nothing
        local slot s = .first
        
        loop
            exitwhen s == 0
            if s.id >= 6*(page-1) and s.id < 6*page then
                call s.update()
            endif
            set s = s.next
        endloop
    endmethod
    
    method additem takes item whichitem, integer page returns item
        local slot s
        local integer pages = .pages
        local integer id
        
        if whichitem == null or .disabled then
            if .disabled then
                debug call BJDebugMsg("Extended Inventory Error: Disabled.")
            else
                debug call BJDebugMsg("Extended Inventory Error: Passing null as argument.")
            endif
            return null
        endif
        call .updatepage(.page)
        set s = .itemstack(whichitem)
        if s > 0 then
            return s.item
        else
            set s = .first
        endif
        loop
            if (s.id >= 6*(page-1) and s.id < 6*page) then
                if s.free or s.item == whichitem then
                    exitwhen true
                endif
            endif
            if s.id+1 >= 6*page then
                set page = page+1
                set pages = pages-1
            endif
            if page > .pages  then
                set page = pages
                set s = .first
            else
                set s = s.next
            endif
            if s == 0 or pages == 0 then
                return null
            endif
        endloop
        if s.page != .page then
            call .icontag(whichitem,1)
        endif
        set s.item = whichitem
        return s.item
    endmethod
    
    method getitem takes integer id returns item
        local slot s = .first
        
        if id < .size then
            loop
                exitwhen s.id == id or s == 0
                set s = s.next
            endloop
        elseif id >= '0000' then
            loop
                exitwhen s.itemid == id
                set s = s.next
            endloop
        else
            return null
        endif
        return s.item
    endmethod
    
    method turnpage takes integer page returns nothing
        local integer oldpage = .page
        local slot a = .first
        local slot b = .first
    
        if page == oldpage then
            return
        elseif page > .pages or page == 0 then
            set page = 1
        endif
        set .page = page
        loop
            exitwhen a.page == oldpage or a == 0
            set a = a.next
        endloop
        loop
            exitwhen b.page == page or b == 0
            set b = b.next
        endloop
        call .updatepage(oldpage)
        call .icontag(null,0)
        loop
            exitwhen a.id == oldpage*6 or b.id == page*6
            if a.item != null then
                set a.item = a.item
            endif
            if b.item != null then
                set b.item = b.item
            endif
            set a = a.next
            set b = b.next
        endloop
    endmethod
    
    method disable takes boolean flag returns nothing
        local slot s
        local real x
        local real y
        
        if flag then
            set s = .first
            set x = GetUnitX(.u)
            set y = GetUnitY(.u)
            loop
                exitwhen s == 0
                if s.page > 1 then
                    call CreateItem(s.itemid,x,y)
                    call RemoveItem(s.item)
                endif
                set s = s.next
            endloop
            call DisableTrigger(.trig)
        else
            call EnableTrigger(.trig)
            set .page = 1
            call .updatepage(1)
        endif
        set .disabled = flag
    endmethod
    
    static method extend takes unit u, integer size returns nothing
        local inventory this = inventory.allocate()
        local integer i = 0
        local slot s
        
        set .u = u
        set .u:inventory = this
        set .p = GetOwningPlayer(.u)
        set .size = size+6
        set .pages = .size/6
        set .page = 1
        loop
            exitwhen i == .size
            set s = slot.create()
            set s.current = this
            if .last == 0 then
                set .first = s
            else
                set .last.next = s
            endif
            set s.page = 1+(i/6)
            set s.id = i
            set s.free = s.item == null
            set .last = s
            set i = i+1
        endloop
        set .trig = CreateTrigger()
        call TriggerRegisterUnitEvent(.trig,.u,EVENT_UNIT_PICKUP_ITEM)
        call TriggerRegisterUnitEvent(.trig,.u,EVENT_UNIT_DROP_ITEM)
        call TriggerAddCondition(.trig,Condition(function inventory.Delegator))
        set .disabled = false
        set .automove = false
        set .addons = modules.create()
        call .updatepage(1)
    endmethod
    
    static method onAquire takes nothing returns nothing
        local inventory this = GetTriggerUnit():inventory
        local item whichitem = GetManipulatedItem()
        
        if slot.last > 0 then   
            set slot.last.item = whichitem
        else
            if .automove then
                call .additem(whichitem,.page+1)
            else
                call .additem(whichitem,.page)
            endif
        endif
        set whichitem = null
    endmethod
        
    static method onDrop takes nothing returns nothing
        local inventory this = GetTriggerUnit():inventory
        local item whichitem = GetManipulatedItem()
        local slot s = .first

        loop
            exitwhen s.item == whichitem or s == 0
            set s = s.next
        endloop
        set s.item = null
        set whichitem = null
    endmethod
endstruct
endlibrary
[/spoil]
 
Chỉnh sửa cuối:
Ai giúp mình tạo trig như vầy nhe : khi Hero tăng 1 lv thì creep cũng tăng 1 lv, mình ko biết viết thế nào cho hợp lý và leakless

đang có trigger thế nào rồi?
----
Enrage attach ở dưới đó
 

Attachments

Của word editor sai rồi ^^ Làm như wordeditor nó chỉ tính dame lúc đầu thôi,trong khi máu tụt xuống hoặc nâng lên thì dame cũng phải thay đổi theo cơ.

Cách làm là mỗi 0,04s đó nếu unit có buff Enrage thì remove lượng dame đã cộng cho nó rồi add lại cho nó lượng dame = số máu hiện tại * với (4+level Enrage)/100 ^^ xong set lượng dame đã cộng = lượng dame vừa cộng đó,dùng 1 cái hashtable dễ ợt.

Vì hôm qua khi làm cái spell này thì lúc ấy chỉ mới xem mấy bài trước đó, ai ngờ khi làm xong lại có thêm cái vụ giảm theo hp :-o ( mà hình như Ursa trong DotA đâu có vụ giảm damage theo hp nhỉ :-?? )
Làm như luci cứ mỗi 0.04s remove và add thì có thể có nguy cơ lag, nên mình làm thêm cái check Hp :)
Và đây là Enrage đã fix [..]
 

Attachments

Chỉnh sửa cuối:
Trong dota unti ursa có giảm hay tăng dmg theo hp trong khi đang được buff đó bác.
 
đang có trigger thế nào rồi?
----
Enrage attach ở dưới đó

Cũng tương tự cách này mình làm ra luôn Empowering Haste để ví dụ
Mã:
[URL="http://www.mediafire.com/?nmmf2woj2x2"]Empowering Haste[/URL]


---------- Post added at 12:27 ---------- Previous post was at 11:46 ----------

à cho hỏi cách làm cái 3 4 5 6 attack của skill overpower mình set integer đủ kiểu nhưng vẫn ko đc
 
mỗi lần đùng skill overpower thì set Integer = 0

rồi làm 1 trigger thế này

E
A unit is attacked

C
Attacking unit has buff Overpower equal to true

E
Set Integer = Integer + 1
If
Integer = 2 + (1 x Level of Overpower for Attacking Unit)
Then
Remove buff Overpower from Attacking Unit
Else
Do nothing
 
mỗi lần đùng skill overpower thì set Integer = 0

rồi làm 1 trigger thế này

E
A unit is attacked

C
Attacking unit has buff Overpower equal to true

E
Set Integer = Integer + 1
If
Integer = 2 + (1 x Level of Overpower for Attacking Unit)
Then
Remove buff Overpower from Attacking Unit
Else
Do nothing

Mình thử rồi! Trigger của bạn chính xác rồi. Thế ai làm được cái change voltex color của neither Strike k?

---------- Post added at 14:08 ---------- Previous post was at 13:15 ----------

mỗi lần đùng skill overpower thì set Integer = 0

rồi làm 1 trigger thế này

E
A unit is attacked

C
Attacking unit has buff Overpower equal to true

E
Set Integer = Integer + 1
If
Integer = 2 + (1 x Level of Overpower for Attacking Unit)
Then
Remove buff Overpower from Attacking Unit
Else
Do nothing

Bạn có map cụ thể ko? mình thấy nhiều lúc vẫn bị lỗi
 
YAN[asian];15493066 nói:
Mình chưa hiểu chỗ tạo 4 skill +1 +10 +100 +1000 và cách dùng chúng, ai giải thích hộ cái!

Thế này nhé, trong war, dùng lệnh add ability damage giống nhau thì nó sẽ không stack (Add 10 lần ability +1 damage thì nó vẫn +1 damage thôi). Vì thế ta mới tạo ra 4 skill, mỗi skill có 9 level. Vd skill +1:
Level 1: + 1 damage
Level 2: + 2 damage
....
Level 9: + 9 damage

Và tương tự với skill +10 + 100 +1000
Khi unit cast spell, thì ta lấy chỉ số integer của damage cần add và convert sang string
Nếu độ dài string = 4 thì:
Add (+1000) cho caster và set level của ability là chữ số đầu của string ( hàng nghìn )
Add (+100) cho caster và set level của ability là chữ số thứ 2 của string ( hàng trăm )
Add (+10) cho caster và set level của ability là chữ số thứ 3 của string ( hàng chục )
Add (+1) cho caster và set level của ability là chữ số thứ 4 của string ( hàng đơn vị )
Tương tự nếu độ dài string = 3, 2, 1

Ở đây damage add chỉ có thể max là 9999, nếu muốn damage cao hơn thì tương tự các bạn tạo thêm các ability hàng chục nghìn, hàng triệu,....
Hoặc làm theo cách anh Tom hay hơn là set lên level 10 và để lvl 10 damage = 0, thế sẽ đỡ mất công remove add :D

P/s: Không để ý là anh Tom có post spell, mà sao nặng đến...46kb :-??
Anh Tom cho hỏi cách làm OverPower, dùng các skill base như Berserk thì thấy nó vẫn đánh chậm...hoặc là animation nó giật...
 
Chỉnh sửa cuối:
spell cộng dmg trên thì level đầu là 0 chứ ko phải +1 gì cả

như vậy thì khi ở level 1 thì sẽ cộng 0 damage

khi có buff Enrage, timer sẽ kiểm tra số máu đang có, tính ra số damage được cộng rồi đặt level của các ability cộng dmg cho đúng

ví dụ: cộng 115 damage thì cần:
  • Item Damage Bonus(+100) level 1
  • Item Damage Bonus(+10) level 1
  • Item Damage Bonus(+1) level 5
nhưng do level 1 của các ability này cộng 0 damage nên level thật sẽ phải là:
  • Item Damage Bonus(+100) level 2
  • Item Damage Bonus(+10) level 2
  • Item Damage Bonus(+1) level 6

còn cách tính thì cứ convert ra integer rồi chia thôi, chia số nguyên thì ra số nguyên.

---------------------
@WordEditor, remove add làm gì? anh làm vậy à =))
các ability cộng dmg trên, do nhiều level nên được cho vào unit ability của hero luôn. Nhiều level mà add/remove thì có mà giật tung 8-}
 
Cho em hỏi muốn làm 1 skill dạng stack kiểu như đánh 1 hit slow x%,2 hit y% và 3 hit z%,cap ở 3 hit chẳng hạn thì phải làm như thế nào ạ.
Với cả có thể làm 1 unit A tung hết skill vào mồm unit B đc ko ạ,ví dụ:A có Storm Bolt,Finger of Death,Shadow Strike và Mana burn,khi A dùng 1 trong 4 cái skill trên vào 1 thằng B nào đó sẽ lập tức tung luôn cả 3 skill còn lại vào thằng B ấy luôn
 
Làm thế nào để tớ tính khoảng cách gần nhất nhỉ? ví dụ tớ muốn 1 unit có thể attack cả hero và non-hero nhưng khi spawn ra nếu sẽ tự động tấn công hero gần nhất và chỉ đánh con đó thôi
 
@WordEditor, remove add làm gì? anh làm vậy à =))
các ability cộng dmg trên, do nhiều level nên được cho vào unit ability của hero luôn. Nhiều level mà add/remove thì có mà giật tung 8-}
À không, đấy là cái spell của em.. @-)
Anh Tom chỉ dẫn cách làm cái OverPower sao cho động tác nó nhanh mà không "thiếu" animation
Dùng berserk hay frenzy thì nó đánh không nhanh lắm, và tốc độ animation attack thì chậm
Giảm attack animation thì nó đánh hơi kì, thường là giơ tay lên, vung tới rồi rút lại, đằng này nó chỉ giơ tay rồi gây damage và giơ tay...( Vd: tốc độ animation attack = 1s thì nó chỉ thực hiện cỡ 0.2s đầu ) :-??
 
tốc độ bonus của Berserk hay Frenzy cứ đặt tầm 10.00 đi thì có gì mà không nhanh?
với lại, tốc độ đánh max là 400% thôi, muốn nhanh nữa cũng không nhanh được đâu.

còn về animation thì còn xem cái Cooldown là bao nhiêu, ít quả thì rõ ràng nếu chưa hết animation mà cooldown đã xong -> đánh attack mới thì rõ ràng là ko thấy hết đc animation :-??
 
Các skill Aura, khi unit đi khỏi vùng aura thì vài giây sau (khoảng 3s) mới hết tác dụng. Có cách nào làm cho đi khỏi vùng aura là hết tác dụng ngay lập tức ko?
 
Cho mình hỏi làm sao để gõ Tiếng Việt trong WE ... giống như map Kiếm thế vậy đó :)
 
À không, đấy là cái spell của em.. @-)
Anh Tom chỉ dẫn cách làm cái OverPower sao cho động tác nó nhanh mà không "thiếu" animation
Dùng berserk hay frenzy thì nó đánh không nhanh lắm, và tốc độ animation attack thì chậm
Giảm attack animation thì nó đánh hơi kì, thường là giơ tay lên, vung tới rồi rút lại, đằng này nó chỉ giơ tay rồi gây damage và giơ tay...( Vd: tốc độ animation attack = 1s thì nó chỉ thực hiện cỡ 0.2s đầu ) :-??

Bạn cho thêm .8s casting time xem sao?

[/COLOR]hoặc bạn dùng skill Battle Roar rồi chuyển hết thành 0 xong đổi tên là Overpower Animation thì cứ để nguyên cũng được rồi bạn tạo 1 con dummy cast bloodlust vào con ursa (bloodlust scaling value increase = 0, ms increase=0, as = 4.00, effect sound = none, buff= overpower) làm thế cũng được
 
Chỉnh sửa cuối:
@Yan: Hiện tại ( tớ biết ) có mỗi cách này.
@WE: Giờ chuyển sang cách dùng chia số nguyên đi, tại lúc trước kô biết cách nên mới dùng string, dùng string nó rắc rối hơn chút.
Ví dụ số đó là A

set hangnghin = R2I( A / 1000 )
set A = A - ( hangnghin * 1000 )
set hangtram = R2I( A / 100 )
set A = A - ( hangtram * 100 )
......

R2I là Real To Integer ( Convert từ Real sang Integer ấy ).

Ví dụ số A là 6784.

set hangnghin = A / 1000 = 6784 / 1000 = 6.784, R2I = 6
set A = A - ( hangnghin * 1000 ) = 6784 - 6000 = 784 >> chỉ còn lại hàng trăm
set hangtram = A / 100 = 784 / 100 = 7.84, R2I = 7
set A = A - ( hangtram * 1000 ) = 784 - 700 = 84 >> chỉ còn lại hàng chục
...
 
Ai cho tớ hỏi cái này nhé :D
Nếu tớ tạo 1 spell dùng dummy thì tớ chỉnh cho Hp Regen của dummy là -1 thì sau khi dummy chết thì có cần xài lệnh call_remove... để xóa leak ko ?? :-/
 
Status
Không mở trả lời sau này.
Back
Top