Jump to content

Kitted mage, how to forbid a school ?


deratiseur

Recommended Posts

Hello :blush:

 

I continue to mod my kits pack (5 kits for now), and i have created a master necromancer really powerfull (35 new spells and hlas)

 

It take the place of the original "necromancer" mage kit. But i would give it the disadvantage of an over forbid school : Evocation.

 

Is there a way to do this ?

 

 

It's an important question, cause another of my work is a "Warlord" kit, who learn spells instinctively (40 originals and almost 15 news) but moreover have all schools borbiddens. (to now allow him to learn any over magic)

 

If there are no ways to do this, i can delete all my job and cry for 2 weeks of job losts.

 

I'm a stupid boy, to have write and created the spells, and only now think that maybe what i expect is impossible :s

Link to comment

I don't know a way to do it directly (I *think* it's hardcoded).

 

However, you could make all scrolls of evocation spells unusable by necromancers. That means (if it works the way I expect; not tested) they can't learn any new ones in-game. It's not quite perfect because they could learn them at character creation, but you could just deal with that on the honour system.

Link to comment

As far as preventing spells being selectable at character generation, I couldn't say if it's hardcoded or not. If I wanted to find out, I'd edit the Necromancer's usability field in kitlist.2da as follows.

 

Change the Necromancer line's usability field from:

28 NECROMANCER 12744 12787 9570 CLABMA03 27 0x00001000 1

 

To have the value of Necromancer + Enchanter (opposing school to Evocation):

28 NECROMANCER 12744 12787 9570 CLABMA03 27 0x00001200 1
Link to comment

This is controlled by the exclusion flags in each spell. If you want to make evocation an opposition school to the necromancer, this could be a way to do it:

 

COPY_EXISTING_REGEXP ~.*\.spl~ ~override~
 READ_SHORT 0x1c "spelltype"
 READ_BYTE 0x22 "castingtype"
PATCH_IF ("%spelltype%" = "0x1") AND ("%castingtype%" = "0xf") BEGIN
  READ_BYTE 0x1f "exclusion"
  WRITE_BYTE 0x1f ("exclusion" BOR "0b00010000")
END
 BUT_ONLY_IF_IT_CHANGES

 

This will search all spells and for those with spell type set to "wizard" and casting type set to "invocation" (which seems to be the most reliable way to detect an evocation spell if you do not want to find them all yourself) it will tick the necromancer exclusion flag.

Link to comment

Ok, thanks, i will try this on a short time.

 

The "usability" flag is a cool and easy solution :)

 

 

 

But for the Warlord, do you have a solution ? I only need a usability flag, i cannot change many thing, cause he share the "warrior/mage" multiclass.

 

I know that the sorcerer can use but not learn from scrools. This is the way. is there a usability flag to simulate the sorcerer ?

If there is a usability flag to borbid the USE of scrolls i take it too. The warlord can cast spell in wearing heavy armor and learn instinctively new spells at new levels, so that's a good thing if i can't use scrools (he use his hown magic, he don't worry the arcanic studies)

OR..... maybe somewhere on the net, a tutorial on the opcode #181 ?

Link to comment

No, you cannot duplicate the way the sorcerer is restricted with regard to scrolls. You will need to prevent fighter/mages from using scrolls altogether. This is done in much the same way as the other example I posted.

Link to comment
Guest Guest

Couldn't the warlord work as a cleric (or ranger, or paladin) kit? That would prevent the character from both deleting spells and scribing new ones.

Link to comment
Couldn't the warlord work as a cleric (or ranger, or paladin) kit? That would prevent the character from both deleting spells and scribing new ones.

 

The "divine" casters (cleric, ranger, paladins and druids) have there spell list refreshed on each new level. It's a really difficult way to "purge" it and delete spells.

I know it because i have made it for on on my kit, a cleric kit who haven't access to cure, restaure and ressurect. It work, but with a glitch : with the method i use, it's possible to cheat and memorize the deleted spell (on the screen which resume the spells wins when passing a level, because they are refreshed before delete)

Link to comment
This is controlled by the exclusion flags in each spell. If you want to make evocation an opposition school to the necromancer, this could be a way to do it:

 

COPY_EXISTING_REGEXP ~.*\.spl~ ~override~
 READ_SHORT 0x1c "spelltype"
 READ_BYTE 0x22 "castingtype"
PATCH_IF ("%spelltype%" = "0x1") AND ("%castingtype%" = "0xf") BEGIN
  READ_BYTE 0x1f "exclusion"
  WRITE_BYTE 0x1f ("exclusion" BOR "0b00010000")
END
 BUT_ONLY_IF_IT_CHANGES

 

This will search all spells and for those with spell type set to "wizard" and casting type set to "invocation" (which seems to be the most reliable way to detect an evocation spell if you do not want to find them all yourself) it will tick the necromancer exclusion flag.

 

I cannot do that cause it will also affect Tsujatha, and many over necromancer pnjs i doesn't know for the moment.

 

The way is the unusable flag, restricted to the kit.

Link to comment
Couldn't the warlord work as a cleric (or ranger, or paladin) kit? That would prevent the character from both deleting spells and scribing new ones.

 

The "divine" casters (cleric, ranger, paladins and druids) have there spell list refreshed on each new level. It's a really difficult way to "purge" it and delete spells.

I know it because i have made it for on on my kit, a cleric kit who haven't access to cure, restaure and ressurect. It work, but with a glitch : with the method i use, it's possible to cheat and memorize the deleted spell (on the screen which resume the spells wins when passing a level, because they are refreshed before delete)

DR has a system in place that stops the automatic re-learning of divine spells. Make your mod depend on Divine Remix, and study DR's compatibility documentation for more tips and tricks.

Link to comment
Couldn't the warlord work as a cleric (or ranger, or paladin) kit? That would prevent the character from both deleting spells and scribing new ones.

 

The "divine" casters (cleric, ranger, paladins and druids) have there spell list refreshed on each new level. It's a really difficult way to "purge" it and delete spells.

I know it because i have made it for on on my kit, a cleric kit who haven't access to cure, restaure and ressurect. It work, but with a glitch : with the method i use, it's possible to cheat and memorize the deleted spell (on the screen which resume the spells wins when passing a level, because they are refreshed before delete)

DR has a system in place that stops the automatic re-learning of divine spells. Make your mod depend on Divine Remix, and study DR's compatibility documentation for more tips and tricks.

 

I've ever studied DR, ever made this choice, and i've choice to not be dependent of anyone mod.

I know that DR delete some spells of the cleric, but in fact it delete all spells from all clerics and redistribute someones. This is not what i want, cause i don't want that the use of my cleric kit altere Viconia or Anomen...

 

But thank for the idea :)

