Auto Spells

smoochy boys on tour

TheMightyOne

Golden Oldie
Golden Oldie
Jun 14, 2004
722
3
124
UnitedKingdom
How do i make it so that when a player levels they are given that skill for the specific level automatically into there spell collection at level 1 2 or 3.

Thanks.
 

mStation

Golden Oldie
Golden Oldie
Oct 29, 2003
2,042
69
255
♫♪♫ ♦♥♠♣ ♀♂♀
i think something like

gmexecute training (pointer to $username) skillname level

into the qfunction after it checks the level will do but i must see what the hell u need to make it point to the correct username of the player.. maybe using simply <$USERNAME> will work but it must be tryed..

try adding after the checklevelex this
gmexecute training <$USERNAME> flamefield 3

and see what it does
 
Upvote 0

TheMightyOne

Golden Oldie
Golden Oldie
Jun 14, 2004
722
3
124
UnitedKingdom
hmm that's quite confusing lol.

I need it to check there level and class, and then execute the spell and spell level for the players level.
I know it can be done as it's been done on another recent server i've been playing but i can't remember what it was. maybe MirMasters.

so say a level 17 wizard, i want it to recognise it's level 17, and then give them t bolt level 3.
 
Upvote 0

transporter

LOMCN Veteran
Veteran
Jul 12, 2008
608
8
125
Darlington
Q-function

[@LevelUp]
#IF
CHECKLEVELEX = 22
#ACT
sendmsg 3 " Has Reached Level 22, Congratulations!!"
GOTO @Spell
#ELSEACT
BREAK

[@Spell]
#IF
Checkjob Wizard
#ACT
Goto @wiz
#IF
Checkjob Warrior
#ACT
Goto @war
#IF
Checkjob Taoist
#ACT
Goto @tao


[@Wiz]
#ACT
ADDSKILL FireWall 3
sendmsg 6 "<$USERNAME> you have learned FireWall".

etc etc
 
Upvote 0

Dazz

LOMCN Veteran
Veteran
Apr 12, 2008
296
0
63
Nope QFunction is a seperate script, can't remember off the top of my head where it is.

/Daz
 
Upvote 0

TheMightyOne

Golden Oldie
Golden Oldie
Jun 14, 2004
722
3
124
UnitedKingdom
right trying to do multiple auto spells. the above script works like that. but then i'm trying to do say checklevel 9 checkjob tao addskill spiritsword.

this is what i've done.

[@LevelUp]
#IF
CHECKLEVELEX = 7
#ACT
GOTO @Spell
#ELSEACT
Break


[@Spell]
#IF
Checkjob Wizard
#ACT
Goto @wiz
#IF
Checkjob Warrior
#ACT
Goto @war
#IF
Checkjob Taoist
#ACT
Goto @tao


[@Wiz]
#ACT
ADDSKILL Fireball 3
sendmsg 6 "<$USERNAME> you have learned Fireball".

[@War]
#ACT
ADDSKILL Fencing 3
sendmsg 6 "<$USERNAME> you have learned Fencing".

[@tao]
#ACT
ADDSKILL Healing 3
sendmsg 6 "<$USERNAME> you have learned Healing".


[@LevelUp1]
#IF
CHECKLEVELEX = 9
#ACT
GOTO @Spell1
#ELSEACT
BREAK

[@Spell1]
#IF
Checkjob Taoist
#ACT
Goto @tao1


[@tao1]
#ACT
ADDSKILL SpiritSword 3
sendmsg 6 "<$USERNAME> you have learned SpiritSword".


[@LevelUp2]
#IF
CHECKLEVELEX = 14
#ACT
GOTO @Spell2
#ELSEACT
BREAK

[@Spell]
#IF
Checkjob Taoist
#ACT
Goto @tao2


[@tao2]
#ACT
ADDSKILL Poisoning 3
sendmsg 6 "<$USERNAME> you have learned Poisoning".

It's not recognising the [@Levelup1], i'm guessing that @Levelup is coded in?

how do i write a script so that i can give skills to all classes at random levels.

Thanks.
 
Upvote 0

transporter

LOMCN Veteran
Veteran
Jul 12, 2008
608
8
125
Darlington
Basicley like above but it all has to be @Levelup

Code:
[@LevelUp]
#IF
CHECKLEVELEX = 7
#ACT
GOTO @Spell
#IF
CHECKLEVELEX = 22
#ACT
GOTO @spell

[@Spell]
#IF
Checkjob Wizard
#ACT
Goto @wiz
#IF
Checkjob Warrior
#ACT
Goto @war
#IF
Checkjob Taoist
#ACT
Goto @tao


[@Wiz]
#IF
CHECKLEVELEX = 7
#ACT
ADDSKILL Fireball 3
sendmsg 6 "<$USERNAME> you have learned Fireball".
Break
#IF
CHECKLEVELEX = 22
ADDSKILL FireWall 3
sendmsg 6 "<$USERNAME> you have learned Firewall".
Break

