[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Spells


Reply
 
Thread Tools
The Hive Workshop Spells:
Simple Custom Stats System v1.2 [GUI]
Images
Highslide JS
Details
Uploaded:08:43, 3rd Jul 2012
Last Updated:12:58, 18th Jul 2012
Keywords:defskull, custom, stats, system, add, hp, mp, remove, max, armor, sight, range, armor.
Type:System
Category:GUI / Triggers

INTRODUCTIONS
- This system allows you to customize your Units !

- You can customize the Unit's Max Hp/MP, Damage, Armor, Sight Range and many more ! (will be as time passes)

- It's for GUI-friendly and easy to use !


HOW TO USE
External Instructions
- Copy all abilities inside the folder Special in the Object Editor.
- Open World Editor -> File - Preferences... -> General Tab -> Tick the Automatically create unknown variables while pasting trigger data
- Copy the Simple Custom Stats System folder.
- Copy this code into your map header;
CODE
Jass:
function SimError takes nothing returns nothing
    local string msg = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00Value is either too large or too small.|r"
    local player ForPlayer = GetTriggerPlayer()
    if (GetLocalPlayer() == ForPlayer) then
        call ClearTextMessages()
        call DisplayTimedTextToPlayer( ForPlayer, 0.52, 0.96, 2.00, msg )
        call StartSound(udg_Error)
    endif
    set ForPlayer = null
endfunction

function AddHP takes nothing returns nothing
    local integer i = 1
    local integer max = 16383
    if (udg_CS_Value > max) then
        call SimError()
        return
    else
    endif
    loop
        exitwhen i > udg_CS_MaxLoopingBase
        if udg_CS_LoopingBase[i] > udg_CS_Value then
        else
            call UnitAddAbility(udg_CS_Unit, udg_CS_AddHP[i])
            call IncUnitAbilityLevel(udg_CS_Unit, udg_CS_AddHP[i])
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddHP[i])
            set udg_CS_Value = udg_CS_Value - udg_CS_LoopingBase[i]
        endif
        set i = i + 1
    endloop
endfunction

function RemoveHP takes nothing returns nothing
    local integer i = 1
    local integer min = -16383
    if (udg_CS_Value < min) then
        call SimError()
        return
    else
    endif
    loop
        exitwhen i > udg_CS_MaxLoopingBase
        if udg_CS_LoopingBase[i] > udg_CS_Value then
        else
            call UnitAddAbility(udg_CS_Unit, udg_CS_RemoveHP[i])
            call IncUnitAbilityLevel(udg_CS_Unit, udg_CS_RemoveHP[i])
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveHP[i])
            set udg_CS_Value = udg_CS_Value - udg_CS_LoopingBase[i]
        endif
        set i = i + 1
    endloop
endfunction

function AddMP takes nothing returns nothing
    local integer i = 1
    local integer max = 16383
    if (udg_CS_Value > max) then
        call SimError()
        return
    else
    endif
    loop
        exitwhen i > udg_CS_MaxLoopingBase
        if udg_CS_LoopingBase[i] > udg_CS_Value then
        else
            call UnitAddAbility(udg_CS_Unit, udg_CS_AddMP[i])
            call IncUnitAbilityLevel(udg_CS_Unit, udg_CS_AddMP[i])
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddMP[i])
            set udg_CS_Value = udg_CS_Value - udg_CS_LoopingBase[i]
        endif
        set i = i + 1
    endloop              
endfunction

function RemoveMP takes nothing returns nothing
    local integer i = 1
    local integer min = -16383
    if (udg_CS_Value < min) then
        call SimError()
        return
    else
    endif
    loop
        exitwhen i > udg_CS_MaxLoopingBase
        if udg_CS_LoopingBase[i] > udg_CS_Value then
        else
            call UnitAddAbility(udg_CS_Unit, udg_CS_RemoveMP[i])
            call IncUnitAbilityLevel(udg_CS_Unit, udg_CS_RemoveMP[i])
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveMP[i])
            set udg_CS_Value = udg_CS_Value - udg_CS_LoopingBase[i]
        endif
        set i = i + 1
    endloop
endfunction

function AddDamage takes nothing returns nothing
    local integer i = 1
    local integer max = 16383
    set udg_CS_Key = GetHandleId(udg_CS_Unit)
    set udg_CS_DamageValue = LoadInteger(udg_CS_Hashtable, udg_CS_Key, 0)
    set udg_CS_DamageValue = (udg_CS_DamageValue + udg_CS_Value)
    if (udg_CS_DamageValue > max) then
        call SimError()
        return
    else
    endif
    if (udg_CS_DamageValue > 0) then
        call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 0, udg_CS_DamageValue)
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddDamage[i])
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveDamage[i])
            set i = i + 1
        endloop
        set i = 1
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            if (udg_CS_LoopingBase[i] > udg_CS_DamageValue) then
            else
                call UnitAddAbility(udg_CS_Unit, udg_CS_AddDamage[i])
                set udg_CS_DamageValue = (udg_CS_DamageValue - udg_CS_LoopingBase[i])
            endif
            set i = i + 1
        endloop
    else
        if (udg_CS_DamageValue < 0) then
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 0, udg_CS_DamageValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveDamage[i])
                set i = i + 1
            endloop
            set i = 1
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                if (udg_CS_LoopingBase[i] > -udg_CS_DamageValue) then
                else
                    call UnitAddAbility(udg_CS_Unit, udg_CS_RemoveDamage[i])
                    set udg_CS_DamageValue = (udg_CS_DamageValue + udg_CS_LoopingBase[i])
                endif
                set i = i + 1
            endloop
        else
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 0, udg_CS_DamageValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveDamage[i])
                set i = i + 1
            endloop
        endif
    endif
