• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Transformation Trigger

Status
Not open for further replies.
Level 4
Joined
Dec 3, 2007
Messages
117
Well i made a trigger :
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bone Experiment
      • (Random integer number between 1 and 100) Less than or equal to 50
    • Actions
      • Game - Display to (All players) the text: Failed To Complete ...
      • Unit - Kill (Triggering unit)
Well the problem is that, when my unit finishes the transformation like duration, he has another 50% to die... Because he already takes a 50% chance to die by activating the spell but he has another 50% to die after...How do i remove the last 50% to get killed?

Secondly, the map i want to make has many tomes and such, so how do i do so that the hero keeps his original stats?
 
Level 7
Joined
Oct 5, 2007
Messages
118
@ your first problem: Don't catch the casting of the spell, take 'Unit is Ordered' and than compare the orderstring and the level of your ability...
  • Events
    • Unit - A unit Gets an order
  • Conditions
    • (Issued order) Equal to (Order(<the orderstring of Bone Experiment>))
    • (Level of Bone Experiment for (Ordered Unit)) Greater than 0
    • (Random integer number between 1 and 100) Less than or equal to 50
  • Actions
    • Game - Display to (All players) the text: Failed To Complete ...
    • Unit - Kill (Ordered Unit)
This should work, if I get your problem right :)

@2nd Problem: If you don't want the players to be able to increase the stats of their heros, don't use tomes in your map? Or what is your concrete question? Do you want to save the stats (at the beginning or sometimes)? Then you could use array variables.
 
Level 7
Joined
Oct 5, 2007
Messages
118
I'm not sure... but when you transform a unit with any 'chaos' ability, all stats should be take with it and only the base unit changes
 
Level 7
Joined
Oct 5, 2007
Messages
118
There are abilities with the keyword 'chaos'... look at the orc spells or just search for them :) And if you add any unit the chaos spell, it will instantly change his unit-type (with all values) to the unit-type declared in the spell. But be aware that such morphings can be buggy...
PitzerMike said:
Sca1 (Chaos): Adding a chaos ability to a unit transforms it into the unit type specified in the target unit id field of the ability. This can be used to change any aspect like the proper name or the model of a unit in the game or simply in combination with channel to implement morphing spells. Don't forget to remove the tech requirements from custom chaos abilities. One problem of Chaos is that it adds the morphed unit's current armor, damage, health and mana bonus received from items, auras and srength, agility, intelligence to the stats of the resulting unit. That means it's not a very good idea to morph heroes using chaos until Blizzard fixes those bugs. Ordinary units can't be affected by items and hero stats, so the only problem are buffs received from auras. Those buffs can easily be removed before the conversion and are automatically added again afterwards so that's not a real issue.
JASS:
call UnitRemoveAbility(u, 'BHab')
call UnitRemoveAbility(u, 'BUau')
call UnitRemoveAbility(u, 'BUav')
call UnitRemoveAbility(u, 'BEah')
call UnitRemoveAbility(u, 'BHad')
call UnitRemoveAbility(u, 'BEar')
call UnitRemoveAbility(u, 'BOae')
call UnitRemoveAbility(u, 'BOac')
call UnitRemoveAbility(u, 'Bapl')
call UnitRemoveAbility(u, 'Bplg')
call UnitRemoveAbility(u, 'Boar')
call UnitRemoveAbility(u, 'Babr')
call UnitRemoveAbility(u, 'Bakb')
call UnitAddAbility(u, <chaos ability id>)

This script will remove all aura buffs before applying the chaos upgrade. If you have custom buffs in your map, you'll have to remove them here too.
Ok, you see: There are problems with heros and items. But I'm sure that dropping all items before morphing and add them afterwards will solve the problem.
 
Level 7
Joined
Oct 5, 2007
Messages
118
hey, sorry, I didn't want to scare you off. But morphing is unfortunately one of the complicated things...
 
Status
Not open for further replies.
Top