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 .