Updated AMS marker feats. Removed arcane & divine marker feats. Updated Dread Necromancer for epic progression. Updated weapon baseitem models. Updated new weapons for crafting & npc equip. Updated prefix. Updated release archive.
		
			
				
	
	
		
			176 lines
		
	
	
		
			6.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			176 lines
		
	
	
		
			6.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| //::///////////////////////////////////////////////
 | |
| //:: Elemental Shape
 | |
| //:: NW_S2_ElemShape
 | |
| //:: Copyright (c) 2001 Bioware Corp.
 | |
| //:://////////////////////////////////////////////
 | |
| /*
 | |
|     Allows the Druid to change into elemental forms.
 | |
| */
 | |
| //:://////////////////////////////////////////////
 | |
| //:: Created By: Preston Watamaniuk
 | |
| //:: Created On: Jan 22, 2002
 | |
| //:://////////////////////////////////////////////
 | |
| //:: Modified By: Deva Winblood
 | |
| //:: Modified Date: January 15th-16th, 2008
 | |
| //:://////////////////////////////////////////////
 | |
| /*
 | |
|     Modified to insure no shapeshifting spells are castable upon
 | |
|     mounted targets.  This prevents problems that can occur due
 | |
|     to dismounting after shape shifting, or other issues that can
 | |
|     occur due to preserved appearances getting out of synch.
 | |
| 
 | |
|     This can additional check can be disabled by setting the variable
 | |
|     X3_NO_SHAPESHIFT_SPELL_CHECK to 1 on the module object.  If this
 | |
|     variable is set then this script will function as it did prior to
 | |
|     this modification.
 | |
| 
 | |
| */
 | |
| 
 | |
| //#include "x3_inc_horse"
 | |
| #include "prc_alterations"
 | |
| #include "pnp_shft_poly"
 | |
| 
 | |
| void elemental_shape_shift(object oPC, int nShape)
 | |
| {
 | |
|     string sResRef = Get2DACache("prc_polymorph", "ResRef", nShape);
 | |
|     StoreCurrentAppearanceAsTrueAppearance(oPC, TRUE);
 | |
|     ShiftIntoResRef(oPC, SHIFTER_TYPE_DRUID, sResRef, TRUE);
 | |
| }
 | |
| 
 | |
| void main()
 | |
| {
 | |
|     //Declare major variables
 | |
|     int nSpell = GetSpellId();
 | |
|     object oTarget = PRCGetSpellTargetObject();
 | |
|     effect eVis = EffectVisualEffect(VFX_IMP_POLYMORPH);
 | |
|     effect ePoly;
 | |
|     int nPoly;
 | |
|     int nDuration = GetLevelByClass(CLASS_TYPE_DRUID)
 | |
|                   + GetLevelByClass(CLASS_TYPE_ARCANE_HIEROPHANT);
 | |
|     int bElder = FALSE;
 | |
|     if (!GetLocalInt(GetModule(),"X3_NO_SHAPESHIFT_SPELL_CHECK"))
 | |
|     { // check to see if abort due to being mounted
 | |
|     if (PRCHorseGetIsMounted(oTarget))
 | |
|         { // abort
 | |
|             if (GetIsPC(oTarget)) FloatingTextStrRefOnCreature(111982,oTarget,FALSE);
 | |
|                 return;
 | |
|         } // abort
 | |
|     } // check to see if abort due to being mounted
 | |
| 
 | |
|     //this command will make shore that polymorph plays nice with the shifter
 | |
|     ShifterCheck(OBJECT_SELF);
 | |
| 
 | |
|     int nShape = GetPersistantLocalInt(OBJECT_SELF, PRC_PNP_SHIFTING + IntToString(nSpell));
 | |
|     if(nShape > 0)
 | |
|     {
 | |
|         elemental_shape_shift(OBJECT_SELF, nShape);
 | |
|         return;
 | |
|     }
 | |
| 
 | |
|     if(GetLevelByClass(CLASS_TYPE_DRUID) >= 20)
 | |
|     {
 | |
|         bElder = TRUE;
 | |
|     }
 | |
|     //Determine Polymorph subradial type
 | |
|     if(bElder == FALSE)
 | |
|     {
 | |
|         if(nSpell == 397)
 | |
|         {
 | |
|             nPoly = POLYMORPH_TYPE_HUGE_FIRE_ELEMENTAL;
 | |
|         }
 | |
|         else if (nSpell == 398)
 | |
|         {
 | |
|             nPoly = POLYMORPH_TYPE_HUGE_WATER_ELEMENTAL;
 | |
|         }
 | |
|         else if (nSpell == 399)
 | |
|         {
 | |
|             nPoly = POLYMORPH_TYPE_HUGE_EARTH_ELEMENTAL;
 | |
|         }
 | |
|         else if (nSpell == 400)
 | |
|         {
 | |
|             nPoly = POLYMORPH_TYPE_HUGE_AIR_ELEMENTAL;
 | |
|         }
 | |
|     }
 | |
|     else
 | |
|     {
 | |
|         if(nSpell == 397)
 | |
|         {
 | |
|             nPoly = POLYMORPH_TYPE_ELDER_FIRE_ELEMENTAL;
 | |
|         }
 | |
|         else if (nSpell == 398)
 | |
|         {
 | |
|             nPoly = POLYMORPH_TYPE_ELDER_WATER_ELEMENTAL;
 | |
|         }
 | |
|         else if (nSpell == 399)
 | |
|         {
 | |
|             nPoly = POLYMORPH_TYPE_ELDER_EARTH_ELEMENTAL;
 | |
|         }
 | |
|         else if (nSpell == 400)
 | |
|         {
 | |
|             nPoly = POLYMORPH_TYPE_ELDER_AIR_ELEMENTAL;
 | |
|         }
 | |
|     }
 | |
|     ePoly = EffectPolymorph(nPoly);
 | |
|     //Fire cast spell at event for the specified target
 | |
|     SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_ELEMENTAL_SHAPE, FALSE));
 | |
