Ok, I make this very simple example. People usually find it easy to understand:
JASS:
function Conditions takes nothign returns boolean
return GetSpellAbilityId() == 'A000' //this is the rawcode of the hero spell
endfunction
function Actions takes nothing returns nothing
local unit caster = GetTriggerUnit() //we save our caster in a unit variable. Care, local vairiables are NOT global, this means that everytime you run a function they are created and that they can NOT be used outside the function in which they are created. This is why this example is MUI. Everytime I run actions, I save the caster in a new variable.
call TriggerSleepAction(2.0) //this is a Wait from GUI. Waits are very evil, but for learning purposes I advise you to start easy with it.
call KillUnit(caster) //try guessing what this does =P
set caster = null //we always have to null our variables to prevent leaks
endfunction
function InitTrig takes nothing returns nothing
local trigger spellTrg = CreateTrigger()
call TriggerAddEventBJ(spellTrg, EVENT_UNIT_SPELL_EFFECT) //I am not sure if this like is correct, but it is something similar to this for sure
call TriggerAddCondition(spellTrg, Condition(function Conditions))
call TriggerAddAction(spellTrg, Actions)
endfunction
Ok, start from the InitTrig. It tells you the basic stuff, the event that fires the trigger, the conditions and the actions it runs (like in GUI).
You will have questions about this, so I advise you to read some JASS tutorials to learn how to use "if statements" and "loops" they are very useful.
Once you master this concepts, try reading one of my first spells:
Lightning Bolt by Flame_Phoenix - The Hive Workshop - A Warcraft III Modding Site
Things with vJass will be easier, but for now you should battle with Jass only and try to understand the JESP standard (if you find necessary).
ATTENTION: If you convert a simple spell from GUI to Jass, this is NOT what you will see. GUI conversions create
obfuscated inneficient code, and that is why most beginers fear starting Jass, because GUI conversions are scary and messy. This small example was optimized.
Also, try using this tool to code in Jass:
http://www.wc3c.net/showthread.php?t=90999
All red functions you see (many of them BJ's) are bad and inefficient and should be replaced. An exception is the EventBJ (in Inittrig function). I prefer to use it because it does something useful =)
You can also use JassCraft =P