metallick
Chevalier
Inscrit le: 26 Aoû 2006
Messages: 88
|
Posté le : 22/01/2007 22:26:04 Sujet du message : Probleme de sommation
Bonsoir. J'ai un souci avec mon script de sommations... Le truc c'est que mon pnj enchaine les phrases a toute vitesse alors que je n'ai rien changé du script... Alos je ne comprends pas d'ou viens le souci....
NWScript :#include "NW_I0_GENERIC"string WARNING1 = "Retirez vos armes !!"; string WARNING2 = ""; string WARNING3 = ""; string ATTACK_MSG = ""; string COMPLY_REPLY = "bien, merci."; float WARN_DISTANCE = 20.0; float ANGER_DUR = 120.0; void main() { object oPC; object item; oPC = GetNearestCreature( CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF); if( oPC != OBJECT_INVALID && ( GetDistanceBetween( OBJECT_SELF, oPC) < WARN_DISTANCE) && GetObjectSeen( oPC) && ! GetIsEnemy( oPC)) { if (( GetItemPossessedBy( oPC, "TAGpourCastelmort")!= OBJECT_INVALID)&&( GetLocalInt( OBJECT_SELF, GetFamiliarName( oPC))!= 1)) { AssignCommand( OBJECT_SELF, ActionPlayAnimation( ANIMATION_FIREFORGET_BOW, 1.0)); if ( GetItemPossessedBy( oPC, "InsigneNobledeCastelMort")!= OBJECT_INVALID) { SpeakString( "Bienvenue Seigneur "+ GetFamiliarName( oPC)+ " "+ GetName( oPC)); } SetLocalInt( OBJECT_SELF, GetFamiliarName( oPC), 1); } if ((( item = GetItemInSlot( INVENTORY_SLOT_RIGHTHAND, oPC))!= OBJECT_INVALID)&&( GetItemPossessedBy( oPC, "TAGpourCastelmort")== OBJECT_INVALID)) { if( GetLocalObject( OBJECT_SELF, "LastOffender")== oPC) { if( GetLocalInt( OBJECT_SELF, "OffenseCount")== 2) { SpeakString( ATTACK_MSG); SetIsTemporaryEnemy( oPC, OBJECT_SELF, TRUE, ANGER_DUR); ActionAttack( oPC); } else if( GetLocalInt( OBJECT_SELF, "OffenseCount")== 1) { ActionMoveToObject( oPC, TRUE); SetLocalInt( OBJECT_SELF, "OffenseCount", 2); SpeakString( WARNING3); } else{ SetLocalInt( OBJECT_SELF, "OffenseCount", 1); SpeakString( WARNING2); } } else{ SetLocalInt( OBJECT_SELF, "OffenseCount", 0); SpeakString( WARNING1); SetLocalObject( OBJECT_SELF, "LastOffender", oPC); } } else{ if( GetLocalObject( OBJECT_SELF, "LastOffender")!= OBJECT_INVALID) SpeakString( COMPLY_REPLY); DeleteLocalObject( OBJECT_SELF, "LastOffender"); SetLocalInt( OBJECT_SELF, "OffenseCount", 0); } } if( GetSpawnInCondition( NW_FLAG_FAST_BUFF_ENEMY)) { if( TalentAdvancedBuff( 40.0)) { SetSpawnInCondition( NW_FLAG_FAST_BUFF_ENEMY, FALSE); return; } } if( GetSpawnInCondition( NW_FLAG_DAY_NIGHT_POSTING)) { int nDay = FALSE; if( GetIsDay() || GetIsDawn()) { nDay = TRUE; } if( GetLocalInt( OBJECT_SELF, "NW_GENERIC_DAY_NIGHT") != nDay) { if( nDay == TRUE) { SetLocalInt( OBJECT_SELF, "NW_GENERIC_DAY_NIGHT", TRUE); } else{ SetLocalInt( OBJECT_SELF, "NW_GENERIC_DAY_NIGHT", FALSE); } WalkWayPoints(); } } if(! GetHasEffect( EFFECT_TYPE_SLEEP)) { if(! GetIsPostOrWalking()) { if(! GetIsObjectValid( GetAttemptedAttackTarget()) && ! GetIsObjectValid( GetAttemptedSpellTarget())) { if(! GetIsObjectValid( GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN))) { if(! GetBehaviorState( NW_FLAG_BEHAVIOR_SPECIAL) && ! IsInConversation( OBJECT_SELF)) { if( GetSpawnInCondition( NW_FLAG_AMBIENT_ANIMATIONS) || GetSpawnInCondition( NW_FLAG_AMBIENT_ANIMATIONS_AVIAN)) { PlayMobileAmbientAnimations(); } else if( GetIsEncounterCreature() && ! GetIsObjectValid( GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN))) { PlayMobileAmbientAnimations(); } else if( GetSpawnInCondition( NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS) && ! GetIsObjectValid( GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN))) { PlayImmobileAmbientAnimations(); } } else{ DetermineSpecialBehavior(); } } else{ } } } } else{ if( GetSpawnInCondition( NW_FLAG_SLEEPING_AT_NIGHT)) { effect eVis = EffectVisualEffect( VFX_IMP_SLEEP); if( d10() > 6) { ApplyEffectToObject( DURATION_TYPE_INSTANT, eVis, OBJECT_SELF); } } } if( GetSpawnInCondition( NW_FLAG_HEARTBEAT_EVENT)) { SignalEvent( OBJECT_SELF, EventUserDefined( 1001)); } } Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.
|