Embrace_It
New Member
- Reaction score
- 9
A lot of those skills are great, might get their name changes a bit but those skills are really good.
Tauren Warrior:
===============
1. Taunt
- Type: Instant
- Spell Description:
The Tauren Warrior taunt his surrounding enemies, causing them to attack him.
- Note: Not original, but more or less necessary.
2. Spirit Guidance
- Type: Instant
- Spell Description:
The Tauren Warrior asks his ancestors for guidance, healing him for <level> hit points
over x seconds. If the Tauren Warrior is attacked, the blessing is lost.
- Note: This should probably have a long cooldown.
3. Battle Charge
- Type: Point Target
- Spell Description:
The Tauren Warrior begins charging in the given direction, elegantly passing through his allies, and brutally colliding with the first enemies he
encounters. Damage depends on distance travelled.
- Note: None
5. Battle Rage
- Type: Instant
- Spell Description:
The Tauren Warrior goes in rage dealing extra damage to enemy units and also has a chance of pushing units away from him dealing extra damage to them.
- Note: Knockback is 300 range away, 10% chance
Troll Rogue:
============
1. Critical Strike
- Type: Passive
- Spell Description:
The rogue has trained for many years, up to a point where he can
easily pass through the defenses of even the most skilled swordsman,
cutting into their flesh.
Gives the rogue a x% chance to cut the target, opening a wound.
- Note: This affects the rogues other attacks.
2. Pinpoint weakness
- Type: Unit Target
- Spell Description:
Instantly seeing an opportunity to attack, the rogue strikes with deadly precision,
afflicting the target with <level> wounds. The unit loses life every second for 10 seconds.
- Note: Instantly adds the Wound debuff as in Elegant strikes.
3. Poison
- Type: Unit Target
- Spell Description:
The rogue's blades are dipped in toxic extracts, dealing <level> damage over
<level> time. The amount of damage dealt, depends on how many wounds the target has. Does not stack.
- Note: None
4.
- Type:
- Spell Description:
- Note:
To make sure I understand, say I had to code 'Battle Charge'. I would make the spell so that damage was dependant on both the unit's strength/stam and the distance travelled. Would that be ok then? If not, please elaborate a bit
scope Camera initializer Init
struct cam
unit locked
real distance
real angle
location loc
real lr
endstruct
globals
private integer Total = 11
private cam array D
private timer T = CreateTimer()
endglobals
private function TimerLoop takes nothing returns nothing
local integer i = 0
local real z
loop
exitwhen i>=Total
if D<i>.locked != null then
set D<i>.loc = GetUnitLoc(D<i>.locked)
set z = GetLocationZ(D<i>.loc)
if (GetLocalPlayer() == Player(i)) then
call PanCameraToTimed(GetLocationX(D<i>.loc), GetLocationY(D<i>.loc), 2)
endif
if (GetLocalPlayer() == Player(i)) then
call SetCameraTargetController(D<i>.locked, 0, 0, false)
endif
if (GetLocalPlayer() == Player(i)) then
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, D<i>.distance, .75)
endif
if (GetLocalPlayer() == Player(i)) then
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, D<i>.angle, .75)
endif
if (GetLocalPlayer() == Player(i)) then
call SetCameraField(CAMERA_FIELD_ROTATION, GetUnitFacing(D<i>.locked)+D<i>.lr, .75)
endif
if (GetLocalPlayer() == Player(i)) then
call SetCameraField(CAMERA_FIELD_ZOFFSET, 100+(z/3), .75)
endif
call RemoveLocation(D<i>.loc)
endif
set i = i+1
endloop
endfunction
private function RotateUpAct takes nothing returns nothing
local integer i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
set D<i>.angle = D<i>.angle - 30
if D<i>.angle < -360 then
set D<i>.angle = D<i>.angle + 360
endif
endfunction
private function RotateUpCond takes nothing returns boolean
return GetSpellAbilityId() == 039;A003039;
endfunction
private function RotateUp takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(t,Condition(function RotateUpCond))
call TriggerAddAction(t,function RotateUpAct)
endfunction
private function RotateRightAct takes nothing returns nothing
local integer i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
set D<i>.lr = D<i>.lr+30
if D<i>.lr > 360 then
set D<i>.lr = D<i>.lr - 360
endif
endfunction
private function RotateRightCond takes nothing returns boolean
return GetSpellAbilityId() == 039;A002039;
endfunction
private function RotateRight takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(t,Condition(function RotateRightCond))
call TriggerAddAction(t,function RotateRightAct)
endfunction
private function RotateLeftAct takes nothing returns nothing
local integer i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
set D<i>.lr = D<i>.lr-30
if D<i>.lr < -360 then
set D<i>.lr = D<i>.lr + 360
endif
endfunction
private function RotateLeftCond takes nothing returns boolean
return GetSpellAbilityId() == 039;A000039;
endfunction
private function RotateLeft takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(t,Condition(function RotateLeftCond))
call TriggerAddAction(t,function RotateLeftAct)
endfunction
private function RotateDownAct takes nothing returns nothing
local integer i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
set D<i>.angle = D<i>.angle + 30
if D<i>.angle > 360 then
set D<i>.angle = D<i>.angle - 360
endif
endfunction
private function RotateDownCond takes nothing returns boolean
return GetSpellAbilityId() == 039;A001039;
endfunction
private function RotateDown takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(t,Condition(function RotateDownCond))
call TriggerAddAction(t,function RotateDownAct)
endfunction
private function ResetCamAct takes nothing returns nothing
local integer i = GetPlayerId(GetTriggerPlayer())
set D<i>.angle = -20
set D<i>.lr = 0
endfunction
private function ResetCam takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i>11
call TriggerRegisterPlayerChatEvent( t, Player(i), "-reset cam", true )
set i = i+1
endloop
call TriggerAddAction(t,function ResetCamAct)
endfunction
private function Init takes nothing returns nothing
call ResetCam()
call RotateDown()
call RotateLeft()
call RotateRight()
call RotateUp()
call TimerStart(T,0.03,true,function TimerLoop)
endfunction
function SetCamTarget takes unit u, real dist,real angle, integer i returns nothing
set D<i>.locked = u
set D<i>.distance = dist
set D<i>.angle = angle
set D<i>.lr = 0
endfunction
endscope
</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>
ResetStaminaRange(u) and ResetStaminaMelee(unit u)
Actually, playing around with the stats, I think that the formula we have right now for damage works good for all levels but just in case, use the functions wel made.
EDIT: @ wellwish3r - I read your post about your camera system. The DGUI library that D.V.D is using has a 3rd person camera as well. I tested it on some steep slopes and there was no problem. It does use a 3D math library however, but you might be able to solve your problem. You can check it out if you like: http://www.wc3c.net/showthread.php?t=102351
globals
constant real GamePeriod = 0.04
trigger GameTimer = null
CAMERA GameCamera = NULL
unit GameUnit = null
player GamePlayer = null
endglobals
function Approximately takes real v1, real v2, real s returns boolean
return v2-s < v1 and v1 < v2+s
endfunction
function GameUpdate takes nothing returns nothing
local real ang = GetUnitFacing(GameUnit)*bj_DEGTORAD
local real tx = GetUnitX(GameUnit)
local real ty = GetUnitY(GameUnit)
local real tz = GetTerrainZ(tx, ty)+GetUnitDefaultFlyHeight(GameUnit)+150
local real dex = (tx-550*Cos(ang))-GameCamera.Eye.x
local real dey = (ty-550*Sin(ang))-GameCamera.Eye.y
local real dez = (tz+100)-GameCamera.Eye.z
local real X = GameCamera.Eye.x+dex*0.07
local real Y = GameCamera.Eye.y+dey*0.07
local real Z = GameCamera.Eye.z+dez*0.07
set ang = GetTerrainZ(X, Y)+170
if Z < ang then
set Z = ang
endif
if not(Approximately(X, GameCamera.Eye.x, 1) and Approximately(Y, GameCamera.Eye.y, 1) and Approximately(Z, GameCamera.Eye.z, 1) and Approximately(tx, GameCamera.At.x, 1) and Approximately(ty, GameCamera.At.y, 1) and Approximately(tz, GameCamera.At.z, 1)) then
call GameCamera.SetEyeAndAt(X, Y, Z, tx, ty, tz)
endif
endfunction
function GamePostUpdate takes nothing returns nothing
if GameCamera.ApplyCameraForPlayer(GamePlayer, false) then
call DGUIUpdate(true, true, true)
endif
call UpdateFigure(GameCamera)
endfunction
function StartGame takes nothing returns nothing
set GameUnit = CreateUnit(GamePlayer, 039;Hpal039;, 0, 0, 0)
set GameCamera = CAMERA.New()
call CreateInterface(GameCamera)
set GameTimer = CreateTrigger()
call TriggerRegisterTimerEvent(GameTimer, GamePeriod, true)
call TriggerAddAction(GameTimer, function GameUpdate)
call TriggerAddAction(GameTimer, function GamePostUpdate)
call DestroyTimer(GetExpiredTimer())
endfunction
library Camera initializer Init requires Math
globals
private constant integer TypeUnit = 039;dgui039;
private location GL4Cam = Location(0,0)
private unit AtUnit = null
private real DeltaZ = 0
endglobals
globals
constant real WidthScreen = 0.544
constant real HeightScreen = 0.302
constant real AspectRatio = WidthScreen/HeightScreen
endglobals
private function Matrix4Perspective1 takes MATRIX4 Output, real fovy, real Aspect, real zn, real zf returns MATRIX4
return Output.SetValues(2*zn/fovy,0,0,0,0,2*zn/Aspect,0,0,0,0,zf/(zf-zn),1,0,0,zn*zf/(zn-zf),0)
endfunction
private function Matrix4Perspective2 takes MATRIX4 Output, real n, real f, real r, real l, real t, real b returns MATRIX4
return Output.SetValues(2*n/(r-l), 0, (r+l)/(r-l), 0, 0, 2*n/(t-b), (t+b)/(t-b), 0, 0, 0, -(f+n)/(f-n), -2*f*n/(f-n), 0, 0, -1, 0)
endfunction
private function Matrix4Look takes MATRIX4 Output, VECTOR3 PosCamera, VECTOR3 AxisX, VECTOR3 AxisY, VECTOR3 AxisZ returns MATRIX4
return Output.SetValues(AxisX.x,AxisY.x,AxisZ.x,0,AxisX.y,AxisY.y,AxisZ.y,0,AxisX.z,AxisY.z,AxisZ.z,0,-Vec3Dot(AxisX, PosCamera),-Vec3Dot(AxisY, PosCamera),-Vec3Dot(AxisZ, PosCamera),1)
endfunction
struct CAMERA
VECTOR3 Eye
VECTOR3 At
real Distance
real Yaw
real Pitch
real Roll
VECTOR3 AxisX
VECTOR3 AxisY
VECTOR3 AxisZ
private MATRIX4 View
private MATRIX4 Projection
private boolean change
integer CostumValue
method Win2World takes real X, real Y, real Range returns VECTOR3
local VECTOR3 Output = VECTOR3.create()
set Output.x = .Eye.x+.AxisZ.x*Range+X*.AxisX.x*WidthScreen*Range+Y*.AxisY.x*HeightScreen*Range
set Output.y = .Eye.y+.AxisZ.y*Range+X*.AxisX.y*WidthScreen*Range+Y*.AxisY.y*HeightScreen*Range
set Output.z = .Eye.z+.AxisZ.z*Range+X*.AxisX.z*WidthScreen*Range+Y*.AxisY.z*HeightScreen*Range
return Output
endmethod
method World2Win takes real X, real Y, real Z returns VECTOR3
local VECTOR3 Pos = VECTOR3.New_1(X, Y, Z)
local boolean b
call Vec3Transform_2(Pos, Pos, .View)
set b = Pos.z < 0
call Vec3Transform_2(Pos, Pos, .Projection)
if b then
set Pos.z = -Pos.z
endif
return Pos
endmethod
private method UpdateDistanceYawPitch takes nothing returns nothing
local real dx = .At.x-.Eye.x
local real dy = .At.y-.Eye.y
local real dz = .At.z-.Eye.z
local real len2d
set .Distance = SquareRoot(dx*dx+dy*dy+dz*dz)
set .Yaw = Atan2(dy, dx)
set len2d = SquareRoot(dx*dx+dy*dy)
set .Pitch = Atan2(dz, len2d)
endmethod
private method UpdateAxisMatrix takes nothing returns nothing
local MATRIX3 mat
call Vec3Normalize(.AxisZ, Vec3Subtract(.AxisZ, .At, .Eye))
set mat = Matrix3RotationAxis(MATRIX3.create(), .AxisZ, -.Roll)
call Vec3Normalize(.AxisX, Vec3Cross(.AxisX, .AxisZ, VECTOR3.oneZ))
call Vec3Transform_1(.AxisY, Vec3Cross(.AxisY, .AxisX, .AxisZ), mat)
call Vec3Transform_1(.AxisX, .AxisX, mat)
call Matrix4Look(.View, .Eye, .AxisX, .AxisY, .AxisZ)
call mat.destroy()
endmethod
method ApplyCameraForPlayer takes player p, boolean IgnorChange returns boolean
if GetLocalPlayer() == p then
call SetCameraField(CAMERA_FIELD_ROTATION, .Yaw*bj_RADTODEG, 0)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, .Pitch*bj_RADTODEG, 0)
call SetCameraField(CAMERA_FIELD_ROLL, .Roll*bj_RADTODEG, 0)
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, .Distance, 0)
call SetCameraTargetController(AtUnit, .At.x, .At.y, false)
call SetCameraField(CAMERA_FIELD_ZOFFSET, .At.z-DeltaZ, 0)
endif
if .change or IgnorChange then
set .change = false
return true
endif
return false
endmethod
method SetPosition takes real x, real y, real z returns nothing
local real dx = x-.At.x
local real dy = y-.At.y
local real dz = z-.At.z
set .Eye.x = .Eye.x+dx
set .Eye.y = .Eye.y+dy
set .Eye.z = .Eye.z+dz
set .At.x = x
set .At.y = y
set .At.z = z
set .change = true
endmethod
method SetEyeAndAt takes real ex, real ey, real ez, real tx, real ty, real tz returns nothing
set .Eye.x = ex
set .Eye.y = ey
set .Eye.z = ez
set .At.x = tx
set .At.y = ty
set .At.z = tz
call .UpdateDistanceYawPitch()
call .UpdateAxisMatrix()
set .change = true
endmethod
method SetYawPitchRoll takes real yaw, real pitch, real roll, boolean EyeLock returns nothing
local real Z = .Distance*Sin(pitch)
local real XY = .Distance*Cos(pitch)
local real X = XY*Cos(yaw)
local real Y = XY*Sin(yaw)
set .Yaw = yaw
set .Pitch = pitch
set .Roll = roll
if EyeLock then
set .At.x = .Eye.x+X
set .At.y = .Eye.y+Y
set .At.z = .Eye.z+Z
else
set .Eye.x = .At.x-X
set .Eye.y = .At.y-Y
set .Eye.z = .At.z-Z
endif
call .UpdateAxisMatrix()
set .change = true
endmethod
static method New takes nothing returns CAMERA
local CAMERA this = CAMERA.create()
set .CostumValue = 0
set .change = true
set .Eye = VECTOR3.New_1(0.0,-922.668,DeltaZ+1367.912)
set .At = VECTOR3.New_1(0, 0, DeltaZ)
set .Distance = 0
set .Yaw = 0
set .Pitch = 0
set .Roll = 0
set .AxisX = VECTOR3.create()
set .AxisY = VECTOR3.create()
set .AxisZ = VECTOR3.create()
set .View = MATRIX4.create()
set .Projection = Matrix4Perspective2(MATRIX4.create(), 0.5, 10000, -WidthScreen/2, WidthScreen/2, -HeightScreen/2, HeightScreen/2)
call .UpdateDistanceYawPitch()
call .UpdateAxisMatrix()
return this
endmethod
method Delete takes nothing returns nothing
call .Eye.destroy()
call .At.destroy()
call .AxisX.destroy()
call .AxisY.destroy()
call .AxisZ.destroy()
call .View.destroy()
call .Projection.destroy()
call this.destroy()
endmethod
endstruct
globals
private real TempX = 0
private real TempY = 0
endglobals
private function InitDeltaZ_Timer takes nothing returns nothing
set DeltaZ = GetCameraTargetPositionZ()
call SetCameraPosition(TempX, TempY)
call DestroyTimer(GetExpiredTimer())
endfunction
function InitDeltaZ takes nothing returns nothing
set TempX = GetCameraTargetPositionX()
set TempY = GetCameraTargetPositionY()
call SetCameraPosition(0, 0)
call TimerStart(CreateTimer(), 0.04, false, function InitDeltaZ_Timer)
endfunction
private function Init takes nothing returns nothing
set AtUnit = CreateUnit(Player(15), TypeUnit, 0, 0, 0)
call ShowUnit(AtUnit, false)
call InitDeltaZ()
endfunction
endlibrary
You could delete all the other versions that you have replaced of the combat systems and camera to save memory. Testing your system now. I plan on making the DGUI work with your camera instead of its camera library.