endfunction

function RemoveDamage takes nothing returns nothing
    local integer i = 1
    local integer min = -16383
    set udg_CS_Key = GetHandleId(udg_CS_Unit)
    set udg_CS_DamageValue = LoadInteger(udg_CS_Hashtable, udg_CS_Key, 0)
    set udg_CS_DamageValue = (udg_CS_DamageValue - udg_CS_Value)
    if (udg_CS_DamageValue < min) then
        call SimError()
        return
    else
    endif
    if (udg_CS_DamageValue > 0) then
        call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 0, udg_CS_DamageValue)
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddDamage[i])
            set i = i + 1
        endloop
        set i = 1
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            if (udg_CS_LoopingBase[i] > udg_CS_DamageValue) then
            else
                call UnitAddAbility(udg_CS_Unit, udg_CS_AddDamage[i])
                set udg_CS_DamageValue = (udg_CS_DamageValue - udg_CS_LoopingBase[i])
            endif
            set i = i + 1
        endloop
    else
        if (udg_CS_DamageValue < 0) then
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 0, udg_CS_DamageValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddDamage[i])
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveDamage[i])
                set i = i + 1
            endloop
            set i = 1
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                if (udg_CS_LoopingBase[i] > -udg_CS_DamageValue) then
                else
                    call UnitAddAbility(udg_CS_Unit, udg_CS_RemoveDamage[i])
                    set udg_CS_DamageValue = (udg_CS_DamageValue + udg_CS_LoopingBase[i])
                endif
                set i = i + 1
            endloop
        else
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 0, udg_CS_DamageValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddDamage[i])
                set i = i + 1
            endloop
        endif
    endif
endfunction

function AddArmor takes nothing returns nothing
    local integer i = 1
    local integer max = 16383
    set udg_CS_Key = GetHandleId(udg_CS_Unit)
    set udg_CS_ArmorValue = LoadInteger(udg_CS_Hashtable, udg_CS_Key, 1)
    set udg_CS_ArmorValue = (udg_CS_ArmorValue + udg_CS_Value)
    if (udg_CS_ArmorValue > max) then
        call SimError()
        return
    else
    endif
    if (udg_CS_ArmorValue > 0) then
        call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_ArmorValue)
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddArmor[i])
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveArmor[i])
            set i = i + 1
        endloop
        set i = 1
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            if (udg_CS_LoopingBase[i] > udg_CS_ArmorValue) then
            else
                call UnitAddAbility(udg_CS_Unit, udg_CS_AddArmor[i])
                set udg_CS_ArmorValue = (udg_CS_ArmorValue - udg_CS_LoopingBase[i])
            endif
            set i = i + 1
        endloop
    else
        if (udg_CS_ArmorValue < 0) then
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_ArmorValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveArmor[i])
                set i = i + 1
            endloop
            set i = 1
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                if (udg_CS_LoopingBase[i] > -udg_CS_ArmorValue) then
                else
                    call UnitAddAbility(udg_CS_Unit, udg_CS_RemoveArmor[i])
                    set udg_CS_ArmorValue = (udg_CS_ArmorValue + udg_CS_LoopingBase[i])
                endif
                set i = i + 1
            endloop
        else
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_ArmorValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveArmor[i])
                set i = i + 1
            endloop
        endif
    endif
endfunction

function RemoveArmor takes nothing returns nothing
    local integer i = 1
    local integer min = -16383
    set udg_CS_Key = GetHandleId(udg_CS_Unit)
    set udg_CS_ArmorValue = LoadInteger(udg_CS_Hashtable, udg_CS_Key, 1)
    set udg_CS_ArmorValue = (udg_CS_ArmorValue - udg_CS_Value)
    if (udg_CS_ArmorValue < min) then
        call SimError()
        return
    else
    endif
    if (udg_CS_ArmorValue > 0) then
        call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_ArmorValue)
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddArmor[i])
            set i = i + 1
        endloop
        set i = 1
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            if (udg_CS_LoopingBase[i] > udg_CS_ArmorValue) then
            else
                call UnitAddAbility(udg_CS_Unit, udg_CS_AddArmor[i])
                set udg_CS_ArmorValue = (udg_CS_ArmorValue - udg_CS_LoopingBase[i])
            endif
            set i = i + 1
        endloop
    else
        if (udg_CS_ArmorValue < 0) then
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_ArmorValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddArmor[i])
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveArmor[i])
                set i = i + 1
            endloop
            set i = 1
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                if (udg_CS_LoopingBase[i] > -udg_CS_ArmorValue) then
                else
                    call UnitAddAbility(udg_CS_Unit, udg_CS_RemoveArmor[i])
                    set udg_CS_ArmorValue = (udg_CS_ArmorValue + udg_CS_LoopingBase[i])
                endif
                set i = i + 1
            endloop
        else
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_ArmorValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddArmor[i])
                set i = i + 1
            endloop
        endif
    endif
