HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spell sometimes doesnt work...

08-04-2007, 06:29 AM#1
botanic
I have an ability that summons an infernal to an area on attack.

sometimes the infernal stone item stays on the hero and they lose the item tho.

This is the trigger

Trigger:
Infernal
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
(Unit-type of (Attacking unit)) Equal to Demon Caller
Collapse Actions
Set temppoint = (Position of (Attacked unit))
Set TempInteger = (Random integer number between 1 and 100)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
TempInteger Less than or equal to ((Intelligence of Explosive_Caster (Include bonuses)) / 10)
Collapse Then - Actions
Set tempreal = (Mana of (Attacking unit))
Unit - Set mana of (Attacking unit) to (tempreal - 100.00)
Set L = (Center of (Playable map area))
Unit - Create 1 Blood Mage for Neutral Hostile at L facing Default building facing degrees
Custom script: call RemoveLocation(udg_L)
Set Temp_Unit = (Last created unit)
Hero - Give (Item carried by (Attacking unit) in slot 6) to Temp_Unit
Set L = (Center of (Playable map area))
Item - Create Inferno Stone at L
Custom script: call RemoveLocation(udg_L)
Hero - Give (Last created item) to (Attacking unit)
Hero - Order (Attacking unit) to use (Last created item) on temppoint
Item - Remove (Last created item)
Collapse For each (Integer A) from 1 to 6, do (Actions)
Collapse Loop - Actions
Hero - Give (Item carried by Temp_Unit in slot (Integer A)) to (Attacking unit)
Unit - Remove Temp_Unit from the game
Trigger - Turn off (This trigger)
Wait 0.20 seconds
Trigger - Turn on (This trigger)
Else - Actions

is there a better way todo this so that wont happen?
08-04-2007, 06:36 AM#2
cohadar
If the attacking unit has all 6 slots full you cannot give item to it,

I suggest you swap the item in first slot with that stone.
and after casting is finished, remove the stone and give the slot 1 item back.

But casting abilities by moving items is really a bad idea,
you should you dummy casters.
08-04-2007, 07:16 AM#3
botanic
i couldnt figure out how to cast a spell by a trigger.... you know how?

PS: i did what you recomended just the item sometimes didnt get given back...
08-04-2007, 07:30 AM#4
cohadar
Ok general guide for using dummy casters:

You probably read a tutorial on dummy casters,
if you haven't search for one and read it.

The problem with dummy casters is that people
try it and it NEVER works the first time, so they give it up.

When you order the dummy to cast a spell it can fail for several reasons:

1. dummy has not enough mana (you forgot to set it properly)
2. spell has tech-tree requirements that are not researched,
3. you created dummy too far from target and a spell cannot reach
4. you destroyed dummy caster before it could finish casting a spell

All 4 problems have I common cause: Dummy casters are Invisible.
And they should be, but ONLY when you release the map

When you create the map just make a dummy caster INVULNERABLE
do not make it INVISIBLE or LOCUST.

Before you try to order the dummy to cast with a trigger
preplace one dummy on the map and try to cast the spell yourself,
you will detect most of the problems this way.

When you want to release your map
add INVISIBLE and LOCUST to the dummy
08-04-2007, 07:42 AM#5
botanic
actually the way i was doing it was to add summon infernal to teh caster then cast it then remove it... couldnt get it to cast the spell tho...
08-04-2007, 07:58 AM#6
cohadar
You cannot order the cast of inferno from item
You must use inferno that undead dreadlord has.

EDIT:
No I am wrong, you must use this
Unit - Order (Triggering unit) to Special Warlock - Inferno (Target point of ability being cast)

So it is not dreadlord inferno it is warlock inferno you must use.
08-04-2007, 10:54 AM#7
botanic
thanks the last one worked