• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[JASS] learning ablitty's from tomes help..

Status
Not open for further replies.
Level 1
Joined
Dec 28, 2005
Messages
5
i got this code from wc3camps..and it wont work for my map heres the code im tryin to fix i make a new trigger named TomeLearn ..but i get errors when i try to save...wut am i not addin or doin wrong?

//===========================================================================
// Demo Map Examples:
// This are some examples how to use the functions
// in the TomeLearn System for your map
//
// You can copy this trigger to your map directly and change
// the values and rawcodes of spells.
//===========================================================================
function InitTrig_TomeLearn takes nothing returns nothing
local string tm //Create a local temp variable to store the tome id
call InitTomeLearn() //Call this before calling other TL functions

//===========================================================================
// Tome of Shockwave
//---------------------------------------------------------------------------

// Add Tome('I000') and spell('A001') record the id in the string variable
set tm = TL_AddTome('I000','A000',3)

// Set the requirement to hero lvl 1 and Strength 10
call TL_ReqStatLvl(tm, 1,10,0,0)

// Set the factor so that the requirement increased by the factor of 1 each level
// Which means 10/20/30 Strength and 1/2/3 Hero Level
call TL_ReqStatsFactor(tm, 1)


//===========================================================================


//===========================================================================
// Slam
// Basic sample of how to add a Spellbook ability and example how to use
// the TL_InstantUse function
//---------------------------------------------------------------------------

// Because this spell is a SpellBook Ability so use the TL_AddTomeSB instead of
// TL_AddTome. 'A003' is the dummy spellbook ability while 'ACtc' is the "real"
// slam ability.
set tm = TL_AddTomeSB('I003','A003','ACtc',2)

// Add Required Strength of 20 to this Abililty
call TL_ReqStatLvl(tm,0,20,0,0)

//Set the Instant flag so it will use the rune as soon as pickup
call TL_InstantUse(tm, true)


//===========================================================================


//===========================================================================
// Chain Lightning
// Example of how to use TL_AddTomeEx
//---------------------------------------------------------------------------
// This function will let the player Learn Chain Lightning('A001') when use the Tome
// of Chain Lightning('I001') with a maximum level of 3 and the following requirements:
// Hero Level 2, Intelligence 30.
// The last 2 flag is InstantUse and SpellBook, which both is false since this tome
// won't use automaticly when acquired and it's no a SpellBook ability
// Since Spellbook is false so just set the dummyid to 0

call TL_AddTomeEx('I001','A001',3,2,0,0,30,0, false, false, 0)



//===========================================================================


//===========================================================================
// FrostNova
// Example of the Usage of TL_ReqAbilitySingle
// This spell cannot be learnt unless the learner has Level 3 Chain Lightning
//---------------------------------------------------------------------------

// As always, call TL_AddTome and record the id in the string variable for later use
// Note that 'A002' is the Frost Nova which the tome GIVES
set tm = TL_AddTome('I002','A002',3)

// Call the TL_ReqAbilitySingle, adding a required ability and level of that ability
// Note that 'A001' is the Chain Lightning which is NEEDED to learn Frost Nova
call TL_ReqAbilitySingle(tm, 'A001', 3)



//===========================================================================


//===========================================================================
// Ultimate Lightning
// Example of the Usage of TL_ReqAbililyById
// This spell cannot be learnt unless the learner has:
// Level 3 Chain Lightning AND Level 3 Frost Nova
// Rawcode Reference:
// Tome = 'I006' Ultimate Lightning = 'A005'
// Chain Lighting = 'A001' Frost Nova = 'A002'
//---------------------------------------------------------------------------
set tm = TL_AddTome('I006','A005',1) //As usual

// Call the TL_ReqAbililyById function to add Level 3 Chain Lightning as first
// requirement and then add another Level 3 Frost Nova as second requirement.
call TL_ReqAbilityAdd(tm, 'A001', 3) //Level 3 Chain Lightning
call TL_ReqAbilityAdd(tm, 'A002', 3) //Level 3 Frost Nova


//===========================================================================


//===========================================================================
// Advanced sample - Avatar and Improved Avatar
// This sample show how to create tomes that gives the ability Avatar
// There is Tome1 and Tome2 where Tome1 gives you Level 1 Avatar while Tome2
// Gives you Level 2 Avatar BUT you need Level 1 avatar 1st
// Rawcode Reference:
// Avatar = 'A004', Tome of Avatar = 'I004', Tome of Improved Avatar = 'I005'
//---------------------------------------------------------------------------

// Gives the First Tome Avatar Ability with a maximum of 1 level
// Add a 50strength as requirement as well
call TL_ReqStatLvl(TL_AddTome('I004','A004',1),0,50,0,0)

// Then we gives the Second tome the SAME ability but change the requirmenet
// to Level 1 of the Avatar ability and maximum level to 2.
call TL_ReqAbilitySingle(TL_AddTome('I005','A004',2), 'A004', 1)

// How this works:
// Although the second tome will give the Avatar ability at level 1 but it
// never able to give it because it NEED that Level 1 Avatar to use the tome.
// So the tome only works if the unit get the Level 1 Avatar from other means
// which is using the first tome in this case. So in game it will "looks like"
// you need to use the first tome before using the second tome.


endfunction
 
Level 1
Joined
Dec 28, 2005
Messages
5
well how i posted it there is how i posted it in my map...i copyied all varibles from that map also..and i kno the break down of raw data...is just showin some wierd errors or maybe im nub
 
Status
Not open for further replies.
Top