endfunction

function AddSight takes nothing returns nothing
    local integer i = 1
    local integer max = 16383
    set udg_CS_Key = GetHandleId(udg_CS_Unit)
    set udg_CS_SightValue = LoadInteger(udg_CS_Hashtable, udg_CS_Key, 1)
    set udg_CS_SightValue = (udg_CS_SightValue + udg_CS_Value)
    if (udg_CS_SightValue > max) then
        call SimError()
        return
    else
    endif
    if (udg_CS_SightValue > 0) then
        call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_SightValue)
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddSight[i])
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveSight[i])
            set i = i + 1
        endloop
        set i = 1
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            if (udg_CS_LoopingBase[i] > udg_CS_SightValue) then
            else
                call UnitAddAbility(udg_CS_Unit, udg_CS_AddSight[i])
                set udg_CS_SightValue = (udg_CS_SightValue - udg_CS_LoopingBase[i])
            endif
            set i = i + 1
        endloop
    else
        if (udg_CS_SightValue < 0) then
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_SightValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveSight[i])
                set i = i + 1
            endloop
            set i = 1
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                if (udg_CS_LoopingBase[i] > -udg_CS_SightValue) then
                else
                    call UnitAddAbility(udg_CS_Unit, udg_CS_RemoveSight[i])
                    set udg_CS_SightValue = (udg_CS_SightValue + udg_CS_LoopingBase[i])
                endif
                set i = i + 1
            endloop
        else
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_SightValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveSight[i])
                set i = i + 1
            endloop
        endif
    endif
endfunction

function RemoveSight takes nothing returns nothing
    local integer i = 1
    local integer min = -16383
    set udg_CS_Key = GetHandleId(udg_CS_Unit)
    set udg_CS_SightValue = LoadInteger(udg_CS_Hashtable, udg_CS_Key, 1)
    set udg_CS_SightValue = (udg_CS_SightValue - udg_CS_Value)
    if (udg_CS_SightValue < min) then
        call SimError()
        return
    else
    endif
    if (udg_CS_SightValue > 0) then
        call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_SightValue)
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddSight[i])
            set i = i + 1
        endloop
        set i = 1
        loop
            exitwhen i > udg_CS_MaxLoopingBase
            if (udg_CS_LoopingBase[i] > udg_CS_SightValue) then
            else
                call UnitAddAbility(udg_CS_Unit, udg_CS_AddSight[i])
                set udg_CS_SightValue = (udg_CS_SightValue - udg_CS_LoopingBase[i])
            endif
            set i = i + 1
        endloop
    else
        if (udg_CS_SightValue < 0) then
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_SightValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddSight[i])
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_RemoveSight[i])
                set i = i + 1
            endloop
            set i = 1
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                if (udg_CS_LoopingBase[i] > -udg_CS_SightValue) then
                else
                    call UnitAddAbility(udg_CS_Unit, udg_CS_RemoveSight[i])
                    set udg_CS_SightValue = (udg_CS_SightValue + udg_CS_LoopingBase[i])
                endif
                set i = i + 1
            endloop
        else
            call SaveInteger(udg_CS_Hashtable, udg_CS_Key, 1, udg_CS_SightValue)
            loop
                exitwhen i > udg_CS_MaxLoopingBase
                call UnitRemoveAbility(udg_CS_Unit, udg_CS_AddSight[i])
                set i = i + 1
            endloop
        endif
    endif
endfunction


Internal Instructions
- To add max HP of a unit, simply set which unit to be added and the value to be added, example;
Actions
Set CS_Unit = Paladin 0000 <gen>
Set CS_Value = 1000
Custom script: call AddHP()

- Same goes for other function;
Custom script: call RemoveHP()
Custom script: call AddMP()
Custom script: call RemoveMP()
Custom script: call AddDamage()
Custom script: call RemoveDamage()
Custom script: call AddArmor()
Custom script: call RemoveArmor()
Custom script: call AddSight()
Custom script: call RemoveSight()

- I also included a demo trigger, you should know how to use it in less than 5 seconds.


