offline
Опыт:
11,222
Активность:
|
Помогите изменить кусок скрипта Jass
Люди добрые помогите исправить (настроить) его под 2.24е. Заране благодарен. Этот кусок Jass кода Van Damm 'а. Это код с ElementalDamageSystem. Мне очень нужена эта система, чтобы она работала на 2.24е. Если не сможете, то где можно найти подобную систему? Только без RB и SCV.
constant function H2I takes handle h returns integer
return h
return 0
endfunction
constant function I2U takes integer i returns unit
return i
return null
endfunction
constant function I2T takes integer i returns trigger
return i
return null
endfunction
constant function I2TT takes integer i returns texttag
return i
return null
endfunction
constant function I2Tm takes integer i returns timer
return i
return null
endfunction
constant function I2It takes integer i returns item
return i
return null
endfunction
constant function I2D takes integer i returns destructable
return i
return null
endfunction
constant function I2MB takes integer i returns multiboard
return i
return null
endfunction
constant function I2B takes integer i returns button
return i
return null
endfunction
constant function I2FX takes integer i returns effect
return i
return null
endfunction
constant function I2L takes integer i returns location
return i
return null
endfunction
constant function I2P takes integer i returns player
return i
return null
endfunction
constant function I2Gr takes integer i returns group
return i
return null
endfunction
//################################################################################
constant function caster_unit takes nothing returns integer
return 'e000'
endfunction
constant function target_unit takes nothing returns integer
return 'e003'
endfunction
//################################################################################
function setcfg takes string key, string val returns nothing
call StoreString(udg_cache, "config", key, val)
endfunction
function cfg takes string key returns string
return GetStoredString(udg_cache, "config", key)
endfunction
function cfgr takes string key returns real
return S2R(cfg(key))
endfunction
function cfgi takes string key returns integer
return S2I(cfg(key))
endfunction
//################################################################################
function get_object_iparam takes handle h, string key returns integer
return GetStoredInteger(udg_cache, I2S(H2I(h)), key)
endfunction
function set_object_iparam takes handle h, string key, integer val returns nothing
call StoreInteger(udg_cache, I2S(H2I(h)), key, val)
endfunction
function get_object_rparam takes handle h, string key returns real
return GetStoredReal(udg_cache, I2S(H2I(h)), key)
endfunction
function set_object_rparam takes handle h, string key, real val returns nothing
call StoreReal(udg_cache, I2S(H2I(h)), key, val)
endfunction
function get_object_sparam takes handle h, string key returns string
return GetStoredString(udg_cache, I2S(H2I(h)), key)
endfunction
function set_object_sparam takes handle h, string key, string val returns nothing
call StoreString(udg_cache, I2S(H2I(h)), key, val)
endfunction
function get_object_bparam takes handle h, string key returns boolean
return GetStoredBoolean(udg_cache, I2S(H2I(h)), key)
endfunction
function set_object_bparam takes handle h, string key, boolean val returns nothing
call StoreBoolean(udg_cache, I2S(H2I(h)), key, val)
endfunction
function flush_object takes handle h returns nothing
call FlushStoredMission(udg_cache, I2S(H2I(h)))
endfunction
//################################################################################
function echo takes integer playerID, string msg returns nothing
if playerID == -1 then
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,5.00, msg)
else
call DisplayTimedTextToPlayer(Player(playerID),0,0,5.00, msg)
endif
endfunction
//################################################################################
function chr takes integer i returns string
local string abc = "abcdefghijklmnopqrstuvwxyz"
local string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
local string digits = "0123456789"
if i >= 65 and i <= 90 then
return SubString(ABC, i-65,i-64)
elseif i >= 97 and i <= 122 then
return SubString(abc, i-97,i-96)
elseif i >= 48 and i <= 57 then
return SubString(digits, i-48,i-47)
endif
return ""
endfunction
function CPos takes string StrData, string ToFind, integer From returns integer
local integer FromPos = From
loop
exitwhen (SubString(StrData, FromPos, FromPos+1) == ToFind) or (SubString(StrData, FromPos, FromPos+1) == "")
set FromPos = FromPos + 1
endloop
if (SubString(StrData, FromPos, FromPos+1) == ToFind) then
return FromPos
endif
return -1
endfunction
function int takes string Str returns integer
local integer Pos = CPos("ABCDEFGHIJKLMNOPQRSTUVWXYZ", Str, 0) + 65
if Pos == 64 then
set Pos = CPos("0123456789", Str, 0) + 48
endif
if Pos == 47 then
set Pos = CPos("abcdefghijklmnopqrstuvwxyz", Str, 0) + 97
endif
if (Str == "") then
return 0
else
return Pos
endif
endfunction
//################################################################################
function Dec2Bin takes integer in returns nothing
local boolean array ranks
local integer i = 0
local integer out
set out = in
loop
call set_object_bparam(null,"rank"+I2S(i),(ModuloInteger(out,2) == 1) or (out <= 1))
exitwhen (out <= 1)
set out = (out - ModuloInteger(out,2))/2
set i = i + 1
endloop
call set_object_iparam(null,"ranks",i)
endfunction
//################################################################################
function msg takes string s returns nothing
call DisplayTimedTextToForce(GetPlayersAll(), 10, s)
endfunction
//################################################################################
function ID2String takes integer itemid returns string
return chr(itemid/256/256/256) + chr(ModuloInteger(itemid/256/256, 256)) + chr(ModuloInteger(itemid/256, 256)) + chr(ModuloInteger(itemid, 256))
endfunction
function String2ID takes string str returns integer
return int(SubString(str,0,1))*256*256*256 + int(SubString(str,1,2))*256*256 + int(SubString(str,2,3))*256 + int(SubString(str,3,4))
endfunction
//################################################################################
function GetStringStrEx takes string str, string divisor, integer n returns string
local integer i = 0
local integer num = 0
local string res = ""
loop
exitwhen i >= StringLength(str)
if (SubString(str, i, i+1) == divisor) then
if (num == n) then
return res
else
set res = ""
set i = i + 1
endif
set num = num + 1
else
set res = res + SubString(str, i, i+1)
set i = i + 1
endif
endloop
return res
endfunction
function GetStringInt takes string str, string divisor, integer n returns integer
return S2I(GetStringStrEx(str,divisor,n))
endfunction
//################################################################################
function GetSpellProperty takes integer spellid, string property returns string
local integer i = 0
loop
exitwhen ((GetAbilityEffectById(spellid,EFFECT_TYPE_TARGET,i) == property) or (GetAbilityEffectById(GetSpellAbilityId(),EFFECT_TYPE_TARGET,i) == "end"))
set i = i + 1
endloop
if not (GetAbilityEffectById(GetSpellAbilityId(),EFFECT_TYPE_TARGET,i) == "end") then
return GetAbilityEffectById(GetSpellAbilityId(),EFFECT_TYPE_TARGET,i+1)
endif
return "-1"
endfunction
function SpellHasProperty takes integer spellid, string property returns boolean
local integer i = 0
loop
exitwhen ((GetAbilityEffectById(spellid,EFFECT_TYPE_TARGET,i) == property) or (GetAbilityEffectById(GetSpellAbilityId(),EFFECT_TYPE_TARGET,i) == "end"))
set i = i + 1
endloop
if not (GetAbilityEffectById(GetSpellAbilityId(),EFFECT_TYPE_TARGET,i) == "end") then
return true
endif
return false
endfunction
function GetSpellPropertyLeveled takes integer spellid, string property, integer lvl returns string
local integer i = 0
loop
exitwhen ((GetAbilityEffectById(spellid,EFFECT_TYPE_TARGET,i) == property) or (GetAbilityEffectById(GetSpellAbilityId(),EFFECT_TYPE_TARGET,i) == "end"))
set i = i + 1
endloop
if not (GetAbilityEffectById(GetSpellAbilityId(),EFFECT_TYPE_TARGET,i) == "end") then
return GetStringStrEx(GetAbilityEffectById(GetSpellAbilityId(),EFFECT_TYPE_TARGET,i+1),"*",lvl-1)
endif
return "-1"
endfunction
//################################################################################
function InitTrig_SCVx takes nothing returns nothing
set udg_cache = InitGameCache("spells.w3v")
call FlushGameCache(udg_cache)
call SaveGameCache(udg_cache)
set udg_cache = InitGameCache("spells.w3v")
endfunction
Отредактировано Hellfim, 13.04.2011 в 14:03.
|