| Machine56 | Дата: Четверг, 22.05.2008, 16:59 | Сообщение # 1 |
 Инженер кровавых эльфов
Группа: Проверенные
Сообщений: 26
Статус: Offline
| Ability Editor Code scope ThunderStorm initializer init
//************************************** // Буря от machine56 // // требования: // // NewGen v1.5a, способности и // дамми-юнит // // Ну и кредиты мне если этот спелл тру!!! //**************************************
globals private constant integer ThunderStorm_SpellID = 'A002' // Рав код спелла private constant integer ThunderStorm_DummyID = 'h000' // Рав код Дамми private constant integer ThunderStorm_DummyAbilID = 'A001' // Рав код способности дамми private constant real ThunderStorm_AoE = 400.0 // Спелл АОЕ private constant real ThunderStorm_Damage = 50.0 // Урон от магии private constant real ThunderStorm_Time = 5.0 // Время жизни каждой молнии <img src="http://src.ucoz.net/sm/8/happy.gif" border="0" align="absmiddle" alt="happy"> private constant real ThunderStorm_Multi = 2.10 // Урон мултиинстансовый private constant real ThunderStorm_Divide = 3.30 // private constant boolean ThunderStorm_Show = true // Показывать тест или нет // ставь не тру <img src="http://src.ucoz.net/sm/8/biggrin.gif" border="0" align="absmiddle" alt="biggrin">
// Ну и что трогать не стоит так как это не изменяемые данные для нубов private group ThunderStorm_Group = CreateGroup() private unit ThunderStorm_Target = null private unit ThunderStorm_Caster = null private rect ThunderStorm_Rect = null endglobals
private constant function ThunderStorm_AttackType takes nothing returns attacktype return ATTACK_TYPE_NORMAL // Тип атаки endfunction
private constant function ThunderStorm_DamageType takes nothing returns damagetype return DAMAGE_TYPE_UNIVERSAL // Тип дамага endfunction
private constant function ThunderStorm_WeaponType takes nothing returns weapontype return WEAPON_TYPE_WHOKNOWS // Типа оружия endfunction
private constant function ThunderStorm_DamageMulti takes nothing returns real return ThunderStorm_Damage * ThunderStorm_Multi / ThunderStorm_Divide // ЫЫЫЫЫ нубы не поймут все равно endfunction
private function ThunderStorm_Conditions takes nothing returns boolean return GetSpellAbilityId() == ThunderStorm_SpellID endfunction
private function ThunderStorm_BefCond2 takes nothing returns nothing if ( CountUnitsInGroup(ThunderStorm_Group) <= 0 ) then call DisplayTextToPlayer(GetOwningPlayer(ThunderStorm_Caster), 0.5, -0.5, "|cffffcc00Под ударом нет юнитов.|r") if gg_snd_Error != null then call StartSound(gg_snd_Error) endif endif endfunction
private function ThunderStorm_ConditionsDies takes nothing returns boolean return ( IsUnitInGroup(GetDyingUnit(), ThunderStorm_Group) == true ) endfunction
private function ThunderStorm_GroupDies takes nothing returns nothing local unit u = GetEnumUnit() local location l = GetUnitLoc(u) local unit d = CreateUnitAtLoc(GetOwningPlayer(ThunderStorm_Caster), ThunderStorm_DummyID, l, 0) call SetUnitFlyHeight(d, 0.00, 100000000.0) call TriggerSleepAction(0.01) call UnitAddAbility(d, ThunderStorm_DummyAbilID) call IssueTargetOrderById(d, 852587, u) //forkedlightning call UnitApplyTimedLife(d, 'BTLF', 0.75) call UnitDamageTarget(ThunderStorm_Caster, u, ThunderStorm_DamageMulti(), false, true, ThunderStorm_AttackType(), ThunderStorm_DamageType(), ThunderStorm_WeaponType()) set d=null set u=null call RemoveLocation(l) set l = null endfunction
private function ThunderStorm_ActionsDies takes nothing returns nothing local unit d = GetDyingUnit() local unit u = ThunderStorm_Caster local group g2 = GetRandomSubGroup(1, ThunderStorm_Group) call ForGroup(g2, function ThunderStorm_GroupDies) if ( ThunderStorm_Show == true ) then call ThunderStorm_BefCond2() endif endfunction
private function initdies takes nothing returns nothing local trigger t = CreateTrigger() call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_DEATH) call TriggerAddCondition(t, Condition(function ThunderStorm_ConditionsDies)) call TriggerAddAction(t, function ThunderStorm_ActionsDies) endfunction
private function ThunderStorm_GroupActions takes nothing returns nothing local unit u = GetEnumUnit() local unit d = CreateUnit(GetOwningPlayer(ThunderStorm_Caster), ThunderStorm_DummyID, GetRandomReal(GetRectMinX(ThunderStorm_Rect),GetRectMaxX(ThunderStorm_Rect)), GetRandomReal(GetRectMinY(ThunderStorm_Rect),GetRectMaxY(ThunderStorm_Rect)), 0) call UnitAddAbility(d, ThunderStorm_DummyAbilID) call IssueTargetOrderById(d, 852587, u) //форкедлайт call UnitApplyTimedLife(d, 'BTLF', 0.75) call UnitDamageTarget(ThunderStorm_Caster, u, ThunderStorm_DamageMulti(), false, true, ThunderStorm_AttackType(), ThunderStorm_DamageType(), ThunderStorm_WeaponType()) set d=null set u=null call initdies() endfunction
private function ThunderStorm_GroupConditions takes nothing returns boolean return ( IsUnitAliveBJ(GetFilterUnit()) == true ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(ThunderStorm_Caster)) == true ) endfunction
private function ThunderStorm_BefCond1 takes nothing returns nothing if ( CountUnitsInGroup(ThunderStorm_Group) <= 0 ) then call DisplayTextToPlayer(GetOwningPlayer(ThunderStorm_Caster), 0.5, -0.5, "|cffffcc00Под ударом нет юнитов.|r") if gg_snd_Error != null then call StartSound(gg_snd_Error) endif endif endfunction
private function ThunderStorm_Actions takes nothing returns nothing local unit u = GetTriggerUnit() local real x = GetUnitX(u) local real y = GetUnitY(u) local location l = GetUnitLoc(u) set ThunderStorm_Caster = u set ThunderStorm_Rect = Rect( x - ThunderStorm_AoE*0.5, y - ThunderStorm_AoE*0.5, x + ThunderStorm_AoE*0.5, y + ThunderStorm_AoE*0.5 ) set ThunderStorm_Group = GetUnitsInRangeOfLocMatching(ThunderStorm_AoE, l, Condition(function ThunderStorm_GroupConditions)) call ForGroup(ThunderStorm_Group, function ThunderStorm_GroupActions) if ( ThunderStorm_Show == true ) then call ThunderStorm_BefCond1() endif call GroupClear(ThunderStorm_Group) call RemoveRect(ThunderStorm_Rect) set u = null endfunction
//================================================== ========================= private function init takes nothing returns nothing local trigger t = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT) call TriggerAddCondition(t, Condition(function ThunderStorm_Conditions)) call TriggerAddAction(t, function ThunderStorm_Actions) endfunction
endscope
Сообщение отредактировал Machine56 - Четверг, 22.05.2008, 17:01 |
| |
|
|
| Ven | Дата: Четверг, 22.05.2008, 17:05 | Сообщение # 2 |
|
Вурдалак
Группа: Проверенные
Сообщений: 112
Статус: Offline
| Бля ты же не хочешь чтобы я разбирался в этом коде??? Запихай в карту и взглянем в действии. И че за хйня?jassnewgenpack 1.5v?На дворе уже давно 5v!
Сообщение отредактировал Ven - Четверг, 22.05.2008, 17:19 |
| |
|
|
| Machine56 | Дата: Суббота, 24.05.2008, 12:16 | Сообщение # 3 |
 Инженер кровавых эльфов