TRIGGERS
CS Setup
Events
Map initialization
Conditions
Actions
Custom script: local integer maxability = 140
Custom script: local integer i = 1
Custom script: local unit Dummy = CreateUnit(Player (0), 'hfoo', 0.00, 0.00, 0.00)
Custom script: set udg_Error = CreateSoundFromLabel("InterfaceError", false, false, false, 10, 10)
Set CS_AddHP[1] = HP Add +8192
Set CS_AddHP[2] = HP Add +4096
Set CS_AddHP[3] = HP Add +2048
Set CS_AddHP[4] = HP Add +1024
Set CS_AddHP[5] = HP Add +512
Set CS_AddHP[6] = HP Add +256
Set CS_AddHP[7] = HP Add +128
Set CS_AddHP[8] = HP Add +64
Set CS_AddHP[9] = HP Add +32
Set CS_AddHP[10] = HP Add +16
Set CS_AddHP[11] = HP Add +8
Set CS_AddHP[12] = HP Add +4
Set CS_AddHP[13] = HP Add +2
Set CS_AddHP[14] = HP Add +1
Set CS_RemoveHP[1] = HP Remove -8192
Set CS_RemoveHP[2] = HP Remove -4096
Set CS_RemoveHP[3] = HP Remove -2048
Set CS_RemoveHP[4] = HP Remove -1024
Set CS_RemoveHP[5] = HP Remove -512
Set CS_RemoveHP[6] = HP Remove -256
Set CS_RemoveHP[7] = HP Remove -128
Set CS_RemoveHP[8] = HP Remove -64
Set CS_RemoveHP[9] = HP Remove -32
Set CS_RemoveHP[10] = HP Remove -16
Set CS_RemoveHP[11] = HP Remove -8
Set CS_RemoveHP[12] = HP Remove -4
Set CS_RemoveHP[13] = HP Remove -2
Set CS_RemoveHP[14] = HP Remove -1
Set CS_AddMP[1] = MP Add +8192
Set CS_AddMP[2] = MP Add +4096
Set CS_AddMP[3] = MP Add +2048
Set CS_AddMP[4] = MP Add +1024
Set CS_AddMP[5] = MP Add +512
Set CS_AddMP[6] = MP Add +256
Set CS_AddMP[7] = MP Add +128
Set CS_AddMP[8] = MP Add +64
Set CS_AddMP[9] = MP Add +32
Set CS_AddMP[10] = MP Add +16
Set CS_AddMP[11] = MP Add +8
Set CS_AddMP[12] = MP Add +4
Set CS_AddMP[13] = MP Add +2
Set CS_AddMP[14] = MP Add +1
Set CS_RemoveMP[1] = MP Remove -8192
Set CS_RemoveMP[2] = MP Remove -4096
Set CS_RemoveMP[3] = MP Remove -2048
Set CS_RemoveMP[4] = MP Remove -1024
Set CS_RemoveMP[5] = MP Remove -512
Set CS_RemoveMP[6] = MP Remove -256
Set CS_RemoveMP[7] = MP Remove -128
Set CS_RemoveMP[8] = MP Remove -64
Set CS_RemoveMP[9] = MP Remove -32
Set CS_RemoveMP[10] = MP Remove -16
Set CS_RemoveMP[11] = MP Remove -8
Set CS_RemoveMP[12] = MP Remove -4
Set CS_RemoveMP[13] = MP Remove -2
Set CS_RemoveMP[14] = MP Remove -1
Set CS_AddDamage[1] = Damage Add +8192
Set CS_AddDamage[2] = Damage Add +4096
Set CS_AddDamage[3] = Damage Add +2048
Set CS_AddDamage[4] = Damage Add +1024
Set CS_AddDamage[5] = Damage Add +512
Set CS_AddDamage[6] = Damage Add +256
Set CS_AddDamage[7] = Damage Add +128
Set CS_AddDamage[8] = Damage Add +64
Set CS_AddDamage[9] = Damage Add +32
Set CS_AddDamage[10] = Damage Add +16
Set CS_AddDamage[11] = Damage Add +8
Set CS_AddDamage[12] = Damage Add +4
Set CS_AddDamage[13] = Damage Add +2
Set CS_AddDamage[14] = Damage Add +1
Set CS_RemoveDamage[1] = Damage Remove -8192
Set CS_RemoveDamage[2] = Damage Remove -4096
Set CS_RemoveDamage[3] = Damage Remove -2048
Set CS_RemoveDamage[4] = Damage Remove -1024
Set CS_RemoveDamage[5] = Damage Remove -512
Set CS_RemoveDamage[6] = Damage Remove -256
Set CS_RemoveDamage[7] = Damage Remove -128
Set CS_RemoveDamage[8] = Damage Remove -64
Set CS_RemoveDamage[9] = Damage Remove -32
Set CS_RemoveDamage[10] = Damage Remove -16
Set CS_RemoveDamage[11] = Damage Remove -8
Set CS_RemoveDamage[12] = Damage Remove -4
Set CS_RemoveDamage[13] = Damage Remove -2
Set CS_RemoveDamage[14] = Damage Remove -2
Set CS_AddArmor[1] = Add Armor +8192
Set CS_AddArmor[2] = Add Armor +4096
Set CS_AddArmor[3] = Add Armor +2048
Set CS_AddArmor[4] = Add Armor +1024
Set CS_AddArmor[5] = Add Armor +512
Set CS_AddArmor[6] = Add Armor +256
Set CS_AddArmor[7] = Add Armor +128
Set CS_AddArmor[8] = Add Armor +64
Set CS_AddArmor[9] = Add Armor +32
Set CS_AddArmor[10] = Add Armor +16
Set CS_AddArmor[11] = Add Armor +8
Set CS_AddArmor[12] = Add Armor +4
Set CS_AddArmor[13] = Add Armor +2
Set CS_AddArmor[14] = Add Armor +1
Set CS_RemoveArmor[1] = Remove Armor -8192
Set CS_RemoveArmor[2] = Remove Armor -4096
Set CS_RemoveArmor[3] = Remove Armor -2048
Set CS_RemoveArmor[4] = Remove Armor -1024
Set CS_RemoveArmor[5] = Remove Armor -512
Set CS_RemoveArmor[6] = Remove Armor -256
Set CS_RemoveArmor[7] = Remove Armor -128
Set CS_RemoveArmor[8] = Remove Armor -64
Set CS_RemoveArmor[9] = Remove Armor -32
Set CS_RemoveArmor[10] = Remove Armor -16
Set CS_RemoveArmor[11] = Remove Armor -8
Set CS_RemoveArmor[12] = Remove Armor -4
Set CS_RemoveArmor[13] = Remove Armor -2
Set CS_RemoveArmor[14] = Remove Armor -1
Set CS_AddSight[1] = Add Sight +8192
Set CS_AddSight[2] = Add Sight +4096
Set CS_AddSight[3] = Add Sight +2048
Set CS_AddSight[4] = Add Sight +1024
Set CS_AddSight[5] = Add Sight +512
Set CS_AddSight[6] = Add Sight +256
Set CS_AddSight[7] = Add Sight +128
Set CS_AddSight[8] = Add Sight +64
Set CS_AddSight[9] = Add Sight +32
Set CS_AddSight[10] = Add Sight +16
Set CS_AddSight[11] = Add Sight +8
Set CS_AddSight[12] = Add Sight +4
Set CS_AddSight[13] = Add Sight +2
Set CS_AddSight[14] = Add Sight +1
Set CS_RemoveSight[1] = Remove Sight -8192
Set CS_RemoveSight[2] = Remove Sight -4096
Set CS_RemoveSight[3] = Remove Sight -2048
Set CS_RemoveSight[4] = Remove Sight -1024
Set CS_RemoveSight[5] = Remove Sight -512
Set CS_RemoveSight[6] = Remove Sight -256
Set CS_RemoveSight[7] = Remove Sight -128
Set CS_RemoveSight[8] = Remove Sight -64
Set CS_RemoveSight[9] = Remove Sight -32
Set CS_RemoveSight[10] = Remove Sight -16
Set CS_RemoveSight[11] = Remove Sight -8
Set CS_RemoveSight[12] = Remove Sight -4
Set CS_RemoveSight[13] = Remove Sight -2
Set CS_RemoveSight[14] = Remove Sight -1
Set CS_Ability[1] = Damage Add +1
Set CS_Ability[2] = Damage Add +2
Set CS_Ability[3] = Damage Add +4
Set CS_Ability[4] = Damage Add +8
Set CS_Ability[5] = Damage Add +16
Set CS_Ability[6] = Damage Add +32
Set CS_Ability[7] = Damage Add +64
Set CS_Ability[8] = Damage Add +128
Set CS_Ability[9] = Damage Add +256
Set CS_Ability[10] = Damage Add +512
Set CS_Ability[11] = Damage Add +1024
Set CS_Ability[12] = Damage Add +2048
Set CS_Ability[13] = Damage Add +4096
Set CS_Ability[14] = Damage Add +8192
Set CS_Ability[15] = Damage Remove -1
Set CS_Ability[16] = Damage Remove -2
Set CS_Ability[17] = Damage Remove -4
Set CS_Ability[18] = Damage Remove -8
Set CS_Ability[19] = Damage Remove -16
Set CS_Ability[20] = Damage Remove -32
Set CS_Ability[21] = Damage Remove -64
Set CS_Ability[22] = Damage Remove -128
Set CS_Ability[23] = Damage Remove -256
Set CS_Ability[24] = Damage Remove -512
Set CS_Ability[25] = Damage Remove -1024
Set CS_Ability[26] = Damage Remove -2048
Set CS_Ability[27] = Damage Remove -4096
Set CS_Ability[28] = Damage Remove -8192
Set CS_Ability[29] = Add Armor +1
Set CS_Ability[30] = Add Armor +1024
Set CS_Ability[31] = Add Armor +128
Set CS_Ability[32] = Add Armor +16
Set CS_Ability[33] = Add Armor +2
Set CS_Ability[34] = Add Armor +2048
Set CS_Ability[35] = Add Armor +256
Set CS_Ability[36] = Add Armor +32
Set CS_Ability[37] = Add Armor +4
Set CS_Ability[38] = Add Armor +4096
Set CS_Ability[39] = Add Armor +512
Set CS_Ability[40] = Add Armor +64
Set CS_Ability[41] = Add Armor +8
Set CS_Ability[42] = Add Armor +8192
Set CS_Ability[43] = Remove Armor -1
Set CS_Ability[44] = Remove Armor -1024
Set CS_Ability[45] = Remove Armor -128
Set CS_Ability[46] = Remove Armor -16
Set CS_Ability[47] = Remove Armor -2
Set CS_Ability[48] = Remove Armor -2048
Set CS_Ability[49] = Remove Armor -256
Set CS_Ability[50] = Remove Armor -32
Set CS_Ability[51] = Remove Armor -4
Set CS_Ability[52] = Remove Armor -4096
Set CS_Ability[53] = Remove Armor -512
Set CS_Ability[54] = Remove Armor -64
Set CS_Ability[55] = Remove Armor -8
Set CS_Ability[56] = Remove Armor -8192
Set CS_Ability[57] = HP Add +1
Set CS_Ability[58] = HP Add +1024
Set CS_Ability[59] = HP Add +128
Set CS_Ability[60] = HP Add +16
Set CS_Ability[61] = HP Add +2
Set CS_Ability[62] = HP Add +2048
Set CS_Ability[63] = HP Add +256
Set CS_Ability[64] = HP Add +32
Set CS_Ability[65] = HP Add +4
Set CS_Ability[66] = HP Add +4096
Set CS_Ability[67] = HP Add +512
Set CS_Ability[68] = HP Add +64
Set CS_Ability[69] = HP Add +8
Set CS_Ability[70] = HP Add +8192
Set CS_Ability[71] = HP Remove -1
Set CS_Ability[72] = HP Remove -1024
Set CS_Ability[73] = HP Remove -128
Set CS_Ability[74] = HP Remove -16
Set CS_Ability[75] = HP Remove -2
Set CS_Ability[76] = HP Remove -2048
Set CS_Ability[77] = HP Remove -256
Set CS_Ability[78] = HP Remove -32
Set CS_Ability[79] = HP Remove -4
Set CS_Ability[80] = HP Remove -4096
Set CS_Ability[81] = HP Remove -512
Set CS_Ability[82] = HP Remove -64
Set CS_Ability[83] = HP Remove -8
Set CS_Ability[84] = HP Remove -8192
Set CS_Ability[85] = MP Add +1
Set CS_Ability[86] = MP Add +1024
Set CS_Ability[87] = MP Add +128
Set CS_Ability[88] = MP Add +16
Set CS_Ability[89] = MP Add +2
Set CS_Ability[90] = MP Add +2048
Set CS_Ability[91] = MP Add +256
Set CS_Ability[92] = MP Add +32
Set CS_Ability[93] = MP Add +4
Set CS_Ability[94] = MP Add +4096
Set CS_Ability[95] = MP Add +512
Set CS_Ability[96] = MP Add +64
Set CS_Ability[97] = MP Add +8
Set CS_Ability[98] = MP Add +8192
Set CS_Ability[99] = MP Remove -1
Set CS_Ability[100] = MP Remove -1024
Set CS_Ability[101] = MP Remove -128
Set CS_Ability[102] = MP Remove -16
Set CS_Ability[103] = MP Remove -2
Set CS_Ability[104] = MP Remove -2048
Set CS_Ability[105] = MP Remove -256
Set CS_Ability[106] = MP Remove -32
Set CS_Ability[107] = MP Remove -4
Set CS_Ability[108] = MP Remove -4096
Set CS_Ability[109] = MP Remove -512
Set CS_Ability[110] = MP Remove -64
Set CS_Ability[111] = MP Remove -8
Set CS_Ability[112] = MP Remove -8192
Set CS_Ability[113] = Add Sight +1
Set CS_Ability[114] = Add Sight +1024
Set CS_Ability[115] = Add Sight +128
Set CS_Ability[116] = Add Sight +16
Set CS_Ability[117] = Add Sight +2
Set CS_Ability[118] = Add Sight +2048
Set CS_Ability[119] = Add Sight +256
Set CS_Ability[120] = Add Sight +32
Set CS_Ability[121] = Add Sight +4
Set CS_Ability[122] = Add Sight +4096
Set CS_Ability[123] = Add Sight +512
Set CS_Ability[124] = Add Sight +64
Set CS_Ability[125] = Add Sight +8
Set CS_Ability[126] = Add Sight +8192
Set CS_Ability[127] = Remove Sight -1
Set CS_Ability[128] = Remove Sight -1024
Set CS_Ability[129] = Remove Sight -128
Set CS_Ability[130] = Remove Sight -16
Set CS_Ability[131] = Remove Sight -2
Set CS_Ability[132] = Remove Sight -2048
Set CS_Ability[133] = Remove Sight -256
Set CS_Ability[134] = Remove Sight -32
Set CS_Ability[135] = Remove Sight -4
Set CS_Ability[136] = Remove Sight -4096
Set CS_Ability[137] = Remove Sight -512
Set CS_Ability[138] = Remove Sight -64
Set CS_Ability[139] = Remove Sight -8
Set CS_Ability[140] = Remove Sight -8192
Set CS_LoopingBase[1] = 8192
Set CS_LoopingBase[2] = 4096
Set CS_LoopingBase[3] = 2048
Set CS_LoopingBase[4] = 1024
Set CS_LoopingBase[5] = 512
Set CS_LoopingBase[6] = 256
Set CS_LoopingBase[7] = 128
Set CS_LoopingBase[8] = 64
Set CS_LoopingBase[9] = 32
Set CS_LoopingBase[10] = 16
Set CS_LoopingBase[11] = 8
Set CS_LoopingBase[12] = 4
Set CS_LoopingBase[13] = 2
Set CS_LoopingBase[14] = 1
Set CS_MaxLoopingBase = 14
-------- PRELOADING SPELLS --------
Custom script: loop
Custom script: exitwhen i > maxability
Custom script: call UnitAddAbility(Dummy, udg_CS_Ability[i])
Custom script: set i = i + 1
Custom script: endloop
Custom script: call RemoveUnit(Dummy)
Custom script: set Dummy = null
-------- PRELOADING SPELLS --------
Custom script: set udg_CS_Hashtable = InitHashtable()
Custom script: call DestroyTrigger(GetTriggeringTrigger())


CREDITS
- WaterKnight -> First modulo solution
- Halo7568 - Full credits to him for the code (modulo algorithm)
- Vexorian -> SimError
- Magtheridon96 - Showed me the new algorithm


CHANGELOGS
v1.0
- Initial release

v1.1
- Sound leak and player leak has been fixed
- Changed to new algorithm to base 2
- Added new customization, Damage and Armor
- Deleted some variables, replaced them with just local variables

v1.2
- Added new customization; Sight Range
Rating - 4.83 (6 votes)
(Hover and click)
Moderator Comments
Not Rated
15:56, 18th Jul 2012
Magtheridon96:

For starters, you can reduce the number of abilities.
You can cut them in half if you use only one ability that gives negative stats.

If the highest positive bonus is 8192, all you need is a -16384 ability.

This spell is awaiting update.


Download Simple Custom Stats System v1.2.w3x
(32.64 KB, 174 Downloads)

Old 07-03-2012, 08:46 AM   #2 (permalink)
Registered User defskull
ϟƘƦƖ|ןΣ✘
 
defskull's Avatar
 
Join Date: Mar 2008
Posts: 7,577
defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)
Zephyr Contest #9 - Winner: Stringed Shuriken: An assassin is always working like a trickster. This entry proves the theory, as defskull managed to integrate the fictional lore of the human legacy into a single, virtual ability. Strike fast, die instantly! 
More features will be added, such as Movement Speed, Attack Speed, Regeneration and such :)
defskull is offline   Reply With Quote
Old 07-03-2012, 09:26 AM   #3 (permalink)
Registered User Kgg123
User
 
