I'm pretty sure it's because you have your Lilac's activated script naming conventions backward. Your last script should be named "eleweap" and the first should be "aq_eleweap". If you switch those it should work.
However, and not in any way to put down Lilac's (since his generator is the reason I learned to script), Lilac's has a redundancy in the tag based scripting that you should probably unlearn. With Lilac's you need 2 scripts for every tag based event. The generic one that you have posted above that checks for the item event numbers and then the actual script that is executed.
Instead you can skip the generic item event check script and just add a check to each one of your main tag based scripts.
So in this case you would keep the name of your first script as is if that is the tag of the weapon that is acquired. And then you add the item event check at the top of that script to make sure that it is only going to do stuff if the item was acquired and NOT unacquired, activated, equipped, unequipped, etc..
So your first script would look like so:
#include "x2_inc_itemprop"
#include "csu_library"
void main()
{
//Check to make sure this script only continues if the item was "acquired".
//If not then end.
int nEvent =GetUserDefinedItemEventNumber();
if (nEvent != X2_ITEM_EVENT_ACQUIRE) return;
object oItem = GetModuleItemAcquired();
itemproperty ipAdd;
string sName;
string sWeapon;
int nProp = GetLocalInt( oItem, "Enchanted");
int nRand = d4();
if (nProp == 0)
{
switch (nRand)
{
case 1:
ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGEBONUS_1d6);
sName = "Acid";
break;
case 2:
ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGEBONUS_1d6);
sName = "Flame";
break;
case 3:
ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGEBONUS_1d6);
sName = "Ice";
break;
case 4:
ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ELECTRICAL, IP_CONST_DAMAGEBONUS_1d6);
sName = "Thunder";
break;
default:
break;
}
sWeapon = GetWeaponType(oItem);
IPSafeAddItemProperty(oItem, ipAdd);
sName = ColorString(("Elemental " + sWeapon + " of " + sName), 0, 255, 0);
SetName(oItem , sName);
SetLocalInt( oItem, "Enchanted", nRand);
}
else
{
// Do Nothing
}
}
Hope that helps. Good luck.
Modifié par GhostOfGod, 30 octobre 2010 - 07:31 .