ERF V1.0 xj$ExportInfox3_it_wingtypex3_it_wingtypex3_it_wingtypex3_it_wingtype1x3_it_wingtype2x3_it_wingtype3x3_it_wingtype4x3_it_wingtype6 ~*40?8 BJ6SGFF V3.28$(H (08@HPX`hpx       0 @ P ` p       DMod_MinGameVerExpansion_PackCommentsTopResRefResTypeDependenciesMissing1.67--------------------------------- x3_it_wingtype.erf --------------------------------- (c) 2006, Georg Zoeller, BioWare Corp. This package demonstrates the use of the Get/SetCreatureWingType scripting command added in NWN Patch 1.67, February 2006. Package Contents - 1 script (x3_it_wingtype.nss) - 6 sample items(Misc-Clothing-Cloaks) - Angle's Wings Cape - Bat's Wings Cape - Demon's Wings Cape - Dragon's Wings Cape - Eagle's Wings Cape - Fey Wings Cape Please read the description in x3_it_wingtype.nss for setup instructions. This .erf is part of a series of .erfs released with a BioWare Wednesday article on nwn.bioware.com. Please visit our webpage for more detailed information. Thank you for playing and supporting NWN! x3_it_wingtypex3_it_wingtypex3_it_wingtype1x3_it_wingtype2x3_it_wingtype3x3_it_wingtype4x3_it_wingtype6x3_it_wingtypex3_it_wingtypex3_it_wingtypex3_it_wingtype1x3_it_wingtype2x3_it_wingtype3x3_it_wingtype4x3_it_wingtype6#  !" NCS V1.0B  ~"2 -`- H X2_L_LAST_ITEM_EVENT3   X3_B_HAS_WINGS_THROUGH_ITEM5 #,X3_S_ITEM_WINGTYPE3 ,>  X3_S_ITEM_WINGTYPE3 ,X3_B_HAS_WINGS_THROUGH_ITEM5 #<X3_S_PREV_WINGTYPE7X3_B_HAS_WINGS_THROUGH_ITEM9 X3_B_HAS_WINGS_THROUGH_ITEM5 #X3_B_HAS_WINGS_THROUGH_ITEM X3_S_PREV_WINGTYPE3X3_S_PREV_WINGTYPE  //------------------------------------------------------------------------------ //:: x3_it_wingtype //:: Copyright (c) 2006 Bioware Corp. //------------------------------------------------------------------------------ /* This is a demo item for new script functionality included in NWN patch 1.67, February 2006. This script demonstrates one possible use for the new commands: # GetCreatureWingType() # SetCreatureWingType() In order to use this script, your module needs to support tag based scripting, which all new modules created with the Hordes of the Underdark toolset do by default By setting your item's tag to "x3_it_wingtype", this script will perform it's effects whenever that item is equipped or unequipped, in this case it will add wings to a player! that does not already possess wings when the item is equipped and it will remove wings from the creature once the item gets unequipped. This works for invisible (hide) item as well as for visible ones. You can define the type of wings the item adds by setting the variable X3_S_ITEM_WINGTYPE to a value corresponding a CREATURE_WING_TYPE constant from nwscripts (i.e. 1 for CREATURE_WING_TYPE_DEMON) Only one wingtype item can be active at any time. ** Tag based scripting ** If your module does not support tag based scripting, you can use the following module level scripts to add that functionality: OnEquip - x2_mod_def_equ OnUnEquip - x2_mod_def_unequ OnAcquire - x2_mod_def_aqu OnUnAcqucire - x2_mod_def_unaqu OnActivate - x2_mod_def_act If you want to learn more about Tag Based Item Scripting, I recommend visiting our scripting forums at nwn.bioware.com and reading the the following excellent tutorial by Grimlar at the NWN Lexicon: http://www.nwnlexicon.com/compiled/tutorial.Grimlar-IntroductionToTagBasedScripting.html */ //------------------------------------------------------------------------------ //:: Created By: Georg Zoeller //:: Created On: 2006-01-31 //------------------------------------------------------------------------------ #include "x2_inc_switches" const string X3_S_HAS_WINGS_THROUGH_ITEM = "X3_B_HAS_WINGS_THROUGH_ITEM"; const string X3_S_ITEM_WINGTYPE = "X3_S_ITEM_WINGTYPE"; const string X3_S_PREV_WINGTYPE = "X3_S_PREV_WINGTYPE"; //------------------------------------------------------------------------------ // Returns TRUE if a creature has wings that originate from a source different // from the item with Tag sItemTag. //------------------------------------------------------------------------------ int _GetCreatureHasWingsFromOtherSource(object oCreature, object oItem); int _GetCreatureHasWingsFromOtherSource(object oCreature, object oItem) { //-------------------------------------------------------------------------- // If we don't have wings from another source... //-------------------------------------------------------------------------- if (GetCreatureWingType(oCreature) != CREATURE_WING_TYPE_NONE) { //---------------------------------------------------------------------- // And if the source is not this item (or an item with the same tag) //---------------------------------------------------------------------- if (GetLocalString(oCreature, X3_S_HAS_WINGS_THROUGH_ITEM) != GetTag(oItem)) { return TRUE; } int nWingType = GetLocalInt (oItem,X3_S_ITEM_WINGTYPE); if (nWingType != GetCreatureWingType(oCreature)) { return TRUE; } } return FALSE; } //------------------------------------------------------------------------------ // Returns TRUE if a creature's wing type could successfully be set to // the type the item contains //------------------------------------------------------------------------------ int _SetCreatureWingType(object oCreature, object oItem); int _SetCreatureWingType(object oCreature, object oItem) { //-------------------------------------------------------------------------- // The type of wings to use is coded on a string variable on the item... //-------------------------------------------------------------------------- int nWingType = GetLocalInt (oItem,X3_S_ITEM_WINGTYPE); if (nWingType == CREATURE_WING_TYPE_NONE) { //---------------------------------------------------------------------- // We do not support wing removal items in this script, therefore // CREATURE_WING_TYPE_NONE (0) means that we don't do anything //---------------------------------------------------------------------- return FALSE; } if (GetLocalString(oCreature,X3_S_HAS_WINGS_THROUGH_ITEM) == "") { SetLocalInt(oCreature, X3_S_PREV_WINGTYPE, GetCreatureWingType(oCreature)); } //-------------------------------------------------------------------------- // Set the variable on the creature. //-------------------------------------------------------------------------- SetLocalString(oCreature, X3_S_HAS_WINGS_THROUGH_ITEM, GetTag(oItem)); SetCreatureWingType(nWingType, oCreature); return TRUE; } //------------------------------------------------------------------------------ // Remove the effects of a wing modification item //------------------------------------------------------------------------------ void _RemoveWingModItem(object oCreature, object oItem); void _RemoveWingModItem(object oCreature, object oItem) { if (GetLocalString(oCreature,X3_S_HAS_WINGS_THROUGH_ITEM) == GetTag(oItem)) { DeleteLocalString(oCreature,X3_S_HAS_WINGS_THROUGH_ITEM); int nPrev = GetLocalInt(oCreature, X3_S_PREV_WINGTYPE); DeleteLocalInt(oCreature, X3_S_PREV_WINGTYPE); SetCreatureWingType(nPrev,oCreature); } } void main() { int nEvent =GetUserDefinedItemEventNumber(); object oPC; object oItem; // ------------------------------------------------------------------------- // OnEquip Handler - add wings // ------------------------------------------------------------------------- if (nEvent ==X2_ITEM_EVENT_EQUIP) { oPC = GetPCItemLastEquippedBy(); oItem = GetPCItemLastEquipped(); if (!_GetCreatureHasWingsFromOtherSource(oPC,oItem)) { if (_SetCreatureWingType(oPC,oItem)) { // debug stuff goes here... } else { } } } // ------------------------------------------------------------------------- // OnUnEquip Handler - remove wings // ------------------------------------------------------------------------- else if (nEvent ==X2_ITEM_EVENT_UNEQUIP) { oPC = GetPCItemLastUnequippedBy(); oItem = GetPCItemLastUnequipped(); _RemoveWingModItem(oPC,oItem); } } UTI V3.28\(t$Lh P  6 J 4     d  $TemplateResRefBaseItemLocalizedNameDescriptionDescIdentifiedTagChargesCostStolenStackSizePlotAddCostIdentifiedCursedModelPart1PropertiesListPropertyNameSubtypeCostTableCostValueParam1Param1ValueChanceAppearVarTableNameTypeValuePaletteIDCommentx3_it_wingtype#Dragon's Wings CapeThe magic in this cloak is ancient and powerful ... at least in the eye of the beholder, as dragon wings will sprout out of the wearer's back the moment he equips the item. Observers are smart not to mock the wearer of this cloak for he is capable of unleasing the fiery breath of a red dragon on those not showing proper respect. Note: This item requires special scripting support in a module to work correctly.x3_it_wingtypeX3_S_ITEM_WINGTYPE UTI V3.28t+xHtLh P  6 J T     |dd>d f |TemplateResRefBaseItemLocalizedNameDescriptionDescIdentifiedTagChargesCostStolenStackSizePlotAddCostIdentifiedCursedModelPart1PropertiesListPropertyNameSubtypeCostTableCostValueParam1Param1ValueChanceAppearVarTableNameTypeValuePaletteIDCommentx3_it_wingtype1"Demon's Wings CapeIt is said that the powerful necromancer Samuel de Vries created the first cloak of this kind from the skin of a living demon. Due to the nature of the cloak, only creatures of evil alignment are able to equip it savely and the wearer will be slightly more vulnerable to the effects of divine magic as a result. Worn, leathery wings will appear on the wearer's back, granting the owner the ability to cast Bane 1/day. Note: This item requires special scripting support in a module to work correctly.x3_it_wingtypeX3_S_ITEM_WINGTYPE %)* !"#$&'(UTI V3.282Q Lh P  6 J (     dd d>d * @TemplateResRefBaseItemLocalizedNameDescriptionDescIdentifiedTagChargesCostStolenStackSizePlotAddCostIdentifiedCursedModelPart1PropertiesListPropertyNameSubtypeCostTableCostValueParam1Param1ValueChanceAppearVarTableNameTypeValuePaletteIDCommentx3_it_wingtype2"Angel's Wings CapeThis mysterious cloak radiates strong, divine magic. Only creatures of good alignment are able to equip it savely and even then the wearer will be slightly more vulnerable to the effects of negative energy c. Worn, the feathery wings of a Planetar will appear on the wearer's back, granting the owner the ability to cast Bless and Divine Might once per day. Note: This item requires special scripting support in a module to work correctly.x3_it_wingtypeX3_S_ITEM_WINGTYPE Wing Cloak Georg Zoeller, BioWare Corp Check x3_it_wingtype.nss for details. You can set the following variable on this item to control the wing type it grants to the wearer: int X3_S_ITEM_WINGTYPE Allowed values int CREATURE_WING_TYPE_NONE = 0; int CREATURE_WING_TYPE_DEMON = 1; int CREATURE_WING_TYPE_ANGEL = 2; int CREATURE_WING_TYPE_BAT = 3; int CREATURE_WING_TYPE_DRAGON = 4; int CREATURE_WING_TYPE_BUTTERFLY = 5; int CREATURE_WING_TYPE_BIRD = 6; ,01 !"#$%&'()*+-./UTI V3.28t+xHLh P  4 H }gN     dKd4d  TemplateResRefBaseItemLocalizedNameDescriptionDescIdentifiedTagChargesCostStolenStackSizePlotAddCostIdentifiedCursedModelPart1PropertiesListPropertyNameSubtypeCostTableCostValueParam1Param1ValueChanceAppearVarTableNameTypeValuePaletteIDCommentx3_it_wingtype3 Bat's Wings Cape1!When worn, the wings of a bat sprout out of the wearer's back, granting him the Freedom of Movement feat and increasing his Listening skill while making him especially vulnerable to attacks of sonic origin. Note: This item requires special scripting support in a module to work correctly.x3_it_wingtypeX3_S_ITEM_WINGTYPE Wing Cloak Georg Zoeller, BioWare Corp Check x3_it_wingtype.nss for details. You can set the following variable on this item to control the wing type it grants to the wearer: int X3_S_ITEM_WINGTYPE Allowed values int CREATURE_WING_TYPE_NONE = 0; int CREATURE_WING_TYPE_DEMON = 1; int CREATURE_WING_TYPE_ANGEL = 2; int CREATURE_WING_TYPE_BAT = 3; int CREATURE_WING_TYPE_DRAGON = 4; int CREATURE_WING_TYPE_BUTTERFLY = 5; int CREATURE_WING_TYPE_BIRD = 6; %)* !"#$&'(UTI V3.28h$"Lh P  2 F qc      d"d  TemplateResRefBaseItemLocalizedNameDescriptionDescIdentifiedTagChargesCostStolenStackSizePlotAddCostIdentifiedCursedModelPart1PropertiesListPropertyNameSubtypeCostTableCostValueParam1Param1ValueChanceAppearVarTableNameTypeValuePaletteIDCommentx3_it_wingtype4Fey Wings Cape'The wearer of this cloak sprouts two delicate, butterfly wings, similar to those seen on pixies. The cloak is almost weightless and grants the owner the ability to cast Charm Person once per day. Note: This item requires special scripting support in a module to work correctly.x3_it_wingtypeX3_S_ITEM_WINGTYPE Wing Cloak Georg Zoeller, BioWare Corp Check x3_it_wingtype.nss for details. You can set the following variable on this item to control the wing type it grants to the wearer: int X3_S_ITEM_WINGTYPE Allowed values int CREATURE_WING_TYPE_NONE = 0; int CREATURE_WING_TYPE_DEMON = 1; int CREATURE_WING_TYPE_ANGEL = 2; int CREATURE_WING_TYPE_BAT = 3; int CREATURE_WING_TYPE_DRAGON = 4; int CREATURE_WING_TYPE_BUTTERFLY = 5; int CREATURE_WING_TYPE_BIRD = 6; "# !UTI V3.28h$*Lh P  6 J $    !d4d  TemplateResRefBaseItemLocalizedNameDescriptionDescIdentifiedTagChargesCostStolenStackSizePlotAddCostIdentifiedCursedModelPart1PropertiesListPropertyNameSubtypeCostTableCostValueParam1Param1ValueChanceAppearVarTableNameTypeValuePaletteIDCommentx3_it_wingtype6"Eagle's Wings CapeThe wearer of this cloak sprouts two magnificent feathery wings. Note: This item requires special scripting support in a module to work correctly.x3_it_wingtypeX3_S_ITEM_WINGTYPE Wing Cloak Georg Zoeller, BioWare Corp Check x3_it_wingtype.nss for details. You can set the following variable on this item to control the wing type it grants to the wearer: int X3_S_ITEM_WINGTYPE Allowed values int CREATURE_WING_TYPE_NONE = 0; int CREATURE_WING_TYPE_DEMON = 1; int CREATURE_WING_TYPE_ANGEL = 2; int CREATURE_WING_TYPE_BAT = 3; int CREATURE_WING_TYPE_DRAGON = 4; int CREATURE_WING_TYPE_BUTTERFLY = 5; int CREATURE_WING_TYPE_BIRD = 6; "# !