Kgg123's Avatar
 
Join Date: Apr 2011
Posts: 64
Kgg123 has little to show at this moment (6)
Looks interesting but ... the Hero can use the Spell always i think ??^^
FTW nice idea 7/10
Kgg123 is offline   Reply With Quote
Old 07-03-2012, 10:39 AM   #4 (permalink)
Registered User defskull
ϟƘƦƖ|ןΣ✘
 
defskull's Avatar
 
Join Date: Mar 2008
Posts: 7,577
defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)
Zephyr Contest #9 - Winner: Stringed Shuriken: An assassin is always working like a trickster. This entry proves the theory, as defskull managed to integrate the fictional lore of the human legacy into a single, virtual ability. Strike fast, die instantly! 
Quote:
Looks interesting but ... the Hero can use the Spell always i think
What do you mean by this ?

Quote:
FTW nice idea 7/10
Again, you didn't actually rate it ! :)
defskull is offline   Reply With Quote
Old 07-03-2012, 10:58 AM   #5 (permalink)
Registered User king_drift_alex
noob_smoke
 
king_drift_alex's Avatar
 
Join Date: Nov 2007
Posts: 710
king_drift_alex is on a distinguished road (67)king_drift_alex is on a distinguished road (67)
Wow, that's great. Waiting for "More features will be added, such as Movement Speed, Attack Speed, Regeneration and such :)" to implement it on my map .
Good job 5/5.
__________________
king_drift_alex is offline   Reply With Quote
Old 07-03-2012, 11:42 AM   #6 (permalink)
Registered User Almia
I/O System Coder
 
