Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //! zinc
- library SpeechSystem requires Users,TimerUtils,Functions{
- boolean SoundInUse = false;
- force Silence_Force = CreateForce();
- sound Titan_Speech[];
- sound Builder_Speech[];
- function onSilence() -> boolean{
- player p=GetTriggerPlayer();
- string s=GetEventPlayerChatString();
- if (s=="-silence"){
- sayPlayer(p,"|c00cfb549Player Speech:|r Off");
- ForceAddPlayer(Silence_Force,p);
- }else if (s=="-unsilence"){
- sayPlayer(p,"|c00cfb549Player Speech:|r On");
- ForceRemovePlayer(Silence_Force,p);
- }
- p=null;
- return false;
- }
- function getTitanSound(string text) -> sound{
- sound s=Titan_Speech[S2I(text)];
- if (s==null){return null;}
- return s;
- }
- function getBuilderSound(string text) -> sound{
- sound s=Builder_Speech[S2I(text)];
- if (s==null){return null;}
- return s;
- }
- struct Data{
- sound soundHandle;
- }
- function onTimer(){
- timer t=GetExpiredTimer();
- Data this=GetTimerData(t);
- SoundInUse=false;
- this.destroy();
- ReleaseTimer(t);
- t=null;
- }
- function onAction() -> boolean{
- Data this=Data.create();
- player p=GetTriggerPlayer();
- timer t=NewTimer();
- integer id=GetPlayerId(p);
- integer d;
- string s=GetEventPlayerChatString();
- sound h;
- if (SoundInUse==false){
- if (isBuilder[id]==true){h=getBuilderSound(s);}
- else if (isTitan[id]==true){h=getTitanSound(s);}
- if (h!=null){
- SoundInUse=true;
- d=GetSoundDuration(h);
- this.soundHandle=h;
- SetTimerData(t,integer(this));
- TimerStart(t,d,false,function onTimer);
- if (IsPlayerInForce(GetLocalPlayer(),Silence_Force)==false){SoundStart(h);}
- }
- }
- p=null;
- t=null;
- h=null;
- return false;
- }
- function speechVariable(){
- timer t=GetExpiredTimer();
- //Builder Speech
- Builder_Speech[S2I("im waiting")]=gg_snd_Builder_ImWaiting;
- Builder_Speech[S2I("this is too easy")]=gg_snd_Builder_ThisIsTooEasy;
- Builder_Speech[S2I("by the gods")]=gg_snd_Builder_ByTheGodsYourAnnoying;
- Builder_Speech[S2I("aahh")]=gg_snd_Builder_Aahh;
- Builder_Speech[S2I("what")]=gg_snd_Builder_What;
- Builder_Speech[S2I("begone")]=gg_snd_Builder_BeGoneSpawnOfDarkness;
- Builder_Speech[S2I("i grow tired of waiting")]=gg_snd_Builder_IGrowTiredOfWaiting;
- Builder_Speech[S2I("lolol")]=gg_snd_Builder_Lolol;
- Builder_Speech[S2I("huh")]=gg_snd_Builder_Huh;
- Builder_Speech[S2I("yes")]=gg_snd_Builder_Yes;
- Builder_Speech[S2I("why not")]=gg_snd_Builder_WhyNot;
- Builder_Speech[S2I("bring it on")]=gg_snd_Builder_BringItOn;
- Builder_Speech[S2I("time to die")]=gg_snd_Builder_TimeToDie;
- Builder_Speech[S2I("let me at them")]=gg_snd_Builder_LetMeAtThem;
- Builder_Speech[S2I("youve done well")]=gg_snd_Builder_YouveDoneWell;
- Builder_Speech[S2I("lets get the hell out of here")]=gg_snd_Builder_LetsGetTheHellOutOfHere;
- Builder_Speech[S2I("no not that way")]=gg_snd_Builder_NoNotThatWay;
- Builder_Speech[S2I("to hell with your apologies")]=gg_snd_Builder_ToHellWithYourApologies;
- Builder_Speech[S2I("then lets go")]=gg_snd_Builder_ThenLetsGoIDontWantToKeepTheBastardWaiting;
- Builder_Speech[S2I("damned cowards")]=gg_snd_Builder_DamnedCowards;
- Builder_Speech[S2I("you bastard")]=gg_snd_Builder_YouBastard;
- Builder_Speech[S2I("what the hell is that")]=gg_snd_Builder_WhatTheHellIsThat;
- Builder_Speech[S2I("here they come boys")]=gg_snd_Builder_HereTheyComeBoysStandYourGround;
- Builder_Speech[S2I("take cover")]=gg_snd_Builder_TakeCover;
- Builder_Speech[S2I("hes escaping")]=gg_snd_Builder_HesEscapingKillHim;
- Builder_Speech[S2I("save us")]=gg_snd_Builder_SaveUs;
- Builder_Speech[S2I("oh no")]=gg_snd_Builder_OhNo;
- Builder_Speech[S2I("where")]=gg_snd_Builder_Where;
- Builder_Speech[S2I("damn beasts")]=gg_snd_Builder_DamnBeasts;
- Builder_Speech[S2I("im so tired")]=gg_snd_Builder_ImSoTired;
- Builder_Speech[S2I("demon spawned wretchs")]=gg_snd_Builder_DemonSpawnedWretchs;
- Builder_Speech[S2I("kill them all twice")]=gg_snd_Builder_KillThemAllTwice;
- Builder_Speech[S2I("panda")]=gg_snd_Builder_Panda;
- //Titan Speech
- Titan_Speech[S2I("this one is mine")]=gg_snd_Titan_ThisOneIsMine;
- Titan_Speech[S2I("vanquish the weak")]=gg_snd_Titan_VanquishTheWeak;
- Titan_Speech[S2I("dont waste my time")]=gg_snd_Titan_DontWasteMyTime;
- Titan_Speech[S2I("right")]=gg_snd_Titan_Right;
- Titan_Speech[S2I("of course")]=gg_snd_Titan_OfCourse;
- Titan_Speech[S2I("stay out of my way")]=gg_snd_Titan_StayOutOfMyWay;
- Titan_Speech[S2I("pitiful")]=gg_snd_Titan_Pitiful;
- Titan_Speech[S2I("i must feed")]=gg_snd_Titan_IMustFeed;
- Titan_Speech[S2I("im always on the winning side")]=gg_snd_Titan_ImAlwaysOnTheWinningSide;
- Titan_Speech[S2I("die")]=gg_snd_Titan_Die;
- Titan_Speech[S2I("your soul is mine")]=gg_snd_Titan_YourSoulIsMine ;
- Titan_Speech[S2I("outstanding")]=gg_snd_Titan_Outstanding;
- Titan_Speech[S2I("cross over children")]=gg_snd_Titan_CrossOverChildrenCrossOverIntoTheLight;
- Titan_Speech[S2I("i come to cleanse")]=gg_snd_Titan_IComeToCleansThisLand;
- Titan_Speech[S2I("taste this")]=gg_snd_Titan_TasteThis;
- Titan_Speech[S2I("the dead shall serve")]=gg_snd_Titan_TheDeadShallServe;
- Titan_Speech[S2I("let blood drown the weak")]=gg_snd_Titan_LetBloodDrownedTheWeak;
- Titan_Speech[S2I("now feel my wrath")]=gg_snd_Titan_NowFeelMyWrath;
- Titan_Speech[S2I("never")]=gg_snd_Titan_Never;
- Titan_Speech[S2I("what the hell")]=gg_snd_Titan_WhatTheHellIsGoingOnHere;
- Titan_Speech[S2I("kill them all")]=gg_snd_Titan_KillThemAll;
- Titan_Speech[S2I("youve betrayed us all")]=gg_snd_Titan_YouveBetrayedUsAll;
- Titan_Speech[S2I("you should burn")]=gg_snd_Titan_YouShouldBurnInHell;
- Titan_Speech[S2I("gladly")]=gg_snd_Titan_Gladly;
- Titan_Speech[S2I("fateless coward")]=gg_snd_Titan_FatelessCoward;
- Titan_Speech[S2I("its a trap")]=gg_snd_Titan_ItsATrap;
- Titan_Speech[S2I("that doesnt sound too difficult")]=gg_snd_Titan_ThatDoesntSoundTooDifficult;
- Titan_Speech[S2I("your time has come")]=gg_snd_Titan_YourTimeHasCome;
- Titan_Speech[S2I("well see about that")]=gg_snd_Titan_WellSeeAboutThat;
- Titan_Speech[S2I("so youre not upset")]=gg_snd_Titan_SoYoureNotUpsetAboutMeKillingYouThatOneTime;
- Titan_Speech[S2I("tremble mortals")]=gg_snd_Titan_TrembleMortals;
- Titan_Speech[S2I("haha")]=gg_snd_Titan_Haha;
- ReleaseTimer(t);
- t=null;
- }
- function onInit(){
- trigger t=CreateTrigger();
- trigger s=CreateTrigger();
- timer v=NewTimer();
- integer i=0;
- TimerStart(v,0.01,false,function speechVariable);
- while (i<bj_MAX_PLAYER_SLOTS){
- TriggerRegisterPlayerChatEvent(t,Player(i),"",false);
- TriggerRegisterPlayerChatEvent(s,Player(i),"-silence",true);
- TriggerRegisterPlayerChatEvent(s,Player(i),"-unsilence",true);
- i=i+1;
- }
- TriggerAddCondition(t,Condition(function onAction));
- TriggerAddCondition(t,Condition(function onSilence));
- t=null;
- s=null;
- v=null;
- }
- }
- //! endzinc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement