What would happen with the spell function?
- ********************************************************************************
- *** Generate Random Spell Number by Fnord ***
- !#MCv3500:S@spell@;
- !#VR$spell$:S7777;
- Syntax:
- * FU$spell$:P#1/#2/#3/#4/#5/#6/#7/#8/#9/#10/#11/#12/#13/#14/#15;
- * Spell Number is returned in y-99, value is -1 if no spell exists.
- #1 = minimum spell level: 0=any, or 1..5
- #2 = maximum spell level: 0=any, or 1..5
- #3 = type: 0=any, 1=adventure, 2=combat
- #4 = element: 0=any, 1=air, 2=earth, 4=fire, 8=water. Add numbers for multiple elements.
- #5 = banning: 0=ignore spell banning, 1=skip banned spells
- #6 = exclusions: 0=no exclusions, 1..9=number of specific spell exclusions (#7..#15)
- #7..#15 = specific spell exclusions: 0..69 for spell number, anything else is ignored
- and only exclusions up to the number in #6 are used, so if #6 is 0, all
- specific exclusions will be ignored.
- Example:
- To generate a random Level 3 Combat Fire or Air spell excluding all Banned
- spells and excluding the Misfortune (spell #52), use:
- * !!FU$spell$:P3/3/2/5/1/1/52;
- A subfunction of this function may be used to determine the level, element and type
- (combat or adventure) of any given spell:
- Syntax:
- FU7779:P#;
- #=spell number being checked (0..69).
- Returned Values:
- y-96 : Level (1..5)
- y-97 : Type (1=Adventure, 2=Combat)
- y-98 : Element (1=air, 2=earth, 4=fire, 8=water, 15=all elements)
- --------------------------------------------------------------------------------
any script that uses this function expects y-99 to hold the spell :/ not sure if it would also work with y99.
(This post was last modified: 04.09.2019 14:02 by PerryR.)
|