Almia's Avatar
 
Join Date: Apr 2012
Posts: 3,364
Almia is a splendid one to behold (809)Almia is a splendid one to behold (809)Almia is a splendid one to behold (809)
Nice Idea 5/5
__________________
Almia is online now   Reply With Quote
Old 07-03-2012, 11:48 AM   #7 (permalink)
Registered User defskull
ϟƘƦƖ|ןΣ✘
 
defskull's Avatar
 
Join Date: Mar 2008
Posts: 7,577
defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)
Zephyr Contest #9 - Winner: Stringed Shuriken: An assassin is always working like a trickster. This entry proves the theory, as defskull managed to integrate the fictional lore of the human legacy into a single, virtual ability. Strike fast, die instantly! 
Actually, the idea is from vJASS scripting, I made it from scratch in GUI (well a bit JASS there in map header) for GUI users so they do not need any requirements at all, unlike in vJASS, JNGP is required I think.
defskull is offline   Reply With Quote
Old 07-03-2012, 03:03 PM   #8 (permalink)
Registered User Tank-Commander
Most recommended Spells
 
Tank-Commander's Avatar
 
Join Date: May 2009
Posts: 1,226
Tank-Commander is a glorious beacon of light (460)Tank-Commander is a glorious beacon of light (460)Tank-Commander is a glorious beacon of light (460)
Well, while it's called in GUI, the actual part you put in "triggers" is simply the preloading, right (as well as setting the powers of 10 to reach wanted values)? or atleast it looks that way, Eitherway I'd put the Jass script in the "Triggers" section and change the category, considering it's operation that's done in GUI (or Jass) but the actual key script is in Jass. Also, you could add the set-up of the variables into the jass section as well of this system, just to make it more compact.
__________________
Tank-Commander is online now   Reply With Quote
Old 07-03-2012, 03:45 PM   #9 (permalink)
Registered User defskull
ϟƘƦƖ|ןΣ✘
 
