View Full Version: Langue différentes (MutateSpeech)

RunUO.FR Support > System > Langue différentes (MutateSpeech)


Title: Langue différentes (MutateSpeech)


Shariz - August 19, 2003 02:52 AM (GMT)
Remplacer MutateSpeech par ce script dans le fichier PlayerMobile.cs

Ce script est fait pour un serveur qui a les races orc et human de type RaceType.
Les personnages orc et human ne pourront pas parler ensemble.
Un personnage avec un casque ne pourra pas parler.


Fait par Voran (modifié par Shariz)
CODE

  private static object m_RaceContext = new object();

public override bool CheckHearsMutatedSpeech( Mobile m, object context )
{
     Mobile somemobile = m;
         
        PlayerMobile someperso = somemobile as PlayerMobile;
  if(someperso !=null)
  {
if((someperso.m_Race != this.m_Race ||  (FindItemOnLayer( Layer.Helm ) != null)) && someperso.AccessLevel == AccessLevel.Player )
  {
  if ( context == m_RaceContext )
   
     return ( ( somemobile is PlayerMobile) && ((PlayerMobile)somemobile).m_Race == m_Race );

  return base.CheckHearsMutatedSpeech( somemobile, context );
  }
   
     
  }
  return false;
}



     public override bool MutateSpeech( ArrayList hears, ref string text, ref object context )
     {
        if ( Alive )
        {
if ( (this.FindItemOnLayer( Layer.Helm ) is Bascinet) || (this.FindItemOnLayer( Layer.Helm ) is BoneHelm) || (this.FindItemOnLayer( Layer.Helm ) is CloseHelm) || (this.FindItemOnLayer( Layer.Helm ) is DaemonHelm) || (this.FindItemOnLayer( Layer.Helm ) is Helmet) || (this.FindItemOnLayer( Layer.Helm ) is NorseHelm) || (this.FindItemOnLayer( Layer.Helm ) is OrcHelm) || (this.FindItemOnLayer( Layer.Helm ) is PlateHelm) )
{

if ( base.MutateSpeech( hears, ref text, ref context ) )
return true;

string[] HeaumeWords = new string[]{ "mmm", "mmffft", "mffft", "hmmmm", "arrgh", "rhaaaaaa", "...", " rrmmmfff", "mmuufff", "pftt", "hiiiiii", "...", "???", "!!!", "***"  };
string[] split = text.Split( ' ' );

for ( int i = 0; i < split.Length; ++i )
split[i] = HeaumeWords[Utility.Random( HeaumeWords.Length )];

text = String.Join( " ", split );
return true;
}

           if(this.m_Race==RaceType.Orc )
           {
           if ( base.MutateSpeech( hears, ref text, ref context ) )
     return true;

  string[] orcWords = new string[]{ "ugbug", "glubyug", "rugbleg", "ardig", "waaargh", "durbuk", "fiddug", "gok", "gitz", "grot", "nibbuk", "pagrog", "niggug", "raggik", "buggrut", "Zog", "zog", "Gorka", "gorka", "bratz", "faschig", "bazza", "grook", "bugrit"  };

  string[] split = text.Split( ' ' );

  for ( int i = 0; i < split.Length; ++i )
     split[i] = orcWords[Utility.Random( orcWords.Length )];

  text = String.Join( " ", split );
  return true;
           }
              if(this.m_Race==Server.Mobiles.PlayerMobile.RaceType.Human  && this.FindItemOnLayer( Layer.Helm ) == null )
           {
           if ( base.MutateSpeech( hears, ref text, ref context ) )
     return true;

  string[] humanWords = new string[]{ "ayesey", "watho", "jolligoodshoh", "rahrther", "watwat", "demryte", "soopa", "ahi", "blahstid", "chohksawey" };

  string[] split = text.Split( ' ' );

  for ( int i = 0; i < split.Length; ++i )
     split[i] = humanWords[Utility.Random( humanWords.Length )];

  text = String.Join( " ", split );
  return true;
           }
         
         

           
        }

        for ( int i = 0; i < hears.Count; ++i )
        {
           object o = hears[i];

           if ( o != this && o is Mobile && ((Mobile)o).Skills[SkillName.SpiritSpeak].Value >= 100.0 )
              return false;
        }

        return base.MutateSpeech( hears, ref text, ref context );
     }


Script : http://www.runuo.com/discussion/viewtopic....ht=mutatespeech

Signé : Shariz l'ami des plus petits.

zedar - July 14, 2004 07:28 PM (GMT)
j ai repris ton mutatedSpeech et g trouver un petit probleme g du modifer le m_Race en m_Lang pour l addapter a mon serveur...


Bon le probleme que j ai recontré avec plusieur essay avec Uodouble (peu me connecter avec 2 meme client 2D sur le meme pc)


quand on porte un chapeau (chapeau du mage quand g tester) le mutated speech ne fonctionne pas sa peu venir de mes legeres modif; je ne pence pas donc il a une cou..llle dans le pater on dirait... je vais regarder un peu plus le code pour trouver une solution. :unsure:

je pence qu il faut modifier
if(this.m_Race==RaceType.Orc && this.FindItemOnLayer( Layer.Helm ) == null )
et ajouter un trus ou si m_race c un orc et qu il porte un chapeau sa serrai la solution




Hosted for free by InvisionFree