Dest
New Member
- Reaction score
- 26
Woah! My jaw dropped. You must have put a lot of great progress and work there! I can't wait to try this out!
Wow, excelent terrain.
A question, all terrain of your map will be desert?
Legend:
Dark Brown represents the mountians(only outlined for now, not filled in)
Green represents the trolls
Sandy Brown represents the desert(orcs)
Everywhere else are were the other reigons will be.
scope MeleeCS initializer Init
struct MeleeFighter //The struct, dont alter this
unit attacker
boolean attk
real stamina
real damage
integer agi
integer str
integer int
location uloc
location oloc
real facing
boolean end
texttag txt
location txtloc
player owner
endstruct
globals //Globals, don't touch these
private integer Total = 0
private MeleeFighter array D
private timer T = CreateTimer()
private integer index
private integer aindex
endglobals
private function GetDamage takes integer j returns real // Here Is the function that gives you the dmg
local real dmg
local integer i = j
set D<i>.agi = GetHeroAgi(D<i>.attacker,true)
set D<i>.str = GetHeroStr(D<i>.attacker,true)
set D<i>.int = GetHeroInt(D<i>.attacker,true)
if D<i>.stamina < 16 then
set dmg = 0
else
set dmg = (D<i>.agi + D<i>.str + D<i>.int)*(D<i>.stamina/25)
endif
return dmg
endfunction
private function GetStamTick takes nothing returns real //determines the amount of stamina regenerated every 0.025 seconds (40 times per second)
return 100.00/120.00 //currently simply set to an amount that results in a 3 second cooldown
endfunction
private function IsHero takes nothing returns boolean //Is just temporary, as it picks all Heroes on the map, and adds gives them a slot in the struct array
local unit u = GetFilterUnit()
if IsUnitType(u,UNIT_TYPE_HERO) then
set u = null
return true
endif
set u = null
return false
endfunction
private function MatchUnits takes nothing returns boolean //Picks the Units for the Unitgroup that is damaged
local unit u = GetFilterUnit()
if IsPlayerEnemy(GetOwningPlayer(D[aindex].attacker),GetOwningPlayer(u)) then
if IsUnitType(u,UNIT_TYPE_FLYING) == false then
if GetUnitAbilityLevel(u,039;Aloc039;) < 1 then
if GetUnitState(u,UNIT_STATE_LIFE) > 0.405 then
set u = null
return true
endif
endif
endif
endif
set u = null
return false
endfunction
private function DamageGroup takes nothing returns nothing //Damages the picked units
local unit u = GetEnumUnit()
local real dmg = GetDamage(aindex)
call UnitDamageTarget(D[aindex].attacker,u,dmg,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
//call BJDebugMsg("Damage: "+R2S(dmg)+" Stamina: "+R2S(D[aindex].stamina))
set u = null
endfunction
private function AddToStruct takes nothing returns nothing //Adds a new Unit to the struct array
local MeleeFighter LF = MeleeFighter.create()
local unit u = GetEnumUnit()
set LF.attacker = u
set LF.stamina = 100
set LF.attk = false
set LF.end = false
set LF.owner = GetOwningPlayer(u)
set D[Total] = LF
set Total = Total + 1
endfunction
private function TimerLoop takes nothing returns nothing //This creates the floating text and regenerates the stamina
local integer i = 0
local integer j = 1
local string s = ""
local integer cstam = 0
loop
exitwhen i>=Total
if D<i>.stamina < 100 then
set index = i
if D<i>.stamina >= 100 then
set D<i>.stamina = 100
else
set D<i>.stamina = D<i>.stamina + GetStamTick()
endif
set cstam = R2I(D<i>.stamina)
loop
exitwhen j > 50
if (cstam/2) >= j then
set s = s + "|cff660066039;|r"
else
set s = s + "039;"
endif
set j = j+1
endloop
set D<i>.uloc = GetUnitLoc(D<i>.attacker)
set D<i>.txtloc = Location(GetLocationX(D<i>.uloc) - 65.00,GetLocationY(D<i>.uloc))
call RemoveLocation(D<i>.uloc)
set D<i>.uloc = null
set D<i>.txt = CreateTextTag()
call SetTextTagText(D<i>.txt,s,TextTagSize2Height(8.00))
call SetTextTagPos(D<i>.txt,GetLocationX(D<i>.txtloc),GetLocationY(D<i>.txtloc),180)
call SetTextTagColor(D<i>.txt,255,255,255,255)
call SetTextTagPermanent(D<i>.txt,false)
call SetTextTagFadepoint(D<i>.txt,0.05)
call SetTextTagLifespan(D<i>.txt, 0.051)
if D<i>.owner == GetLocalPlayer() then
call SetTextTagVisibility(D<i>.txt,true)
else
call SetTextTagVisibility(D<i>.txt,false)
endif
call RemoveLocation(D<i>.txtloc)
set D<i>.txtloc = null
else
set D<i>.stamina = 100
endif
set i = i+1
endloop
endfunction
private function Init takes nothing returns nothing //Initializer function Starts timer etc
local group grp = CreateGroup()
call GroupEnumUnitsInRect(grp,GetPlayableMapRect(),Condition(function IsHero))
call ForGroup(grp,function AddToStruct)
call TimerStart(T,0.025,true,function TimerLoop)
call DestroyGroup(grp)
set grp = null
endfunction
function AddUnit takes unit u returns nothing //you can call this function to add HEROES (!) to the system, for example after a player loads one, or obtains one from a tavern
local MeleeFighter LF = MeleeFighter.create()
set LF.attacker = u
set LF.stamina = 100
set LF.attk = false
set LF.end = false
set LF.owner = GetOwningPlayer(u)
set D[Total] = LF
set Total = Total + 1
endfunction
function MeleeAttack takes unit u returns nothing // This function is the one that does the damage stuff. Call it via custom script to initialize the attack
local integer i = 0
local integer ai
local boolean found = false
local group grp = CreateGroup()
local real facing
loop
exitwhen found == true
if D<i>.attacker == u then
set found = true
set ai = i
endif
set i = i+1
endloop
set aindex = ai
set D[ai].attk = true
set D[ai].uloc = GetUnitLoc(D[ai].attacker)
set facing = GetUnitFacing(D[ai].attacker)
set D[ai].oloc = PolarProjectionBJ(D[ai].uloc,100.00,facing)
call RemoveLocation(D[ai].uloc)
set D[ai].uloc = null
call GroupEnumUnitsInRangeOfLoc(grp,D[ai].oloc,125,Condition(function MatchUnits))
call ForGroup(grp,function DamageGroup)
if CountUnitsInGroup(grp) > 0 then
set D[aindex].stamina = 0
endif
call DestroyGroup(grp)
set grp = null
set D[ai].attk = false
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></i></i>
call AddUnit(takes unit)
call MeleeAttack(takes unit)
This map will be a huge dungeon
I should've commented here before, :O
Terrain is really nice, the desert atmosphere fits well.
It seems like you have a stable amount of mobs. Are the bosses like mob bosses or raid bosses?
I don't like how bosses can only be killed once, people might miss it, heh. If you want it to be more realistic, then maybe the respawn time is long, like 5 - 10 minutes. Or when they are about to die, at 1% health, they escape and disappear, so they don't ever "die" but you still get the experience and loot.
Do you need names for the game and Tauren city?
~Hai-Bye-Vine~
Oh and nice apple .
scope RangeCS initializer Init
struct RangeFighter //The struct, dont alter this
unit attacker
unit target
real stamina
real damage
integer agi
integer str
integer int
location uloc
location oloc
boolean end
texttag txt
location txtloc
player owner
real stammax
endstruct
globals //Globals, don't touch these
private integer Total = 0
private RangeFighter array D
private timer T = CreateTimer()
private integer index
private integer aindex
endglobals
private function GetDamage takes integer j returns real // Here Is the function that gives you the dmg
local real dmg
local integer i = j
set D<i>.str = GetHeroStr(D<i>.attacker,true)
if D<i>.stamina < (0.14)*(D<i>.stamina) then
set dmg = 0
else
set dmg = D<i>.str + D<i>.stamina/5
endif
return dmg
endfunction
private function GetStamTick takes unit u returns real //determines the amount of stamina regenerated every 0.2 seconds (5 times per second)
return (I2R(GetHeroAgi(u,true)))/8.00
endfunction
private function IsHero takes nothing returns boolean //Is just temporary, as it picks all Heroes on the map, and adds gives them a slot in the struct array
local unit u = GetFilterUnit()
if IsUnitType(u,UNIT_TYPE_HERO) then
set u = null
return true
endif
set u = null
return false
endfunction
private function MatchUnits takes nothing returns boolean //Picks the Units for the Unitgroup that is damaged
local unit u = GetFilterUnit()
if IsPlayerEnemy(GetOwningPlayer(D[aindex].attacker),GetOwningPlayer(u)) then
if IsUnitType(u,UNIT_TYPE_FLYING) == false then
if GetUnitAbilityLevel(u,039;Aloc039;) < 1 then
if GetUnitState(u,UNIT_STATE_LIFE) > 0.405 then
set u = null
return true
endif
endif
endif
endif
set u = null
return false
endfunction
private function AddToStruct takes nothing returns nothing //Adds a new Unit to the struct array
local RangeFighter LF = RangeFighter.create()
local unit u = GetEnumUnit()
set LF.attacker = u
set LF.end = false
set LF.owner = GetOwningPlayer(u)
set LF.stammax = I2R(GetHeroInt(u,true))*8
set LF.stamina = LF.stammax
set D[Total] = LF
set Total = Total + 1
endfunction
private function TimerLoop takes nothing returns nothing //This creates the floating text and regenerates the stamina
local integer i = 0
local integer j = 1
local string s = ""
local integer cstam = 0
loop
exitwhen i>=Total
set D<i>.stammax = I2R(GetHeroInt(D<i>.attacker,true))*8
if D<i>.stamina < D<i>.stammax then
set index = i
set D<i>.stamina = D<i>.stamina + GetStamTick(D<i>.attacker)
set cstam = R2I(D<i>.stamina)
loop
exitwhen j > 50
if (cstam/2) >= j then
set s = s + "|cff660066039;|r"
else
set s = s + "039;"
endif
set j = j+1
endloop
set D<i>.uloc = GetUnitLoc(D<i>.attacker)
set D<i>.txtloc = Location(GetLocationX(D<i>.uloc) - 65.00,GetLocationY(D<i>.uloc))
call RemoveLocation(D<i>.uloc)
set D<i>.uloc = null
set D<i>.txt = CreateTextTag()
call SetTextTagText(D<i>.txt,s,TextTagSize2Height(8.00))
call SetTextTagPos(D<i>.txt,GetLocationX(D<i>.txtloc),GetLocationY(D<i>.txtloc),180)
call SetTextTagColor(D<i>.txt,255,255,255,255)
call SetTextTagPermanent(D<i>.txt,false)
call SetTextTagLifespan(D<i>.txt, 0.09)
if D<i>.owner == GetLocalPlayer() then
call SetTextTagVisibility(D<i>.txt,true)
else
call SetTextTagVisibility(D<i>.txt,false)
endif
call RemoveLocation(D<i>.txtloc)
set D<i>.txtloc = null
else
set D<i>.stamina = D<i>.stammax
endif
set i = i+1
endloop
endfunction
private function Init takes nothing returns nothing //Initializer function Starts timer etc
local group grp = CreateGroup()
call GroupEnumUnitsInRect(grp,GetPlayableMapRect(),Condition(function IsHero))
call ForGroup(grp,function AddToStruct)
call TimerStart(T,0.04,true,function TimerLoop)
call DestroyGroup(grp)
set grp = null
endfunction
function AddUnitRange takes unit u returns nothing //you can call this function to add HEROES (!) to the system, for example after a player loads one, or obtains one from a tavern
local RangeFighter LF = RangeFighter.create()
set LF.attacker = u
set LF.end = false
set LF.owner = GetOwningPlayer(u)
set LF.stammax = I2R(GetHeroInt(u,true))*8
set LF.stamina = LF.stammax
set D[Total] = LF
set Total = Total + 1
endfunction
private function DmgActions takes nothing returns nothing
local unit u = GetEventDamageSource()
local unit t = GetTriggerUnit()
local integer bid = 039;B000039;
local integer ai = 0
local integer i = 0
local boolean found = false
local real dmg
//call BJDebugMsg("Damage Call "+ R2S(dmg))
loop
exitwhen found == true
if D[ai].attacker == u then
set i = ai
set found = true
endif
set ai = ai + 1
endloop
//call BJDebugMsg(GetObjectName(GetUnitTypeId(D<i>.attacker)))
set dmg = GetDamage(i)
if GetUnitAbilityLevel(t, bid) > 0 then
call UnitRemoveAbility(t, bid)
call UnitDamageTarget(D<i>.attacker,t,dmg,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
//call BJDebugMsg(R2S(dmg))
endif
set u = null
set t = null
endfunction
private function TargDmg takes unit ta returns nothing
local trigger t = CreateTrigger()
//call BJDebugMsg("Trigger Init")
call TriggerRegisterUnitEvent(t,ta,EVENT_UNIT_DAMAGED)
call TriggerAddAction(t,function DmgActions)
endfunction
function RangeAttack takes unit u,unit t returns nothing
local integer i = 0
local integer ai
local boolean found = false
local group grp = CreateGroup()
local real facing
//call BJDebugMsg("Attack Call")
loop
exitwhen found == true
if D<i>.attacker == u then
set ai = i
set found = true
endif
set i = i+1
endloop
call TargDmg(t)
set D[ai].stamina = 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></i>
this looks pretty nice, but gosh, it reminds me so much on WoW and Barrens...
at least from the screenies
you could make the Tauren City in some snowy mountains, so it wont remind so much on WoW
5 thumbs up! :thup::thup::thup::thup::thup:
just one thing though,
how can a palm tree grow inside a dungeon
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 RotateResetAct takes nothing returns nothing
local integer i = GetPlayerId(GetTriggerPlayer())
set D<i>.lr = 0
endfunction
private function RotateReset takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i>11
call TriggerRegisterPlayerKeyEventBJ(t,Player(i),bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_UP)
set i = i+1
endloop
call TriggerAddAction(t,function RotateResetAct)
endfunction
private function RotateRightAct takes nothing returns nothing
local integer i = GetPlayerId(GetTriggerPlayer())
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 RotateRight takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i>11
call TriggerRegisterPlayerKeyEventBJ(t,Player(i),bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_LEFT)
set i = i+1
endloop
call TriggerAddAction(t,function RotateRightAct)
endfunction
private function RotateLeftAct takes nothing returns nothing
local integer i = GetPlayerId(GetTriggerPlayer())
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 RotateLeft takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i>11
call TriggerRegisterPlayerKeyEventBJ(t,Player(i),bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT)
set i = i+1
endloop
call TriggerAddAction(t,function RotateLeftAct)
endfunction
private function TurnAct takes nothing returns nothing
local integer i = GetPlayerId(GetTriggerPlayer())
call SetUnitFacing(D<i>.locked,GetUnitFacing(D<i>.locked)-180)
endfunction
private function Turn takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i>11
call TriggerRegisterPlayerKeyEventBJ(t,Player(i),bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_DOWN)
set i = i+1
endloop
call TriggerAddAction(t,function TurnAct)
endfunction
private function Init takes nothing returns nothing
call Turn()
call RotateLeft()
call RotateRight()
call RotateReset()
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>