Making a Spell That Works Only In Cities
Raduziel
Member Posts: 4,714
Hi
Is there any way to make a spell only target neutral characters (non-hostiles out of the party)?
I'm working on a kind of Charm Person that I need to be completely useless against enemies (because of reasons)
Thanks.
Is there any way to make a spell only target neutral characters (non-hostiles out of the party)?
I'm working on a kind of Charm Person that I need to be completely useless against enemies (because of reasons)
Thanks.
Post edited by Raduziel on
0
Comments
Parameter 1: NONEVIL
Parameter 2: EA
p1: 199 (NOTEVIL)
p2: EA
Resource the spell that I want to take effect.
The resource field accepts .spl files or only .eff files?
Thanks!
In many ways, 324 is the easiest. All you need to do is make non-allied creatures immune to the spell as the very first effect. It must be the first effect. There are a number of IWDEE spells that use this trick (I think, e.g. Hold person works this way--In IWDEE only, though).
Basically, I think you'd set param1 to 0, and param 2 to 51 (enemies).
I know the solution is somewhere around Opcode 324, but I just can't find the right parameters to use.
I want to create a spell that can be used only when inside a city. This spell will, when cast in a valid condition, call another one that has a 25% os chance of raising the party's reputation by 1 or 5% of dropping it by the same amount (RAChaTa1).
From IESDP I got the following info:
Opcode 324
I know that I want to use the 0x106 info (areatype) and the code for City is 8.
If opcode 324 gives immunity from a spell so I guess I need to use the option 5 (not equal). This way I'll be immune every time I'm outside a city.
Can you guys give me some help? Especially @subtledoctor @Grammarsalad , who loves this opcode apparently
NOT_IN_CITY 0x106 8 5
with 0x106 = areatype (like outdoors, forest, etc)
8 = CITY
5 = not equal
I once wrote a function to do this, but Argent77's one is better.
Once done, use it with #324.
But how do I fill the #324? What will be p1, p2, special, etc in this case?
5 (Not Equal) will not work correctly here though, you need to use 9 (Binary Not Match), so:
NOT_IN_CITY 0x106 8 9
Using the function:
0x106 is the "stat"
8 is the "value"
9 is the "relation"
Let's say: the spell will only work inside specific areas.
The AREATYPE part on .are files is coded on two bytes. In an unmodded game only 7 or 8 types are set in AREATYPE.IDS , out of 16 (2*8 bits) possible types. So it is possible, though not sure, that you could add a line to AREATYPE.IDS, flag the areas you want to work as being of this type you just created, and then use @Gwendolyne 's trick, changing the middle value to 256. Can't give you any guarantee this would work as I have never actually tried messing with that, but I don't see why not so it might be worth a try.
Might cause compatibility issues if multiple modders decide to do things with areatype.ids, since the total number of entries would hardcap at 16 regardless but no mod that I know of make use of that so as they say, first come first served.
Other than that, well, pretty much everything can be achieved through clever scripting, but it may get quite tedious, so I would first try my first method.
Maybe @Avenger_teambg or another developer could enlighten us about what can be done with areatype.IDS.
So you can have maximum 8 new values in areatype.ids
If you combine multiple bits, you may have more values (at the cost of being mutually exclusive), and it would be more difficult (but not impossible) to create an splprot entry to discern them.