Sorry about that, I completely forgot.
Here is the altered nw_s0_truesee script, you can do this through the spellhook system now but it didn't exist back in 2004. Though the scripting is all mine the idea came from Talon and Mo of the GodSpire PvP server.
//Changes True Seeing to the effects Ultravision and See Invisibility
//By: 420
//11/15/04
//::///////////////////////////////////////////////
//:: True Seeing
//:: NW_S0_TrueSee.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The creature can seen all invisible, sanctuared,
or hidden opponents.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: [date]
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
effect eVis = EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eSight = EffectSeeInvisible();
effect eUltra = EffectUltravision();
effect eLink = EffectLinkEffects(eVis, eSight);
eLink = EffectLinkEffects(eLink, eDur);
eLink = EffectLinkEffects(eLink, eUltra);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_TRUE_SEEING, FALSE));
int nDuration = GetCasterLevel(OBJECT_SELF);
int nMetaMagic = GetMetaMagicFeat();
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
if(GetLocalInt(oTarget, "TrueSeeing"))
{
FloatingTextStringOnCreature("You are already wearing an item with that effect.", oTarget, FALSE);
return;
}
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration));
SetLocalInt(oTarget, "TSSpell", TRUE);
DelayCommand(TurnsToSeconds(nDuration), DeleteLocalInt(oTarget, "TSSpell"));
}
Now the next part is a little trickier, they are the module's OnPlayerEquipItem and OnPlayerUnEquipItem events.
First the OnPlayerEquipItem (the check for multiple darkvisions handles cases where the item was unequiped in another module):
//OnPlayerEquipItem script to replace the True Seeing item property on an item
//with See Invisibility/Ultravision effects
//by: 420
//5/1/04
void main()
{
object oPC = GetPCItemLastEquippedBy();
object oItem = GetPCItemLastEquipped();
string sItem = GetTag(oItem);
itemproperty ipTS;
effect eUltra = EffectUltravision();
effect eSeeInv = EffectSeeInvisible();
effect eLink = SupernaturalEffect(EffectLinkEffects(eUltra, eSeeInv));
int iCountDV;
effect eTS;
if (GetItemHasItemProperty(oItem, ITEM_PROPERTY_TRUE_SEEING))
{
SetLocalInt(oItem, "TrueSeeing", 1);
ipTS = GetFirstItemProperty(oItem);
while (GetIsItemPropertyValid(ipTS) == TRUE)
{
if (GetItemPropertyType(ipTS) == ITEM_PROPERTY_TRUE_SEEING)
{
//For Item Level Restriction servers
//Replace the True Seeing item property with 6 Darkvisions to keep the item value equal
RemoveItemProperty(oItem, ipTS);
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyDarkvision(), oItem);
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyDarkvision(), oItem);
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyDarkvision(), oItem);
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyDarkvision(), oItem);
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyDarkvision(), oItem);
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyDarkvision(), oItem);
}
ipTS = GetNextItemProperty(oItem);
}
//Check to see if the altered True Seeing spell is in effect if so, end the effect
if(GetLocalInt(oPC, "TSSpell"))
{
DeleteLocalInt(oPC, "TSSpell");
eTS = GetFirstEffect(oPC);
while(GetIsEffectValid(eTS) == TRUE)
{
if(GetEffectType(eTS) == EFFECT_TYPE_ULTRAVISION ||
GetEffectType(eTS) == EFFECT_TYPE_SEEINVISIBLE &&
GetEffectSubType(eTS) == SUBTYPE_SUPERNATURAL)
{
RemoveEffect(oPC, eTS);
}
eTS = GetNextEffect(oPC);
}
}
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oPC);
SetLocalInt(oPC, "TrueSeeing", TRUE);
}
//Check to see if the item equiped has 6 Darkvision item properties
//If so, make it into an altered True Seeing item
else if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DARKVISION))
{
iCountDV = 1;
ipTS = GetFirstItemProperty(oItem);
while (GetIsItemPropertyValid(ipTS) == TRUE)
{
if (GetItemPropertyType(ipTS) == ITEM_PROPERTY_DARKVISION)
{
iCountDV = iCountDV+1;
}
ipTS = GetNextItemProperty(oItem);
}
if(iCountDV >= 6)
{
SetLocalInt(oItem, "TrueSeeing", 1);
if(GetLocalInt(oPC, "TSSpell"))
{
DeleteLocalInt(oPC, "TSSpell");
eTS = GetFirstEffect(oPC);
while(GetIsEffectValid(eTS) == TRUE)
{
if(GetEffectType(eTS) == EFFECT_TYPE_ULTRAVISION ||
GetEffectType(eTS) == EFFECT_TYPE_SEEINVISIBLE &&
GetEffectSubType(eTS) == SUBTYPE_SUPERNATURAL)
{
RemoveEffect(oPC, eTS);
}
eTS = GetNextEffect(oPC);
}
}
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oPC);
SetLocalInt(oPC, "TrueSeeing", TRUE);
}
}
}
OnPlayerUnEuipItem script:
//OnPlayerUnEquipItem script to replace the True Seeing property on an item and
//remove the See Invisibility/Ultravision effects
//by: 420
//5/1/04
void main()
{
object oPC = GetPCItemLastUnequippedBy();
object oItem = GetPCItemLastUnequipped();
string sItem = GetTag(oItem);
int iTSCheck = GetLocalInt(oItem, "TrueSeeing");
effect eTS;
int iCounter;
itemproperty ipTS;
int iCountDV;
if (iTSCheck == 1)
{
iCountDV = 1;
ipTS = GetFirstItemProperty(oItem);
while (GetIsItemPropertyValid(ipTS) == TRUE)
{
if (GetItemPropertyType(ipTS) == ITEM_PROPERTY_DARKVISION &&
iCountDV <= 6)
{
RemoveItemProperty(oItem, ipTS);
iCountDV = iCountDV+1;
}
ipTS = GetNextItemProperty(oItem);
}
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyTrueSeeing(), oItem);
DeleteLocalInt(oItem, "TrueSeeing");
//Check through all equiped items.
for (iCounter = 0; iCounter <= NUM_INVENTORY_SLOTS; iCounter++)
{
oItem = GetItemInSlot(iCounter, oPC);
if(GetLocalInt(oItem, "TrueSeeing") == 1)
{
return;
}
}
eTS = GetFirstEffect(oPC);
while(GetIsEffectValid(eTS) == TRUE)
{
if(GetEffectType(eTS) == EFFECT_TYPE_ULTRAVISION ||
GetEffectType(eTS) == EFFECT_TYPE_SEEINVISIBLE)
{
if(GetEffectSubType(eTS) == SUBTYPE_SUPERNATURAL)
{
RemoveEffect(oPC, eTS);
}
}
eTS = GetNextEffect(oPC);
}
DeleteLocalInt(oPC, "TrueSeeing");
}
}
-420
Modifié par 420, 31 octobre 2010 - 05:50 .