Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Categories

Dark Dreams of Furiae - a new module for NWN:EE! Buy now
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Bonus Party XP script??

jpsweeney94jpsweeney94 Member Posts: 93
edited March 2019 in Builders - Scripting
I was curious if someone could help with the module i host with a script that is beyond me... Right now, playing with 2 players in a party in the same area, the XP is fine. But as soon as 3+ players are in a party in the same area, the XP takes a serious dip!! Anyone have any advice on a script that will increase XP/give some bonus XP when in a party of 3+ in the same area??

Thanks!!!

Comments

  • FreshLemonBunFreshLemonBun Member Posts: 907
    The monsters fire a death event with a death script. For example a quick and very simple way to give cr based bonus experience to all party members in the area could be like so, within that death script.
    object oCreature = OBJECT_SELF;
    object oKiller = GetLastKiller();
    int nCR = FloatToInt(GetChallengeRating(oCreature));
    object oMember = GetFirstFactionMember(oKiller);
    while (GetIsObjectValid(oMember))
    {
    	if (GetArea(oMember) == GetArea(oKiller))
    	{
    		GiveXPToCreature(oMember, nCR * 100);
    	}
    	oMember = GetNextFactionMember(oKiller);
    }
    

    I haven't checked it, but you should get the idea.

  • jpsweeney94jpsweeney94 Member Posts: 93
    edited April 2019
    The monsters fire a death event with a death script. For example a quick and very simple way to give cr based bonus experience to all party members in the area could be like so, within that death script.
    object oCreature = OBJECT_SELF;
    object oKiller = GetLastKiller();
    int nCR = FloatToInt(GetChallengeRating(oCreature));
    object oMember = GetFirstFactionMember(oKiller);
    while (GetIsObjectValid(oMember))
    {
    	if (GetArea(oMember) == GetArea(oKiller))
    	{
    		GiveXPToCreature(oMember, nCR * 100);
    	}
    	oMember = GetNextFactionMember(oKiller);
    }
    

    I haven't checked it, but you should get the idea.

    thanks for the reply! will try soon.

    Are you saying this script will need to be added to the onDeath script for all NPCs in the custom palette? There are hundreds in there and many have different scripts in their "onDeath" script drop down in their creature properties scripts tab... Is their some other way to apply this to all NPCs/monsters on death without editing every creature with a unique death script?

    thanks

  • TerrorbleTerrorble Member Posts: 108
    Usually all creatures will run the same OnDeath script. I think the default one is called ..._default7.

  • FreshLemonBunFreshLemonBun Member Posts: 907
    Like Terrorble said, but it depends on the specifics, of course. If a module has a different one for everything then it would be trickier.

    Alternatively if you just want everyone to have the same experience points you could add a module heartbeat script that loops through the party for max experience points. Then adjusts party members lower than max. It would work for a module with friends, but not for persistent world. It would only really work for a co-op module between friends, for a persistent world you really want to hook into the death event script I think.

Sign In or Register to comment.