• Marking a Character for Deletion

    3
    3 Posts
    2k Views
    I

    Thanks for responding. I will try to keep figuring it out. Good system though. I like NWN and NWN2 because I use it to play and practice programming. But sometimes I get stuck. So I appreciate any help you can give. Take care.

  • Bard Songs

    2
    2 Posts
    1k Views
    Mr.MolochM

    Continued

    void SongRhapsody(object oPC, int nSongStrength) { int nCount = GetLocalInt(oPC, "RHAPSODYCOUNT"); if(nCount==0) { SetLocalInt(oPC, "RHAPSODYCOUNT", 1); DelayCommand(RoundsToSeconds(nSongStrength), DeleteLocalInt(oPC, "RHAPSODYCOUNT")); nCount++; } else { nCount++; SetLocalInt(oPC, "RHAPSODYCOUNT", nCount); } int nDC = 8; if(nCount<=5) nDC = 8 + nCount*4; //+4 has DC 24 else if(nCount<=10) nDC = 12 + nCount*5; //+9 has DC 57 else if(nCount<=15) nDC = 16 + nCount*6; //+14 has DC 100 else if(nCount<=20) nDC = 20 + nCount*7; //+19 has DC 153 else nDC = 24 + nCount*8; string sPronoun = "her"; if(GetGender(oPC)==GENDER_MALE) sPronoun="his"; if(!GetIsSkillSuccessful(oPC, SKILL_PERFORM, nDC)) //Failed { FloatingTextStringOnCreature(GetName(oPC)+"'s voice cracks!", oPC, FALSE); DeleteLocalInt(oPC, "RHAPSODYCOUNT"); effect eSilence = EffectSilence(); effect eVis2 = EffectVisualEffect(VFX_DUR_CESSATE_NEUTRAL); eSilence = EffectLinkEffects(eSilence, eVis2); eSilence = ExtraordinaryEffect(eSilence); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSilence, oPC, RoundsToSeconds(10)); return; } else { FloatingTextStringOnCreature(GetName(oPC)+" raises "+sPronoun+" song's volume to "+IntToString(nCount)+"!", oPC, FALSE); } //Bonuses Here effect eDamage; //Visuals effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); effect eImpact = EffectVisualEffect(302); effect eVis2 = EffectVisualEffect(507); //BardSong VFX2 //Loop object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { eVis2 = ExtraordinaryEffect(eVis2); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis2, oPC, RoundsToSeconds(1)); } float fDelay; while(GetIsObjectValid(oTarget)) { if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oPC)) { // * GZ Oct 2003: If we are deaf, we do not have negative effects from curse song if (!GetHasEffect(EFFECT_TYPE_DEAF,oTarget)) { if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { //Damage Here eDamage = EffectDamage(d6(nCount), DAMAGE_TYPE_SONIC); eDamage = ExtraordinaryEffect(eDamage); ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget); ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oTarget); DelayCommand(GetRandomDelay(0.1,0.5),ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } else //Target is Deaf, VFX { ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE), oTarget); } //Non Deaf Dependant Damage Here } oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); } DecrementRemainingFeatUses(oPC, FEAT_BARD_SONGS); } void SongCalumny(object oPC, int nSongStrength, int nDuration) { //Visuals effect eVis = EffectVisualEffect(VFX_IMP_HEAD_SONIC); effect eImpact = EffectVisualEffect(VFX_IMP_CHARM); effect eVis2 = EffectVisualEffect(507); //BardSong VFX2 //Setup Variables object oSlander; int nCount = 10, nPCCha, nFail, nDC1; nPCCha = GetAbilityModifier(ABILITY_CHARISMA, oPC) +nSongStrength +d20(1); //Loop object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { eVis2 = ExtraordinaryEffect(eVis2); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis2, oPC, RoundsToSeconds(1)); } float fDelay; while(GetIsObjectValid(oTarget)&& nFail!=1) { if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oPC)) { // * GZ Oct 2003: If we are deaf, we do not have negative effects from curse song if (!GetHasEffect(EFFECT_TYPE_DEAF,oTarget)) { if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { if(!GetIsObjectValid(oSlander)) //First Target { nDC1 = GetAbilityModifier(ABILITY_CHARISMA, oTarget) + GetHitDice(oTarget) + d20(1); string sGender = "his"; if(GetGender(OBJECT_SELF)==GENDER_FEMALE) sGender = "her"; FloatingTextStringOnCreature("Charisma: "+GetName(oPC)+" attempts to throw "+sGender+" voice!", oPC); if(nPCCha>=nDC1) //Success beating CHA { oSlander = oTarget; DelayCommand(0.5, SlanderString(oSlander)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oTarget); } else //Failure to beat CHA { nFail=1; DelayCommand(0.5, FloatingTextStringOnCreature("Charisma: Failure!", oPC)); } } else //Other Targets + Slander valid { nCount = nCount + 4 + GetHitDice(oTarget)/2; //DC increases by HD/2 of each creature SetLocalInt(oTarget, "SLANDERTHEM", 1); } } } else //Target is Deaf, VFX { ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE), oTarget); } //Non Deaf Dependant Damage Here } oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); } oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); if(nFail!=1) { if(nCount>10) { if(GetIsSkillSuccessful(oPC, SKILL_PERFORM, nCount)) { while(GetIsObjectValid(oTarget)) { if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oPC)) { if(GetLocalInt(oTarget, "SLANDERTHEM")==1) { SetIsTemporaryEnemy(oSlander, oTarget, TRUE, RoundsToSeconds(nDuration+10)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); AssignCommand(oTarget, ClearAllActions()); AssignCommand(oTarget, ActionAttack(oSlander)); RespondString(oTarget); } } oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); } } else DelayCommand(1.5, AssignCommand(oSlander, SpeakString("WHO DID THAT?!"))); } } DecrementRemainingFeatUses(oPC, FEAT_BARD_SONGS); } void SongEleWeak(object oPC, int nSongStrength, int nDuration, int nType = DAMAGE_TYPE_FIRE, int nVFX = VFX_IMP_SONIC) { //Penalties Here int nPenalty = 2*nSongStrength +6; //+2% Per Level if(nSongStrength>=13) nPenalty = nPenalty + nSongStrength-12; //+3% Per Level after 20 if(nSongStrength>=18) nPenalty = nPenalty + nSongStrength-17; //+4% Per Level after 25 if(nSongStrength>=23) nPenalty = nPenalty + 1; //+5% Per Level at 30 (70% Total Bonus) effect ePenalty = EffectDamageImmunityDecrease(nType, nPenalty); effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); effect eLink = EffectLinkEffects(ePenalty, eDur); eLink = ExtraordinaryEffect(eLink); //Visuals effect eVis = EffectVisualEffect(nVFX); effect eVis2 = EffectVisualEffect(507); //BardSong VFX2 //Loop object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { eVis2 = ExtraordinaryEffect(eVis2); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis2, oPC, RoundsToSeconds(nDuration)); } float fDelay; while(GetIsObjectValid(oTarget)) { if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oPC)) { // * GZ Oct 2003: If we are deaf, we do not have negative effects from curse song if (!GetHasEffect(EFFECT_TYPE_DEAF,oTarget)) { if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { //Damage Here ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); DelayCommand(GetRandomDelay(0.1,0.5),ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } else //Target is Deaf, VFX { ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE), oTarget); } //Non Deaf Dependant Damage Here } oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); } DecrementRemainingFeatUses(oPC, FEAT_BARD_SONGS); } void SongSResist(object oPC, int nSongStrength, int nDuration, int nVFX = VFX_IMP_SILENCE) { //Penalties Here effect ePenalty = EffectSpellResistanceDecrease(nSongStrength); effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); effect eLink = EffectLinkEffects(ePenalty, eDur); eLink = ExtraordinaryEffect(eLink); //Visuals effect eVis = EffectVisualEffect(nVFX); effect eVis2 = EffectVisualEffect(507); //BardSong VFX2 //Loop object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { eVis2 = ExtraordinaryEffect(eVis2); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis2, oPC, RoundsToSeconds(nDuration)); } float fDelay; while(GetIsObjectValid(oTarget)) { if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oPC)) { // * GZ Oct 2003: If we are deaf, we do not have negative effects from curse song if (!GetHasEffect(EFFECT_TYPE_DEAF,oTarget)) { if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { //Damage Here ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); DelayCommand(GetRandomDelay(0.1,0.5),ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } else //Target is Deaf, VFX { ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE), oTarget); } //Non Deaf Dependant Damage Here } oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); } DecrementRemainingFeatUses(oPC, FEAT_BARD_SONGS); } void SongTResist(object oPC, int nSongStrength, int nDuration, int nVFX = VFX_IMP_MAGBLUE) { //Penalties Here nSongStrength++; effect ePenalty = EffectTurnResistanceDecrease(nSongStrength/2); effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); effect eLink = EffectLinkEffects(ePenalty, eDur); eLink = ExtraordinaryEffect(eLink); //Visuals effect eVis = EffectVisualEffect(nVFX); effect eVis2 = EffectVisualEffect(507); //BardSong VFX2 //Loop object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { eVis2 = ExtraordinaryEffect(eVis2); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis2, oPC, RoundsToSeconds(nDuration)); } float fDelay; while(GetIsObjectValid(oTarget)) { if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oPC)) { // * GZ Oct 2003: If we are deaf, we do not have negative effects from curse song if (!GetHasEffect(EFFECT_TYPE_DEAF,oTarget)) { if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { //Damage Here ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); DelayCommand(GetRandomDelay(0.1,0.5),ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } else //Target is Deaf, VFX { ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE), oTarget); } //Non Deaf Dependant Damage Here } oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); } DecrementRemainingFeatUses(oPC, FEAT_BARD_SONGS); } void SongCrazyFarm(object oPC, int nSongStrength, int nDuration) { //Penalties Here int nDC = 4 + nSongStrength; effect ePoly = EffectPolymorph(POLYMORPH_TYPE_CHICKEN, TRUE); effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); effect eLink; // = EffectLinkEffects(ePoly, eDur); //eLink = ExtraordinaryEffect(eLink); //Visuals effect eVis = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M); effect eImpact = EffectVisualEffect(49); effect eVis2 = EffectVisualEffect(507); //BardSong VFX2 //Loop object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { eVis2 = ExtraordinaryEffect(eVis2); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis2, oPC, RoundsToSeconds(nDuration)); } float fDelay; while(GetIsObjectValid(oTarget)) { if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oPC)) { // * GZ Oct 2003: If we are deaf, we do not have negative effects from curse song if (!GetHasEffect(EFFECT_TYPE_DEAF,oTarget)) { if(!GetHasFeatEffect(871, oTarget)&& !GetHasSpellEffect(GetSpellId(),oTarget)) { //Damage Here if(!WillSave(oTarget, nDC, SAVING_THROW_TYPE_SPELL)) { ePoly = EffectPolymorph(RandomAnimal(Random(16)), TRUE); eLink = EffectLinkEffects(ePoly, eDur); eLink = ExtraordinaryEffect(eLink); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); DelayCommand(GetRandomDelay(0.1,0.5),ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } } else //Target is Deaf, VFX { ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE), oTarget); } //Non Deaf Dependant Damage Here } oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oPC)); } DecrementRemainingFeatUses(oPC, FEAT_BARD_SONGS); }
  • Delay a Creature Spawn

    9
    9 Posts
    3k Views
    Mr.MolochM

    Yeah, I got this working eventually. It was one of those incredibly ridiculous problems where you look at a line of code a dozen times before you realize you did one simple obvious thing wrong.

  • Copying scripts onto an 'NPC'

    3
    3 Posts
    2k Views
    ZoolZ

    I actually just found an include designed specifically for doing what I want buried deep in the underbelly of CoA. It's so deep, no one knows who made it, but it's rumoured the great script sorceror Bacon waded through the amalgam of code, and made magical adjustments some time ago.

    Now to figure out how it works.

  • Customising armour/clothes with haks

    19
    19 Posts
    5k Views
    StrawManS

    Unfortunately, the systems above haven't been updated to account for the new content delivered in the 1.69 patch, much less custom content.
    They simply don't work in their current state (I preformed some cursory tests, locally).
    And yes, the number of additional resources required to make them function is off-putting.

  • NWN 2 scripts compatibile with NWN1

    5
    5 Posts
    3k Views
    ZoolZ

    It would be more effort than it would be worth. There would be massive resolution issues including poly counts, nevermind textures, add to that the fact that NWN 2 likely has more vertical possibilities than NWN 1 (more 3d than 2.5D, probably, not entirely sure) and you have one hell of a task ahead of you.

    The answer is yes, essentially, but boy… I would not want to take on that project.

  • Nbane - Editing .2das and the talk table Explained

    12
    12 Posts
    5k Views
    DiaboSatanD

    Hm. I like this.

  • Getting a characters domains

    7
    7 Posts
    3k Views
    ZoolZ

    Thanks

  • Can you loop FNF visual effects, on a creature?

    5
    5 Posts
    3k Views
    ZoolZ

    Oh. thanks, yeah, Azzmodan told me about this way of doing it. Cheers for the help though, and maybe someone else will find this useful in the future.

  • Custom classes for v5 - Custom Spells

    5
    5 Posts
    2k Views
    N

    I'm omitting the spell "Imbue Item" since it is a crafting type feat, and would affect the balance of CoA's economy. I haven't by any means ruled it out, but I'd rather deal with it later on.

  • New Loot system/information on looting equipment

    19
    19 Posts
    6k Views
    O

    Yea, except when they stand back up and can't ID all the stuff they had.

  • Catchable Familiars

    5
    5 Posts
    2k Views
    F

    oh i so have to make a char with a familiar

  • Lycanthrope Dodge Bonus

    2
    2 Posts
    2k Views
    O-louthO

    The hybrid form -DOES- have dodge. Otherwise it wouldnt stack with the shield spell, which it does.

  • Sheriff searching player inventory

    2
    2 Posts
    1k Views
    DiaboSatanD

    While we do not share most of our scripts, this one is fairly easy to implement. Have an item script created attached to a proper item and use the idea of:ject

    object oItem = GetFirstItemInInventory(oTarget); ... while (GetIsObjectValid(oItem)) { SendMessageToPC(oUser, GetName(oItem)); oItem = GetNextItemInInventory(oTarget); } ...

    Cheers

  • Random Encounters

    3
    3 Posts
    3k Views
    B
    /////////////Seth's Random Encounters /////////////Author : BlackRose/Seth Carter /////////////Date: 07/10/2005, Update May 2007, Update August 2010, Update Jan 2011 /////////////If this wasn't posted or directly distributed to you, it ain't yours. To date including Escape From The Underdark, Isles of Elysium, Bid For Transcendence, Akrylonor, Cormyr & Dales /////////////New Version 2010, d100 Odds. /////////////Called From:Area or Trigger OnEnter void SpawnEncounter(string sSpawn, location lSpawn) { string sDebugSpawn = "Encounter String:'" + sSpawn + "', "; string sSubstring; string sCritter; //string reading function int iPositionInString = 0; int iStringLength = GetStringLength(sSpawn); int iPositionInSubString = 0; int iSubStringLength; int iLastStop = 0; int iMultipleCreatures; int iCounter; int iFoundInSubstring; //read through the string while(iPositionInString != iStringLength) { //stop at | if(GetSubString(sSpawn, iPositionInString, 1) == "|") { //get the creature substring sSubstring = GetSubString(sSpawn, iLastStop, iPositionInString-iLastStop); sDebugSpawn += "Creature Substring: '" + sSubstring +"', "; iLastStop = iPositionInString+1; //move the stop to the character after "|" iMultipleCreatures = 1; //reset the check for a multiple creatures //read through the substring iPositionInSubString = 0; iSubStringLength = GetStringLength(sSubstring); iFoundInSubstring = 0; while(iPositionInSubString != iSubStringLength) { if(GetSubString(sSubstring, iPositionInSubString, 1) == "*") { sCritter = GetSubString(sSubstring, 0, iPositionInSubString); iMultipleCreatures = StringToInt(GetSubString(sSubstring, GetStringLength(sCritter)+1, GetStringLength(sSubstring)-(GetStringLength(sCritter)+1))); iFoundInSubstring =1; } else { if(iFoundInSubstring != 1) { sCritter = sSubstring; } } iPositionInSubString++; } //spawning function (complex, ain't it) if(iMultipleCreatures == 1) { CreateObject(OBJECT_TYPE_CREATURE, sCritter, lSpawn, FALSE); } else { for(iCounter = 0; iCounter < iMultipleCreatures; iCounter++) { CreateObject(OBJECT_TYPE_CREATURE, sCritter, lSpawn, FALSE); } } } iPositionInString ++; } WriteTimestampedLogEntry(sDebugSpawn); } void main() { /// string sLocationDebug; DEBUG ONLY //load area, and initialize dice object oArea; //// If I'm a Trigger, get my area, else I should be the area if(GetObjectType(OBJECT_SELF) == OBJECT_TYPE_TRIGGER) { oArea = GetArea(OBJECT_SELF); } else { oArea = OBJECT_SELF; } object oPC = GetEnteringObject(); int iLocationDice = GetLocalInt(oArea, "Number_Of_Spawnpoints"); // Not strictly necessary, but putting this variable on the area will stop it at that many points, and avoid a very rare TMI int iSpawnDice = d100(1); int iCondition = iLocationDice; int iCounter = 0; int iEncounterOdds; int nOddsCounter; int iEncounterChosen = 0; //avoid bombarding the place when a group enters and don't spawn stuff if a DM turned encounters off if(GetLocalInt(oArea, "RecentSpawned") == 0 && GetLocalInt(oArea, "DMENCOFF") == 0) { if(GetIsPC(oPC) && GetIsDM(oPC) == FALSE) //prevents multispawns and potential TMIS and massive lags from companions, other monsters, DM's wandering about, etc //////Strangely, a DM will register as a PC without this second check { //run for as many times as there are possible spawnpoints iCounter = 1; // Initialize Counter string sLocation = "WP_spawnpoint_" + IntToString(iCounter); // Start with the first spawnpoint object oSpawnPoint = GetNearestObjectByTag(sLocation, oPC); // Grab our first waypoint, for added accuracy (cause nwn is occasionally random about it, start from the PC triggering) while(iCounter <= iLocationDice) { sLocation = "WP_spawnpoint_" + IntToString(iCounter); //Redundant the first time around, but increments to the next spawnpoint //////sLocationDebug = "Area:'" + GetName(oArea) + "', " + "Location: '" + sLocation + "', "; ////MORE DEBUGGING //////object oSomethingInArea = GetFirstObjectInArea(oArea); I Have no clue what this is for. I think its from a prior iteration and was used to confirm the area oSpawnPoint = GetNearestObjectByTag(sLocation, oPC); ///Grabbing the relavent spawn point location lToSpawn = GetLocation(oSpawnPoint); ///// Where to spawn stuff //check around for creatures already spawned or PCs, so we don't doublespawn or drop on their heads object oNearby = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lToSpawn, TRUE, OBJECT_TYPE_CREATURE); ///Check for existing spawns, or PCs where we're looking to throw stuff ///// int iAnyoneAround = 0; Another Legacy line I'm pretty sure. if(oNearby == OBJECT_INVALID) //IF the spawns are still there from a prior firing, or if a PC's there, don't spawn (Avoid doubling, and infamous MONSTERONHEAD Syndrome { nOddsCounter = 1; iEncounterOdds = GetLocalInt (oSpawnPoint, "enc_chance_" + IntToString(nOddsCounter)); // Get the odds assigned to enc_chance_1, or enc_chance_2, or enc_chance_3, etc iEncounterChosen = 0; // We have not yet chosen an ecnounter iSpawnDice = d100(1); /////WriteTimestampedLogEntry("Spawn Roll =" + IntToString(iSpawnDice)); DEBUG STUFF while(iEncounterOdds > 0 && iEncounterOdds < 101 && iEncounterChosen != 1 && GetLocalString(oSpawnPoint, "encounter_" + IntToString(nOddsCounter)) != "") /// IF it's below 0, somethings really weird, and probably missing variables. Odds only go to 100.Stop once we've found the encounter we want. ////If it hits a sudden blank encounter string stop cause its probably gone past the encounter list. { if(iSpawnDice <= iEncounterOdds) ///If the dice roll is lower then the odds of the encounter (The logic is a bit mathematical and confusing, but is explained in external documentation) { string sEncounter = "encounter_" + IntToString(nOddsCounter); //Get the encounter string with the corresponding number sEncounter = GetLocalString(oSpawnPoint, sEncounter); // if(sEncounter != "null" && sEncounter != "") /// If it's "" it's an invalid string, if it's null, it's a blank spawn { SpawnEncounter(sEncounter, lToSpawn); /// Use that giant block of code way up there to decode that gibberish of resrefs } else { //// sLocationDebug += "Encounter '" + sEncounter + "' is null, blank, or missing"; /// MORE DEBUGGING if(sEncounter == "null") { iEncounterChosen = 1; //// null indicates a deliberate blank encounter, and is thus an chosen } }
  • Widgit that changes armor appearance

    8
    8 Posts
    3k Views
    SeterS

    I think what the OP is considering is the possibility of finding better armors than RH provide and modifying them using that requested item.

  • Glowing eyes made easy

    1
    1 Posts
    2k Views
    No one has replied
  • Custom summons (and PC mode switch)

    6
    6 Posts
    4k Views
    A

    This scripting is for a working Mode Switch. For those who don't understand or know how it works.

    I have confirmed this will work with the nw_s0_summon and cs_summon__inc scripts linked here, in a blank module.

    To create a Mode Switch:

    Use the Toolset to create a new Miscellaneous Small item. Name it "Mode Switch" (without the "). This way, the tag/resref will be modeswitch.

    Create two blank scripts in the Script Editor. They should look like this:

    //modeswitch #include "x2_inc_switches" void main() { int nEvent =GetUserDefinedItemEventNumber(); switch (nEvent) { case X2_ITEM_EVENT_ACTIVATE: ExecuteScript("ac_"+GetTag(GetItemActivated()), OBJECT_SELF); break; } } /* Script generated by Lilac Soul's NWN Script Generator, v. 2.3 For download info, please visit: http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ //ac_modeswitch void main() { object oPC = GetItemActivator(); object oTarget = GetItemActivatedTarget(); SetLocalObject(oPC, "oLastTargettedItem", oTarget); SendMessageToPC(GetItemActivator(), "You take hold of the " + GetName(oTarget) + " and concentrate."); }

    The second script is special, in that when you target a reagent, it will speak a line in your dialog. This line will fire no matter what you target:

    You take hold of the Light Crossbow and concentrate.
    You take hold of the Fiery Stick of Dhoom and concentrate.
    You take hold of the Slaad's Tongue and concentrate.

    Any of these could pop up, depending on what you target. But they aren't all going to have reagent themes. (Slaad's Tongue, however, does.)

    The Mode Switch just selects what you want to attempt to use as a reagent. If it is, in fact, a reagent, when you cast Summon Creature (1-9), you will receive a special creature.

    If you target something that isn't a reagent, you will fall back to either a Deity/Racial/Alignment theme, or the default theme, as a last resort. So the spell won't be wasted.

    I hope it was okay to post this here for other scripters, to help those who may not have understood how a Mode Switch worked. If not, you can deleted as needed.

  • Summon Creature Discussion (Ideas for Single Player version)

    7
    7 Posts
    3k Views
    A

    /topic/220

    I figured you guys knew it was there. Bacon linked me to it when I made mention of hunting down Moloch's script, which I already knew was on NWvault, I just couldn't find it.

    That's why I put this in Off-Topic.

  • Obtain the Centre of a Trigger

    4
    4 Posts
    2k Views
    DuckrollD

    Try drawing a trigger starting from it's middle point then? You could always make a "ring" shape around that point.