| 
 | |
|     int bWeapon = StringToInt(Get2DACache("polymorph","MergeW",nPoly)) == 1;
 | |
|     int bArmor  = StringToInt(Get2DACache("polymorph","MergeA",nPoly)) == 1;
 | |
|     int bItems  = StringToInt(Get2DACache("polymorph","MergeI",nPoly)) == 1;
 | |
| 
 | |
|     object oWeaponOld = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,OBJECT_SELF);
 | |
|     object oArmorOld = GetItemInSlot(INVENTORY_SLOT_CHEST,OBJECT_SELF);
 | |
|     object oRing1Old = GetItemInSlot(INVENTORY_SLOT_LEFTRING,OBJECT_SELF);
 | |
|     object oRing2Old = GetItemInSlot(INVENTORY_SLOT_RIGHTRING,OBJECT_SELF);
 | |
|     object oAmuletOld = GetItemInSlot(INVENTORY_SLOT_NECK,OBJECT_SELF);
 | |
|     object oCloakOld  = GetItemInSlot(INVENTORY_SLOT_CLOAK,OBJECT_SELF);
 | |
|     object oBootsOld  = GetItemInSlot(INVENTORY_SLOT_BOOTS,OBJECT_SELF);
 | |
|     object oBeltOld = GetItemInSlot(INVENTORY_SLOT_BELT,OBJECT_SELF);
 | |
|     object oHelmetOld = GetItemInSlot(INVENTORY_SLOT_HEAD,OBJECT_SELF);
 | |
|     object oShield    = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,OBJECT_SELF);
 | |
|     if (GetIsObjectValid(oShield))
 | |
|     {
 | |
|         if (GetBaseItemType(oShield) !=BASE_ITEM_LARGESHIELD &&
 | |
|             GetBaseItemType(oShield) !=BASE_ITEM_SMALLSHIELD &&
 | |
|             GetBaseItemType(oShield) !=BASE_ITEM_TOWERSHIELD)
 | |
|         {
 | |
|             oShield = OBJECT_INVALID;
 | |
|         }
 | |
|     }
 | |
| 
 | |
| 
 | |
| 	//this command will make shore that polymorph plays nice with the shifter
 | |
| 	ShifterCheck(OBJECT_SELF);
 | |
| 
 | |
|     //Apply the VFX impact and effects
 | |
|     ClearAllActions(); // prevents an exploit
 | |
|     
 | |
|     ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
 | |
|     ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, OBJECT_SELF, HoursToSeconds(nDuration));
 | |
| 
 | |
|     object oWeaponNew = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,OBJECT_SELF);
 | |
|     object oArmorNew = GetItemInSlot(INVENTORY_SLOT_CARMOUR,OBJECT_SELF);
 | |
| 
 | |
|     if (bWeapon)
 | |
|     {
 | |
|             IPWildShapeCopyItemProperties(oWeaponOld,oWeaponNew, TRUE);
 | |
|     }
 | |
|     if (bArmor)
 | |
|     {
 | |
|         IPWildShapeCopyItemProperties(oHelmetOld,oArmorNew);
 | |
|         IPWildShapeCopyItemProperties(oArmorOld,oArmorNew);
 | |
|         IPWildShapeCopyItemProperties(oShield,oArmorNew);
 | |
|     }
 | |
|     if (bItems)
 | |
|     {
 | |
|         IPWildShapeCopyItemProperties(oRing1Old,oArmorNew);
 | |
|         IPWildShapeCopyItemProperties(oRing2Old,oArmorNew);
 | |
|         IPWildShapeCopyItemProperties(oAmuletOld,oArmorNew);
 | |
|         IPWildShapeCopyItemProperties(oCloakOld,oArmorNew);
 | |
|         IPWildShapeCopyItemProperties(oBootsOld,oArmorNew);
 | |
|         IPWildShapeCopyItemProperties(oBeltOld,oArmorNew);
 | |
|     }
 | |
| 
 | |
|     DelayCommand(1.5,ActionCastSpellOnSelf(SPELL_SHAPE_INCREASE_DAMAGE));
 | |
| }
 |