Setting a variable on PC which lasts as long as a polymorph?
#1
Posté 24 février 2014 - 01:55
While setting a variable temporarily, as long as the duration of the polymorph, would not be difficult, I don't want it to persist if the effect lasts shorter for some reason, i.e. if the PC cancels the polymorph.
Is there an easy way to do this?
#2
Posté 24 février 2014 - 02:05
Im not sure whether you use CPP 1.71 or not, but in case you would then you can use the function int spellsIsImmuneToDrown(object oCreature) from #include "70_inc_spells"
basically any creature that can breath underwater is immune to the drowning so its the same thing
this function is defined as this:
int spellsIsImmuneToDrown(object oCreature)
{//undead, construct and any creature that doesn't breath or can breath water are immune to the drown effect
switch(GetRacialType(oCreature))
{
case RACIAL_TYPE_UNDEAD:
case RACIAL_TYPE_CONSTRUCT:
case RACIAL_TYPE_ELEMENTAL:
case RACIAL_TYPE_OOZE:
return TRUE;
}
switch(GetAppearanceType(oCreature))
{
case APPEARANCE_TYPE_WYRMLING_BLACK:
case APPEARANCE_TYPE_WYRMLING_GREEN:
case APPEARANCE_TYPE_WYRMLING_BRONZE:
case APPEARANCE_TYPE_WYRMLING_GOLD:
case APPEARANCE_TYPE_DRAGON_BLACK:
case APPEARANCE_TYPE_DRAGON_GREEN:
case APPEARANCE_TYPE_DRAGON_BRONZE:
case APPEARANCE_TYPE_DRAGON_GOLD:
case APPEARANCE_TYPE_SAHUAGIN:
case APPEARANCE_TYPE_SAHUAGIN_CLERIC:
case APPEARANCE_TYPE_SAHUAGIN_LEADER:
case APPEARANCE_TYPE_SEA_HAG:
case APPEARANCE_TYPE_MEPHIT_OOZE:
case APPEARANCE_TYPE_MEPHIT_WATER:
case APPEARANCE_TYPE_SHARK_GOBLIN:
case APPEARANCE_TYPE_SHARK_MAKO:
case APPEARANCE_TYPE_SHARK_HAMMERHEAD:
return TRUE;
}
return GetLocalInt(oCreature,"IMMUNITY_DROWN");
}
#3
Posté 24 février 2014 - 02:10
That's even better, because I don't need to modify all the water elemental blueprints (including summonings) to make them immune to drowning.
I'm using 1.70, is full release of 1.71 out yet? If so, I gotta check it out. I want to download a full version once it's out, as I'd like a Polish translation included in it. Until then, I'm fine with 1.70.
Anyway, thanks!
Modifié par Grani, 24 février 2014 - 02:11 .
#4
Posté 24 février 2014 - 02:16
EDIT: oops to late.
Modifié par Lightfoot8, 24 février 2014 - 02:17 .
#5
Posté 24 février 2014 - 05:31
#6
Posté 24 février 2014 - 06:22
henesua wrote...
Another way to handle this is to create a custom 2DA which is linked to appearance. I created appearance_x, and added a bunch of additional columns for data I wanted associated with each appearance: AQUATIC, SOFTBODIED, FLYING and so on.
Interesting. I've been debating the best way to do a GetIsFlier function. I still think appearance is likely the way to go, since you're going to wind up modifying it if you add new appearances to your mod, and it's probably simpler and easier to access that information in code (though probably not much faster, these days).
Funky
#7
Posté 25 février 2014 - 03:49
For me its just a matter of when I want to manage the information, and whether I want others to have the ability to modify it.
Also i am not using CEP, and I mess with custom content a lot, so in my case its easier to manage the data when the creature is imported into the HAKs. I go over all of the appearance 2da at once, and then I'm done.





Retour en haut






