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!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
How to do a quest with kill and a respawn for .w3x
Variables
Respawn Unit
Respawn Points
Dying units
Quest Alliance
Set Exclamation Point and turn off
Quest
Variable
Variable End
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
Name
Type
is_array
initial_value
Exclamation_Point
effect
Yes
Quest
quest
Yes
QuestKill
real
No
Respawnpoint
location
Yes
tempinteger2
integer
No
Tempspezialeffect
effect
Yes
Respawn Points
Events
Map initialization
Conditions
Actions
-------- Change Nothing --------
Set Variable Set tempinteger2 = "0"
Unit Group - Pick every unit in (Units owned by Neutral Hostile.) and do (Actions)
Loop - Actions
Set Variable Set tempinteger2 = (tempinteger2 + 1)
Set Variable Set Respawnpoint[tempinteger2] = (Position of (Picked unit))
Unit - Set the custom value of (Picked unit) to tempinteger2
Dying units
Events
Unit - A unit Dies
Conditions
Or - Any (Conditions) are true
Conditions
(Owner of (Dying unit)) Equal to Neutral Hostile
Actions
-------- Set the time between when the creep die and when he revive --------
Wait 30.00 game-time seconds
-------- You can change the special effect that do on the unit when he revive --------
Special Effect - Create a special effect at Respawnpoint[(Custom value of (Dying unit))] using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
-------- Change nothing for the rest --------
Set Variable Set Tempspezialeffect[(Custom value of (Dying unit))] = (Last created special effect)
Unit - Create 1 . (Unit-type of (Dying unit)) for Neutral Hostile at Respawnpoint[(Custom value of (Dying unit))] facing Default building facing degrees
Unit - Set the custom value of (Last created unit) to (Custom value of (Dying unit))
Wait 3.00 game-time seconds
Special Effect - Destroy Tempspezialeffect[(Custom value of (Dying unit))]
Set Exclamation Point and turn off
Events
Map initialization
Conditions
Actions
Special Effect - Create a special effect attached to the overhead (Unexpected type: 'attachpoint') of Quest Giver 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
Set Variable Set Exclamation_Point[1] = (Last created special effect)
Trigger - Turn off Variable <gen>
If you want to change the number of kill, change the number of the condition in the second : If Then Else
Quest
Events
Unit - A unit Is attacked
Conditions
(Attacked unit) Equal to Quest Giver 0000 <gen>
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
QuestKill Equal to 0.00
Then - Actions
Special Effect - Destroy Exclamation_Point[1]
Special Effect - Create a special effect attached to the overhead (Unexpected type: 'attachpoint') of Quest Giver 0000 <gen> using Objects\RandomObject\RandomObject.mdl
Set Variable Set Exclamation_Point[1] = (Last created special effect)
Unit - Order (Attacking unit) to Stop .
-------- You can change the text here when you receive the quest --------
Game - Display to (Player group((Owner of (Attacking unit)))) the text: |cffFFFF00Quest Giver : |rCan you Help me Kill 15 Gnolls? Good luck you will need it.
-------- You can change quest there --------
Quest - Create a Required quest titled Gnoll with the description The Gnoll are stupid but strong. If you can help me kill 15, it will be appreciated. , using icon path ReplaceableTextures\CommandButtons\BTNGnollKing.blp
Set Variable Set Quest[1] = (Last created quest)
Trigger - Turn on Variable <gen>
Else - Actions
Unit - Order (Attacking unit) to Stop .
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
QuestKill Greater than or equal to 15.00
Then - Actions
Unit - Order (Attacking unit) to Stop .
Special Effect - Destroy Exclamation_Point[1]
Quest - Mark Quest[1] as Completed
-------- You can change the text here when you receive the reward --------
Game - Display to (Player group((Owner of (Attacking unit)))) the text: |cffFFFF00Quest Giver : |rThanks For Helping me. There your reward|cffFF0000(2000 xp)|r
-------- Change reward here --------
Hero - Add 2000 experience to (Attacking unit) , Show level-up graphics
Trigger - Turn off (This trigger)
Else - Actions
Unit - Order (Attacking unit) to Stop .
Unit - Order (Attacking unit) to Stop .
If You changed the number of kill, change the text
/(Number of kill)
Variable
Events
Unit - A unit Dies
Conditions
(Owner of (Dying unit)) Equal to Neutral Hostile
Actions
Set Variable Set QuestKill = (QuestKill + 1)
Game - Display to (All players) the text: ((String(QuestKill, 1, 0)) + / 15)
If you changed the number of kill change the event to the number of kill and the text
Variable End
Events
Game - QuestKill becomes Greater than or equal to 15.00
Conditions
Actions
Trigger - Turn off Variable <gen>
Wait 1.00 seconds
Game - Display to (All players) the text: (|cff0000FFYou killed 15 Gnolls|r + |cff8000FF Go get your reward.|r)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.