Alangara uses a non-standard method for tag-based scripting. @Tara, the module should be using the farm_mod_activ script in its OnActivateItem event (you can verify this in the edit->module properties->events).
When an item is activated, the farm_mod_activ script runs a script with a name corresponding exactly to the tag of the activated item. It is not necessary to check for item event, since we use a custom script for item activation (and do not currently have any tag-based scripts triggered by the other events)
So specifically for the Alangara module, Tara's reasoning is correct, the scripts should not be wrapped in "if( GetUserDefinedItemEventNumber() == X2_ITEM_EVENT_ACTIVATE )", since the scripts will then exit immediately .
(the reason for this is, that Alangara predates the expansion/patch that introduced the "official" tag-based event system, hence we use a custom system)
Well first of I'm mighty glad some of this scripting is slowly starting to incoorporate in my brain
Secondly thanks for the full explanation Seeker, and yes the farm_mod_activate makes a lot of sense since the module would have needed the script for the farm functions even 10 years ago
Now for the matter at hand though... Did you check if it's working now Rose ?
Well, Tara did not mention any custom module activate item scripts, where the item is activated there, so I made them specifically as tag scripts. Thus they would require the check for item event. As tag scripts, they did work fine, when I tested them on my own cep2.61 server.
From testing on the server last night, the item did not work, and since there were no whips, we spent the night just chatting. Obviously the script needs to be adapted to your farm_mod_activ script, but without seeing that script, I cannot do anything more.
First of sorry about the whips - totally forgot about those, will reset the module in 5 minuttes WITH whips inside Morgloins's Smithie.
secondly here comes the on_activate_item script....
<SNIP: edited by Seeker>
This said i dont really get it. Whenever i've made scripts I have simply given them the name of the item tag and VUPTI script runs - sometimes other things are wrong though lol, but the script activates.
And here Seeker is the script that is not running so you might see the problems...
//::///////////////////////////////////////////////
//:: Negative Weapon
//:: Copyright (c) 2015 Rose Corp.
//:://////////////////////////////////////////////
// Gives a melee weapon 2d8 negative energy damage.
//:://////////////////////////////////////////////
//:: Created By: Rose
//:: Created On: Dec. 6, 2015
//:://////////////////////////////////////////////
void main()
// {
// if( GetUserDefinedItemEventNumber() == X2_ITEM_EVENT_ACTIVATE )
{
if (GetLevelByClass(CLASS_TYPE_BLACKGUARD, OBJECT_SELF) < 1)
{
SendMessageToPC(OBJECT_SELF, "You must have at least 1 level of blackguard to use this item!");
return;
}
//Declare major variables
effect eVis = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
int nMetaMagic = GetMetaMagicFeat();
int nCasterLvl = GetLevelByClass(CLASS_TYPE_BLACKGUARD, OBJECT_SELF);
int nDuration = 2 * nCasterLvl;
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration * 2; //Duration is +100%
}
object oTarget = GetItemActivatedTarget();
if(GetIsObjectValid(oTarget) && GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
{
// Alter the right hand weapon equipped by the creature.
object oWeapon1 = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget);
if(GetIsObjectValid(oWeapon1))
{
// If the PC has a melee weapon equipped.
if ( IPGetIsMeleeWeapon(oWeapon1))
{
if (nDuration>0)
{
// haaaack: store caster level on item for the on hit spell to work properly
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon1));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon1), TurnsToSeconds(nDuration));
IPSafeAddItemProperty(oWeapon1, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_NEGATIVE, IP_CONST_DAMAGEBONUS_2d8), 1440.0);
}
}
else
{
FloatingTextStrRefOnCreature(83615, OBJECT_SELF);
}
}
// Alter the left hand weapon equipped by the creature.
object oWeapon2 = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oTarget);
if(GetIsObjectValid(oWeapon2))
{
// If the PC has a melee weapon equipped.
if ( IPGetIsMeleeWeapon(oWeapon2))
{
if (nDuration>0)
{
// haaaack: store caster level on item for the on hit spell to work properly
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon2));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon2), TurnsToSeconds(nDuration));
IPSafeAddItemProperty(oWeapon2, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_NEGATIVE, IP_CONST_DAMAGEBONUS_2d8), 1440.0);
}
}
else
{
FloatingTextStrRefOnCreature(83615, OBJECT_SELF);
}
}
// Alter the right claw equipped by the creature.
object oWeapon3 = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oTarget);
if(GetIsObjectValid(oWeapon3))
{
if (nDuration>0)
{
// haaaack: store caster level on item for the on hit spell to work properly
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon3));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon3), TurnsToSeconds(nDuration));
IPSafeAddItemProperty(oWeapon3, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_NEGATIVE, IP_CONST_DAMAGEBONUS_2d8), 1440.0);
}
}
// Alter the left claw equipped by the creature.
object oWeapon4 = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oTarget);
if(GetIsObjectValid(oWeapon4))
{
if (nDuration>0)
{
// haaaack: store caster level on item for the on hit spell to work properly
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon4));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon4), TurnsToSeconds(nDuration));
IPSafeAddItemProperty(oWeapon4, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_NEGATIVE, IP_CONST_DAMAGEBONUS_2d8), 1440.0);
}
}
// Alter the bite equipped by the creature.
object oWeapon5 = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oTarget);
if(GetIsObjectValid(oWeapon5))
{
if (nDuration>0)
{
// haaaack: store caster level on item for the on hit spell to work properly
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon5));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon5), TurnsToSeconds(nDuration));
IPSafeAddItemProperty(oWeapon5, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_NEGATIVE, IP_CONST_DAMAGEBONUS_2d8), 1440.0);
}
}
}
else
{
SendMessageToPC(OBJECT_SELF, "You must target a creature!");
return;
}
}
// }
In our onActivation script, OBJECT_SELF refers to module, not the PC - use a "object oPC = GetItemActivator();", and then replace OBJECT_SELF with oPC in the script
Ah, that would explain why OBJECT_SELF worked for me, but not on your module. These scripts were converted from spell scripts, which refered to the caster as OBJECT_SELF. I had to play around with them to get them to work as item activate scripts. You could probably remove all of the metamagic stuff, since the duration is fixed, so extend spell will have no effect.