Author Topic: Skill Decrease Effect  (Read 526 times)

Legacy_Tassle_Hof

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
Skill Decrease Effect
« on: March 12, 2011, 04:02:22 pm »


               I am trying to figure out how to decrease a PC's charisma and have it stay permanent until they take a bath.
 
After killing a huge beetle in the sewers, the PC is covered in 'stink' and I what all NPC's they encounter to either run off, refuse to talk to them, gag, etc, until the PC goes and takes a bath in order to get clean.
 
It's just a stupid extra I wanted to have in my module but I am having trouble figuring out how to get the decrease to stay. I don't want the PC to be able to take a restoration or rest and get rid of it.

I have been away from the building end for awhile and I seem to have forgotten everything (little though it was) that I had learned. Any help would be greatly appreciated.'Posted
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Skill Decrease Effect
« Reply #1 on: March 12, 2011, 04:38:58 pm »


               There was similar thread about increasing someone skill, and the idea of just adding it as a item property to the skin seem to work fine. I use that all the time. So add it to the players skin as a negative and when they take the bath remove it. You could also use SupernaturalEffect if you wanted too. Good luck '<img'>
               
               

               
            

Legacy_Tassle_Hof

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
Skill Decrease Effect
« Reply #2 on: March 12, 2011, 07:47:14 pm »


               Thanks for the reply! Unfortunately, I have no idea how to do that. I am new to building and have a lot to learn yet. If you could explain it to me maybe I could add it to my 'skill learned' list. Again, thanks for replying!
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Skill Decrease Effect
« Reply #3 on: March 12, 2011, 10:14:36 pm »


               Adding it as a skill decrease, you will have to contend with spells removing it. I can see a simple work around, have the stink bettle spray give a small mics non drop item to the pc on a failed save. Then have all npc conversations check for the item in the inventory, and act accourdingly. When the pc takes a bath, have the bath remove the item. This way there is no spell work around.
               
               

               
            

Legacy_Tassle_Hof

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
Skill Decrease Effect
« Reply #4 on: March 12, 2011, 11:30:51 pm »


               Thanks Shova! Will give that a try. How do I make sure the PC fails a save? I want to make sure they get the stink effect no matter what.
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Skill Decrease Effect
« Reply #5 on: March 13, 2011, 05:14:42 am »


               simple answer, don't let the pc roll for one, as they can't save if they don't get the chance too.
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Skill Decrease Effect
« Reply #6 on: March 13, 2011, 12:45:47 pm »


               I would place the attribute decrease on the pc skin as recommended, plus an int to indicate they are stinky. Then you could have convo nodes that check for that int, and proceed accordingly. You could also use spellhooking to have all the restore type spells check for that int, and also act accordingly.
               
               

               
            

Legacy_Tassle_Hof

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
Skill Decrease Effect
« Reply #7 on: March 13, 2011, 02:30:17 pm »


               Okay, I know these are simple questions but:

1. How do I prevent the PC from rolling for a save?
2. I still have no idea how to place the decrease on the PC skin?
3. Spellhooking? That just sounds scary.

I have read many posts where all of these where reccomended but I've never seen the instructions for how to do them. I'm such a noob . . . *sigh* If you could point me in the right direction I would be so very grateful!
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Skill Decrease Effect
« Reply #8 on: March 13, 2011, 02:52:43 pm »


               well skin is problematic, yea there is a new function with skin from patch 1.69, but thats so buggy that I can't recommend it...
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Skill Decrease Effect
« Reply #9 on: March 13, 2011, 03:37:49 pm »


               The simple way, is to not touch the pc skin.
First look to see what monster ability (the breath stink) that the bettle is using, and open that script.
for example, Lets say your bettle uses the mephit steam breath. that script is named NW_S1_MephSteam. Line 28, is where the saving throw is called up. If I wanted to give a item, I would add the code to after the save line, that way, the pc gets the item, but still gets to roll a save for damage from the breath.

I would incert this into line 52 :

if (GetItemPossessedBy(oTarget, "tagstinkbreath")!= OBJECT_INVALID)
  return;

CreateItemOnObject("resrefofstinkbreath", oTarget);

This checks first to see if the pc has the stink breath, if so then it won't give them another. If they do not have it, then it gives it to them. This does nothing to how the damage and effect of the monster ability, only adds giving the item to the pc. One other thing, is if you do go this route, and change the standard breath script for the mod, than any other creature that uses this ability, will also give the stink item. You could of course add a check to the line, if user is stink bettle, and then if pc does not have hte item, then give it to them, but that is for you to figure out how to make it work in your mod.

good luck.
               
               

               
            