defskull's Avatar
 
Join Date: Mar 2008
Posts: 7,577
defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)
Zephyr Contest #9 - Winner: Stringed Shuriken: An assassin is always working like a trickster. This entry proves the theory, as defskull managed to integrate the fictional lore of the human legacy into a single, virtual ability. Strike fast, die instantly! 
I think I'll stick to my current trigger, your suggestion is just to improve the "eye-candy".
defskull is offline   Reply With Quote
Old 07-03-2012, 04:04 PM   #10 (permalink)
Registered User maddeem
Red Reaver
 
maddeem's Avatar
 
Join Date: Jan 2011
Posts: 1,080
maddeem is a jewel in the rough (228)maddeem is a jewel in the rough (228)maddeem is a jewel in the rough (228)
For the abilities are you using this method:
1-9, 10-90, 100-900, and so on?
Don't add MS tho, you can change that really easy in triggers xD
__________________
NOT ENOUGH
maddeem is offline   Reply With Quote
Old 07-03-2012, 04:06 PM   #11 (permalink)
Registered User Tank-Commander
Most recommended Spells
 
Tank-Commander's Avatar
 
Join Date: May 2009
Posts: 1,226
Tank-Commander is a glorious beacon of light (460)Tank-Commander is a glorious beacon of light (460)Tank-Commander is a glorious beacon of light (460)
Quote:
Originally Posted by defskull View Post
I think I'll stick to my current trigger, your suggestion is just to improve the "eye-candy".
actually my suggesting to change category was to make the category correct, since the majority of this is Jass, not GUI. And compressing it for compacting is also to make it easier to use and so that people don't have to import waste
__________________
Tank-Commander is online now   Reply With Quote
Old 07-03-2012, 04:14 PM   #12 (permalink)
Registered User defskull
ϟƘƦƖ|ןΣ✘
 
defskull's Avatar
 
Join Date: Mar 2008
Posts: 7,577
defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)
Zephyr Contest #9 - Winner: Stringed Shuriken: An assassin is always working like a trickster. This entry proves the theory, as defskull managed to integrate the fictional lore of the human legacy into a single, virtual ability. Strike fast, die instantly! 
Quote:
For the abilities are you using this method:
1-9, 10-90, 100-900, and so on?
Don't add MS tho, you can change that really easy in triggers xD
Yeah, I'm using a mod function which allows me to find appropriate value for each level such as 874, I would separate a +100 HP to level 8 | +70 HP to level 7 | +4 HP to level 4, therefore it would 800 + 70 + 4.
This algorithm is fully made by halo7568, full credits goes to him for that algorithm search.

Quote:
actually my suggesting to change category was to make the category correct, since the majority of this is Jass, not GUI. And compressing it for compacting is also to make it easier to use and so that people don't have to import waste
Ohhh change it from GUI -> JASS ?
I prefer not, cause' I want this system to be in favor for GUI-users, if I change it to JASS category, I'm afraid I would scare them away before they actually download and test it >.>"
defskull is offline   Reply With Quote
Old 07-04-2012, 05:49 AM   #13 (permalink)
Registered User mckill2009
SSJ99999 Pinoy!
 
mckill2009's Avatar
 
Join Date: Mar 2009
Posts: 4,469
mckill2009 is a splendid one to behold (872)mckill2009 is a splendid one to behold (872)mckill2009 is a splendid one to behold (872)mckill2009 is a splendid one to behold (872)mckill2009 is a splendid one to behold (872)mckill2009 is a splendid one to behold (872)
sound error should be a global variable coz it will leak and ForPlayer should be nulled...
__________________
My Resources:
My Maps
My Systems/Spells

Your ideas tend to result in unnecessary violence so shut the F*** up!
mckill2009 is offline   Reply With Quote
Old 07-04-2012, 08:05 AM   #14 (permalink)
Forum Moderator Magtheridon96
Go away.
 
Magtheridon96's Avatar
Resource Moderator
 
Join Date: Dec 2008
Posts: 5,748
Magtheridon96 has a brilliant future (1889)Magtheridon96 has a brilliant future (1889)Magtheridon96 has a brilliant future (1889)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. 
You should base this on powers of 2.
That's how all the JASS libs do it.

Check out Bonus by Nestharus for a good algorithm, or maybe even Status by Jesus4Lyf.
__________________
Magtheridon96 is offline   Reply With Quote
Old 07-04-2012, 08:11 AM   #15 (permalink)
Registered User defskull
ϟƘƦƖ|ןΣ✘
 
defskull's Avatar
 
Join Date: Mar 2008
Posts: 7,577
defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)defskull has a brilliant future (1318)
Zephyr Contest #9 - Winner: Stringed Shuriken: An assassin is always working like a trickster. This entry proves the theory, as defskull managed to integrate the fictional lore of the human legacy into a single, virtual ability. Strike fast, die instantly! 
Like 2 4 8, such as computer's memory ?
I don't really get that how to do it, like +2 damage, and then +4 damage, how do you want to +3 damage ?
I know they did it in base 2 and it's perfect, but how it is executed ?
But never mind, I'll stick to this method for now.
defskull is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 07:54 AM.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle