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 16:05:02
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 |
zogzog59 Grand Chevalier Messages: 123 |
salut a tous ...
voila j'ai créer une corde et je voudrai que le pj reussit a monter a la corde si et seulement si il reussit un jet de force ou de dexterité pour passer un obstacle et qui retombe a un point que je determine... cela et t'il possible via un script dans le onUsed de l'objet ??? merci d'avance amicalement. |
Revenir en haut | |
omega Grand Chevalier Messages: 116 |
NWScript :
void main () { object oPC = GetLastUsedBy(); // personnage qui utilise int nIntel = GetAbilityModifier(ABILITY_DEXTERITY, oPC);// jet de caract int nRand = Random(20); int nRs = nRand + nIntel; string bla = IntToString(nRs); if (GetIsPC(oPC)) { object oTarget = GetWaypointByTag("TON_TAG"); if (nRs >=21) { AssignCommand(oPC,ActionJumpToObject(oTarget,TRUE)); } } } J'ai pas verifié, mais ca doit etre ca. |
Revenir en haut | |
zogzog59 Grand Chevalier Messages: 123 |
merci beaucoup omega .....
mais ca marche pas il ne ce passe rien c normal ou pas ???? |
Revenir en haut | |
Raudgers Ecuyer Messages: 46 Localisation: En furtif à coter de toi... |
OUééééé j'ai réussit à en faire un qui marche, mais sur la dex, le jet apparait dans le log et si il rate il tombe au sol, j'ai pas réussit a inclure aussi un test de force avec ... Ca te convien ou je continu de chercher ?
_________________ I need your help.Give light to me please. J'ai besoin de votre aide. Donnez-moi la lumière s'il vous plaît. |
Revenir en haut | |
zogzog59 Grand Chevalier Messages: 123 |
ca me convient tres bein si tu pouvais me le faire partager j'en serai ravi ....
|
Revenir en haut | |
gulin cul'sec Grand Chevalier Messages: 121 Localisation: mon pieu |
en faite tu veus que sa se passe comment, tu veux qu'il le fasse directement sans dialogue ou avec un dialogue? car si s'est ac un dialogue alor ta surement oublier le script qui permet un dialogue avec les placeable.
_________________ purer j'ai une de ses envies de pionce zzzzzzzZZZZZZzzzzzZZZZZZzz |
Revenir en haut | |
Raudgers Ecuyer Messages: 46 Localisation: En furtif à coter de toi... |
Coucou me revoila, j'ai fais quelque rajout simpa tu vera :) avec des modification de jet selon les classe d'apres mes testes ça marche impec, alors tu rend ta corde utilisable et dans le OnUsed tu met ça :
NWScript :
const int MS_MOVEMENT_SKILL_PERCENTAGE = 75;
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.const int MS_TUMBLE_SAVE_REDUCTION_PERCENTAGE = 75; const float MS_MAX_NO_WP_SEARCH_DISTANCE = 30.0; const float MS_CLICK_TIMEOUT_SEC = 30.0; const int MS_DEBUG = FALSE; const int MS_SKILL_BALANCE = 1; const int MS_SKILL_CLIMB = 2; const int MS_SKILL_JUMP = 3; const int MS_SKILL_SWIM = 4; const int MS_SKILL_TIGHT_SPACE = 5; const int MS_SKILL_LONG_JUMP = 6; const int MS_SKILL_HIGH_JUMP = 7; const int MS_POSITION_SKILL_TYPE = 1; const int MS_POSITION_DC = 2; const int MS_POSITION_DEST_TAG = 3; const int MS_POSITION_MAX_DMG = 4; string MSStrTok(string sStr, int i); string MSStrTok(string sStr, int i) { int iIndex = 1; int iPos = GetStringLength(sStr); int iDelimiter = FindSubString(sStr, "_"); string sMatch = ""; while (iDelimiter != -1) { if (iIndex == i) { sMatch = GetStringLeft(GetStringRight(sStr, iPos), iDelimiter); break; } iIndex++; iPos = iPos - iDelimiter - 1; iDelimiter = FindSubString(GetStringRight(sStr, iPos), "_"); if (iDelimiter == -1) sMatch = GetStringRight(sStr, iPos); } return sMatch; } void MSErrorMsg (object oPC, string sMsg); void MSErrorMsg (object oPC, string sMsg) { string sErrorMsg = "MoveSkillError: "+sMsg+" on obj:"+GetResRef(OBJECT_SELF)+" tag:"+GetTag(OBJECT_SELF)+" area:"+GetName(GetArea(OBJECT_SELF)); SendMessageToAllDMs(sErrorMsg); SendMessageToPC(oPC, sMsg); WriteTimestampedLogEntry(sErrorMsg); } string MSGetSkillName(object oPC, int iSkill); string MSGetSkillName(object oPC, int iSkill) { switch (iSkill) { case MS_SKILL_BALANCE: return "balance"; case MS_SKILL_CLIMB: return "escalade"; case MS_SKILL_JUMP: return "saut"; case MS_SKILL_SWIM: return "swim"; case MS_SKILL_TIGHT_SPACE: return "tight space"; case MS_SKILL_LONG_JUMP: return "long jump"; case MS_SKILL_HIGH_JUMP: return "high jump"; } MSErrorMsg (oPC, "Skill "+IntToString(iSkill)+" was not recognized."); return "Unknown Skill"; } object MSGetDestination(string sDestTag, int bKeepLooking = TRUE); object MSGetDestination(string sDestTag, int bKeepLooking = TRUE) { object oDest = GetWaypointByTag(sDestTag); if ((GetIsObjectValid(oDest)) || (!bKeepLooking)) { return (oDest); } oDest = GetNearestObjectByTag(GetTag(OBJECT_SELF)); if (!GetIsObjectValid(oDest)) { return (OBJECT_INVALID); } float fDistance = GetDistanceBetween(OBJECT_SELF, oDest); if ((fDistance > 0.0) && (fDistance <= MS_MAX_NO_WP_SEARCH_DISTANCE)) { return (oDest); } return (OBJECT_INVALID); } int MSGetIsClassSkill(int nSkill, int nClass); int MSGetIsClassSkill(int nSkill, int nClass) { switch(nSkill) { case MS_SKILL_BALANCE: switch(nClass) { case CLASS_TYPE_ROGUE: case CLASS_TYPE_ASSASSIN: return TRUE; } break; case MS_SKILL_CLIMB: switch(nClass) { case CLASS_TYPE_RANGER: case CLASS_TYPE_ROGUE: case CLASS_TYPE_ASSASSIN: return TRUE; } break; case MS_SKILL_JUMP: case MS_SKILL_HIGH_JUMP: case MS_SKILL_LONG_JUMP: switch(nClass) { case CLASS_TYPE_RANGER: case CLASS_TYPE_ROGUE: case CLASS_TYPE_ASSASSIN: case CLASS_TYPE_SHADOWDANCER: return TRUE; } break; case MS_SKILL_SWIM: switch(nClass) { case CLASS_TYPE_BARBARIAN: case CLASS_TYPE_BARD: case CLASS_TYPE_DRUID: case CLASS_TYPE_FIGHTER: case CLASS_TYPE_MONK: case CLASS_TYPE_RANGER: case CLASS_TYPE_ROGUE: case CLASS_TYPE_ASSASSIN: case CLASS_TYPE_HARPER: return TRUE; } break; case MS_SKILL_TIGHT_SPACE: switch(nClass) { case CLASS_TYPE_BARD: case CLASS_TYPE_MONK: case CLASS_TYPE_ROGUE: case CLASS_TYPE_ASSASSIN: case CLASS_TYPE_HARPER: return TRUE; } break; } return FALSE; } int MSGetCreatureSizeModifier(object oPC); int MSGetCreatureSizeModifier(object oPC) { switch(GetCreatureSize(oPC)) { case CREATURE_SIZE_TINY: return(2); case CREATURE_SIZE_SMALL: return(1); case CREATURE_SIZE_MEDIUM: return(0); case CREATURE_SIZE_LARGE: return(-1); case CREATURE_SIZE_HUGE: return(-2); } return(0); } int MSGetCreatureSizeVerticalModifier(object oPC); int MSGetCreatureSizeVerticalModifier(object oPC) { switch(GetCreatureSize(oPC)) { case CREATURE_SIZE_TINY: return(-24); case CREATURE_SIZE_SMALL: return(-16); case CREATURE_SIZE_MEDIUM: return(0); case CREATURE_SIZE_LARGE: return(32); case CREATURE_SIZE_HUGE: return(128); } return(0); } int MSGetBonusRank(int nSkill, object oPC); int MSGetBonusRank(int nSkill, object oPC) { int iBonus = 0; int iMonkLevel = 0; switch(nSkill) { case MS_SKILL_BALANCE: iBonus = iBonus + GetAbilityModifier(ABILITY_DEXTERITY, oPC); if (GetSkillRank(SKILL_TUMBLE, oPC) >= 5) iBonus = iBonus + 2; break; case MS_SKILL_CLIMB: iBonus = iBonus + GetAbilityModifier(ABILITY_DEXTERITY, oPC); break; case MS_SKILL_HIGH_JUMP: iBonus = iBonus + MSGetCreatureSizeVerticalModifier(oPC); case MS_SKILL_LONG_JUMP: if (GetRacialType(oPC) == RACIAL_TYPE_HALFLING) iBonus = iBonus + 2; iBonus = iBonus + GetAbilityModifier(ABILITY_STRENGTH, oPC); if (GetSkillRank(SKILL_TUMBLE, oPC) >= 5) iBonus = iBonus + 2; if (GetHasFeat(FEAT_BARBARIAN_ENDURANCE, oPC)) iBonus = iBonus + 1; if (GetHasFeat(FEAT_MONK_ENDURANCE, oPC)) { iMonkLevel = GetLevelByClass(CLASS_TYPE_MONK, oPC); if ((iMonkLevel >= 3) && (iMonkLevel <= 5)) iBonus = iBonus + 1; if ((iMonkLevel >= 6) && (iMonkLevel <= 8)) iBonus = iBonus + 2; if ((iMonkLevel >= 9) && (iMonkLevel <= 11)) iBonus = iBonus + 3; if ((iMonkLevel >= 12) && (iMonkLevel <= 17)) iBonus = iBonus + 4; if (iMonkLevel >= 18) iBonus = iBonus + 5; } break; case MS_SKILL_JUMP: iBonus = iBonus + GetAbilityModifier(ABILITY_STRENGTH, oPC); if (GetSkillRank(SKILL_TUMBLE, oPC) >= 5) iBonus = iBonus + 2; if (GetHasFeat(FEAT_BARBARIAN_ENDURANCE, oPC)) iBonus = iBonus + 1; if (GetHasFeat(FEAT_MONK_ENDURANCE, oPC)) { iMonkLevel = GetLevelByClass(CLASS_TYPE_MONK, oPC); if ((iMonkLevel >= 3) && (iMonkLevel <= 5)) iBonus = iBonus + 1; if ((iMonkLevel >= 6) && (iMonkLevel <= 8)) iBonus = iBonus + 2; if ((iMonkLevel >= 9) && (iMonkLevel <= 11)) iBonus = iBonus + 3; if ((iMonkLevel >= 12) && (iMonkLevel <= 17)) iBonus = iBonus + 4; if (iMonkLevel >= 18) iBonus = iBonus + 5; } break; case MS_SKILL_SWIM: iBonus = iBonus + GetAbilityModifier(ABILITY_STRENGTH, oPC); break; case MS_SKILL_TIGHT_SPACE: iBonus = iBonus + GetAbilityModifier(ABILITY_DEXTERITY, oPC); break; } return iBonus; } int MSGetArmorCheckPenalty(object oPC); int MSGetArmorCheckPenalty(object oPC) { int iPenalty = 0; object oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC); switch (GetBaseItemType(oItem)) { case BASE_ITEM_SMALLSHIELD: iPenalty = iPenalty - 1; break; case BASE_ITEM_LARGESHIELD: iPenalty = iPenalty - 2; break; case BASE_ITEM_TOWERSHIELD: iPenalty = iPenalty - 10; break; } oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC); int iWeight = GetWeight(oItem)/10; if ((iWeight >= 15) && (iWeight < 30)) iPenalty = iPenalty - 1; if ((iWeight >= 30) && (iWeight < 40)) iPenalty = iPenalty - 2; if ((iWeight >= 40) && (iWeight < 45)) iPenalty = iPenalty - 5; if ((iWeight >= 45) && (iWeight < 50)) iPenalty = iPenalty - 7; if (iWeight >= 50) iPenalty = iPenalty - 8; return (iPenalty); } int MSGetEncumbrancePenalty(object oPC); int MSGetEncumbrancePenalty(object oPC) { int iLight = 0; int iMed = 0; int iHigh = 0; int iStr = GetAbilityScore(oPC, ABILITY_STRENGTH); switch(iStr) { case 0: iLight = 0; iMed = 0; iHigh = 0; break; case 1: iLight = 3; iMed = 6; iHigh = 10; break; case 2: iLight = 6; iMed = 13; iHigh = 20; break; case 3: iLight = 10; iMed = 20; iHigh = 30; break; case 4: iLight = 13; iMed = 26; iHigh = 40; break; case 5: iLight = 16; iMed = 33; iHigh = 50; break; case 6: iLight = 20; iMed = 40; iHigh = 60; break; case 7: iLight = 23; iMed = 46; iHigh = 70; break; case 8: iLight = 26; iMed = 53; iHigh = 80; break; case 9: iLight = 30; iMed = 60; iHigh = 90; break; case 10: iLight = 33; iMed = 66; iHigh = 100; break; case 11: iLight = 38; iMed = 76; iHigh = 115; break; case 12: iLight = 43; iMed = 86; iHigh = 130; break; case 13: iLight = 50; iMed = 10; iHigh = 150; break; case 14: iLight = 58; iMed = 116; iHigh = 175; break; case 15: iLight = 66; iMed = 133; iHigh = 200; break; case 16: iLight = 76; iMed = 153; iHigh = 230; break; case 17: iLight = 86; iMed = 173; iHigh = 260; break; case 18: iLight = 100; iMed = 200; iHigh = 300; break; case 19: iLight = 116; iMed = 233; iHigh = 350; break; case 20: iLight = 133; iMed = 266; iHigh = 400; break; case 21: iLight = 153; iMed = 306; iHigh = 460; break; case 22: iLight = 173; iMed = 346; iHigh = 520; break; case 23: iLight = 200; iMed = 400; iHigh = 600; break; case 24: iLight = 233; iMed = 466; iHigh = 700; break; case 25: iLight = 266; iMed = 533; iHigh = 800; break; case 26: iLight = 306; iMed = 613; iHigh = 920; break; case 27: iLight = 346; iMed = 693; iHigh = 1040; break; case 28: iLight = 400; iMed = 800; iHigh = 1200; break; case 29: iLight = 466; iMed = 933; iHigh = 1400; break; default: iLight = (iStr-28)*4*466/10; iMed = (iStr-28)*4*933/10; iHigh = (iStr-28)*4*1400/10; break; } int iEncumbrance = GetWeight(oPC)/10; if (iEncumbrance <= iLight) return (0); if ((iEncumbrance > iLight) && (iEncumbrance <= iMed)) return (-3); if ((iEncumbrance > iMed) && (iEncumbrance <= iHigh)) return (-6); return (-100); } int MSGetPenalty(int nSkill, object oPC); int MSGetPenalty(int nSkill, object oPC) { int iPenalty = 0; switch(nSkill) { case MS_SKILL_TIGHT_SPACE: iPenalty = iPenalty + 10*MSGetCreatureSizeModifier(oPC); iPenalty = iPenalty + MSGetArmorCheckPenalty(oPC); iPenalty = iPenalty + MSGetEncumbrancePenalty(oPC); break; case MS_SKILL_BALANCE: case MS_SKILL_CLIMB: iPenalty = iPenalty + MSGetArmorCheckPenalty(oPC); iPenalty = iPenalty + MSGetEncumbrancePenalty(oPC); break; case MS_SKILL_JUMP: iPenalty = iPenalty - 10*MSGetCreatureSizeModifier(oPC); iPenalty = iPenalty + MSGetArmorCheckPenalty(oPC); iPenalty = iPenalty + MSGetEncumbrancePenalty(oPC); break; case MS_SKILL_SWIM: iPenalty = iPenalty - (GetWeight(oPC)/(50)); break; } return iPenalty; } int MSGetSkillRank(int nSkill, object oPC); int MSGetSkillRank(int nSkill, object oPC) { int iRank1 = 0; int iRank2 = 0; int iRank3 = 0; int iBonus = MSGetBonusRank(nSkill, oPC); int iPenalty = MSGetPenalty(nSkill, oPC); if (MSGetIsClassSkill(nSkill, GetClassByPosition(1, oPC))) iRank1 = 4 + GetLevelByPosition(1, oPC); else iRank1 = 2 + (GetLevelByPosition(1, oPC)/2); if (MSGetIsClassSkill(nSkill, GetClassByPosition(2, oPC))) iRank2 = GetLevelByPosition(2, oPC); else iRank2 = (GetLevelByPosition(2, oPC)/2); if (MSGetIsClassSkill(nSkill, GetClassByPosition(3, oPC))) iRank3 = GetLevelByPosition(3, oPC); else iRank3 = (GetLevelByPosition(3, oPC)/2); string sMsg = GetName(oPC)+" "+MSGetSkillName(oPC, nSkill)+" modifie pour "+MSGetSkillName(oPC, nSkill)+" est "+IntToString(iRank1)+"+"+IntToString(iRank2)+"+"+IntToString(iRank3)+"+Modifie("+IntToString(iBonus)+")+Penalite("+IntToString(iPenalty)+")"; if (MS_MOVEMENT_SKILL_PERCENTAGE != 100) sMsg = sMsg + " classe modifie par "+IntToString(MS_MOVEMENT_SKILL_PERCENTAGE)+"%"; if (MS_DEBUG) AssignCommand(oPC, ActionSpeakString(sMsg)); return ((MS_MOVEMENT_SKILL_PERCENTAGE * (iRank1+iRank2+iRank3)/100)+iBonus+iPenalty); } string MSGetDifficultyLevel(int iRank, int iDC); string MSGetDifficultyLevel(int iRank, int iDC) { if (iRank >= iDC) return "sans probleme"; if (iRank+6 >= iDC) return "facile"; if (iRank+13 >= iDC) return "moyenne"; if (iRank+20 >= iDC) return "difficile"; return "impossible"; } string MSGetAngleBetween(object oDestination, object oPC); string MSGetAngleBetween(object oDestination, object oPC) { float fAngle = VectorToAngle(GetPosition(oDestination) - GetPosition(oPC)); AssignCommand(oPC, SetFacing(fAngle)); switch (FloatToInt(fAngle / 45)) { case 0: return "ouest"; case 1: return "nord ouest"; case 2: return "nord"; case 3: return "nord est"; case 4: return "est"; case 5: return "sud est"; case 6: return "sud"; case 7: return "sud ouest"; case 8: return "ouest"; } return ""; } int MSGetDamage(int iSkill, int iMaxDmg, object oPC); int MSGetDamage(int iSkill, int iMaxDmg, object oPC) { int iDmg = Random(iMaxDmg+1); if (MS_DEBUG) SendMessageToPC(oPC, "jet "+IntToString(iDmg)+" de degats."); if (iDmg == 0) return 0; switch (iSkill) { case MS_SKILL_BALANCE: case MS_SKILL_CLIMB: case MS_SKILL_JUMP: if ((MS_TUMBLE_SAVE_REDUCTION_PERCENTAGE > 0) && (GetIsSkillSuccessful(oPC, SKILL_TUMBLE, 15))) iDmg = MS_TUMBLE_SAVE_REDUCTION_PERCENTAGE * iDmg / 100; break; case MS_SKILL_SWIM: case MS_SKILL_TIGHT_SPACE: int iHP = GetCurrentHitPoints(oPC); if (iDmg >= iHP) iDmg = iHP - 1; break; } if (MS_DEBUG) SendMessageToPC(oPC, "prenez "+IntToString(iDmg)+" pts de degats."); return iDmg; } void MSDoFalldown(); void MSDoFalldown() { int iVoice = VOICE_CHAT_CANTDO; switch (Random(8)) { case 0: iVoice = VOICE_CHAT_BADIDEA; break; case 1: iVoice = VOICE_CHAT_CANTDO; break; case 2: iVoice = VOICE_CHAT_CUSS; break; case 3: iVoice = VOICE_CHAT_LAUGH; break; case 4: iVoice = VOICE_CHAT_NO; break; case 5: iVoice = VOICE_CHAT_PAIN1; break; case 6: iVoice = VOICE_CHAT_PAIN2; break; case 7: iVoice = VOICE_CHAT_PAIN3; break; } PlayVoiceChat(iVoice); if (Random(2)) PlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 5.0); else PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, 5.0); } void MSDoMovementAction(int iSkill, object oDest, int bFall); void MSDoMovementAction(int iSkill, object oDest, int bFall) { SetFacing(VectorToAngle(GetPosition(oDest) - GetPosition(OBJECT_SELF))); switch (iSkill) { case MS_SKILL_BALANCE: DelayCommand(1.0, ActionJumpToObject(oDest, TRUE)); if (bFall) DelayCommand(1.1, MSDoFalldown()); DelayCommand(0.1, PlaySound("fs_dirt_soft1")); DelayCommand(0.5, PlaySound("fs_dirt_soft2")); DelayCommand(1.0, PlaySound("fs_dirt_soft3")); PlayAnimation(ANIMATION_FIREFORGET_DODGE_SIDE); break; case MS_SKILL_CLIMB: DelayCommand(1.0, ActionJumpToObject(oDest, TRUE)); if (bFall) DelayCommand(1.1, MSDoFalldown()); DelayCommand(0.1, PlaySound("fs_dirt_hard1")); DelayCommand(0.5, PlaySound("fs_dirt_hard2")); DelayCommand(1.0, PlaySound("fs_dirt_hard3")); PlayAnimation(ANIMATION_LOOPING_TALK_FORCEFUL); break; case MS_SKILL_JUMP: DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDisappearAppear(GetLocation(oDest)), OBJECT_SELF, 3.0)); if (bFall) DelayCommand(6.0, MSDoFalldown()); PlaySound("as_cv_florcreak3"); break; case MS_SKILL_LONG_JUMP: case MS_SKILL_HIGH_JUMP: DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDisappearAppear(GetLocation(oDest)), OBJECT_SELF, 3.0)); if (bFall) DelayCommand(6.0, MSDoFalldown()); PlaySound("as_cv_florcreak3"); break; case MS_SKILL_SWIM: DelayCommand(1.3, ActionJumpToObject(oDest, TRUE)); if (bFall) DelayCommand(1.4, MSDoFalldown()); DelayCommand(0.3, PlayAnimation(ANIMATION_FIREFORGET_DODGE_DUCK)); PlaySound("as_na_splash1"); break; case MS_SKILL_TIGHT_SPACE: DelayCommand(1.0, ActionJumpToObject(oDest, TRUE)); if (bFall) DelayCommand(1.1, MSDoFalldown()); PlaySound("as_cv_brickscrp1"); PlayAnimation(ANIMATION_LOOPING_GET_LOW); break; } } void main() { object oPC = GetLastUsedBy(); if (GetObjectType(OBJECT_SELF) == OBJECT_TYPE_TRIGGER) { oPC = GetClickingObject(); } if (!GetIsObjectValid(oPC)) return; if(GetLocalInt(OBJECT_SELF, GetPCPlayerName(oPC)+"USING") > 0) { FloatingTextStringOnCreature("Attendez le round suivant !", oPC, FALSE); return; } if(GetLocalInt(OBJECT_SELF, GetPCPlayerName(oPC)) > 0) { DelayCommand(6.0, DeleteLocalInt(OBJECT_SELF, GetPCPlayerName(oPC)+"USING")); SetLocalInt(OBJECT_SELF, GetPCPlayerName(oPC)+"USING", 1); } string sTag = GetTag(OBJECT_SELF); int iSkill = StringToInt(MSStrTok(sTag, MS_POSITION_SKILL_TYPE)); int iDC = StringToInt(MSStrTok(sTag, MS_POSITION_DC)); string sDestTag = MSStrTok(sTag, MS_POSITION_DEST_TAG); int iMaxDmg = StringToInt(MSStrTok(sTag, MS_POSITION_MAX_DMG)); object oDest = MSGetDestination(sDestTag); if (!GetIsObjectValid(oDest)) { MSErrorMsg (oPC, "Destination introuvable."); return; } string sSkillName = MSGetSkillName(oPC, iSkill); int iRank = MSGetSkillRank(iSkill, oPC); string sDifficulty = MSGetDifficultyLevel(iRank, iDC); if (GetLocalInt(OBJECT_SELF, GetPCPlayerName(oPC)) == 0) { DelayCommand(MS_CLICK_TIMEOUT_SEC, DeleteLocalInt(OBJECT_SELF, GetPCPlayerName(oPC))); SetLocalInt(OBJECT_SELF, GetPCPlayerName(oPC), 1); FloatingTextStringOnCreature(GetName(OBJECT_SELF)+" : cela semble "+sDifficulty+" "+sSkillName+" face "+MSGetAngleBetween(oDest, oPC)+". *CLICKEZ A NOUVEAU POUR BOUGER*", oPC, FALSE); return; } int iClick = GetLocalInt(OBJECT_SELF, GetPCPlayerName(oPC)+"CLICK"); SetLocalInt(OBJECT_SELF, GetPCPlayerName(oPC)+"CLICK", iClick+1); if (iClick == 0) DelayCommand(MS_CLICK_TIMEOUT_SEC, DeleteLocalInt(OBJECT_SELF, GetPCPlayerName(oPC)+"CLICK")); int iRoll = d20(); if (GetIsDM(oPC)) iRoll = 127; // DMs always move for free. if ((iMaxDmg == 0) && (iClick > 0) && (!GetIsInCombat(oPC))) { if ((iClick == 1) && (iRoll < 10)) iRoll = 10; if (iClick > 1) iRoll = 20; } string sRoll = IntToString(iRoll)+"+"+IntToString(iRank)+"="+IntToString(iRank+iRoll)+" contre un Des ="+IntToString(iDC); if ((iSkill == MS_SKILL_LONG_JUMP) || (iSkill == MS_SKILL_HIGH_JUMP)) { if ( ((iRank + iRoll) < iDC) && ((iRank + iRoll + 5) >= iDC) ) { if (ReflexSave(oPC, 15) == 1) { AssignCommand(oPC, ActionSpeakString("*REUSSITE*")); iRoll = iRoll + 5; } } if ( ((iRank + iRoll) >= iDC) && ((iRank + iRoll) < (iDC + 5)) ) { AssignCommand(oPC, MSDoMovementAction(iSkill, oDest, TRUE)); FloatingTextStringOnCreature("*"+GetStringUpperCase(sSkillName)+" REUSSITE* "+sRoll, oPC, FALSE); if(!GetIsDM(oPC)) AssignCommand(oPC, ActionSpeakString("*REUSSITE* sur "+sDifficulty+" "+sSkillName)); return; } } if ((iRank + iRoll) >= iDC) { AssignCommand(oPC, MSDoMovementAction(iSkill, oDest, FALSE)); FloatingTextStringOnCreature("*"+GetStringUpperCase(sSkillName)+" REUSSITE* "+sRoll, oPC, FALSE); if(!GetIsDM(oPC)) AssignCommand(oPC, ActionSpeakString("*REUSSITE* sur "+sDifficulty+" "+sSkillName)); return; } if ((iRank + iRoll + 5) >= iDC) { object oFailDest = MSGetDestination(sDestTag+"F", FALSE); if (GetIsObjectValid(oFailDest)) AssignCommand(oPC, MSDoMovementAction(iSkill, oFailDest, TRUE)); else AssignCommand(oPC, MSDoFalldown()); FloatingTextStringOnCreature("*"+GetStringUpperCase(sSkillName)+" ECHEC* "+sRoll, oPC, FALSE); AssignCommand(oPC, ActionSpeakString("*ECHEC* sur "+sDifficulty+" "+sSkillName)); return; } object oFailDest = MSGetDestination(sDestTag+"F", FALSE); if (GetIsObjectValid(oFailDest)) AssignCommand(oPC, MSDoMovementAction(iSkill, oFailDest, TRUE)); else AssignCommand(oPC, MSDoFalldown()); int iDmg = MSGetDamage(iSkill, iMaxDmg, oPC); if (iDmg > 0) AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(iDmg, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_FIVE), oPC)); FloatingTextStringOnCreature("*"+GetStringUpperCase(sSkillName)+" ECHEC CRITIQUE* "+sRoll+". vous prenez "+IntToString(iDmg)+" de degats.", oPC, FALSE); AssignCommand(oPC, ActionSpeakString("*ECHEC CRITIQUE* sur "+sDifficulty+" "+sSkillName)); return; } tu créer un point de passage de tag "UPVATIS" et tu test tout ça ^_^ Tu me redit ce que tu en pense... _________________ I need your help.Give light to me please. J'ai besoin de votre aide. Donnez-moi la lumière s'il vous plaît. |
Revenir en haut | |
zogzog59 Grand Chevalier Messages: 123 |
il m'a l'air super bien ton script mais y a un pb je le met ds "onused" de la corde et je créer un WP avec le tag "UPVATIS" et ca marque bien reussite ou pas mais il ne ce passe rien ??
c normal ?? amicalement |
Revenir en haut | |
warpShadow Légende vivante Messages: 363 Localisation: Perpignan |
[Hors Sujet] LE script le plus long du monde [/Hors Sujet]
_________________ Asphia Module RP Médiéval Fantastique pour Neverwiner Nights |
Revenir en haut | |
Sith Vicious Grand Sage du Conseil Messages: 693 |
Ca serait bien de nous dire comment appeler la corde non ?
"2_12_UPVATIS_5" Ca marche ou j'ai rien pigé ??? (ce qui est plus que probable ) |
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