PDA

View Full Version : Fix: Invis Vs Undead = Invis to anything


inkubus
08-09-2007, 10:17 PM
In faction.cpp

Change: Lines 445
if (invisible_undead && tnpc && !tnpc->SeeInvisibleUndead())
{
return FACTION_INDIFFERENT;
}

To:
if (invisible_undead && tnpc && !tnpc->SeeInvisibleUndead())
{
if (tnpc->GetBodyType() == BT_Undead || tnpc->GetBodyType() == BT_SummonedUndead)
{
return FACTION_INDIFFERENT;
}
}


Appears the issue wasn't checking body types like it should have been, making IVU the greatest invis any man (or woman) has ever seen!

cavedude
08-10-2007, 11:17 AM
This change isn't needed. IVU, like all other invis spells checks the db to see what sees through it and what doesn't. So long as your db is setup correctly, the spell will work correctly.

I just tested IVU on Grand Creation, with it on I was KOS to animals, giants, goblins, etc, but indifferent to Skellies and zombies. So it is working correctly, meaning the newest PEQ CVS will having working IVU.

inkubus
08-10-2007, 12:51 PM
Hi Cavedude,

I'm using angelox's db which must be missing something. Where in the DB does it specify the rules for what IVU affects? I'd rather add that in than having to change the source everytime there's an update.

Cheers

InKy

cavedude
08-11-2007, 01:40 AM
In the npc_types table set see_invis_undead to 1 if the mob can see through it, 0 if it can't. Likewise, you'd do the same for see_invis, see_hide, and see_improved_hide.

inkubus
08-11-2007, 08:00 AM
So every normal mob must have see invis undead set that is not undead? Seems a bit reactive?

cavedude
08-11-2007, 09:21 AM
It's far better to be able to control each mob's habits individually, especially in the invis spell area where there are plenty of exceptions. Plus, allowing all normal NPCs to be able to see through IVU is as simple as:

update npc_types set see_invis_undead = 1 where bodytype != '3' and bodytype != '8';

inkubus
08-11-2007, 11:26 AM
I agree that it's an easy step to adjust them all, it's just when producing potentially thousands of new npcs it's 1000 extra lines that could be unnecessary and easily forgotten. Since the spell is Invis Vs Undead it should rely specifically on bodytypes 3 and 8 else IVU turns itself into a normal invis spell (which is not what the name implies).

The only time I can think it would be useful is I had say a human that was secretly undead (for some storyline reason perhaps). But then I should still be setting it's bodytype to 3 for undead spells to function.

cavedude
08-11-2007, 11:52 AM
You're also forgetting undead NPCs which can see through IVU. That's really the true reason why this and all the other invis columns exist in the database, for the exceptions.

inkubus
08-11-2007, 11:59 AM
Yeah but those exceptions would still work with this

cavedude
08-12-2007, 02:50 AM
Ah, I gotcha now. Yep, so long as the column in npc_types can still override this is a good change.