| 01-26-2008, 05:24 PM | #1 |
For my map there's this building that will buff one enemy creep with bloodlust every 3 seconds within a radius of 1000. The building itself slowly loses health and eventually dies. When rebuilt the building will attempt to start buffing any creeps nearby but whenever the function fires off, the bloodlust spamming kinda stops and no creeps gain bloodlust here's the function I used: JASS:private function Fervor_Filter takes nothing returns boolean return GetUnitAbilityLevel(GetFilterUnit(), 'B007') > 0 and (GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0 ) endfunction private function FervorAction takes nothing returns nothing local group v = CreateGroup() local real x = GetLocationX(GetUnitLoc(GetTriggerUnit())) local real y = GetLocationY(GetUnitLoc(GetTriggerUnit())) local real radius = 1000 local unit u local location p local boolexpr cond = Condition(function Fervor_Filter) local boolean exit = false call GroupEnumUnitsInRange(v, x, y, radius, cond) loop set u = GroupPickRandomUnit(v) exitwhen exit == true or u == null if (UnitHasBuffBJ(u, 'B000') == false ) then set p = GetUnitLoc(u) call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(u), p, bj_UNIT_FACING ) call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() ) call UnitAddAbility(GetLastCreatedUnit(), 'A00K') call IssueTargetOrder(GetLastCreatedUnit(),"bloodlust",u) call RemoveLocation( p ) set exit = true endif call GroupRemoveUnit(v,u) endloop call DestroyGroup(v) set v = null set u = null set p = null endfunction This fires off whenever the building casts a dummyspell warstomp... but for some reason the function just stops working whenever a new building is constructed after the old one - they have the same dummyspell ability, nothing else and they're exactly the same statwise. Note: I chose GroupPickRandomUnit instead of FirstofGroup because whenever two of the same building were built close to each other, the FirstofGroup would always be the same unit and bloodlust would be casted twice on the same unit instead of two different creeps EDIT: Case closed, took me a long time to figure out some models don't show a bloodlust animation/effects when given bloodlust ![]() |
| 01-26-2008, 06:27 PM | #2 |
Are you sure they're actually using the ability? |
| 01-26-2008, 06:41 PM | #3 | |
Quote:
yes, they do and I also pressed the ability button myself to make sure of this as well Update: Even stranger, I found the function works fine for all except for when the creeps are raccoons. Kinda weird cause the raccoons are the same as the other creeps except for model, icon, hp, and speed... very confusing |
| 01-27-2008, 01:13 AM | #4 |
sounds like a discrepancy in Targets Allowed - ? |
| 01-27-2008, 04:33 AM | #5 | |
Quote:
nope, all the creeps are exactly identical except for model, hp stats and a few other non targeting related stuff I tested it recently and found that some models like the raccoon don't have a "bloodlust animation" but they do still get the buff and benefits |
| 01-27-2008, 07:13 AM | #6 |
if you using event related functions (trigger unit) provide complete trigger with event. |
| 01-27-2008, 10:19 AM | #7 |
ok, good you found out there was no problem, but why don't you do a blood lust aura? |