Basic idea
 
Upvote 0

Spoon666

LOMCN Veteran
Veteran
Feb 12, 2005
292
0
63
South West Wales
No m8y it all goes under [@LevelUp] i always use #CALL for long scripts like this:

[@LevelUp]
#IF
CHECKLEVELEX = 7
#CALL [..\Questdiary\LevelUp\Level7.txt] @lvl7
break
#IF
CHECKLEVELEX = 9
#CALL [..\Questdiary\LevelUp\Level9.txt] @lvl9
break

Then create the folder LevelUp in QuestDiary and Make Level7.txt then copy level7.txt and rename it to Level9.txt and change the script. Repeat that process for all the levels. Your Q-Function will remain readable not have 20000 lines and you can easily find each level quickly to edit it


#CALL script must start like:

[@lvl7]
{
ALL script here make sure you got the brackets at start and end
}
 
Upvote 0

TheMightyOne

Golden Oldie
Golden Oldie
Jun 14, 2004
722
3
124
UnitedKingdom
ok in my Q-Function.txt i have put..

[@LevelUp]
#IF
CHECKLEVELEX = 7
#CALL [QuestDiary\LevelUp\Level7] @lvl7
break


and then i have made a folder called LevelUp and placed in my QuestDiary.

inside LevelUp there is a txt file called Level7, and the script is as follows...

[@lvl7]
#IF
CHECKLEVELEX = 7
#ACT
GOTO @Spell
#ELSEACT
Break


[@Spell]
#IF
Checkjob Wizard
#ACT
Goto @wiz
#IF
Checkjob Warrior
#ACT
Goto @war
#IF
Checkjob Taoist
#ACT
Goto @tao


[@Wiz]
#ACT
ADDSKILL Fireball 3
sendmsg 6 "<$USERNAME> you have learned Fireball".

[@War]
#ACT
ADDSKILL Fencing 3
sendmsg 6 "<$USERNAME> you have learned Fencing".

[@tao]
#ACT
ADDSKILL Healing 3
sendmsg 6 "<$USERNAME> you have learned Healing".



When i load my m2server the file load fails. says something to do with my Q-Function.txt, i know i've done something wrong but i don't know what lol.
 
Upvote 0

Spoon666

LOMCN Veteran
Veteran
Feb 12, 2005
292
0
63
South West Wales
i said to use the { } before and after the script m8y

also to save confusion in the m2 use diff names rather than Spell, Wiz, War and Tao,
[@lvl7]
{
#IF
CHECKLEVELEX = 7
#ACT
GOTO @lvl7Spell
#ELSEACT
Break


[@lvl7Spell]
#IF
Checkjob Wizard
#ACT
Goto @lvl7wiz
#IF
Checkjob Warrior
#ACT
Goto @lvl7war
#IF
Checkjob Taoist
#ACT
Goto @lvl7tao


[@lvl7Wiz]
#ACT
ADDSKILL Fireball 3
sendmsg 6 "<$USERNAME> you have learned Fireball".

[@lvl7War]
#ACT
ADDSKILL Fencing 3
sendmsg 6 "<$USERNAME> you have learned Fencing".

[@lvl7tao]
#ACT
ADDSKILL Healing 3
sendmsg 6 "<$USERNAME> you have learned Healing".
}
 
Last edited:
Upvote 0

TheMightyOne

Golden Oldie
Golden Oldie
Jun 14, 2004
722
3
124
UnitedKingdom
ah wicked ty, it was also the [..\ that i missed off just before the questdiary\LevelUp\Lvl7.txt........... i didn't think it was needed :P

thanks bud. that works a treat :)
 
Upvote 0

mStation

Golden Oldie
Golden Oldie
Oct 29, 2003
2,042
69
255
♫♪♫ ♦♥♠♣ ♀♂♀
i think something like

gmexecute training (pointer to $username) skillname level

into the qfunction after it checks the level will do but i must see what the hell u need to make it point to the correct username of the player.. maybe using simply <$USERNAME> will work but it must be tryed..

try adding after the checklevelex this
gmexecute training <$USERNAME> flamefield 3

and see what it does

sorry i just realised that i have had drunk something before writing this.. :)

anyway i wanted to say something more like what the others told you.. sorry :S
 
Upvote 0

jewjewbee

Dedicated Member
Dedicated Member
May 5, 2007
99
2
55
[@levelup]
#IF
CHECKLEVELEX = 7
checkjob warrior
#ACT
ADDSKILL Fencing 3

#IF
CHECKLEVELEX = 7
checkjob Wizard
#ACT
ADDSKILL Fireball 3

#IF
CHECKLEVELEX = 7
checkjob Taoist
#ACT
ADDSKILL Healing 3

#IF
CHECKLEVELEX = 9
checkjob Taoist
#ACT
ADDSKILL SpiritSword 3


whats so hard about that? Way easier than using #call imo
 
Upvote 0