Advertisement
Guest User

Voices And Stoof

a guest
Nov 26th, 2011
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.84 KB | None | 0 0
  1. function openAura.schema:ChatBoxAdjustInfo(info)
  2.  
  3.     if (info.class != "ooc" and info.class != "looc") then
  4.  
  5.         if ( IsValid(info.speaker) and info.speaker:HasInitialized() ) then
  6.  
  7.             if (string.sub(info.text, 1, 1) == "?") then
  8.  
  9.                 info.text = string.sub(info.text, 2);
  10.  
  11.                 info.data.anon = true;
  12.  
  13.             end;
  14.  
  15.         end;
  16.  
  17.     end;
  18.  
  19.    
  20.  
  21.     if (info.class == "ic" or info.class == "yell" or info.class == "radio" or info.class == "whisper" or info.class == "request") then
  22.  
  23.         if ( IsValid(info.speaker) and info.speaker:HasInitialized() ) then
  24.  
  25.             local playerIsCombine = self:PlayerIsCombine(info.speaker);
  26.  
  27.            
  28.  
  29.             if ( playerIsCombine and self:IsPlayerCombineRank(info.speaker, "SCN") ) then
  30.  
  31.                 for k, v in pairs(self.dispatchVoices) do
  32.  
  33.                     if ( string.lower(info.text) == string.lower(v.command) ) then
  34.  
  35.                         local voice = {
  36.  
  37.                             global = false,
  38.  
  39.                             volume = 90,
  40.  
  41.                             sound = v.sound
  42.  
  43.                         };
  44.  
  45.                        
  46.  
  47.                         if (info.class == "request" or info.class == "radio") then
  48.  
  49.                             voice.global = true;
  50.  
  51.                         elseif (info.class == "whisper") then
  52.  
  53.                             voice.volume = 80;
  54.  
  55.                         elseif (info.class == "yell") then
  56.  
  57.                             voice.volume = 100;
  58.  
  59.                         end;
  60.  
  61.                        
  62.  
  63.                         info.text = "<:: "..v.phrase;
  64.  
  65.                         info.voice = voice;
  66.  
  67.                        
  68.  
  69.                         return true;
  70.  
  71.                     end;
  72.  
  73.                 end;
  74.  
  75.             else
  76.  
  77.                 for k, v in pairs(self.combine1voices) do --[[I need it so that it uses both "self.combine1voices" and "self.human1voices"]]--
  78.                     if ( (v.faction == "Combine" and playerIsCombine) or (v.faction == "Human" and !playerIsCombine) ) then
  79.                         if ( string.lower(info.text) == string.lower(v.command) ) then
  80.                             local voice = {
  81.                                 global = false,
  82.                                 volume = 80,
  83.                                 sound = v.sound
  84.                             };
  85.        
  86.                             if (v.female and info.speaker:QueryCharacter("gender") == GENDER_FEMALE) then
  87.                                 voice.sound = string.Replace(voice.sound, "/male", "/female");
  88.                             end;
  89.                            
  90.                             if (info.class == "request" or info.class == "radio") then
  91.                                 voice.global = true;
  92.                             elseif (info.class == "whisper") then
  93.                                 voice.volume = 60;
  94.                             elseif (info.class == "yell") then
  95.                                 voice.volume = 100;
  96.                             end;
  97.                            
  98.                             if (playerIsCombine) then
  99.                                 info.text = "<:: "..v.phrase;
  100.                             else
  101.                                 info.text = v.phrase;
  102.                             end;
  103.                            
  104.                             info.voice = voice;
  105.                            
  106.                             return true;
  107.                         end;
  108.                     end;
  109.                 end;
  110.             end;
  111.            
  112.             if (playerIsCombine) then
  113.                 if (string.sub(info.text, 1, 4) != "<:: ") then
  114.                     info.text = "<:: "..info.text;
  115.                 end;
  116.             end;
  117.         end;
  118.     elseif (info.class == "dispatch") then
  119.         for k, v in pairs(self.dispatchVoices) do
  120.             if ( string.lower(info.text) == string.lower(v.command) ) then
  121.                 openAura.player:PlaySound(nil, v.sound);
  122.                
  123.                 info.text = v.phrase;
  124.                
  125.                 return true;
  126.             end;
  127.         end;
  128.  end;
  129. end;
  130.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement