La Bibliothèque de Neverwinter Nights
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
FAQ
Rechercher
Liste des Membres
Groupes d'utilisateurs
S'enregistrer Se connecter pour vérifier ses messages privés Connexion
S'enregistrer Se connecter pour vérifier ses messages privés Connexion
La date/heure actuelle est 23/11/2024 13:39:20
La Bibliothèque de Neverwinter Nights Index du Forum »
La Bibliothèque Binaire du NWScript - Neverwinter Nights
Voir le sujet précédent ¤ Voir le sujet suivant | |
---|---|
Auteur | Message |
hugies Novice Messages: 7 Localisation: Cholet |
Salut à tous,
Je cherche le script qui se trouve dans la dernière extension et qui concerne la zone sans magie..Vous savez la zone ou les épees deviennent basique, les sorts impossiblent à lancer. Bref le script qui fait ca....Si en plus vous le celui qui redonne tout c'est cool Merci d'avance |
Revenir en haut | |
Yoyo Seigneur Messages: 223 |
Alors voila ce que j'ai copier/coller de HOTU
pour le script lorsque tu rentre dans la zone à placer dans la onEnter bien sur NWScript :
// tunnels on-enter: apply dead-magic zone if active #include "x2_inc_itemprop" void DebugString(string sStr) { //PrintString(sStr); } object GetChest(object oCreature) { object oChest = GetObjectByTag("q5c_chest" + ObjectToString(oCreature)); if(oChest == OBJECT_INVALID) { object oWP = GetWaypointByTag("q5c_wp_chest_sp"); oChest = CreateObject(OBJECT_TYPE_PLACEABLE, "q5c_keep_chest", GetLocation(oWP), FALSE, "q5c_chest" + ObjectToString(oCreature)); } return oChest; } int GetIsAlcohol(object oItem) { itemproperty ip; ip = GetFirstItemProperty(oItem); // if there is more than 1 property then this item should be stripped if(GetIsItemPropertyValid(GetNextItemProperty(oItem))) return FALSE; if(GetItemPropertyType(ip) == ITEM_PROPERTY_CAST_SPELL) { if(GetItemPropertySubType(ip) == IP_CONST_CASTSPELL_SPECIAL_ALCOHOL_BEER || GetItemPropertySubType(ip) == IP_CONST_CASTSPELL_SPECIAL_ALCOHOL_SPIRITS || GetItemPropertySubType(ip) == IP_CONST_CASTSPELL_SPECIAL_ALCOHOL_WINE) return TRUE; } return FALSE; } int GetIsPoisonAmmo(object oItem) { itemproperty ip; ip = GetFirstItemProperty(oItem); // if there is more than 1 property then this item should be stripped if(GetIsItemPropertyValid(GetNextItemProperty(oItem))) return FALSE; if(IPGetItemHasItemOnHitPropertySubType(oItem, IP_CONST_ONHIT_ITEMPOISON)) return TRUE; // single poison property return FALSE; } int GetIsDyeKit(object oItem) { if(GetBaseItemType(oItem) == BASE_ITEM_MISCSMALL) { itemproperty ip = GetFirstItemProperty(oItem); if(GetItemPropertyType(ip) == ITEM_PROPERTY_CAST_SPELL) { int nSubType = GetItemPropertySubType(ip); return (nSubType >= 490 && nSubType <= 497); } return FALSE; } return FALSE; } void RemoveAllProperties(object oItem, object oPC) { DebugString("BOOM DEADM: TRYING to Remove props from item= <" + GetName(oItem) + "> tag= <" + GetTag(oItem) + ">"); int nType = GetBaseItemType(oItem); if(nType == BASE_ITEM_TORCH || nType == BASE_ITEM_TRAPKIT || nType == BASE_ITEM_HEALERSKIT || nType == BASE_ITEM_GRENADE || nType == BASE_ITEM_THIEVESTOOLS || nType == 109 || // crafting stuff nType == 110 || nType == 112) return; if(GetIsAlcohol(oItem) || GetIsPoisonAmmo(oItem) || GetIsDyeKit(oItem)) return; if(oItem == OBJECT_INVALID) return; object oWP = GetWaypointByTag("q5c_wp_chest_sp"); // generating key (global value on area) int nKey = GetLocalInt(OBJECT_SELF, "ITEM_KEY"); nKey++; SetLocalInt(OBJECT_SELF, "ITEM_KEY", nKey); string sKey = IntToString(nKey); DebugString("BOOM DEADM: REMOVING props from item= <" + GetName(oItem) + "> with key value= <" + sKey + "> of creature= " + GetName(oPC)); //object oChest = GetChest(oPC); //object oCopy = CopyObject(oItem, GetLocation(oChest), oChest); // copying original item to a secluded waypoint in the area // and giving it a tag that contains the key string object oCopy = CopyObject(oItem, GetLocation(oWP), OBJECT_INVALID, "q5c_item" + sKey); //storing the key value on the original item (key value would point to the copy item) SetLocalString(oItem, "ITEM_KEY", sKey); //SetLocalObject(oItem, "ITEM_CHEST", oChest); // so the chest can be found //SetLocalObject(oChest, sKey, oCopy); // and referenced in the chest // Stripping original item from all properties itemproperty ip = GetFirstItemProperty(oItem); while(GetIsItemPropertyValid(ip)) { RemoveItemProperty(oItem, ip); ip = GetNextItemProperty(oItem); } } void RemoveEffects(object oObject) { effect eEff = GetFirstEffect(oObject); while(GetIsEffectValid(eEff)) { int nType = GetEffectType(eEff); if(GetEffectSubType(eEff) != SUBTYPE_EXTRAORDINARY && (nType == EFFECT_TYPE_ABILITY_INCREASE || nType == EFFECT_TYPE_AC_INCREASE || nType == EFFECT_TYPE_ATTACK_INCREASE || nType == EFFECT_TYPE_BLINDNESS || nType == EFFECT_TYPE_CHARMED || nType == EFFECT_TYPE_CONCEALMENT || nType == EFFECT_TYPE_CONFUSED || nType == EFFECT_TYPE_CURSE || nType == EFFECT_TYPE_DAMAGE_IMMUNITY_INCREASE || nType == EFFECT_TYPE_DAMAGE_INCREASE || nType == EFFECT_TYPE_DAMAGE_REDUCTION || nType == EFFECT_TYPE_DAMAGE_RESISTANCE || nType == EFFECT_TYPE_DAZED || nType == EFFECT_TYPE_DEAF || nType == EFFECT_TYPE_DOMINATED || nType == EFFECT_TYPE_ELEMENTALSHIELD || nType == EFFECT_TYPE_ETHEREAL || nType == EFFECT_TYPE_FRIGHTENED || nType == EFFECT_TYPE_HASTE || nType == EFFECT_TYPE_IMMUNITY || nType == EFFECT_TYPE_IMPROVEDINVISIBILITY || nType == EFFECT_TYPE_INVISIBILITY || nType == EFFECT_TYPE_INVULNERABLE || nType == EFFECT_TYPE_ABILITY_INCREASE || nType == EFFECT_TYPE_NEGATIVELEVEL || nType == EFFECT_TYPE_PARALYZE || nType == EFFECT_TYPE_POLYMORPH || nType == EFFECT_TYPE_REGENERATE || nType == EFFECT_TYPE_SANCTUARY || nType == EFFECT_TYPE_SAVING_THROW_INCREASE || nType == EFFECT_TYPE_SEEINVISIBLE || nType == EFFECT_TYPE_SILENCE || nType == EFFECT_TYPE_SKILL_INCREASE || nType == EFFECT_TYPE_SLOW || nType == EFFECT_TYPE_SPELL_IMMUNITY || nType == EFFECT_TYPE_SPELL_RESISTANCE_INCREASE || nType == EFFECT_TYPE_SPELLLEVELABSORPTION || nType == EFFECT_TYPE_TEMPORARY_HITPOINTS || nType == EFFECT_TYPE_TRUESEEING || nType == EFFECT_TYPE_ULTRAVISION || nType == EFFECT_TYPE_INVULNERABLE)) RemoveEffect(oObject, eEff); eEff = GetNextEffect(oObject); } } void SetupArea(object oPC) { if(!GetIsPC(oPC)) return; int nDoOnce = GetLocalInt(OBJECT_SELF, "DO_SETUP_ONCE"); if(nDoOnce == 1) return; SetLocalInt(OBJECT_SELF, "DO_SETUP_ONCE", 1); SetLocalInt(GetModule(), "X2Q5_HANDLED_BEBELITH", 1); object oObelisk = GetObjectByTag("q5c_obelisk"); object oRunes = GetObjectByTag("q5c_runes"); effect eVis = EffectVisualEffect(VFX_DUR_ANTI_LIGHT_10); effect eVis2 = EffectVisualEffect(VFX_DUR_BLUR); //ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oObelisk); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis2, oObelisk); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis2, oRunes); effect eWeb = EffectVisualEffect(VFX_DUR_WEB); effect eBigWeb = EffectVisualEffect(VFX_DUR_WEB_MASS); object oWeb = GetFirstObjectInArea(OBJECT_SELF); effect eInv = EffectVisualEffect(VFX_COM_UNLOAD_MODEL); effect eHold = EffectCutsceneParalyze(); while(oWeb != OBJECT_INVALID) { if(GetTag(oWeb) == "q5c_web_source" || GetTag(oWeb) == "q5c_device") { ApplyEffectToObject(DURATION_TYPE_PERMANENT, eWeb, oWeb); } else if(GetTag(oWeb) == "q5c_web_source_big") { ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBigWeb, oWeb); } oWeb = GetNextObjectInArea(OBJECT_SELF); } } void FeedbackMessage(object oPC) { if(!GetIsPC(oPC)) return; int nDoOnce = GetLocalInt(oPC, "Q5C_DO_FEEDBACK_ONCE"); if(nDoOnce == 1) return; SetLocalInt(oPC, "Q5C_DO_FEEDBACK_ONCE", 1); object oTalker = CreateObject(OBJECT_TYPE_PLACEABLE, "q5c_talker", GetLocation(oPC)); DelayCommand(2.0, AssignCommand(oPC, ActionStartConversation(oPC, "q5c_dead_magic", FALSE, FALSE))); } void main() { object oEnter = GetEnteringObject(); FeedbackMessage(oEnter); SetupArea(oEnter); if(GetLocalInt(OBJECT_SELF, "REST_INIT") == 0) { SetLocalString(OBJECT_SELF, "X2_WM_ENCOUNTERTABLE", "q5_LowerTunnels"); SetLocalInt(OBJECT_SELF, "REST_INIT", 1); } // Making a check to see whether the creature is already inside (save game) int nInside = GetLocalInt(oEnter, "Q5C_INSIDE"); if(nInside == 1) // loaded a save game return; SetLocalInt(oEnter, "Q5C_INSIDE", 1); if(GetObjectType(oEnter) == OBJECT_TYPE_CREATURE && GetLocalInt(OBJECT_SELF, "DEAD_MAGIC_DISABLED") == 0 && GetAppearanceType(oEnter) != 422 /*bebelith*/ && GetRacialType(oEnter) != RACIAL_TYPE_VERMIN /* spiders */&& GetAppearanceType(oEnter) != APPEARANCE_TYPE_LIZARDFOLK_B /*ghosts*/) { DebugString("BOOM DEADM: *** Handling removal of magic from creature: " + GetName(oEnter)); RemoveEffects(oEnter); effect eSpellFailure = EffectSpellFailure(100, SPELL_SCHOOL_GENERAL); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpellFailure, oEnter); // Handle all items in inventory: object oItem = GetFirstItemInInventory(oEnter); while(oItem != OBJECT_INVALID) { RemoveAllProperties(oItem, oEnter); oItem = GetNextItemInInventory(oEnter); } oItem = GetItemInSlot(INVENTORY_SLOT_ARMS, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_ARROWS, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_BELT, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_BOLTS, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_BOOTS, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_BULLETS, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_CLOAK, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_HEAD, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_LEFTRING, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_NECK, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oEnter); RemoveAllProperties(oItem, oEnter); oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oEnter); RemoveAllProperties(oItem, oEnter); } } Ci dessous le script lorsque tu sort de la zone à placer dans le onExit de la zone NWScript :
#include "x2_inc_itemprop" void DebugString(string sStr) { //PrintString(sStr); } void RestoreAllProperties(object oItem, object oPC, int nSlot = -1) { DebugString("BOOM DEADM: TRYING to restore magic to item: <" + GetName(oItem) + "> tag= <" + GetTag(oItem) + ">"); if(oPC != OBJECT_INVALID) // this is a pc object that has an item in inventory slot or normal inventory { if(oItem == OBJECT_INVALID) oItem = GetItemInSlot(nSlot, oPC); if(oItem == OBJECT_INVALID) return; } //object oChest = GetLocalObject(oItem, "ITEM_CHEST"); // getting the key value - this points to the tag of the copy item string sKey = GetLocalString(oItem, "ITEM_KEY"); // retrieving the copy item that is in this area object oOriginalItem = GetObjectByTag("q5c_item" + sKey); DebugString("BOOM DEADM: RESTORING magic for item: <" + GetName(oItem) + "> with key value= <" + sKey + "> for creature= <" + GetName(oPC) + ">"); //object oOriginalItem = GetLocalObject(oChest, sKey); object oNewItem; if(oOriginalItem != OBJECT_INVALID) // item has not been restored yet { // replace current item with original IPCopyItemProperties(oOriginalItem, oItem); DestroyObject(oOriginalItem); // destroy dup item on player //DeleteLocalObject(oChest, GetResRef(oItem)); // so it won't be restored again DeleteLocalString(oItem, "ITEM_KEY"); } } void RemoveEffects(object oObject) { effect eEff = GetFirstEffect(oObject); while(GetIsEffectValid(eEff)) { if(GetEffectType(eEff) == EFFECT_TYPE_SPELL_FAILURE || GetEffectType(eEff) == EFFECT_TYPE_POLYMORPH) RemoveEffect(oObject, eEff); eEff = GetNextEffect(oObject); } } void main() { object oExit = GetExitingObject(); SetLocalInt(oExit, "Q5C_INSIDE", 0); // flagging player as outside of area (needed for load/save issues) if(GetObjectType(oExit) == OBJECT_TYPE_CREATURE) // iterate through all creature's items and if there is one in the chest, replace it with // the current one. { DebugString("BOOM DEADM: *** Handling RESTORE of magic from EXITING creature: <" + GetName(oExit)); RemoveEffects(oExit); // Handle all items in inventory: object oItem = GetFirstItemInInventory(oExit); while(oItem != OBJECT_INVALID) { DelayCommand(4.0, RestoreAllProperties(oItem, oExit, -1)); oItem = GetNextItemInInventory(oExit); } DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_ARMS)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_ARROWS)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_BELT)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_BOLTS)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_BOOTS)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_BULLETS)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_CHEST)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_CLOAK)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_HEAD)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_LEFTHAND)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_LEFTRING)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_NECK)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_RIGHTHAND)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oExit, INVENTORY_SLOT_RIGHTRING)); } } Et puis en dessous c'est un script que j'ai trouvé dans le onUserDefined (il parle de lorsque l'on a désactiver l'obélisque avec les 4 runes...) NWScript :
#include "x2_inc_itemprop"
Le code a colorer syntaxiquement est trop long (plus de 10240 caractères) et risque de ne pas s'afficher du tout. Vous pouvez le voir en version colorée ici.#include "nw_i0_plot" #include "x2c2_inc_plot" void DebugString(string sStr) { //PrintString(sStr); } void RestoreAllProperties(object oItem, object oPC, int nSlot = -1) { DebugString("BOOM DEADM: TRYING to restore magic to item: <" + GetName(oItem) + "> tag= <" + GetTag(oItem) + ">"); if(oPC != OBJECT_INVALID) // this is a pc object that has an item in inventory slot or normal inventory { if(oItem == OBJECT_INVALID) oItem = GetItemInSlot(nSlot, oPC); if(oItem == OBJECT_INVALID) return; } //object oChest = GetLocalObject(oItem, "ITEM_CHEST"); // getting the key value - this points to the tag of the copy item string sKey = GetLocalString(oItem, "ITEM_KEY"); // retrieving the copy item that is in this area object oOriginalItem = GetObjectByTag("q5c_item" + sKey); DebugString("BOOM DEADM: RESTORING magic for item: <" + GetName(oItem) + "> with key value= <" + sKey + "> for creature= <" + GetName(oPC) + ">"); //object oOriginalItem = GetLocalObject(oChest, sKey); object oNewItem; if(oOriginalItem != OBJECT_INVALID) // item has not been restored yet { // replace current item with original IPCopyItemProperties(oOriginalItem, oItem); DestroyObject(oOriginalItem); // destroy dup item on player //DeleteLocalObject(oChest, GetResRef(oItem)); // so it won't be restored again DeleteLocalString(oItem, "ITEM_KEY"); } } void RemoveEffects2(object oObject) { // removing also polymorph so player would have his equipped items effect eEff = GetFirstEffect(oObject); while(GetIsEffectValid(eEff)) { if(GetEffectType(eEff) == EFFECT_TYPE_SPELL_FAILURE || GetEffectType(eEff) == EFFECT_TYPE_POLYMORPH) RemoveEffect(oObject, eEff); eEff = GetNextEffect(oObject); } } void main() { int nEvent = GetUserDefinedEventNumber(); if(nEvent == 101) // restore magic { Reward_2daXP(GetFirstPC(), 51); SetPlot("q5_journal_beholders", 100); SetLocalInt(OBJECT_SELF, "DEAD_MAGIC_DISABLED", 1); //object oRunes = GetObjectByTag("q5c_runes"); //DestroyObject(oRunes); object oSound = GetObjectByTag("q5c_obelisk_sound"); SoundObjectStop(oSound); object oObelisk1 = GetObjectByTag("q5c_obelisk"); location lLoc = GetLocation(oObelisk1); SetPlotFlag(oObelisk1, FALSE); DestroyObject(oObelisk1); object oObelisk = CreateObject(OBJECT_TYPE_PLACEABLE, "q5c_obelisk2", GetLocation(oObelisk1)); effect eLight = EffectVisualEffect(VFX_DUR_ANTI_LIGHT_10); //effect eDeath = EffectDeath(); effect eEff = GetFirstEffect(oObelisk); while(GetIsEffectValid(eEff)) { RemoveEffect(oObelisk, eEff); eEff = GetNextEffect(oObelisk); } effect eVis = EffectVisualEffect(VFX_IMP_DISPEL); vector vPos = GetPosition(oObelisk); int i; float fDelay; for(i = 1; i <= 30; i++) { lLoc = Location(GetArea(OBJECT_SELF), vPos, 0.0); DelayCommand(fDelay, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lLoc)); fDelay += 0.05; vPos.z += 0.2; } eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); DelayCommand(4.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oObelisk)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLight, oObelisk, 4.0); //DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oObelisk)); eVis = EffectVisualEffect(VFX_IMP_BREACH); // Restoring magic for all creatures object oObject = GetFirstObjectInArea(OBJECT_SELF); while(oObject != OBJECT_INVALID) { if(GetObjectType(oObject) == OBJECT_TYPE_CREATURE) { DebugString("BOOM DEADM: *** Handling RESTORE of magic from creature: <" + GetName(oObject)); RemoveEffects2(oObject); // Handle all items in inventory: object oItem = GetFirstItemInInventory(oObject); while(oItem != OBJECT_INVALID) { DelayCommand(4.0, RestoreAllProperties(oItem, oObject, -1)); oItem = GetNextItemInInventory(oObject); } DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_ARMS)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_ARROWS)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_BELT)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_BOLTS)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_BOOTS)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_BULLETS)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_CHEST)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_CLOAK)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_HEAD)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_LEFTHAND)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_LEFTRING)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_NECK)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_RIGHTHAND)); DelayCommand(4.0, RestoreAllProperties(OBJECT_INVALID, oObject, INVENTORY_SLOT_RIGHTRING)); DelayCommand(4.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oObject)); } if(GetObjectType(oObject) == OBJECT_TYPE_ITEM) { DebugString("BOOM DEADM: *** Handling RESTORE of magic from DROPPED ITEM: <" + GetName(oObject)); DelayCommand(10.0, RestoreAllProperties(oObject, OBJECT_INVALID)); } oObject = GetNextObjectInArea(OBJECT_SELF); } } else if(nEvent == 102) // pressing a rune plate // Whenever using the plate - switch to the next rune. When all plates in the line // are the same, this line is locked. When all 4 lines are locked - the obelisk is disabled. { object oRune = GetLocalObject(OBJECT_SELF, "CURRENT_RUNE"); object oPC = GetLocalObject(OBJECT_SELF, "PC"); // if the rune is locked - do nothing (all other runes in the same line should also be locked) int nLocked = GetLocalInt(oRune, "LOCKED"); if(nLocked == 1) return; // Switch the rune appearance string sTag = GetTag(oRune); int nNum = GetReflexSavingThrow(oRune); // the rune type is the reflex saving throw nNum++; if(nNum == 5) nNum = 1; // rune numbers are 1 to 4 string sBP = "q5c_Rune" + IntToString(nNum); // getting the blue print // destroy the current rune and create the new one: location lLoc = GetLocation(oRune); object oMasterRune = GetNearestObjectByTag("q5c_MasterRune", oRune); int nType = GetReflexSavingThrow(oMasterRune); // storing the other runes' types before destroying the current one: object oRune1 = GetNearestObjectByTag("q5c_Rune" + IntToString(nType), oRune, 1); object oRune2 = GetNearestObjectByTag("q5c_Rune" + IntToString(nType), oRune, 2); int nRuneType1 = GetReflexSavingThrow(oRune1); int nRuneType2 = GetReflexSavingThrow(oRune2); SetPlotFlag(oRune, FALSE); DestroyObject(oRune); // creating a new rune with the same level (part of tag) object oNewRune = CreateObject(OBJECT_TYPE_PLACEABLE, sBP, lLoc, FALSE, "q5c_Rune" + IntToString(nType)); AssignCommand(oPC, PlaySound("as_dr_stonmedcl1")); // now checking all 3 runes in the lines and comparing to the master rune's type if(nType == nRuneType1 && nType == nRuneType2 && nType == nNum) // got a match in the line { effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S); DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oMasterRune))); DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oRune1))); DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oRune2))); DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oNewRune))); SetLocalInt(oMasterRune, "LOCKED", 1); SetLocalInt(oRune1, "LOCKED", 1); SetLocalInt(oRune2, "LOCKED", 1); SetLocalInt(oNewRune, "LOCKED", 1); // if all 4 lines are locked - disable the obelisk object oMasterRune1 = GetNearestObjectByTag("q5c_MasterRune", oMasterRune, 1); object oMasterRune2 = GetNearestObjectByTag("q5c_MasterRune", oMasterRune, 2); object oMasterRune3 = GetNearestObjectByTag("q5c_MasterRune", oMasterRune, 3); int nLocked1 = GetLocalInt(oMasterRune1, "LOCKED"); int nLocked2 = GetLocalInt(oMasterRune2, "LOCKED"); int nLocked3 = GetLocalInt(oMasterRune3, "LOCKED"); if(nLocked1 && nLocked2 && nLocked3) { //object oObelisk = GetObjectByTag("q5c_obelisk"); SignalEvent(OBJECT_SELF, EventUserDefined(101)); DelayCommand(5.0, AssignCommand(oPC, SpeakOneLinerConversation("q5c_sense_core"))); } } } } Bon j'ai juste copier/coller mais ca peut t'aider |
Revenir en haut | |
warpShadow Légende vivante Messages: 363 Localisation: Perpignan |
balaise ce script...
n'empeche que ça pourra m'être utile, merci a toi _________________ Asphia Module RP Médiéval Fantastique pour Neverwiner Nights |
Revenir en haut | |
hugies Novice Messages: 7 Localisation: Cholet |
yep merci...super rapide et tout
|
Revenir en haut | |
hugies Novice Messages: 7 Localisation: Cholet |
J'ai tester l'ensemble marche bien pour l'entrer et la sortie de la zone..
Par contre le script pour l'obelisque ne marche pas, dés la creation. Il ne trouve pas " #include "x2c2_inc_plot" ".. C'est pas dramatique mais cela pourrait etre utile |
Revenir en haut | |
Yoyo Seigneur Messages: 223 |
C'est bizard...
Alors le fichier "x2c2_inc_plot" il contient : NWScript :
// plot inlude file: set and get plot status // Sets the journal sPlotTag to nState, and sets a module var with the plot status. // The plots is alwats set for all players. void SetPlot(string sPlotTag, int nState); // Gets the current plot status for sPlotTag int GetPlot(string sPlotTag); void SetPlot(string sPlotTag, int nState) { AddJournalQuestEntry(sPlotTag, nState, GetFirstPC(), TRUE, TRUE); SetLocalInt(GetModule(), sPlotTag, nState); } int GetPlot(string sPlotTag) { return GetLocalInt(GetModule(), sPlotTag); } Essaie de copier/coller ca dans un fichier et a la place de #include "x2c2_inc_plot" remplace par #include "le_nom_de_ton_fichier" |
Revenir en haut | |
Seth de Sombrelune Seigneur Messages: 156 |
Si ton but est simplement d'interdire la magie des sorts, utilise le Spell-Hooking en randant ta zone sans magies, il est aussi interessant de retirer tout effet magique sur le pj a son entrée dans la zone. Par contre si tu veux vraiment que les armes redevienne de simple item...
tu a imaginé ce qui se passerait si ton serveur plante alors que le PJ se trouve avec tout ses items privé de magie ? |
Revenir en haut | |
La Bibliothèque de Neverwinter Nights Index du Forum »
La Bibliothèque Binaire du NWScript - Neverwinter Nights
Page 1 sur 1 ¤
Vous ne pouvez pas poster de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas voter dans les sondages de ce forum