Группа: Проверенные
Сообщений: 26
Статус: Offline
| Ven, Хз, я написал каким я пользуюсь, интернет ооочень тормозной качать новые версии не охото, не хчешь можешь неразбиратся в коде. Я собственно только кинул идею по JESP тсандарту. По ней думаю легко сделать все как надо Добавлено (24.05.2008, 12:16) ---------------------------------------------
Code function NadeExplodeDeath takes unit nade returns nothing local real x = GetUnitX(nade) local real y = GetUnitY(nade) local location loc = Location(x,y) local unit fx set fx = CreateUnit(Player(13),'h006',x,y,0) call SetUnitX(fx,x) call SetUnitY(fx,y) call KillUnit(fx) call KillUnit(nade) call RemoveUnitTimed(fx,1) call TimedEffectPt(x,y,5,"Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl") set loc = null set nade = null set fx = null endfunction
function nadeconditions takes nothing returns boolean return IsUnitAliveBJ(GetFilterUnit()) endfunction
function Parabolic takes nothing returns nothing local timer t = GetExpiredTimer() local unit target = GHUnit(t,"target") local real xpower = GHReal(t,"xpower") local real zpower = GHReal(t,"zpower") local real angle = GHReal(t,"angle") local real power = GHReal(t,"power") local real CosAngle = GHReal(t,"cos") local real SinAngle = GHReal(t,"sin") local boolean shouldstop = GHBoolean(t,"shouldstop") local real loft local real x = GetUnitX(target)+xpower*CosAngle local real y = GetUnitY(target)+xpower*SinAngle local sound impactsnd local unit caster = GHUnit(t,"caster") local player p local boolean nade = GHBoolean(t,"grenade") local trigger nadetrig = GHTrigger(t,"nade") local group g local unit u if power<=2.5 or shouldstop or x>GetRectMaxX(gg_rct_game) or x<GetRectMinX(gg_rct_game) or y>GetRectMaxY(gg_rct_game) or y<GetRectMinY(gg_rct_game) then if nade then call FHLocals(nadetrig) call DestroyTrigger(nadetrig) if IsUnitAliveBJ(target) then call NadeExplodeDeath(target) endif endif call ResetUnitAnimation(caster) call UnitRemoveAbility(target,'Bslo') call SetUnitFlyHeight( target, 0, 10000) call PauseTimer(t) call FHLocals(t) call DestroyTimer(t) else //Grenade Stuff if nade then if GetUnitFlyHeight(target)<=100 then set g = CreateGroup() call GroupEnumUnitsInRange(g,GetUnitX(target),GetUnitY(target),200,Condition( function nadeconditions)) call GroupRemoveUnit(g,caster) set u = FirstOfGroup(g) if u!= null and IsUnitAliveBJ(target) then call NadeExplodeDeath(target) call SHBoolean(t,"shouldstop",true) endif endif endif if(GetUnitFlyHeight(target)<=10)then set power = GHReal(t,"power") * .6 set loft = GHReal(t,"loft") call SetUnitFlyHeight( target, 11, 100000) set impactsnd = CreateSound( "Abilities\\Weapons\\SorceressMissile\\SorceressMissileHit3.wav", false, true, true, 10, 10, "MissilesEAX" ) call SetSoundParamsFromLabel( impactsnd, "SorceressMissileHit" ) call SetSoundDuration( impactsnd, 1130 ) call SetSoundPosition(impactsnd,GetUnitX(target),GetUnitY(target),100) call SetSoundVolumeBJ( impactsnd, (power*2) + 5 ) call StartSound(impactsnd) call KillSoundWhenDone(impactsnd) call SHReal(t,"power",power) call SHReal(t,"xpower",CosBJ(loft)*power) call SHReal(t,"zpower",SinBJ(loft)*power) else call SetUnitFlyHeight( target, GetUnitFlyHeight(target)+zpower, 100000) call SetUnitX(target,x) call SetUnitY(target,y) call SHReal(t, "zpower", zpower-6.8) endif endif set u = null set g = null set caster = null set p = null set target = null set t = null set impactsnd = null set nadetrig = null endfunction
function TossHandler takes real power, real loft, real angle, unit u,unit caster, boolean nade returns nothing local timer t = CreateTimer() local real xpower = CosBJ(loft)*power local real zpower = SinBJ(loft)*power call UnitAddAbility(u,'Arav') call UnitRemoveAbility(u,'Arav') call SetUnitFlyHeight(u,12,1000000) call SHHandle(t,"target",u) call SHReal(t,"cos",Cos(angle)) call SHReal(t,"sin",Sin(angle)) call SHBoolean(t,"shouldstop",false) call SHReal(t,"power",power) call SHReal(t,"loft",loft) call SHReal(t,"xpower",xpower) call SHReal(t,"angle",angle) call SHReal(t,"zpower",zpower) call SHHandle(t,"caster",caster) call SHBoolean(t,"grenade",nade) call TimerStart(t,.03,true,function Parabolic) set t = null endfunction
function Trig_Toss_Conditions takes nothing returns boolean return GetSpellAbilityId() == 'A003' endfunction
function NotBuilding takes nothing returns boolean return not(IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE)) and not(GetUnitTypeId(GetFilterUnit())=='h001')and not(GetUnitTypeId(GetFilterUnit())=='h005') and not(GetUnitTypeId(GetFilterUnit())=='h002') endfunction
function Trig_Toss_Actions takes nothing returns nothing local unit caster = GetTriggerUnit() local group g = CreateGroup() local location loc = GetSpellTargetLoc() local real tx = GetLocationX(loc) local real ty = GetLocationY(loc) local real cx = GetUnitX(caster) local real cy = GetUnitY(caster) local real targx local real targy local unit target local real distance local real angle local boolean grenade = false call GroupEnumUnitsInRange(g,cx,cy,330,Condition(function NotBuilding)) call GroupRemoveUnit(g,caster) set target = GetClosestUnit(g,cx,cy) call SetUnitAnimationByIndex( caster, 2 ) if (target!=null) then set targx = GetUnitX(target) set targy = GetUnitY(target) set angle = Atan2(ty-targy,tx-targx) if GetUnitTypeId(target)=='nglm' then call RemoveUnit(target) set grenade = true set target = CreateUnit(GetOwningPlayer(caster),'h005',GetUnitX(target),GetUnitY(target),angle*bj_RADTODEG) endif call DummyCastTarget(GetOwningPlayer(caster),target,'A004',"slow") set distance = SquareRoot((tx-targx)*(tx-targx)+(ty-targy)*(ty-targy)) if distance <= 200 then set distance = distance + 100 endif if distance >= 1300 then set distance = distance - 300 endif call TossHandler(distance/12,69,angle,target,caster,grenade) endif call DestroyGroup(g) call RemoveLocation(loc) set loc = null set target = null set g = null set caster = null endfunction
//=========================================================================== function InitTrig_Toss takes nothing returns nothing set gg_trg_Toss = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Toss, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Toss, Condition( function Trig_Toss_Conditions ) ) call TriggerAddAction( gg_trg_Toss, function Trig_Toss_Actions ) endfunction Собственно еще один простенький Toss спелл
|
| |
|
|
| Ven | Дата: Воскресенье, 25.05.2008, 01:19 | Сообщение # 4 |
|
Вурдалак
Группа: Проверенные
Сообщений: 112
Статус: Offline
| Алло Машин56.Я прошу запихать в карту!!!!! Версия 1.5 давно устарела. И у меня есть огромные подозрения что ты эти спеллы пиздишь. Код очень знакомый и можешь мне доказать что твои если скажешь какой метод сохранения в кеш используется в Toss.
|
| |
|
|