HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Question about gold...

02-26-2006, 12:28 AM#1
MArL
Hello, I use the caster system in my map, I created some spells with, but there is an issue :

If a unit is killed by a spell, no gold are winning by the player owner. And I use a trigger to see which unit have the kill reward, and i saw the dummy caster.
So i want to make my spell giving gold to the player when a unit is killed by those spell.

Thx for future answer .


PS : sorry for my very bad english , i hope i've been anderstood.
02-26-2006, 12:30 AM#2
Vexorian
You are using the caster system in a wrong way.

Whatever function you are using to do damage, you have to specify the player that you want to bonus.
02-26-2006, 12:38 AM#3
MArL
I did :

I use this code for a mass entanglingroots.
Trigger:
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Nature's Rage
Collapse Actions
Set UnitVar = (Triggering unit)
Set PointVar = (Target point of ability being cast)
Set IntegerVar = (Level of (Ability being cast) for (Triggering unit))
Set RealVar = (200.00 + (50.00 x (Real(IntegerVar))))
Wait 0.35 seconds
Custom script: call CasterCastAbilityLevelAOELoc( GetOwningPlayer(udg_UnitVar), 'A00M', udg_IntegerVar,"entanglingroots", udg_PointVar, udg_RealVar, false, true)
Custom script: call RemoveLocation(udg_PointVar)
"GetOwningPlayer(udg_UnitVar)" isn't the fuction for the player setting ??
02-26-2006, 12:56 AM#4
MArL
And a second spell :
Trigger:
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
(Unit-type of (Attacking unit)) Equal to myunit
Collapse Actions
Set UnitVar = (Attacking unit)
Set TargetVar = (Attacked unit)
Set RealVar = ((Real((Level of mypassivespell for (Attacking unit)))) x 7.50)
Set Percent = (Random integer number between 1 and 100)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Percent Less than or equal to 15
Collapse Then - Actions
Custom script: call UnitDamageUnitTimed( GetTriggerUnit(),udg_RealVar,1,5,udg_TargetVar,"Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl","overhead",ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
Collapse Else - Actions
Do nothing

I can see that i didnt set the owner,but how can I do ?
02-26-2006, 02:52 AM#5
Vexorian
In the first trigger there is a huge problem, 35 seconds is kind of a very long second and UnitVar could get overwritten.

Assign Unit Var after the wait.


There is no need to set the owner for the second one because it is a function that takes a unit, anyways that spell is supposed to do damage for the attacked unit or the attacking unit? Cause in the version you posted it will credit Triggering unit which in this event is the Attacked Unit
02-26-2006, 08:54 AM#6
MArL
Ok, thx : the second now works with Attacker()^^

but the first...I removed the wait, I used a shorter wait, I removed the UnitVar to use GetOwningPlayer(TriggerUnit()) or GetOwningPlayer(SpellAblilityUnit()), I set UnitVar with Triggering unit and casting unit, but in all case, there are no bonus gold.

What can I do ??
02-26-2006, 02:22 PM#7
Vexorian
hmnn I note that it is casting entangling roots? So the damage it does is timed . I think you have to set Recycle delay to the duration of the entangling roots spell

Check the readme for that