Link to comment

In that case, study DR some more and alter its code so that the standard clerics/druids/paladins/rangers receive the usual spells, while your kit receives the spells you want to. IIRC, Cam wrote the DR code, and he's notoriously in favor of people re-using his stuff (good luck getting written permission from him though, he's currently away from the modding world).

Link to comment

I have find a solution to forgiv the use of scrools to the warlord.

 

He can use ranger wespons. So, a good solution is to give him the usability flag of the cavaler, and make alls arcane scrools unusable by cavaler.

 

But i doesn't masting script in tp2.

 

Can someone give me the text i have to include in my tp2 to patch all the arcane scrolls to be unusable by cavaler ?

 

Thanks a lot :)

Link to comment
Can someone give me the text i have to include in my tp2 to patch all the arcane scrolls to be unusable by cavaler ?

 

Thanks a lot :)

 

COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
 PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
READ_SHORT 0x1c item_type
READ_BYTE  0x2f kit_usability4
READ_LONG  0x64 abilities_off
READ_SHORT 0x68 num_abilities
READ_SHORT 0x6a effects_off

PATCH_IF (item_type == 0x0b) BEGIN // scroll
  SET is_mage_scroll = 0
  // check to see if this scroll teaches a spell when used
  FOR (i = 0; i < num_abilities; i += 1) BEGIN
	READ_SHORT (abilities_off + 0x38*i + 0x1e) num_features
	READ_SHORT (abilities_off + 0x38*i + 0x20) features_ind
	FOR (j = 0; j < num_features; j += 1) BEGIN
	  READ_SHORT (effects_off + 0x30*(features_ind + j)) opcode
	  PATCH_IF (opcode == 147) BEGIN // "learn spell"
		SET is_mage_scroll = 1
	  END
	END
  END

  PATCH_IF (is_mage_scroll == 1) BEGIN
	// make unusable by cavaliers
	WRITE_BYTE 0x2f (kit_usability4 BOR 0b00001000)
  END
END
 END
 BUT_ONLY

Link to comment
Can someone give me the text i have to include in my tp2 to patch all the arcane scrolls to be unusable by cavaler ?

 

Thanks a lot :)

 

COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
 PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
READ_SHORT 0x1c item_type
READ_BYTE  0x2f kit_usability4
READ_LONG  0x64 abilities_off
READ_SHORT 0x68 num_abilities
READ_SHORT 0x6a effects_off

PATCH_IF (item_type == 0x0b) BEGIN // scroll
  SET is_mage_scroll = 0
  // check to see if this scroll teaches a spell when used
  FOR (i = 0; i < num_abilities; i += 1) BEGIN
	READ_SHORT (abilities_off + 0x38*i + 0x1e) num_features
	READ_SHORT (abilities_off + 0x38*i + 0x20) features_ind
	FOR (j = 0; j < num_features; j += 1) BEGIN
	  READ_SHORT (effects_off + 0x30*(features_ind + j)) opcode
	  PATCH_IF (opcode == 147) BEGIN // "learn spell"
		SET is_mage_scroll = 1
	  END
	END
  END

  PATCH_IF (is_mage_scroll == 1) BEGIN
	// make unusable by cavaliers
	WRITE_BYTE 0x2f (kit_usability4 BOR 0b00001000)
  END
END
 END
 BUT_ONLY

 

Thanks a lot ;-)

 

This is working, and the warlord, with unusable flag of the cavaler, cannot longer use scrools. But he can learn from thems :s

What the hell !

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...