Polymorph Self
-
Here's the script with playable races added and transgender thing resolved. May want to check the codes for playable races.
Also, this version looks for the command on OBJECT_SELF, not on CoA token.
May also want to rename HALF-ORC and HALF-ELF to loose the dash.//:://///////////////////////////////////////////// //:: Polymorph Self //:: NW_S0_PolySelf.nss //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* The PC is able to changed their form to one of several forms. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Jan 21, 2002 //::////////////////////////////////////////////// #include "x2_inc_spellhook" // Returns true if sCreatureName starts with sFormID int ComparePolyStr(string sFormID, string sCreatureName) { return GetStringLeft(sCreatureName, GetStringLength(sFormID)) == sFormID; } void main() { /* Spellcast Hook Code Added 2003-06-23 by GeorgZ If you want to make changes to all spells, check x2_inc_spellhook.nss to find out more */ if (!X2PreSpellCastCode()) { // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell return; } // End of Spell Cast Hook // No spell if already polymorphed. if (GetHasEffect(EFFECT_TYPE_POLYMORPH, OBJECT_SELF)) return; //Declare major variables object oTarget = GetSpellTargetObject(); effect eVis = EffectVisualEffect(VFX_IMP_POLYMORPH); effect ePoly; int nPoly = 0; int nHD = 0; int isFemale = (GetGender(OBJECT_SELF) == GENDER_FEMALE); string sFormID = GetStringUpperCase(GetLocalString(OBJECT_SELF, "sPolyFormID")); int nFeatTier = 0; //used for the splitting forms apart for Spell Focus and //greater spell focus transmutation. Uncomment line 226 to disable int nCasterLevel = GetCasterLevel(OBJECT_SELF); int nTargetHD = GetHitDice(oTarget); // Determine duration int nMetaMagic = GetMetaMagicFeat(); int nDuration = nCasterLevel; if (nMetaMagic == METAMAGIC_EXTEND) { nDuration = nDuration *2; //Duration is +100% } // -------------------------------- // --- Determine Polymorph type --- // HD 1 if(ComparePolyStr(sFormID, "EYEBALL")) { nPoly = 213; nHD = 1; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "GOBLIN")) { nPoly = 157; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "HOBGOBLIN")) { nPoly = 163; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "KOBOLD")) { nPoly = 165; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "ORC")) { nPoly = 166; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "FIRE BEETLE")) { nPoly = 177; nHD = 1; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "CHICKEN")) { nPoly = 40; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "FALCON")) { nPoly = 133; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "PENGUIN")) { nPoly = 26; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "RAVEN")) { nPoly = 134; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "RAT")) { nPoly = 144; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "OX")) { nPoly = 143; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "BADGER")) { nPoly = 25; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "BAT")) { nPoly = 140; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "COW")) { nPoly = 27; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "DEER")) { nPoly = 142; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "DIRE RAT")) { nPoly = 149; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "WHITE STAG")) { nPoly = 145; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "PARROT")) { nPoly = 324; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "SEAGULL")) { nPoly = 325; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "HORSE")) { nPoly = 326; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "PIXIE")) { nPoly = 328; nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "HUMAN")) { nPoly = (isFemale?306:164); nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "HALFLING")) { nPoly = (isFemale?305:162); nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "HALF-ORC")) { nPoly = (isFemale?304:161); nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "HALF-ELF")) { nPoly = (isFemale?303:160); nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "GNOME")) { nPoly = (isFemale?302:159); nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "ELF")) { nPoly = (isFemale?301:156); nHD = 1; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "DWARF")) { nPoly = (isFemale?300:155); nHD = 1; nFeatTier = 0;} // HD 2 else if(ComparePolyStr(sFormID, "TROGLODYTE")) { nPoly = 312; nHD = 2; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "LIZARDFOLK")) { nPoly = 170; nHD = 2; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "GNOLL")) { nPoly = 158; nHD = 2; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "DEEP ROTHE")) { nPoly = 190; nHD = 2; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "KRENSHAR")) { nPoly = 194; nHD = 2; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "BOMBARDIER BEETLE")) { nPoly = 176; nHD = 2; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "FAERIE DRAGON")) { nPoly = 224; nHD = 2; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "PSEUDODRAGON")) { nPoly = 225; nHD = 2; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "DOG")) { nPoly = 130; nHD = 2; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "WOLF")) { nPoly = 23; nHD = 2; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "SAHUAGIN")) { nPoly = 329; nHD = 2; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "DRYAD")) { nPoly = 330; nHD = 2; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "OCHRE JELLY")) { nPoly = 331; nHD = 2; nFeatTier = 2;} // HD 3 else if(ComparePolyStr(sFormID, "BUGBEAR")) { nPoly = 152; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "SEA HAG")) { nPoly = 168; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "STINK BEETLE")) { nPoly = 179; nHD = 3; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "SWORD SPIDER")) { nPoly = 181; nHD = 3; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "WYRMLING WHITE DRAGON")) { nPoly = 235; nHD = 3; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "BLACK BEAR")) { nPoly = 131; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "COUGAR")) { nPoly = 135; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "CRAG CAT")) { nPoly = 136; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "LEOPARD")) { nPoly = 138; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "PANTHER")) { nPoly = 22; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "BOAR")) { nPoly = 24; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "DIRE BADGER")) { nPoly = 37; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "SNAKE")) { nPoly = 327; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "NYMPH")) { nPoly = 332; nHD = 3; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "GRAY OOZE")) { nPoly = 333; nHD = 3; nFeatTier = 2;} // HD 4 else if(ComparePolyStr(sFormID, "OGRE")) { nPoly = 174; nHD = 4; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "STINGER")) { nPoly = 169; nHD = 4; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "GELATINOUS CUBE")) { nPoly = 208; nHD = 4; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "GARGOYLE")) { nPoly = 191; nHD = 4; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "GIANT SPIDER")) { nPoly = 180; nHD = 4; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "WYRMLING BLACK DRAGON")) { nPoly = 226; nHD = 4; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "WYRMLING BRASS DRAGON")) { nPoly = 228; nHD = 4; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "WORG")) { nPoly = 258; nHD = 4; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "BLINK DOG")) { nPoly = 334; nHD = 4; nFeatTier = 1;} // HD 5 else if(ComparePolyStr(sFormID, "ETTERCAP")) { nPoly = 212; nHD = 5; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "HOOK HORROR")) { nPoly = 214; nHD = 5; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "COCKATRICE")) { nPoly = 189; nHD = 5; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "WYRMLING COPPER DRAGON")) { nPoly = 230; nHD = 5; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "WYRMLING GREEN DRAGON")) { nPoly = 232; nHD = 5; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "JAGUAR")) { nPoly = 137; nHD = 5; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "LION")) { nPoly = 139; nHD = 5; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "SATYR")) { nPoly = 335; nHD = 5; nFeatTier = 0;} // HD 6 else if(ComparePolyStr(sFormID, "DRIDER")) { nPoly = (isFemale?307:211); nHD = 6; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "INTELLECT DEVOURER")) { nPoly = 215; nHD = 6; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "TROLL")) { nPoly = 175; nHD = 6; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "YUAN-TI")) { nPoly = 171; nHD = 6; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "MINOTAUR")) { nPoly = 172; nHD = 6; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "MEDUSA")) { nPoly = 167; nHD = 6; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "BASILISK")) { nPoly = 197; nHD = 6; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "MANTICORE")) { nPoly = 195; nHD = 6; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "WYRMLING BLUE DRAGON")) { nPoly = 227; nHD = 6; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "WYRMLING BRONZE DRAGON")) { nPoly = 229; nHD = 6; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "BROWN BEAR")) { nPoly = 21; nHD = 6; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "WINTER WOLF")) { nPoly = 257; nHD = 6; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "DIRE WOLF")) { nPoly = 35; nHD = 6; nFeatTier = 0;} // HD 7 else if(ComparePolyStr(sFormID, "HARPY")) { nPoly = 173; nHD = 7; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "STAG BEETLE")) { nPoly = 178; nHD = 7; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "WYRMLING RED DRAGON")) { nPoly = 233; nHD = 7; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "WYRMLING SILVER DRAGON")) { nPoly = 234; nHD = 7; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "DIRE BOAR")) { nPoly = 36; nHD = 7; nFeatTier = 0;} // HD 8 else if(ComparePolyStr(sFormID, "MIND FLAYER")) { nPoly = 216; nHD = 8; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "UMBER HULK")) { nPoly = 217; nHD = 8; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "GORGON")) { nPoly = 192; nHD = 8; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "SPHINX")) { nPoly = 193; nHD = 8; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "WYRMLING GOLD DRAGON")) { nPoly = 231; nHD = 8; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "POLAR BEAR")) { nPoly = 148; nHD = 8; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "GRIZZLY BEAR")) { nPoly = 147; nHD = 8; nFeatTier = 0;} // HD 9 else if(ComparePolyStr(sFormID, "BATTLE DEVOURER")) { nPoly = 209; nHD = 9; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "WILL O WISP")) { nPoly = 218; nHD = 9; nFeatTier = 2;} else if(ComparePolyStr(sFormID, "BULLETTE")) { nPoly = 313; nHD = 9; nFeatTier = 1;} // HD 10 else if(ComparePolyStr(sFormID, "ETTIN")) { nPoly = 187; nHD = 10; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "GREY RENDER")) { nPoly = 221; nHD = 10; nFeatTier = 1;} else if(ComparePolyStr(sFormID, "DIRE SPIDER")) { nPoly = 188; nHD = 10; nFeatTier = 1;} // HD 11 else if(ComparePolyStr(sFormID, "BEHOLDER")) { nPoly = 210; nHD = 11; nFeatTier = 2;} // HD 12 else if(ComparePolyStr(sFormID, "HILL GIANT")) { nPoly = 222; nHD = 12; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "DIRE BEAR")) { nPoly = 33; nHD = 12; nFeatTier = 0;} else if(ComparePolyStr(sFormID, "WYVERN")) { nPoly = 336; nHD = 12; nFeatTier = 1;} // HD 13 // HD 14 else if(ComparePolyStr(sFormID, "FROST GIANT")) { nPoly = (isFemale?308:259); nHD = 14; nFeatTier = 0;} // HD 15 else if(ComparePolyStr(sFormID, "FIRE GIANT")) { nPoly = (isFemale?309:289); nHD = 14; nFeatTier = 0;} // Couldn't determine the form if (nPoly == 0) { SendMessageToPC(OBJECT_SELF, "Unknown form type. Check spelling."); // Default to pixie! (so the spell defaults back to one of the default nwn forms) nPoly = 328; } // Caster level not high enough for the form if (nHD > nCasterLevel) { SendMessageToPC(OBJECT_SELF, "Caster level is too low for this form."); // Default to pixie! (so the spell defaults back to one of the default nwn forms) nPoly = 328; } // Target hasn't enough HD for the form if (nHD > nTargetHD) { SendMessageToPC(OBJECT_SELF, "Target doesn't have enough HD for this form."); // Default to pixie! (so the spell defaults back to one of the default nwn forms) nPoly = 328; } //Spell Focuses for stronger racial variants ////nFeatTier = 0 ///uncomment this to disable the spell focus restrictions if (nFeatTier == 1 && GetHasFeat(FEAT_SPELL_FOCUS_TRANSMUTATION, OBJECT_SELF) != TRUE) { SendMessageToPC(OBJECT_SELF, "Selected form requires spell focus in transmutation"); // Default to pixie! (so the spell defaults back to one of the default nwn forms) nPoly = 328; } if (nFeatTier == 2 && GetHasFeat(FEAT_GREATER_SPELL_FOCUS_TRANSMUTATION, OBJECT_SELF) != TRUE) { SendMessageToPC(OBJECT_SELF, "Selected form requires greater spell focus in transmutation"); // Default to pixie! (so the spell defaults back to one of the default nwn forms) nPoly = 328; } ePoly = EffectPolymorph(nPoly); //copy their weapon properties so they don't suck completely int bWeapon = StringToInt(Get2DAString("polymorph","MergeW",nPoly)) == 1; object oWeaponOld = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,OBJECT_SELF); //Fire cast spell at event for the specified target SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_POLYMORPH_SELF, FALSE)); //Apply the VFX impact and effects AssignCommand(oTarget, ClearAllActions()); // prevents an exploit ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, oTarget, TurnsToSeconds(nDuration)); //copying the weapon properties object oWeaponNew = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,OBJECT_SELF); if (bWeapon) { IPWildShapeCopyItemProperties(oWeaponOld,oWeaponNew, TRUE); } }
-
I really love this idea, but think it would steal alot of the Shifter's thunder and lose it's entertainment after a small while, like the trench coat.
Maybe it could be implimented as an application only perk?
Just thought I'd mention my opinion and bump the thread at the same time.
-
I disagree with King of Hearts pretty much entirely.
-
Make it as the PnP spell.
Just increase the atributes and natural skills.
No Supernatural powers from the creatrures.
-
To sound much less argumentative, what I meant was: I'd prefer to see more spells with roleplay value, or practical uses, rather than plain combat. Polymorph has a near-infinite array of options, but is limited to 5 poor choices.
-
This should be implemented next reset.
So watch out when you polymorph or you'll end up in pixy! (new default shape)TIP: Quicksloting a chat command like .ps goblin! would be equivalent to quicksloting the polymorph spell so that it turns you like a goblin.
Don't take a form with higher HD than your caster level or than the HD of your target.
Spell focus transmutation and greater spell focus transmutation help you unlock more forms in the list above. You can find which by reading the script (check the variable nFeatTier next to each form).
-
Is the actual command:
.ps goblin!
.ps goblin
"!" part of all of the commands?
-
@Bolthor:
Is the actual command:
.ps goblin!
.ps goblin
"!" part of all of the commands?
The exclamation will cast it instantly if you have it memorized.
Without, it just sets it up for a later casting.
-
Just so I know, spell focus transmutation and greater spell focus transmutation are needed to transform into anything with the text nFeatTier= 1 ; } or nFeatTier= 2 ; } respectively? And nFeatTier= 0 ; } are forms that can be taken without feats?
-
how will this work if we use a metamagic version of the spell and the normal spell? (say extended spell)
-
Just so I know, spell focus transmutation and greater spell focus transmutation are needed to transform into anything with the text nFeatTier= 1 ; } or nFeatTier= 2 ; } respectively? And nFeatTier= 0 ; } are forms that can be taken without feats?
The code answers that for you here: (relevant points in bold)
if (nFeatTier == 1 && GetHasFeat(FEAT_SPELL_FOCUS_TRANSMUTATION, OBJECT_SELF) != TRUE)
{ SendMessageToPC(OBJECT_SELF, "Selected form requires spell focus in transmutation");And:
if (nFeatTier == 2 && GetHasFeat(FEAT_GREATER_SPELL_FOCUS_TRANSMUTATION, OBJECT_SELF) != TRUE)
{ SendMessageToPC(OBJECT_SELF, "Selected form requires greater spell focus in transmutation") -
longest 'yes' I've ever seen.
;) -
how will this work if we use a metamagic version of the spell and the normal spell? (say extended spell)
The code answers that for you here: (relevant points in bold)
int nDuration = nCasterLevel;
if (nMetaMagic == METAMAGIC_EXTEND) {
nDuration = nDuration *2; //Duration is +100%
}Here is some random text so that I don't answer only in quotes :D
-
I used an extended polymorph self earlier, and turned into one of the new forms.
-
Will any of the forms have their abilities like petrifying breath and so on? Cause if not, some forms have little to no reason to require SF or GSF. Mechanically, of course.
-
Not everything is mechanical. We find it acceptable to have some forms requiring SF or GSF, for the sheer awesomeness of the form itself.
-
Will any of the forms have their abilities like petrifying breath and so on? Cause if not, some forms have little to no reason to require SF or GSF. Mechanically, of course.
Most oft hem were weighted both mechanically and in a logic sense, loosely based on the Shifter acquisition levels.
There's a couple of exceptions (Krenshar, and Hook Horror being standouts for having no especially redeeming features in mechanics or RP), but most of the higher tiered ones have passive properties that're fairly potent even without their powers.
-
Let me just say, that I realy enjoy this new function.
However I tried the Human and Dwarf "variables", and they did not seem to work, I was informed to check my spelling.
I tried .ps Human and .ps HUMAN as well as .ps Dwarf
-
Let me just say, that I realy enjoy this new function.
However I tried the Human and Dwarf "variables", and they did not seem to work, I was informed to check my spelling.
I tried .ps Human and .ps HUMAN as well as .ps Dwarf
I mentioned it in bug reports, but yeah. those add-ons were after the version originally sent to the DMs. While the code is in this thread, it'lll have to wait on them having time to implement it in.
-
I copied the scrpit but I don't get anything for the polymorph. No changes at all. only cancel polymorph option. No stat changes, no apperance changes. SOmething I'm missing.
or does it only work with dot commands. and if so how does that work?
Or better yet where does this go???? N00B! I know I know.
Code:
// –------ From onPlayerChat -----------
object oPC = GetPCChatSpeaker();
string sCommand = GetPCChatMessage();if (GetStringLeft(sCommand, 3) == ".ps")
{
int nCmdLength = GetStringLength(sCommand);
int nCastNow = FALSE;// Check if there's any param to the chat command
if (nCmdLength <= 4) {
SendMessageToPC(oPC, "Usage: .ps ");
return;
}// Does it end with "!"?
if (GetStringRight(sCommand, 1) == "!") nCastNow = TRUE;string sPolyFormID = GetSubString(sCommand, 4, nCmdLength - (nCastNow?5:4));
SetLocalString(oPC, "sPolyFormID", sPolyFormID);
SendMessageToPC(oPC, "Poly set at: " + sPolyFormID);// Assign cast spell if ends with "!"
if (nCastNow) AssignCommand(oPC, ActionCastSpellAtObject(SPELL_POLYMORPH_SELF, oPC));
}