Форум HeroesWorld-а - Показать сообщение отдельно - Скрипты
Тема: Скрипты
Показать сообщение отдельно
#883
Старый 09.01.2013, 22:06
  #883
^
Heroist
 
Аватар для Heroist
📖
Регистрация: 16.12.2012
Адрес: Запределье
Сообщения: 14599
Выставка наград
Регистрация: 16.12.2012
Адрес: Запределье
Сообщения: 14599
Выставка наград
По умолчанию
Re: Скрипты

Батл скрипт:

function Start()
hero = GetAttackerHero ()
if GetHeroName("hero") == 'Alaric' then
cast = GetGameVar('spell')+0
mana = GetUnitManaPoints (hero)
SetUnitManaPoints (hero, 100)
if cast == 0 then
UnitCastGlobalSpell(hero, 54)
elseif cast == 1 then
UnitCastGlobalSpell(hero, 221)
elseif cast == 2 then
UnitCastGlobalSpell(hero, 218)
elseif cast == 3 then
UnitCastGlobalSpell(hero, 220)
elseif cast == 4 then
UnitCastGlobalSpell(hero, 219)
elseif cast == 5 then
UnitCastGlobalSpell(hero, 216)
end
SetUnitManaPoints (hero, mana)
end

Скрипт:

function rndcast()
while 1 do
SetGameVar('spell', random(6))
local index = GetLastSavedCombatIndex()
while index == GetLastSavedCombatIndex() do
sleep(10)
end
end
end
startThread(rndcast)
__________________
Whatever
Whatever
Heroist вне форума
Ответить с цитированием