XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Warcraft> Академия: форум для вопросов> Jass
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Ответ
 
16GB
GhostOne User
offline
Опыт: 60,317
Активность:
Не робит код
копировал с опен доты скилл дриады заменил сделал чтобы работал на 1.24. Карта сохраняется всё норм но скилл на работает
function Trig_Impetus_Conditions takes nothing returns boolean
	if(GetLearnedSkill()!='A002'and IsUnitIllusion(GetTriggerUnit())==false)then
		return false
	endif
	return true
endfunction

function Impetus_OnOff takes nothing returns boolean
	if GetTriggerEventId()==EVENT_PLAYER_UNIT_ATTACKED then
		if GetUnitAbilityLevel(GetAttacker(),'A002')==0 then
			return false
		elseif LoadBoolean(udg_Hash,GetHandleId(GetTriggeringTrigger()),StringHash("OrbOn"))then
			if IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false and GetAttacker()==LoadUnitHandle(udg_Hash,GetHandleId(GetTriggeringTrigger()),StringHash("Enchantr​ess"))then
				return true
			endif
		else
			return false
		endif
	elseif GetTriggerEventId()==EVENT_UNIT_ISSUED_ORDER then
		if GetIssuedOrderId()==852255then
                        call SaveBoolean(udg_Hash,GetHandleId(GetTriggeringTrigger()),StringHash("OrbOn"),true)
		elseif GetIssuedOrderId()==852256then
			call SaveBoolean(udg_Hash,GetHandleId(GetTriggeringTrigger()),StringHash("OrbOn"),false)
		endif
	elseif GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT then
		if GetSpellAbilityId()=='A002'then
			return true
		else
			return false
		endif
	endif
	return false
endfunction

function Impetus_Range takes real px1,real py1,real px2,real py2 returns real
	return SquareRoot(((px1-px2)*(px1-px2))+((py1-py2)*(py1-py2)))
endfunction

function Impetus_Main takes nothing returns nothing
	local texttag lgg
	local real ldd
	if UnitHasBuffBJ(GetTriggerUnit(),'B000') and GetUnitAbilityLevel(GetEventDamageSource(),'A002')>0 and LoadUnitHandle(udg_Hash,GetHandleId(GetTriggeringTrigger()),StringHash("Source"))==GetEven​tDamageSource()then
		call DisableTrigger(GetTriggeringTrigger())
		set ldd=.04*I2R(GetUnitAbilityLevel(GetEventDamageSource(),'A002'))*Impetus_Range(GetUnitX(GetTriggerUni​t()),GetUnitY(GetTriggerUnit()),GetUnitX(GetEventDamageSource()),GetUnitY(GetEventDamageSource()))
		if(ldd>400)then
			set ldd=400
		endif
		set lgg=CreateTextTagUnitBJ("+"+I2S(R2I(ldd)),GetTriggerUnit(),64,10,1,85,86,15)
		call SetTextTagVelocityBJ(lgg,64,90)
		call UnitDamageTargetBJ(GetEventDamageSource(),GetTriggerUnit(),ldd,ATTACK_TYPE_HERO,DAMAGE_TYPE_DIVINE)
		call PolledWait(1)
		call DestroyTextTag(lgg)
		call DisableTrigger(GetTriggeringTrigger())
	endif
endfunction

function Impetus_Event takes nothing returns nothing
	local trigger ltt=CreateTrigger()
	local unit lFB
	local unit lFb
	if(GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT)then
		set lFB=GetSpellTargetUnit()
		set lFb=GetTriggerUnit()
	else
		set lFB=GetTriggerUnit()
		set lFb=GetAttacker()
	endif
	if IsUnitIllusion(lFb)==false then
                call SaveUnitHandle(udg_Hash,GetHandleId(ltt),StringHash("Source"),lFb)
		call TriggerRegisterUnitEvent(ltt,lFB,EVENT_UNIT_DAMAGED)
		call TriggerAddAction(ltt,function Impetus_Main)
	endif
	call PolledWait(2)
	call DisableTrigger(ltt)
endfunction

function Trig_Impetus_Actions takes nothing returns nothing
	local unit lfo=GetTriggerUnit()
	local trigger ltt
	local integer lmZ=GetUnitAbilityLevel(lfo,'A002')
	if(lmZ==1)then
		set ltt=CreateTrigger()
		call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_ATTACKED)
		call TriggerRegisterUnitEvent(ltt,lfo,EVENT_UNIT_SPELL_EFFECT)
		call TriggerRegisterUnitEvent(ltt,lfo,EVENT_UNIT_ISSUED_ORDER)
		call TriggerAddCondition(ltt,Condition(function Impetus_OnOff))
		call TriggerAddAction(ltt,function Impetus_Event)
                call SaveUnitHandle(udg_Hash,GetHandleId(ltt),StringHash("Enchantress"),lfo)
endif
endfunction


function InitTrig_Impetus takes nothing returns nothing
set gg_trg_Impetus=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Impetus,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(gg_trg_Impetus,Condition(function Trig_Impetus_Conditions))
call TriggerAddAction(gg_trg_Impetus,function Trig_Impetus_Actions)
endfunction
Прикрепленные файлы
Тип файла: w3x bag.w3x (20.5 Кбайт, 19 просмотров )
Старый 09.08.2010, 11:10
bee
vjass.optimizer
offline
Опыт: 16,615
Активность:
Код:
call SaveUnitHandle(udg_Hash,GetHandleId(ltt),StringHash("Enchantress"),lfo)

call SaveUnitHandle(udg_Hash,GetHandleId(ltt),StringHash("Source"),lFb)
там надо # ячейки а не стоку.
Старый 09.08.2010, 17:59
16GB
GhostOne User
offline
Опыт: 60,317
Активность:
можно и строку
в гуи работает спокойно
Старый 09.08.2010, 18:03
bee
vjass.optimizer
offline
Опыт: 16,615
Активность:
и во всех других также. но по смыслу а не любое число

bee добавил:
16GB, ммм. raw-code?

bee добавил:
'B000', 'A002'
Старый 09.08.2010, 18:04
Ответ

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 21:39.