HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

String ---> ability?

03-16-2004, 11:34 PM#1
Lami
Is there a way to type in a string and convert it to an ability?

Like if i type holylight i well want it to add holy light to a unit.
03-16-2004, 11:47 PM#2
ThyFlame
Code:
Untitled Trigger 001
    Events
        Player - Player 1 (Red) types a chat message containing spell as An exact match
    Conditions
    Actions
        Unit - Add Animate Dead to (Last created unit)

Obviously you need to change the text, ability given, and which unit you are giving the ability, but that is how it's done.
03-17-2004, 12:16 AM#3
Lami
I meant it will convert the entered text and then add the spell that is typed...
Not add a single spell
i meant an array,
since there are like 400+ spells it will take for ever to program an array to do that.

So i mean if you type in spell holyligh it will add holy light, or lets say i want criticalstrike,...

I mean like... hrm how to explain this...

Code:
 
Event: player enters chat string add spell as a substring
  
condition: substring (entered string) 1,9 equal to add spell
 
Action: add ability (substring(entered chat string)10,50) to Peasant 05.