Author Topic: new in engine 3.40: new spell function  (Read 71 times)

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9859
new in engine 3.40: new spell function
« on: December 01, 2017, 02:34:07 PM »
As of engine 3.40, Paul has given us a new function for manipulating a character's spellbook.

The function is $KNOW_SPELL(actor, spell name, flag)

The spell name is exactly as it appears in the spell database.
The flag will accept two values - "1" to add a spell, "0" to remove a spell.

Get the engine here:
http://www.dianneandpaul.net/UAF/DungeonCraft_340.7z

Examples:
To add the spell Magic Missile:
Code: [Select]
-$KNOW_SPELL($CharacterContext(),"Magic Missile","1");To remove the spell Sleep:
Code: [Select]
-$KNOW_SPELL($CharacterContext(),"sleep","0");
Also, the Special Abilities database has been updated and is attached below.

« Last Edit: December 01, 2017, 05:09:51 PM by manikus »

Offline ProphetSword

  • Mod Designer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2903
  • FRUA Lives!
    • Lands of Adventure
Re: new in engine 3.40: new spell function
« Reply #1 on: December 01, 2017, 04:53:05 PM »
To remove the spell Sleep:
Code: [Select]
-$KNOW_SPELL($CharacterContext(),"Spell","0");

Not to nitpick, but shouldn't that code example include the word "Sleep" instead of "Spell" to be accurate?

Code: [Select]
-$KNOW_SPELL($CharacterContext(),"Sleep","0");
LANDS OF ADVENTURE: An Old-School Style CRPG

More Information Here: http://landsadventure.blogspot.com/

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9859
Re: new in engine 3.40: new spell function
« Reply #2 on: December 01, 2017, 05:06:55 PM »
To remove the spell Sleep:
Code: [Select]
-$KNOW_SPELL($CharacterContext(),"Spell","0");

Not to nitpick, but shouldn't that code example include the word "Sleep" instead of "Spell" to be accurate?

Code: [Select]
-$KNOW_SPELL($CharacterContext(),"Sleep","0");

:D :D :D :D :D :D

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3168
Re: new in engine 3.40: new spell function
« Reply #3 on: December 03, 2017, 01:50:42 PM »
Thank You, I have updated my files to new version and will try it tomorrow :).

 

anything