//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
AcidCloudDamage | real | Yes | |
AcidCloudPoint | location | Yes | |
AllPlayers | force | No | |
AnimationSpeed | real | No | |
AO | integer | No | |
AO_Angle | real | Yes | |
AO_AoE | real | Yes | |
AO_Big | boolean | Yes | |
AO_Colision | real | Yes | |
AO_Damage | real | Yes | |
AO_Distance | real | Yes | |
AO_Effect1 | effect | Yes | |
AO_Effect2 | effect | Yes | |
AO_Group | group | Yes | |
AO_Height | real | Yes | |
AO_Hero | unit | Yes | |
AO_MaxDistance | real | Yes | |
AO_Missile | unit | Yes | |
AO_Off | boolean | Yes | |
AO_Parabola | real | Yes | |
AO_Point | location | Yes | |
AO_Scale | real | Yes | |
AO_Skip | integer | No | |
AO_Speed | real | Yes | |
AO_Times | integer | No | |
Asheara | unit | No | |
AutoPickupCount | integer | No | |
AutoPickupInteger | integervar | Yes | |
AutoPickupItemType | itemcode | Yes | |
AutoPickupRange | rect | No | |
AutoPickupTempLoc | location | No | |
b | boolean | No | |
BallanceLevel | trigger | Yes | |
BarbarianRageDrainTimer | integer | Yes | |
blood_sfx | string | Yes | |
blood_sfx_counter | integer | No | |
BloodInteger | integer | No | |
BO_Active | boolean | Yes | |
BO_Angle | real | Yes | |
BO_AOE | real | Yes | |
BO_Caster | unit | Yes | |
BO_Damage | real | Yes | |
BO_Duration | real | Yes | |
BO_LeakPoint | location | Yes | |
BO_LoopIndex | integer | Yes | |
BO_MaxPullSpeed | real | Yes | |
BO_Missile | unit | Yes | |
BO_Speed | real | Yes | |
BolaTarget | unit | Yes | |
Boss_HP | real | No | |
BossChargeRange | real | No | |
BossChargeTime | real | No | |
BossEffekt | effect | Yes | |
BS | integervar | No | |
CameraAngle | real | Yes | |
CameraHeroOn | boolean | Yes | true |
CB_Active | boolean | Yes | |
CB_Angle | real | Yes | |
CB_Caster | unit | Yes | |
CB_CurDistance | real | Yes | |
CB_Damage | real | Yes | |
CB_DamagedUnits | group | Yes | |
CB_Effect | effect | Yes | |
CB_Effect2 | effect | Yes | |
CB_LeakPoint | location | Yes | |
CB_LoopIndex | integer | Yes | |
CB_MaxDistance | real | Yes | |
CB_Speed | real | Yes | |
ComboInteger | integer | Yes | |
CripplingWaveAOE | real | Yes | |
CripplingWaveDamage | real | Yes | |
DeathCam_CurrentHero | integer | Yes | |
DeathLocations | location | Yes | |
DemonAttackPoint | location | No | |
DemonCountInteger | integer | No | |
DemonCountLeaderboard | leaderboard | No | |
DemonGroup | group | Yes | |
DemonMaxCount | integer | No | |
DemonOverseerDead | integer | No | |
DemonTimer | timer | Yes | |
DG_Caster | unit | No | |
DG_Handle | handle | No | |
DG_HashTable | hashtable | No | |
DG_LeakPoint | location | Yes | |
DG_TempGroup | group | No | |
DG_TempInt | integervar | No | |
DG_TempLightning | lightning | No | |
DG_TempReal | real | Yes | |
DG_Units | group | No | |
DiabloDummy | unit | No | |
Dialogbutton1 | button | Yes | |
DifficultyLevel | integer | No | 1 |
DifficultyLvlOn | boolean | No | |
DisableRepick | boolean | Yes | |
Dispatch_Level | real | No | |
DT_Attacktype | attacktype | Yes | |
DT_Damage | real | Yes | |
DT_DamagePerInterval | real | Yes | |
DT_DamageTypes | damagetype | Yes | |
DT_Dealers | unit | Yes | |
DT_Effects | effect | Yes | |
DT_Integers | integer | Yes | |
DT_IntervalReals | real | Yes | |
DT_ReachedDamage | real | Yes | |
DT_ReachedInterval | real | Yes | |
DT_Targets | unit | Yes | |
DTA_Attacktype | attacktype | No | |
DTA_DamageType | damagetype | No | |
DTA_DmgDealer | unit | No | |
DTA_EffectAttachmentPoint | string | No | |
DTA_Interval | real | No | |
DTA_SpecialEffect | string | No | |
DTA_Target | unit | No | |
DTA_Time | real | No | |
DTA_TotalDamageDealt | real | No | |
Dummy_Sichtbarkeit | unit | Yes | |
DummyFinalAttack | unit | Yes | |
DummySichtnachTod | unit | Yes | |
EF_Integer | integervar | No | |
EinschlagUnit | unit | No | |
ElectrocuteDamage | real | Yes | |
ElectrocuteRuneDamage | real | Yes | |
EnemiesInNear | group | No | |
ET_AOE | real | Yes | |
ET_LeakPoint | location | Yes | |
ET_LoopIndex | integer | Yes | |
ExInteger | integervar | No | |
Exp_Bonus_On | boolean | Yes | |
Exp_Integer | integer | Yes | |
Exploding_Palm_Boolean | boolean | Yes | |
ExplodingMongrel | unit | Yes | |
ExplodingPalmChance | integer | Yes | |
ExplodingPalmDamage | real | No | |
FallendeSteine | unit | Yes | |
FallendeSteineHoehe | real | No | |
FallendeSteineHoehe2 | real | No | |
FallendeSteineOn | boolean | No | true |
FallendeSteineZeit | real | No | |
FallingStonesInteger | integer | No | |
FB_Active | boolean | Yes | |
FB_Angle | real | Yes | |
FB_AOE | real | Yes | |
FB_BurnDuration | real | Yes | |
FB_BurnInterval | real | Yes | |
FB_Caster | unit | Yes | |
FB_CurDistance | real | Yes | |
FB_Damage | real | Yes | |
FB_DamageOverTime | real | Yes | |
FB_Distance | real | Yes | |
FB_Height | real | Yes | |
FB_LeakPoint | location | Yes | |
FB_LoopIndex | integer | Yes | |
FB_Missile | unit | Yes | |
FB_Speed | real | Yes | |
FB_StartZ | real | Yes | |
FeuerregenAbilityPoint | location | Yes | |
FeuerregenRange | real | Yes | |
FFN_Int | integervar | No | |
FireWall_Left | integervar | No | |
FireWall_Right | integervar | No | |
Fist_Damage | real | Yes | |
Fist_Damage2 | real | Yes | |
FistSFX | effect | Yes | |
FistTarget | unit | Yes | |
Flame_Dps_MUI_Loop | integervar | Yes | |
FlySFX | modelfile | No | |
FN_Effect_Loc | location | No | |
FN_Int | integer | No | |
FoK_Active | boolean | Yes | |
FoK_Angle | real | Yes | |
FoK_AOE | real | Yes | |
FoK_Caster | unit | Yes | |
FoK_Damage | real | Yes | |
FoK_Duration | real | Yes | |
FoK_LeakPoint | location | Yes | |
FoK_LoopIndex | integer | Yes | |
Fragezeichen | effect | Yes | |
FroschTodPunkt | location | No | |
FuriousChargeInteger | integer | Yes | |
Fury_Integer | integer | No | |
GameHandicap | real | No | |
GameVarianteDialog | dialog | No | |
GeneralInteger | integervar | No | |
GeneralLeakPoint | location | Yes | |
GreatVessel | unit | No | |
GroundStompDamage | real | Yes | |
Group | group | No | |
Heroes | unit | Yes | |
HeroIsRevivable | boolean | Yes | |
HeroPoint | location | Yes | |
HO_Damage | real | Yes | |
HoActive | boolean | Yes | |
HoCaster | unit | Yes | |
HoCurDuration | real | Yes | |
HoDuration | real | Yes | |
HoLeakPoint | location | Yes | |
HoLoopIndex | integer | Yes | |
HoSpirit | unit | Yes | |
HunterGroup | group | No | |
IDS_Item | itemcode | Yes | |
IDS_NumOfItems | integer | No | |
IDS_PercentOfDropping | real | Yes | |
Inventory_Camera | camerasetup | Yes | |
Inventory_Camera_Test | timer | No | |
Inventory_Player_Is_Viewing | boolean | Yes | |
Item_Drops | integer | No | |
JB_Active | boolean | Yes | |
JB_Angle | real | Yes | |
JB_AOE | real | Yes | |
JB_Caster | unit | Yes | |
JB_CurDuration | real | Yes | |
JB_Damage | real | Yes | |
JB_Duration | real | Yes | |
JB_Effect | effect | Yes | |
JB_JumpHeight | real | Yes | |
JB_LandEffect | string | Yes | |
JB_LeakPoint | location | Yes | |
JB_LoopIndex | integer | Yes | |
JB_Speed | real | Yes | |
JB_UseKnockback | boolean | Yes | |
JKS_CDummy | unitcode | No | |
JKS_J_AttachSfxString1 | modelfile | No | |
JKS_J_AttachSfxString2 | modelfile | No | |
KS_Active | boolean | Yes | |
KS_Angle | real | No | |
KS_AngleIndex | real | Yes | |
KS_AnglePont | location | Yes | |
KS_DestroyTrees | boolean | No | |
KS_DestroyTreesIndex | boolean | Yes | |
KS_KnockbackUnit | unit | No | |
KS_KnockbackUnitIndex | unit | Yes | |
KS_LeakPoint | location | Yes | |
KS_LoopIndex | integervar | Yes | |
KS_PausedDuringKnockback | boolean | No | |
KS_SfxString | string | No | |
KS_SfxString2 | string | No | |
KS_SfxStringIndex | string | Yes | |
KS_SfxStringIndex2 | string | Yes | |
KS_SfxTimer | integer | Yes | |
KS_SfxTimer2 | integer | Yes | |
KS_Speed | real | No | |
KS_SpeedIndex | real | Yes | |
KS_VectorLeakPoint | location | Yes | |
Landmine | unit | Yes | |
LaserGroup | group | No | |
LaserPosition | location | Yes | |
LocationPointBeben | location | No | |
LocationPointBoss | location | No | |
LocationPointCleave | location | Yes | |
LocationPointGrab | location | No | |
LocationPointGrab2 | location | No | |
LocationPointGrab3 | location | No | |
LocationPointTod | location | No | |
LocationPointTodOrb | location | No | |
LocationPointWelt1 | location | No | |
LocationPointWelt2 | location | No | |
LocationPointWelt3 | location | No | |
LocationPointWelt5 | location | No | |
LS_LeakPoint | location | Yes | |
MA_Active | boolean | Yes | |
MA_Angle | real | Yes | |
MA_AOE | real | Yes | |
MA_Caster | unit | Yes | |
MA_Damage | real | Yes | |
MA_Duration | real | Yes | |
MA_LeakPoint | location | Yes | |
MA_LoopIndex | integer | Yes | |
MA_MaxPullSpeed | real | Yes | |
MA_Missile | unit | Yes | |
MA_Speed | real | Yes | |
MA_TempReal | real | Yes | |
ManaShieldEffect | effect | Yes | |
MeteorDamage | real | Yes | |
MeteorLeakPoint | location | Yes | |
MeteorPoint | location | Yes | |
MongrelGroup | group | No | |
Mongrels | group | Yes | |
MonkRageDrainTimer | integer | Yes | |
MS_ModelofDummy | modelfile | No | |
Nova_Loop | integervar | Yes | |
NumberOfPlayers | integer | No | |
Player | force | No | |
PlayerNames | string | Yes | |
PlayerSelectsUnit | boolean | Yes | |
PlayerUnit | unit | Yes | |
PlayerViewing | integer | Yes | |
PN_Int | integervar | No | |
PulseDamage | real | Yes | |
Quest | quest | Yes | |
Random_Item_Drop | integer | No | |
rect | location | No | |
RedHeroPoint | location | No | |
Revive | boolean | Yes | |
Revive_Check | integer | No | |
Sample_Group | group | No | |
Sample_Point | location | No | |
SanctuaryGroup | group | No | |
SB_LeakPoint | location | Yes | |
SB_RandomSize | real | No | |
Schild_on | boolean | Yes | |
SDSE_Dummy1 | unit | Yes | |
SDSE_Dummy2 | unit | Yes | |
SDSE_Dummy3 | unit | Yes | |
SDSE_Dummy4 | unit | Yes | |
SDSE_Dummy5 | unit | Yes | |
SDSE_Dummy6 | unit | Yes | |
SerentyDamage | real | Yes | |
SetBoniInteger | integer | Yes | |
SH_Area | real | No | |
SH_Area_Increasement | real | No | |
SH_Damage | real | No | |
SH_Damage_Increasement | real | No | |
SH_Effect | string | No | |
SH_Group | group | No | |
SH_HealthBoost | real | No | |
SH_HealthBoost_Increasement | real | No | |
SH_loc | location | Yes | |
SH_ManaBoost | real | No | |
SH_ManaBoost_Increasement | real | No | |
SH_TempReal | real | No | |
SH_TempReal2 | real | No | |
ShakeMagnitude | real | No | |
Sieben_Ebenen_Point | location | Yes | |
SiebenEbenen_Gebiet | rect | Yes | |
SiebenEbenenAbbild | unit | Yes | |
SiebenEbenenDamage | real | Yes | |
SiebenEbenenLeuchtenEffekt | effect | Yes | |
SiegebreakerDummy | unit | No | |
Siegel_Integer | integer | No | |
SiegeLevel | integer | No | |
SoE_AimValue | real | Yes | |
SoE_AttachmentEffect1 | effect | Yes | |
SoE_AttachmentEffect2 | effect | Yes | |
SoE_Caster | unit | Yes | |
SoE_CasterX | real | Yes | |
SoE_CasterY | real | Yes | |
SoE_Damage | real | Yes | |
SoE_DummyDistance | real | Yes | |
SoE_DummySpeed | real | Yes | |
SoE_EnableMovement | boolean | Yes | |
SoE_HitBox | real | Yes | |
SoE_HitEffect | string | Yes | |
SoE_Index | integer | Yes | |
SoE_LightningCount | integer | Yes | |
SoE_MissileSpawnDistance | real | Yes | |
SoE_ModelEffect | string | Yes | |
SoE_Off | boolean | Yes | |
SoE_Point | location | Yes | |
SoE_RemoveOnHit | boolean | Yes | |
SoE_Timer_NewLightning | real | Yes | |
SoE_Timer_NewLightning_Count | real | Yes | |
SoE_UnitGroup | group | No | |
SoEL_Angle | real | Yes | |
SoEL_Damage | real | Yes | |
SoEL_DamageCounter | real | Yes | |
SoEL_DummyDistance | real | Yes | |
SoEL_DummySpeed | real | Yes | |
SoEL_DummyUnit | unit | Yes | |
SoEL_HitBox | real | Yes | |
SoEL_HitEffect | string | Yes | |
SoEL_Index | integer | Yes | |
SoEL_Off | boolean | Yes | |
SoEL_RemoveOnHit | boolean | Yes | |
SoEL_SpecialEffect | effect | Yes | |
SpaltenDamage | real | Yes | |
SpaltenDummy | unit | Yes | |
SpecialItem | itemcode | Yes | |
SpellIntegerDiablo | integer | No | |
SS_Active | boolean | Yes | |
SS_Angle | real | Yes | |
SS_CurSlams | integer | Yes | |
SS_Damage | real | Yes | |
SS_LeakPoint | location | Yes | |
SS_LoopIndex | integer | Yes | |
SS_MaxSlams | integer | Yes | |
SS_Slamer | unit | Yes | |
SS_StartLocation | location | Yes | |
TargetLoc | location | No | |
TempInt | integer | No | |
TempLoc | location | No | |
TempPoint | location | No | |
TempPoint2 | location | No | |
TempPoint3 | location | No | |
TempUnitArray | unit | Yes | |
TempUnitGroup | group | No | |
ThousandPounderGroup | group | No | |
TimeShieldDuration | integer | Yes | |
TimeShieldGroup | group | No | |
TimeShieldPick | unit | No | |
Tor_MUI_Loop | integervar | Yes | |
TP_Effekt | effect | Yes | |
TPAngle | real | Yes | |
TPCasterPoint | location | Yes | |
TPChargeTime | real | Yes | |
TPChargingUnit | unit | Yes | |
TPTargetGroup | group | Yes | |
TraitSpiritRegenerationBonus | real | Yes | |
TrapDamage | real | Yes | |
TrapLeakPoint | location | Yes | |
TrapUnit | unit | Yes | |
TurnCameraOff | boolean | No | |
TW_Int | integervar | No | |
TW_loop2_int | integervar | No | |
TW_loop_int | integervar | No | |
VA_Active | boolean | Yes | |
VA_Angle | real | Yes | |
VA_Caster | unit | Yes | |
VA_CurDistance | real | Yes | |
VA_Effect | effect | Yes | |
VA_LeakPoint | location | Yes | |
VA_LoopIndex | integer | Yes | |
VA_MaxDistance | real | Yes | |
VA_Speed | real | Yes | |
WaveDamage | real | No | |
Whirlwind_Integer | integer | Yes | |
WitchGroup | group | No | |
WizardGroup | group | No | |
x | real | No | |
XPHandicap | real | No | |
y | real | No | |
z | real | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Setup_Run takes nothing returns nothing
local integer i = 0
local player p = GetEnumPlayer()
loop
exitwhen i > 5
if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
call SetPlayerAlliance(Player(i), p, ALLIANCE_SHARED_ADVANCED_CONTROL, true)
call SetPlayerAlliance(p, Player(i), ALLIANCE_SHARED_ADVANCED_CONTROL, true)
endif
set i = i + 1
endloop
endfunction
function Trig_Setup_Actions takes nothing returns nothing
local force f = CreateForce()
call ForceEnumAllies(f, Player(0), null)
call ForForce(f, function Trig_Setup_Run)
call DestroyForce(f)
endfunction
function InitTrig_Setup takes nothing returns nothing
set gg_trg_Setup = CreateTrigger( )
call TriggerAddAction( gg_trg_Setup, function Trig_Setup_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
//=====================================================================================
// | Health Reserve System |
// | by hell gate and Deaod |
//=====================================================================================
// how to use:
// Cnp this system in your map
// if you don't have BoundSentinel in your map also Cnp it else this system can cause a critical error!
// how to create a new Health Ball:
// call NewHealthBall(X ,Y ,Z ,ModelPath ,Heal ,ManaHeal ,SpeedX ,SpeedY ,SpeedZ ,HealingUnit, Scale)
// real real real string real real real real real unit real
//=====================================================================================
library HealthReserve initializer Init //requires BoundSentinel
globals
private real SpeedIncraise = 10. //
private real MaxSpeed = 500. //the maximum speed of a ball
private constant real RopeLength = 750. //
private constant real RefreshTime = 1./40 //refresh intervall
private constant integer DummyId = 'h01C' //the health reserve dummy
private constant real DistanceNeeded = 100. //how far away the ball have to be to heal
private constant string HealEffect = "Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl"
endglobals
private struct HealthBalls
real x
real y
real z
//----- vectors -----
real Heal
real Mana
unit Ball
unit Target
effect Model
private integer i
private static group RecycledDummys=CreateGroup()
private static integer Count =0
private static timer Tim = CreateTimer()
private static integer Total = 0
private static thistype array Balls
private static location LocZ=Location(0,0)
private static method GetUnitZ takes unit u returns real
call MoveLocation(LocZ, GetUnitX(u), GetUnitY(u))
return GetLocationZ(LocZ)+GetUnitFlyHeight(u)
endmethod
private static method SetUnitZ takes unit u, real z returns nothing
call MoveLocation(LocZ, GetUnitX(u), GetUnitY(u))
call SetUnitFlyHeight(u, z-GetLocationZ(LocZ), 0)
endmethod
private method onDestroy takes nothing returns nothing
set Total = Total - 1
set Balls[i] = Balls[Total]
set Balls[i].i=i
if Total==0 then
call PauseTimer(Tim)
endif
endmethod
private static method BallLoop takes nothing returns nothing
local thistype dat
local integer i = Total-1
local real x
local real y
local real z
local real dx // delta x
local real dy // delta y
local real dz // delta z
local real d // absolute distance
loop
exitwhen i < 0
set dat = Balls[i]
if IsUnitType(dat.Target, UNIT_TYPE_DEAD) == false then
set x=GetUnitX(dat.Ball)
set y=GetUnitY(dat.Ball)
set z=GetUnitZ(dat.Ball)
set dx=GetUnitX(dat.Target)-x
set dy=GetUnitY(dat.Target)-y
set dz=GetUnitZ(dat.Target)-z
set d=SquareRoot(dx*dx+dy*dy+dz*dz)
set dat.x=dat.x+dx/d*(SpeedIncraise*RopeLength/d)
set dat.y=dat.y+dy/d*(SpeedIncraise*RopeLength/d)
set dat.z=dat.z+dz/d*(SpeedIncraise*RopeLength/d)
// reuse d
if d <= DistanceNeeded then
call DestroyEffect(dat.Model)
call GroupAddUnit(RecycledDummys,dat.Ball)
set Count=Count+1
call SetWidgetLife(dat.Target,GetWidgetLife(dat.Target)+dat.Heal)
call SetUnitState(dat.Target, UNIT_STATE_MANA, GetUnitState(dat.Target,UNIT_STATE_MANA)+dat.Mana)
call DestroyEffect(AddSpecialEffectTarget(HealEffect,dat.Target,"origin"))
call dat.destroy()
else
set d=SquareRoot(dat.x*dat.x+dat.y*dat.y+dat.z*dat.z)
if d>MaxSpeed then
set dat.x=dat.x/d*MaxSpeed
set dat.y=dat.y/d*MaxSpeed
set dat.z=dat.z/d*MaxSpeed
endif
call SetUnitX(dat.Ball, x+dat.x)
call SetUnitY(dat.Ball, y+dat.y)
call SetUnitZ(dat.Ball, z+dat.z)
endif
else
call RemoveUnit(dat.Ball)
call dat.destroy()
endif
set i = i-1
endloop
endmethod
static method create takes real X, real Y, real Z, string modeleffect, real HP_Add, real Mana_Add, real vX, real vY, real vZ, unit TargetUnit, real Scale returns thistype
local thistype dat = allocate()
set Balls[Total] = dat
if Total==0 then
call TimerStart(Tim,RefreshTime,true,function thistype.BallLoop)
endif
set dat.i=Total
set Total = Total+1
set dat.Heal = HP_Add
set dat.Mana = Mana_Add
set dat.x = vX
set dat.y = vY
set dat.z = vZ
set dat.Target = TargetUnit
if Count == 0 then
set dat.Ball=CreateUnit(Player(15),DummyId,X,Y,0.)
call UnitAddAbility(dat.Ball,'Amrf')
call UnitRemoveAbility(dat.Ball,'Amrf')
call SetUnitPathing(dat.Ball,false)
else
set dat.Ball=FirstOfGroup(RecycledDummys)
call GroupRemoveUnit(RecycledDummys,dat.Ball)
set Count=Count-1
call SetUnitX(dat.Ball,X)
call SetUnitY(dat.Ball,Y)
endif
set dat.Model = AddSpecialEffectTarget(modeleffect,dat.Ball,"chest")
call SetUnitFlyHeight(dat.Ball,Z,0.)
call SetUnitScale(dat.Ball,Scale*0.01,Scale*0.01,Scale*0.01)
return dat
endmethod
endstruct
function NewHealthBall takes real X, real Y, real Z, string modeleffect, real HP_Add, real Mana_Add, real vX, real vY, real vZ, unit TargetUnit, real Scale returns nothing
call HealthBalls.create( X, Y, Z, modeleffect, HP_Add, Mana_Add, vX, vY, vZ, TargetUnit, Scale)
endfunction
private function Init takes nothing returns nothing
set SpeedIncraise = SpeedIncraise*RefreshTime
set MaxSpeed = MaxSpeed*RefreshTime
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library ReserveExample initializer Init
globals
private constant real HPHeal=10.
private constant real MPHeal=10.
private constant string DummyModel="Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl"
private constant real Scale = 50
endglobals
private function Heal takes nothing returns nothing
if GetUnitTypeId(GetAttacker())=='h001' and GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)!= GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA) then
call NewHealthBall(GetUnitX(GetAttacker()),GetUnitY(GetAttacker()),0.,DummyModel,0.,MPHeal,0.,0.,150.,GetTriggerUnit(),Scale)
elseif GetUnitTypeId(GetAttacker())=='h002' and GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_LIFE)!= GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE) then
call NewHealthBall(GetUnitX(GetAttacker()),GetUnitY(GetAttacker()),0.,DummyModel,HPHeal,0.,0.,0.,150.,GetTriggerUnit(),Scale)
endif
endfunction
private function Init takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddAction(t, function Heal)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library BoundSentinel initializer init
//*************************************************
//* BoundSentinel
//* -------------
//* Don't leave your units unsupervised, naughty
//* them may try to get out of the map bounds and
//* crash your game.
//*
//* To implement, just get a vJass compiler and
//* copy this library/trigger to your map.
//*
//*************************************************
//==================================================
globals
// High enough so the unit is no longer visible, low enough so the
// game doesn't crash...
//
// I think you need 0.0 or soemthing negative prior to patch 1.22
//
private constant real EXTRA = 500.0
endglobals
//=========================================================================================
globals
private real maxx
private real maxy
private real minx
private real miny
endglobals
//=======================================================================
private function dis takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
if(x>maxx) then
set x=maxx
elseif(x<minx) then
set x=minx
endif
if(y>maxy) then
set y=maxy
elseif(y<miny) then
set y=miny
endif
call SetUnitX(u,x)
call SetUnitY(u,y)
set u=null
endfunction
private function init takes nothing returns nothing
local trigger t=CreateTrigger()
local region r=CreateRegion()
local rect rc
set minx=GetCameraBoundMinX() - EXTRA
set miny=GetCameraBoundMinY() - EXTRA
set maxx=GetCameraBoundMaxX() + EXTRA
set maxy=GetCameraBoundMaxY() + EXTRA
set rc=Rect(minx,miny,maxx,maxy)
call RegionAddRect(r, rc)
call RemoveRect(rc)
call TriggerRegisterLeaveRegion(t,r, null)
call TriggerAddAction(t, function dis)
//this is not necessary but I'll do it anyway:
set t=null
set r=null
set rc=null
endfunction
endlibrary
//TESH.scrollpos=69
//TESH.alwaysfold=0
library Multishot requires Math
globals
private constant real Tick = 1./30.
private constant real AngleBetween = 6.
private constant real ShootOffset = 50.
private constant real Speed = 1000.
private attacktype Attacktype = ATTACK_TYPE_PIERCE
private damagetype Damagetype = DAMAGE_TYPE_DEMOLITION
private string DeadEffect = ""
private constant integer ArrowUnit = 'h02A'
private constant integer MultishootSpellID = 'A01U'
endglobals
private struct Arrow
unit Caster
unit Arrow
real Damage
real AOE
real DistanceLeft
string HitEffect
group DamagedUnits = CreateGroup()
vector position
vector velocity
private integer i
private static timer Tim = CreateTimer()
private static integer Total = 0
private static thistype array Arrows
private static group g = CreateGroup()
private static thistype temp
//============================ settings ==============================
private static method GetDistance takes integer level returns real
return 650.+(75.*I2R(level))
endmethod
private static method GetDamage takes integer level returns real
return 17.+(4*I2R(level))
endmethod
private static method GetAOE takes integer level returns real
return 60.
endmethod
private static method GetArrowCount takes integer level returns integer
return 5+(1*level)
endmethod
//========================== end of settings =========================
private static method onDamage takes nothing returns nothing
local vector unitpos = vector.create(GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()),GetUnitZ(GetEnumUnit()))
if IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(temp.Caster)) and Get2DDistance(temp.position,unitpos)<=temp.AOE and not IsUnitInGroup(GetEnumUnit(),temp.DamagedUnits) then
call UnitDamageTarget(temp.Caster,GetEnumUnit(),temp.Damage,true, false, Attacktype, Damagetype, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget(temp.HitEffect,GetEnumUnit(),"chest"))
call GroupAddUnit(temp.DamagedUnits,GetEnumUnit())
endif
call unitpos.destroy()
endmethod
private method onDestroy takes nothing returns nothing
set Total = Total - 1
set Arrows[i] = Arrows[Total]
set Arrows[i].i=i
if Total == 0 then
call PauseTimer(Tim)
endif
endmethod
private static method onLoop takes nothing returns nothing
local thistype dat
local integer i2 = 0
loop
exitwhen i2 > Total - 1
set dat = Arrows[i2]
set dat.DistanceLeft = dat.DistanceLeft - (Speed * Tick)
call dat.position.add(dat.velocity)
call SetUnitXYZ(dat.Arrow,dat.position.x,dat.position.y,dat.position.z)
set temp = dat
call GroupEnumUnitsInRange(g,dat.position.x,dat.position.y,dat.AOE,null)
call ForGroup(g,function thistype.onDamage)
call GroupClear(g)
if dat.DistanceLeft <=0. then //or GetLocZ(dat.position.x,dat.position.y)> dat.position.z then
call RemoveUnit(dat.Arrow)
call DestroyEffect(AddSpecialEffect(DeadEffect,dat.position.x,dat.position.y))
call dat.position.destroy()
call dat.velocity.destroy()
call DestroyGroup(dat.DamagedUnits)
set dat.Caster=null
set dat.Arrow=null
call dat.destroy()
endif
set i2 = i2+1
endloop
endmethod
private static method Check takes nothing returns boolean
local thistype dat
local integer x = 0
local integer lvl
local integer counter
local real arrowspread
local real angletotarget
local real ang
local real offsetx
local real offsety
if GetSpellAbilityId() == MultishootSpellID then
call PlaySoundOnUnitBJ( gg_snd_Diablo_3_Hunter_Molten_Arrow, 80.00, GetTriggerUnit() ) // RainOfFireTarget1 ersetzten
set lvl = GetUnitAbilityLevel(GetTriggerUnit(), MultishootSpellID)
set counter = GetArrowCount(lvl)-1+4*GetNumberOfItemsFromUnit(GetTriggerUnit(),'I028') //rune id
set arrowspread = counter*AngleBetween
set angletotarget = Atan2(GetSpellTargetY()-GetUnitY(GetTriggerUnit()),GetSpellTargetX()-GetUnitX(GetTriggerUnit()))*bj_RADTODEG
set ang = angletotarget-(arrowspread/2)
set offsetx = ShootOffset*Cos(angletotarget*bj_DEGTORAD)
set offsety = ShootOffset*Sin(angletotarget*bj_DEGTORAD)
loop
exitwhen x > counter
set dat = thistype.allocate()
if Total==0 then
call TimerStart(Tim,Tick,true,function thistype.onLoop)
endif
set dat.i=Total
set Arrows[dat.i] = dat
set Total = Total+1
set ang = ang + AngleBetween
set dat.Caster = GetTriggerUnit()
set dat.AOE = GetAOE(lvl)
set dat.Damage = GetDamage(lvl)+(1*GetNumberOfItemsFromUnit(GetTriggerUnit(),'I028')) // rune id
set dat.DistanceLeft = GetDistance(lvl)
set dat.position = vector.create(GetUnitX(dat.Caster)+offsetx,GetUnitY(dat.Caster)+offsety,GetUnitZ(dat.Caster)+40.)
set dat.velocity = vector.create(Speed*Tick*Cos(ang*bj_DEGTORAD),Speed*Tick*Sin(ang*bj_DEGTORAD),0.)
if (GetNumberOfItemsFromUnit(GetTriggerUnit(),'I028')>=1) then
set dat.HitEffect="Abilities\\Spells\\Other\\ForkedLightning\\ForkedLightningTarget.mdl"
else
set dat.HitEffect="Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl"
endif
set dat.Arrow = CreateUnit(GetOwningPlayer(dat.Caster),ArrowUnit,dat.position.x,dat.position.y,ang)
call MakeUnitFly(dat.Arrow)
call SetUnitZ(dat.Arrow,dat.position.z)
set x=x+1
endloop
endif
return false
endmethod
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function thistype.Check))
endmethod
endstruct
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Vector requires Math
struct vector
real x
real y
real z
static constant real accuracy = 1.
static method create takes real x, real y, real z returns vector
local vector v = vector.allocate()
set v.x=x
set v.y=y
set v.z=z
return v
endmethod
method set takes real x, real y, real z returns nothing
set this.x=x
set this.y=y
set this.z=z
endmethod
method getLength takes nothing returns real
return SquareRoot(.x*.x + .y*.y + .z*.z)
endmethod
static method sum takes vector augend, vector addend returns vector
local vector v = vector.allocate()
set v.x = augend.x+addend.x
set v.y = augend.y+addend.y
set v.z = augend.z+addend.z
return v
endmethod
method add takes vector addend returns nothing
set this.x=this.x+addend.x
set this.y=this.y+addend.y
set this.z=this.z+addend.z
endmethod
method addscaled takes vector addend, real scale returns nothing
set this.x=this.x+addend.x*scale
set this.y=this.y+addend.y*scale
set this.z=this.z+addend.z*scale
endmethod
static method difference takes vector minuend, vector subtrahend returns vector
local vector v = vector.allocate()
set v.x = minuend.x-subtrahend.x
set v.y = minuend.y-subtrahend.y
set v.z = minuend.z-subtrahend.z
return v
endmethod
method subtract takes vector subtrahend returns nothing
set this.x=this.x-subtrahend.x
set this.y=this.y-subtrahend.y
set this.z=this.z-subtrahend.z
endmethod
method scale takes real factor returns nothing
set this.x=this.x*factor
set this.y=this.y*factor
set this.z=this.z*factor
endmethod
method setLength takes real length returns nothing
local real l = SquareRoot(.x*.x + .y*.y + .z*.z)
if l == 0.0 then
return
endif
set l = length/l
set this.x = this.x*l
set this.y = this.y*l
set this.z = this.z*l
endmethod
static method dotProduct takes vector a, vector b returns real
return (a.x*b.x+a.y*b.y+a.z*b.z)
endmethod
static method crossProduct takes vector a, vector b returns vector
local vector v = vector.allocate()
set v.x = a.y*b.z - a.z*b.y
set v.y = a.z*b.x - a.x*b.z
set v.z = a.x*b.y - a.y*b.x
return v
endmethod
method ProjToPoint takes real x,real y,real z,real speed,real per,real Zforce returns boolean
local real d
local real des
set speed = speed*per
set Zforce=Zforce*per*per
if Zforce != 0.0 then
set d = SquareRoot(x*x + y*y) + 0.001
set des = speed*speed*speed*speed - Zforce*Zforce*d*d + 2*Zforce*speed*speed*z
if des >= 0.0 then
set des = Atan((-speed*speed-SquareRoot(des))/(Zforce*d))
set this.z = (speed*Sin(des)/per)
set des = speed*Cos(des)/d
set this.x = (des*x/per)
set this.y = (des*y/per)
return true
endif
return false
else
set des = speed/(SquareRoot(x*x + y*y + z*z) + 0.001)
set this.x = x*des/per
set this.y = y*des/per
set this.z = z*des/per
return true
endif
endmethod
// bounce functions
method vecNormalise takes nothing returns nothing
local real length = SquareRoot(this.x*this.x+this.y*this.y+this.z*this.z)
if (length>0) then
set this.x=this.x/length
set this.y=this.y/length
set this.z=this.z/length
else
set this.z=1.
endif
endmethod
static method vecTerrainNormal takes real x, real y returns vector
local vector v=vector.allocate()
local real h1
local real h2
local real h3
local real h4
set h1 = GetLocZ(x-accuracy,y)
set h2 = GetLocZ(x+accuracy,y)
set h3 = GetLocZ(x,y-accuracy)
set h4 = GetLocZ(x,y+accuracy)
set v.x = h1-h2
set v.y = h3-h4
set v.z = 2*accuracy
call v.vecNormalise()
return v
endmethod
method vecBounce takes real x, real y, real b returns nothing
local real scale
local real vecdot
local vector terr = vecTerrainNormal(x,y)
set vecdot = dotProduct(this,terr)
set scale = -(1+b)*vecdot
set this.x = this.x+(terr.x*scale)
set this.y = this.y+(terr.y*scale)
set this.z = this.z+(terr.z*scale)
call terr.destroy()
endmethod
endstruct
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
//=====================================================================================
// by hell gate
//=====================================================================================
library Math initializer Init
globals
private location p = Location(0.,0.)
private item i
endglobals
function GetUnitZ takes unit u returns real
call MoveLocation(p,GetUnitX(u),GetUnitY(u))
return GetLocationZ(p)+GetUnitFlyHeight(u)
endfunction
function SetUnitZ takes unit u, real z returns nothing
call MoveLocation(p,GetUnitX(u),GetUnitY(u))
call SetUnitFlyHeight(u,z-GetLocationZ(p),0.)
endfunction
function SetUnitXYZ takes unit u, real x, real y, real z returns nothing
call MoveLocation(p,GetUnitX(u),GetUnitY(u))
call SetUnitFlyHeight(u,z-GetLocationZ(p),0.)
call SetUnitX(u,x)
call SetUnitY(u,y)
endfunction
function GetLocZ takes real x, real y returns real
call MoveLocation(p,x,y)
return GetLocationZ(p)
endfunction
function GetNumberOfItemsFromUnit takes unit u, integer searchitem returns integer
local integer i2 = 0
local integer count=0
loop
exitwhen i2 == 6
if GetItemTypeId(UnitItemInSlot(u,i2)) == searchitem then
set count = count+1
endif
set i2 = i2+1
endloop
return count
endfunction
function Get3DDistance takes vector p1, vector p2 returns real
local real distX = p1.x-p2.x
local real distY = p1.y-p2.y
local real distZ = p1.z-p2.z
return SquareRoot((distX*distX)+(distY*distY)+(distZ*distZ))
endfunction
function Get2DDistance takes vector p1, vector p2 returns real
local real distX = p1.x-p2.x
local real distY = p1.y-p2.y
return SquareRoot((distX*distX)+(distY*distY))
endfunction
function MakeUnitFly takes unit u returns nothing
call UnitAddAbility(u,'Arav')
call UnitRemoveAbility(u,'Arav')
endfunction
function PolarProjectionX takes real x, real angle, real dist returns real
return x+dist*Cos(angle*bj_DEGTORAD)
endfunction
function PolarProjectionY takes real y, real angle, real dist returns real
return y+dist*Sin(angle*bj_DEGTORAD)
endfunction
function CreateEffectAtLocForPlayer takes real x, real y, string file, player p returns effect
local string s
if GetLocalPlayer()==p then
set s=file
endif
return AddSpecialEffect(s,x,y)
endfunction
function CreateEffectOnUnitForPlayer takes widget target, string file, string attach, player p returns effect
local string s
if GetLocalPlayer()==p then
set s=file
endif
return AddSpecialEffectTarget(s,target,attach)
endfunction
function IsLocPathable takes real x, real y returns boolean
local real tx = x
local real ty = y
call SetItemVisible(i,true)
call SetItemPosition(i,x,y)
set tx = GetItemX(i) - tx
set ty = GetItemY(i) - ty
call SetItemVisible(i,false)
return (tx < 1. and tx > -1. and ty < 1. and ty > -1.)
endfunction
private function Init takes nothing returns nothing
set i = CreateItem('kysn',0,0)
call SetItemVisible(i,false)
endfunction
endlibrary