Scripting Help - Character Restrictions, Ghostly Creatures
Lex23
Member Posts: 34
I'm working on a new adventure, and I've come across a few things that I need a hand figuring out how to do. I'd appreciate any help that anyone has to offer!
1. Restrict race/class options during character creation or module load, such as disallowing halflings and monks as PCs. I'm pretty sure it's possible, but I can't find anything on how to do this.
2. Give creatures a "semi-transparent" appearance, similar to how an invisible creature looks when it has been sensed. Right now I'm doing this by just making them invisible OnSpawn, but that means they can't be seen at all when the PC is more than a few steps away. I'd like for them to always be semi-transparent, no matter where the PC is viewing them from. And if there's a way to give them other ghostly features (hazy appearance, glowing eyes, etc) without just using "ghost" creature models, that would be doubly awesome.
I'm sure there will be more that I can't figure out on my own, but that's what I'm struggling with now.
1. Restrict race/class options during character creation or module load, such as disallowing halflings and monks as PCs. I'm pretty sure it's possible, but I can't find anything on how to do this.
2. Give creatures a "semi-transparent" appearance, similar to how an invisible creature looks when it has been sensed. Right now I'm doing this by just making them invisible OnSpawn, but that means they can't be seen at all when the PC is more than a few steps away. I'd like for them to always be semi-transparent, no matter where the PC is viewing them from. And if there's a way to give them other ghostly features (hazy appearance, glowing eyes, etc) without just using "ghost" creature models, that would be doubly awesome.
I'm sure there will be more that I can't figure out on my own, but that's what I'm struggling with now.
0
Comments
void main() { object oPC = GetEnteringObject(); int iRacialType = GetRacialType(oPC); if (iRacialType == RACIAL_TYPE_HALFLING) BootPC(oPC, "This server does not allow halflings."); //or int iClass = GetLevelByClass(CLASS_TYPE_MONK, oPC); if (iClass) BootPC(oPC, "This server does not allow monks."); }
You could also use the same checks above to just prevent them from using a transition to leave the starting area or what not.
2.) Again just depends on where you want to add the effects but basically something like:
void main() { object oPC = GetEnteringObject(); effect eGhost = SupernaturalEffect(EffectCutsceneGhost()); effect eGhostVisual1 = SupernaturalEffect(EffectVisualEffect(VFX_DUR_GHOST_SMOKE)); effect eGhostVisual2 = SupernaturalEffect(EffectVisualEffect(VFX_DUR_GHOST_TRANSPARENT)); effect eGhostVisual3 = SupernaturalEffect(EffectVisualEffect(VFX_DUR_ICESKIN)); effect eGhostVisual4 = SupernaturalEffect(EffectVisualEffect(VFX_DUR_GLOW_GREY)); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, oPC); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhostVisual1, oPC); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhostVisual2, oPC); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhostVisual3, oPC); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhostVisual4, oPC); SetFootstepType(FOOTSTEP_TYPE_NONE, oPC); }
I used the Supernatural effect link before hand so that the effects stay during resting. While in the script editor you can look over the other VFX_DUR_XXXXX constants and play around with different visuals and see what works for you. There are also glowing eyes in there. Different colors you can glow etc.
Does BootPC work in a single-player module? I can't get it to work OnClientEnter when I'm testing with a halfling monk character.
EndGame("Ending");
But perhaps, put a delay before ending, and send a message to the pc to inform them that they cannot use that class/feat/etc
void main() { object oPC = GetEnteringObject(); int iRacialType = GetRacialType(oPC); if (iRacialType == RACIAL_TYPE_HALFLING) { SendMessageToPC(oPC, "This module does not allow halflings. The game will end in 5 seconds."); DelayCommand(5.0, EndGame("Ending")); } //or int iClass = GetLevelByClass(CLASS_TYPE_MONK, oPC); if (iClass) { SendMessageToPC(oPC, "This module does not allow monks. The game will end in 5 seconds."); DelayCommand(5.0, EndGame("Ending")); } }
The delay may need to be longer or shorter or what not.