Legacy_Tassle_Hof

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
Skill Decrease Effect
« Reply #10 on: March 13, 2011, 05:24:42 pm »


               Thanks everyone!

Shova, I will try that out, sounds good and I should actually be able to do it with those great instructions!
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Skill Decrease Effect
« Reply #11 on: March 13, 2011, 07:30:03 pm »


               Sorry was off playing D&D
here the script for the beetles ondeath rename it so it does not overwrite the standard. Updated to include int so
does not get a free cure ability decrease every bath. '<img'>

//:://////////////////////////////////////////////////
//:: NW_C2_DEFAULT7
/*
  Default OnDeath event handler for NPCs.

  Adjusts killer's alignment if appropriate and
  alerts allies to our death.
 */
//:://////////////////////////////////////////////////
//:: Copyright © 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/22/2002
//:://////////////////////////////////////////////////
//:://////////////////////////////////////////////////
//:: Modified By: Deva Winblood
//:: Modified On: April 1st, 2008
//:: Added Support for Dying Wile Mounted
//:://///////////////////////////////////////////////

#include "x2_inc_compon"
#include "x0_i0_spawncond"
#include "x3_inc_horse"
#include "x2_inc_itemprop"


void main()
{
    int nclass = GetLevelByclass(class_TYPE_COMMONER);
    int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
    object oKiller = GetLastKiller();

    object oKiller_chest =GetItemInSlot(INVENTORY_SLOT_CARMOUR,oKiller);
    //do not know your amount, so put 2
    int iAmount = 2;
    itemproperty ip_Stink =ItemPropertyDecreaseAbility(IP_CONST_ABILITY_CHA,iAmount);

    if(oKiller_chest!=OBJECT_INVALID)
    {
    IPSafeAddItemProperty(oKiller_chest,ip_Stink,0.0,X2_IP_ADDPROP_POLICY_REPLACE_EXISTING);
    SetLocalInt(oKiller,"iStink", 1);
    }
    if(oKiller_chest==OBJECT_INVALID)
    {
    HorseAddHorseMenu(oKiller);
    SendMessageToPC(oKiller,"No Skin");
    }

   //Normal death stuff below


    if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB")&&GetIsObjectValid(GetMaster(OBJECT_SELF))) SetLocalInt(GetMaster(OBJECT_SELF),"bX3_STORE_MOUNT_INFO",TRUE);


    // If we're a good/neutral commoner,
    // adjust the killer's alignment evil
    if(nclass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
    {
        AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
    }

    // Call to allies to let them know we're dead
    SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK);

    //Shout Attack my target, only works with the On Spawn In setup
    SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);

    // NOTE: the OnDeath user-defined event does not
    // trigger reliably and should probably be removed
    if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
    {
         SignalEvent(OBJECT_SELF, EventUserDefined(1007));
    }
    craft_drop_items(oKiller);
}

Here the remove it script

object oPc = GetLastUsedBy();
object oPc_chest = GetItemInSlot(INVENTORY_SLOT_CARMOUR, oPc);
int iStink  =GetLocalInt(oPc,"iStink");
void main()
{
if (!GetIsObjectValid(oPc_chest)) return;

//Get the first itemproperty
itemproperty ipLoop=GetFirstItemProperty(oPc_chest);

//Loop for as long as the ipLoop variable is valid
while (GetIsItemPropertyValid(ipLoop))
   {
   //If ipLoop is a true seeing property, remove it
   if (GetItemPropertyType(ipLoop)==ITEM_PROPERTY_DECREASED_ABILITY_SCORE && iStink==1)
    {
      RemoveItemProperty(oPc_chest, ipLoop);
       SetLocalInt(oPc,"iStink", 0);
}
   //Next itemproperty on the list...
   ipLoop=GetNextItemProperty(oPc_chest);
   }



}
               
               

               


                     Modifié par ShadowM, 14 mars 2011 - 03:28 .
                     
                  


            

Legacy_Tassle_Hof

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
Skill Decrease Effect
« Reply #12 on: March 14, 2011, 12:50:44 am »


               Wow! Thanks ShadowM! Will try it out!

Thanks to all for your  help! I love this place!
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Skill Decrease Effect
« Reply #13 on: March 14, 2011, 03:29:30 am »


               Updated it to include int check so does not get a free cure ability decrease every bath. No problem.
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Skill Decrease Effect
« Reply #14 on: March 14, 2011, 12:45:30 pm »


               just to point out, ShadowMs way, only adds the ability decrease, when the pc kills the creature. Not when the creature uses the stink breath on the PC. What happens when the PC runs away? the answer is nothing, they do not stink, and don't need a bath.