Aller au contenu

Photo

Skill Decrease Effect


  • Veuillez vous connecter pour répondre
23 réponses à ce sujet

#1
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
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 Image

#2
ShadowM

ShadowM
  • Members
  • 768 messages
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 :)

#3
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
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!

#4
SHOVA

SHOVA
  • Members
  • 522 messages
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.

#5
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
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.

#6
SHOVA

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

#7
Baragg

Baragg
  • Members
  • 271 messages
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.

#8
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
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!

#9
Shadooow

Shadooow
  • Members
  • 4 470 messages
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...

#10
SHOVA

SHOVA
  • Members
  • 522 messages
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.

#11
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
Thanks everyone!

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

#12
ShadowM

ShadowM
  • Members
  • 768 messages
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. :)

//:://////////////////////////////////////////////////
//:: 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 .


#13
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
Wow! Thanks ShadowM! Will try it out!

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

#14
ShadowM

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

#15
SHOVA

SHOVA
  • Members
  • 522 messages
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.

#16
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
Good point Shova, but the PC has to kill the beetle in order to advance the plot so it should be okay in this instance. Thanks for pointing that out though, it's important to note that fact.

#17
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
T.H. Do you have a way of telling if someone is a guard. Or I guess i should first ask. Do you have any guards standing post in the area the PC will be walking through after turning into a skunk?

#18
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
Lightfoot8 - no guards, just a lot of NPC's that I want to do random things if they get close enough to "smell" the PC. ie: gag, run, faint, comment loudly, etc. The only guards will be at the bathouse keeping the men out of the ladies area and vice versa.

At least, that's what I hope to accomplish. Can I ask why you wanted to know?

#19
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
I have an Idea how to do what you want. I have not had a chance to script it yet. But I did not want a guard running from his post holding his nose like a common pessent. I would have then do something more along the lines of asking the PC to move along, Or say " Someone light a match" then pull out a torch and wave it.

Long story short. If I where doing what you are trying to do. I would link you ability decreasse with an Area Of Effect effect on the PC. then you just need to place the code for the reactions of the npc into the OnEnter/HB/OnExit of the area of effect. Making your effect supernatural should stop dispell and rest from removing it.

#20
SHOVA

SHOVA
  • Members
  • 522 messages
Wouldn't on perseption be a better choice Lightfoot? Heartbeats can be laggy, especialy with a AOE going on too. though of course if this is for a SP mod, then Heartbeats are no problem. I like the idea of waving the torch.

#21
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
Lightfoot8 - That sounds like exactly what I'm looking for. Have no idea how to accomplish it though, it sucks being a noob. *sigh*

The guard thing sounds like it would be fun and I remembered (how do you forget what's in your own module?) that there are a few guards standing post and walking around the city. The PC actually has to report in to the Captain of the Guards at the guards barracks to complete the quest. There are guards practising on combat dummies and archery targets and two doing hand-to-hand inside the barracks besides the Captain who they have to be able to talk to without him taking off, at least at the start. I have him covering his mouth and tossing their reward from a safe distance and then quickly exited the room, via conversation.
I can't believe I forgot about all that. Egads! I love your idea though! It sounds great!

#22
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
Just a quick note, re Shova's comment. At the moment this is just a SP module,doubt I will master things enough to change that any time soon. I also love the torch waving idea. I am hoping Lightfoot8 is still interested in sharing the how of his idea . . .pretty please . . .

#23
SHOVA

SHOVA
  • Members
  • 522 messages
Tassle, do you have Lilacs? http://nwvault.ign.c...r.detail&id=625

It is a very useful way to make new scripts. You can for instance make a npc do exactly what you want with the torch, even turn the torch waving into a mini cutscene.

With a SP mod, go with the heartbeat, should have no impact on the playability.

#24
Tassle_Hof

Tassle_Hof
  • Members
  • 24 messages
Thanks Shova! Yes, I do have Lilac's, wouldn't have gotten this far without it, but it isn't working for me right now, I'll will have to re download it I guess. I will play around with things and see what havock I can wreak. *manical laughter*