| 10-27-2007, 09:05 AM | #2 |
The dummy is firing the second code and you were checking if Corpse Bomb for the dummy is 1/2/3. You needed to check if Corpse Bomb for the caster is 1/2/3. So change these: Trigger: Into something like this: Trigger: But you need to store the caster in a variable (named Caster, in this case). |
| 10-28-2007, 05:08 PM | #3 |
Oh my, that slipped from me too easily. Thanks. +Rep (because it's polite). |
| 10-29-2007, 01:27 AM | #5 |
JASS:function YourCondition takes nothing returns boolean return GetSpellAbilityId() == 'YourCorpseBombId' endfunction function CorpseBomb takes nothing returns nothing local unit u = GetTriggerUnit() local unit t = GetSpellTargetUnit() //The corpse local real r = GetUnitState(t,UNIT_STATE_MAX_LIFE) call DestroyEffect(AddSpecialEffect("YourEffectPathHere",GetUnitX(t),GetUnitY(t))) ..damage units nearby using 'r' because it is the max life of the unit.. ..when you're done clean leaks.. set u = null set t = null endfunction function CorpseBomb_Cast takes nothing returns nothing local unit u = GetTriggerUnit() local location l = GetSpellTargetLoc() local unit dummy = CreateUnit(GetOwningPlayer(u),'YourId',GetLocationX(l),GetLocationY(l) if not IssueImmediateOrder(dummy,"raisedead") then call IssueImmediateOrder(u,"stop") call CS_Error(GetOwningPlayer(u),"Must cast on area with corpses!") endif call RemoveLocation(l) call RemoveUnit(dummy) set u = null set dummy = null set l = null endfunction function InitTrig_CorpseBomb takes nothing returns nothing local trigger t = CreateTrigger() set gg_trg_CorpseBomb = CreateTrigger() //Use unit casts an ability for an event and add the function CorpseBomb_Cast to that trigger's triggeraction call TriggerAddAction(gg_trg_CorpseBomb,function CorpseBomb_Cast) call TriggerAddCondition(gg_trg_CorpseBomb,Condition(function YourConditions)) //Second trigger call TriggerAddAction(t,function CorpseBomb) call TriggerAddCondition(t,Condition(function YourConditions)) endfunction Basically CorpseBomb_Cast uses a dummy, creates it at the target point, orders it to raise dead and if isn't cast(if there are no corpses) then it will stop the caster and simulate and error to avoid wasting his mana and cooldown. Else just proceed with the ability to be started of its effects. When it starts the effect, another trigger fires off. It stores the caster and the target(the corpse) into variables and then does whatever you want just type in the code. That's all that you'll need. |
