//Index Bieberfelde.script // //- VCmdInit //- VCmdZusatzeinsätze //- VCmdDebug //- FMS //- VCmdAlarm //- VCmdAufsitzen //- VCmdEinsteigen //- DeleteFahrzeug //- InstallELW // --- C-DIENST //- InstallCrane // --- RWK //- InstallTent // --- DEKON // --- MANV //- VCmdWarntafel // --- LRF //- VCmdASF_Bestatter //- VCmdTrain //- VCmdWechsellader //- VCmdABParken // //Variablen // //VCmdAlarm bool WACHE_1_SPRINGER = true; bool WACHE_2_SPRINGER = true; bool WACHE_1_ALARMSTUFE = false; bool WACHE_2_ALARMSTUFE = false; bool deinstall; bool rweinsatz=false; bool lrfeinsatz=false; bool zrtweinsatz=false; bool tlfeinsatz=false; Vector eingang; Vector wache; Vector wendep; Vector richtung; Vector parkpos; char AlarmString[7]; char FireResistance[3]; int ZUFALL; Person p; Actor eing; Actor fz; int DummyGroup_b = "23"; // // VCmdInit (Initialisierung der Fahrzeuge) // const int arleng=128; class Xmlutil: CommandScript { void init(GameObject obj,char * nam){ //Commands int add=GetIntegerArgfor(obj.GetName(),"_ac"); for(int i=0;i 1200) { v.SetSpeed(11.f); v.PushActionExecuteCommand(ACTION_APPEND,"VcmdSiren", &v); } else v.SetSpeed(4.f); } else if (v.IsBlueLightEnabled() && (Input::RCtrlPressed())) v.PushActionExecuteCommand(ACTION_APPEND, "VCmdBlue", &v, 0, false); v.PushActionMove(ACTION_APPEND,obj.GetPosition()); } }; object VCmdInit : CommandScript { VCmdInit() { SetIcon("standbyon"); SetCursor("standbyon"); SetValidTargets(ACTOR_VEHICLE); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle t(Caller); Vector richtung; t.SetCommandable(false); Vehicle v = Game::CreateVehicle(t.GetPrototypeFileName(), t.GetPrototypeName()); v.SetCommandable(false); if (Game::IsMultiplayer()) v.SetPlayerMP(t.GetPlayerMP()); v.SetSpeed(t.GetSpeed()); t.PushActionWait(ACTION_APPEND, 0.5f); t.PushActionDeleteOwner(ACTION_APPEND); ActorList a1; if(!v.HasName("01_84_01")) a1 = Game::GetActors(t.GetPrototypeName()); else a1 = Game::GetActors("CH31"); Actor fz = *a1.GetActor(0); Vector wache = fz.GetPosition(); v.RemoveCommand("GoHome"); v.RemoveCommand("VCmdInit"); v.AssignCommand("DUMMY_INIT"); v.AssignCommand("VCmdDebug"); v.AssignCommand("VCmdWarning"); v.AssignCommand("VCmdBlue"); v.AssignCommand("VCmdAlarm"); v.AssignCommand("VCmdEinsteigen"); v.AssignCommand("VCmdParking"); Xmlutil::init(v,v.GetName()); //BF-Wache 1 if (v.HasName("01_84_01")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); v.PushActionShowHide(ACTION_NEWLIST, true); } if (v.HasName("01_11_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(3); GameObject aSound = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "AlarmSound"); aSound.SetUserData(38); aSound.Hide(); VehicleList("ZugalarmW1").GetVehicle(0)->SetPlayerMP(v.GetPlayerMP()); //Kinoeasteregg Person p(PersonList("filmtyp").GetPerson(0)); p.SetRole(ROLE_SQUAD); p.SetCommandable(true); p.AssignCommand("ShowVideo"); } if (v.HasName("01_10_01")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(2); } if (v.HasName("01_58_01")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(3); } if (v.HasName("01_72_01")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(2); } if (v.HasName("01_71_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(2); } if (v.HasName("01_46_03")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(6); } if (v.HasName("01_24_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(6); } if (v.HasName("01_33_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(3); } if (v.HasName("01_46_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(6); } if (v.HasName("01_52_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(3); } if (v.HasName("01_65_01")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(2); } if (v.HasName("01_91_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(4); } if (v.HasName("01_93_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(6); } if (v.HasName("01_65_02")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(2); } if (v.HasName("AB_MANV")) { richtung = wache + Vector(-8000,0,0); } if (v.HasName("AB_DEKON")) { richtung = wache + Vector(8000,0,0); } if (v.HasName("AB_AS")) { richtung = wache + Vector(8000,0,0); } if (v.HasName("AB_MULDE")) { richtung = wache + Vector(8000,0,0); } if (v.HasName("10_00_00")) { v.AssignCommand("BF01"); richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(0); v.SetMaxTransports(0); } // RD Wache 1 if (v.HasName("01_82_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(2); } if (v.HasName("01_83_01") || v.HasName("01_83_02")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(4); v.SetMaxTransports(1); } if (v.HasName("01_83_03")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(4); v.SetMaxTransports(1); } if(v.HasName("01_83_02")) { if(zrtweinsatz) WACHE_1_SPRINGER = true; zrtweinsatz=false; } // FF Wache 3 if (v.HasName("03_46_01")) { GameObject helper(Game::GetGameObjects("P_03_46_01").GetObject(0)); helper.Show(); v.SetRotation(&helper); v.SetPosition(helper.GetPosition()); //helper.PushActionDeleteOwner(ACTION_NEWLIST); helper.Hide(); v.SetMaxPassengers(9); } if (v.HasName("03_45_01")) { GameObject helper(Game::GetGameObjects("P_03_45_01").GetObject(0)); helper.Show(); v.SetRotation(&helper); v.SetPosition(helper.GetPosition()); //helper.PushActionDeleteOwner(ACTION_NEWLIST); helper.Hide(); v.SetMaxPassengers(9); } if (v.HasName("03_62_01")) { GameObject helper(Game::GetGameObjects("P_03_62_01").GetObject(0)); helper.Show(); v.SetRotation(&helper); v.SetPosition(helper.GetPosition()); //helper.PushActionDeleteOwner(ACTION_NEWLIST); helper.Hide(); v.SetMaxPassengers(3); } if (v.HasName("03_19_01")) { GameObject helper(Game::GetGameObjects("P_03_19_01").GetObject(0)); helper.Show(); v.SetRotation(&helper); v.SetPosition(helper.GetPosition()); //helper.PushActionDeleteOwner(ACTION_NEWLIST); helper.Hide(); v.SetMaxPassengers(8); } // FF Wache 4 if (v.HasName("04_50_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(3); } if (v.HasName("04_19_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(8); } if (v.HasName("04_44_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(8); } if (v.HasName("04_46_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(9); } if (v.HasName("04_74_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(3); } // FF Wache 6 if (v.HasName("06_11_01")) { v.AssignCommand("FF03"); richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(2); v.Hide(); } if (v.HasName("06_46_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(9); v.Hide(); } if (v.HasName("06_24_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(6); v.Hide(); } if (v.HasName("06_46_02")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(9); v.Hide(); } // FF Wache 5 if (v.HasName("02_46_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(6); v.Hide(); } if (v.HasName("02_46_02")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(6); v.Hide(); } if (v.HasName("02_11_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(4); v.Hide(); } if (v.HasName("02_33_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(3); v.Hide(); } //Schlauchanschluss Dummy if(v.GetVehicleType()==VT_FIREFIGHTERS_GTF){ char dummy_nam[30]; snprintf(dummy_nam,30,"w_%s",v.GetName()); Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p",dummy_nam); } // RD Wache 11 if (v.HasName("11_00_00")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(0); v.SetMaxTransports(0); v.PushActionExecuteCommand(ACTION_NEWLIST,"ZZ_KHManager",&v,98,false); } if (v.HasName("11_50_00")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(0); v.SetMaxTransports(0); } if (v.HasName("11_10_01")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(2); } if (v.HasName("11_82_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(2); } if (v.HasName("11_82_02")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(2); } if (v.HasName("11_83_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); } if (v.HasName("11_83_02")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); } if (v.HasName("11_83_03")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); } if (v.HasName("11_83_04")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); } if (v.HasName("11_85_01")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); } if (v.HasName("11_85_02")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); } if (v.HasName("11_26_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); } if (v.HasName("11_26_02")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); } if (v.HasName("11_19_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(8); } if (v.HasName("11_28_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(6); } // RD Wache 12 if (v.HasName("12_82_01")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(2); } if (v.HasName("12_83_01") || v.HasName("12_83_02")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); } if (v.HasName("11_49_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(2); } // RD Wache 13 if (v.HasName("13_80_01") || v.HasName("13_83_01") || v.HasName("13_83_02")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); v.Hide(); } if (v.HasName("13_82_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(2); v.Hide(); } if (v.HasName("13_85_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(2); v.SetMaxTransports(1); v.Hide(); } // RD Wache 14 if (v.HasName("14_86_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(4); v.Hide(); } // RD Wache 15 if (v.HasName("15_82_01")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(2); v.Hide(); } if (v.HasName("15_83_01") || v.HasName("15_83_02")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(3); v.SetMaxTransports(1); v.Hide(); } if (v.HasName("15_89_01")) { v.AssignCommand("RD04"); richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(4); v.Hide(); } if (v.HasName("15_19_01")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(6); v.Hide(); } if (v.HasName("15_85_01") || v.HasName("15_85_02")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(4); v.SetMaxTransports(1); v.Hide(); } // Bademeister Segway if (v.HasName("00_99_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(1); v.RemoveCommand("VCmdBlue"); } // Polizei if (v.HasName("15_00_00")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(0); v.SetMaxTransports(0); } if (v.HasName("PP_10_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(2); v.SetMaxTransports(2); } if (v.HasName("PP_10_02")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(2); v.SetMaxTransports(2); } if (v.HasName("PP_10_03")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(2); v.SetMaxTransports(2); } if (v.HasName("PP_20_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(2); v.SetMaxTransports(2); } if (v.HasName("PP_20_04")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(2); v.SetMaxTransports(2); } if (v.HasName("PP_10_04")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(4); v.SetMaxTransports(4); } if (v.HasName("PP_10_05")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(2); v.SetMaxTransports(4); } if (v.HasName("PP_10_10")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(2); v.SetMaxTransports(0); v.Hide(); } if (v.HasName("PP_20_02")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(2); v.SetMaxTransports(4); } if (v.HasName("PP_10_06")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(1); v.SetMaxTransports(0); } if (v.HasName("PP_20_03")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(1); v.SetMaxTransports(0); } if (v.HasName("BS_01_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(6); v.SetMaxTransports(0); } if (v.HasName("BS_02_01")) { richtung = wache + Vector(0,-8000,0); v.SetMaxPassengers(2); v.SetMaxTransports(0); } if (v.HasName("BS_03_01")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(1); v.SetMaxTransports(12); v.RemoveCommand("VCmdBlue"); } if (v.HasName("PP_10_07") || v.HasName("PP_10_08")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(9); } if (v.HasName("PP_10_09")) { richtung = wache + Vector(0,8000,0); v.SetMaxPassengers(2); v.SetMaxTransports(2); } //BePo von außen if (v.HasName("PP_30_02")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(6); v.SetMaxTransports(0); v.Hide(); } if (v.HasName("PP_30_03")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(6); v.SetMaxTransports(0); v.Hide(); } if (v.HasName("PP_30_04")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(3); v.SetMaxTransports(0); v.Hide(); } if (v.HasName("PP_30_01")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(2); v.SetMaxTransports(12); v.Hide(); } if (v.HasName("PP_30_06")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(6); v.Hide(); } if (v.HasName("PP_30_07")) { richtung = wache + Vector(8000,0,0); v.SetMaxPassengers(6); v.Hide(); } if (v.HasName("KR_01_01")) { richtung = wache + Vector(-8000,0,0); v.SetMaxPassengers(1); v.Hide(); } if(v.HasChild("LM")) v.AssignCommand("VCmdLiMa"); if(v.HasChild("KR")) v.AssignCommand("VCmdWarn"); v.EnableTrafficLight(TLT_NONE); v.EnableBlinker(BLT_NONE); v.EnableSpecialLights(false); v.EnableHeadLights(false); v.EnableBlueLights(false); if(!v.HasNamePrefix("03_")) { v.SetPosition(wache); v.PushActionTurnTo(ACTION_APPEND, richtung); } if(!v.HasCommand("GF_Absitzen") && v.GetFreePassengers() > 0) v.AssignCommand("FahrzeugPosition"); v.PushActionWait(ACTION_APPEND, 0.5f); v.PushActionExecuteCommand(ACTION_APPEND,"ActionEmptyPF",&v,0,true); v.SetCommandable(true); v.PushActionExecuteCommand(ACTION_APPEND, "FMS", &v, 2, false); //INIT #Wasser v.PushActionExecuteCommand(ACTION_APPEND,"ZZ_Schnitt",&v,2,false); char speeds[10]; Game::GetGameString("civilspeed", speeds, 10); v.SetSpeed(Math::atof(speeds)); if (v.HasName("AB_MANV") || v.HasName("AB_AS") || v.HasName("AB_MULDE") || v.HasName("AB_DEKON")) v.RemoveCommand("VCmdAlarm"); if(v.GetVehicleType() == VT_AMBULANCE_RTW || v.HasName("01_84_01")) { if(v.IsChildEnabled("na")){v.SetChildEnabled("na", false);} if(v.IsChildEnabled("pol")){v.SetChildEnabled("pol", false);} if(v.IsChildEnabled("napol")){v.SetChildEnabled("napol", false);} if(v.IsChildEnabled("adi")){v.SetChildEnabled("adi", false);} } // Fahrzeuge von Außerhalb if (v.HasName("11_00_00") || v.HasName("10_00_00") || v.HasName("15_00_00") || v.HasName("11_50_00")) { v.EnableHeadLights(true); v.RemoveCommand("VCmdAlarm"); v.RemoveCommand("MoveTo"); v.RemoveCommand("VCmdWarning"); v.RemoveCommand("VCmdBlue"); v.RemoveCommand("VCmdParking"); v.RemoveCommand("VCmdEinsteigen"); } if ( v.HasName("02_11_01") || v.HasName("02_33_01") || v.HasName("02_46_01") || v.HasName("02_46_02") || v.HasName("06_11_01") || v.HasName("06_24_01") || v.HasName("06_46_01") || v.HasName("06_46_02") || v.HasName("13_80_01") || v.HasName("13_82_01") || v.HasName("13_83_01") || v.HasName("13_85_01") || v.HasName("13_83_02") || v.HasName("15_82_01") || v.HasName("15_83_01") || v.HasName("15_83_02") || v.HasName("15_89_01") || v.HasName("KR_01_01") || v.HasName("14_86_01") || v.HasName("PP_30_01") || v.HasName("PP_30_02") || v.HasName("PP_30_03") || v.HasName("PP_30_04") || v.HasName("PP_30_06") || v.HasName("PP_30_07") || v.HasName("15_85_01") || v.HasName("15_85_02") || v.HasName("PP_10_10")) { v.RemoveCommand("VCmdAlarm"); } } }; // // VCmdZusatzeinsätze // // INITIALISIERUNG DER ZUFALLSEINSÄTZE GameObject DummyObj; bool bereit=false; int EinsatzInit=0; VehicleList MarkerList; int MarkerIndex; GameObjectList Baumliste; int Sturmzeit; // EVENT-ID DES JEWEILIGEN ZUFALLSEINSATZES int EinsatzID=-1; //PUNKTE-ANZAHL DES JEWEILIGEN ZUFALLSEINSATZES int Punkte; Person pInjure; object Zufallseinsatz : CommandScript { Zufallseinsatz() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { System::Log("EINSAETZE: ZUFALLSEINSATZ: Start"); int Zufallszahl=Math::rand()%40; if ((bereit) && (EinsatzID<0)) { EinsatzInit++; if (Zufallszahl < EinsatzInit) { EinsatzInit=-25; Zufallszahl=Math::rand()%13;//schließt 0 aktuell aus switch (Zufallszahl) { case 0: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz Gefahrgut Start"); Game::ExecuteCommand("zufall_gefahrgut",Caller,Target); break; case 1: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz BMA Start"); Game::ExecuteCommand("bmaeinsatz",Caller,Target); break; case 2: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz OELSPUR Start"); Game::ExecuteCommand("oelspureinsatz",Caller,Target); break; case 3: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz PRETT Start"); Game::ExecuteCommand("pretteinsatz",Caller,Target); break; case 4: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz FEUUNKLAR Start"); Game::ExecuteCommand("feueinsatz",Caller,Target); break; case 5: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz RUHESTOERUNG Start"); Game::ExecuteCommand("ruhestoerung",Caller,Target); break; case 6: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz Mord Start"); Game::ExecuteCommand("Mord",Caller,Target); break; case 7: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz Bombenfund Start"); Game::ExecuteCommand("bombenfund",Caller,Target); break; case 8: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz Demo Start"); Game::ExecuteCommand("demo",Caller,Target); break; case 9: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz Zufalls-RD-EinsatzStart"); Game::ExecuteCommand("GenRD",Caller,Target); break; case 10: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz Vermisst Start"); Game::ExecuteCommand("Vermisst",Caller,Target); break; case 11: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz Betrunken Start"); Game::ExecuteCommand("Betrunken",Caller,Target); break; case 12: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz heimrauchmelder Start"); Game::ExecuteCommand("heimrauchmelder",Caller,Target); break; default: System::Log("ZUSATZEINSAETZE.SCRIPT: Zufallseinsatz BMA Start"); Game::ExecuteCommand("bmaeinsatz",Caller,Target); break; } } } else bereit=true; System::Log("EINSAETZE: ZUFALLSEINSATZ: Ende"); } }; /************************************************************Krankentransport************************************************************/ object KT_Start : CommandScript { KT_Start() { SetRestrictions(RESTRICT_SELFEXECUTE); SetIcon("install"); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { int h,m,s; Game::GetTime(h,m,s); if((h > 22 || h < 6) && Math::rand() % 100 < 75) return; int faktor = Math::rand() % 300; Vector housePos; int EinsatzID; bool ktr = false; if(faktor <150) { GameObjectList ol = Game::GetGameObjects("KH_KT"); GameObject house = ol.GetObject(0); if(house.HasCommand("KTEinsatz")) { Game::ExecuteCommand("KT_Start", Caller, Caller); return; } ktr = true; house.AssignCommand("KTEinsatz"); ActorList al = Game::GetActors("Notaufnahme"); housePos = al.GetActor(0)->GetPosition(); char * text="KT-R # Krankentransport (Rücktransport)"; EinsatzID=Game::ShowEvent("BHint_1201", housePos); house.SetUserData(EinsatzID); } else { GameObjectList ol = Game::GetGameObjects("PolEinsatz"); GameObject house = ol.GetObject(Math::rand() % ol.GetNumObjects()); if(house.HasCommand("KTEinsatz")) { Game::ExecuteCommand("KT_Start", Caller, Caller); return; } house.AssignCommand("KTEinsatz"); housePos = house.GetChildPosition("PolEinsatz"); char * text="KT # Krankentransport"; EinsatzID=Game::ShowEvent("BHint_1203", housePos); house.SetUserData(EinsatzID); } Mission::PlayHint("BHint_1202"); Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTP04"); Person patient; if(Math::rand() % 10 < 5) patient = Game::CreatePerson("mod:prototypes/Persons/Civil/civilman03_grey.e4p","Patient_KT"); else patient = Game::CreatePerson("mod:prototypes/Persons/Civil/civilwoman03_blue.e4p","Patient_KT"); patient.SetPosition(housePos); patient.PushActionShowHide(ACTION_NEWLIST, true); patient.Injure(INJUREREASON_UNKNOWN, false); if(Math::rand() % 100 < 15 && !ktr) patient.SetLife(Math::rand()%900+100); else { patient.SetLife(Math::rand()%100+900); patient.SetInjuredLifeDrain(0.f); } patient.SetClassified(true); patient.SetUserData(EinsatzID); if(Math::rand() % 100 < 40 || ktr) patient.AssignCommand("KTAusserhalb"); } }; object KTAufnehmen : CommandScript { KTAufnehmen() { } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Person p(Caller); GameObject targetHouse(Target); switch(ChildID) { case 0: { int id = targetHouse.GetUserData(); PersonList pl("Patient_KT"); for(int i = 0; i < pl.GetNumPersons(); i++) { Person patient = pl.GetPerson(i); if(patient.GetUserData() == id) { p.PushActionLift(ACTION_APPEND, &patient); p.SetUserData(id); patient.SetUserData(patient.GetLife()); p.PushActionExecuteCommand(ACTION_APPEND, "KTAufnehmen", Target, 1, false); } } } break; case 1: { p.SetCommandable(true); targetHouse.RemoveCommand("KTEinsatz"); targetHouse.SetUserData(0); if(targetHouse.HasName("PolEinsatz")) p.PushActionMove(ACTION_NEWLIST, targetHouse.GetChildPosition("ausgang")); else { ActorList al = Game::GetActors("Krankenhaus"); p.PushActionMove(ACTION_NEWLIST, al.GetActor(0)->GetPosition()); } } break; } } }; /************************************Heimrauchmelder************************************/ object heimrauchmelder : CommandScript { heimrauchmelder() { SetRestrictions(RESTRICT_SELFEXECUTE); SetIcon("ruhe"); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return EinsatzID==-1&&Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(EinsatzID < 0) { GameObjectList ol = Game::GetGameObjects("Heim"); GameObject house = ol.GetObject(Math::rand() % ol.GetNumObjects()); Vector housePos = house.GetPosition(); house.AssignCommand("Heim"); house.AssignCommand("HeimAktiv"); int sound = Math::rand()%7; char pfad[256]; if(sound == 6) { int ref = Audio::PlaySample3D("mod:Audio/FX/Ambiente/Heimrauchmelder1.wav", housePos, true); }else{ snprintf(pfad, 256, "mod:Audio/FX/Ambiente/Heimrauchmelder2.wav", sound); int ref = Audio::PlaySample3D(pfad, housePos, true); } house.SetUserData(ref); char * text="BRAND // Heimrauchmelder ausgeloest"; EinsatzID=Game::ShowEvent("BRAND // Heimrauchmelder ausgeloest", housePos); Mission::PlayHint("BRAND // Heimrauchmelder ausgeloest"); //Game::ExecuteCommand("estop", Caller,Caller); //Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTP07"); } } }; object heimrauchmelderAbschliessen : CommandScript { heimrauchmelderAbschliessen() { SetRestrictions(RESTRICT_SELFEXECUTE); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Person p(Caller); GameObject house(Target); int Zufall = Math::rand()%10; switch (Zufall) case 0: { { Game::SetEventFinished(EinsatzID, true, 1); EinsatzID=-1; EinsatzInit=0; //Game::ExecuteCommand("estart", Caller,Caller); Audio::StopSample(Target->GetUserData()); house.RemoveCommand("Heim"); house.RemoveCommand("HeimAktiv"); house.SetUserData(0); Mission::PlayHint("Keine weitere Feststellung! Einsatz fuer die Feuerwehr beendet!"); p.SetCommandable(true); p.PushActionMove(ACTION_NEWLIST, house.GetChildPosition("ausgang")); } break; case 1: { if (house.HasFireChilds() ) { int fx=Math::rand()%house.GetNumFireChilds(); FireObject fob=house.GetFireChild(fx); house.SetFireObjectBurning(fob.GetName()); } Mission::PlayHint("Fuck. Es brennt wirklich, so holt doch einer die Feuerwehr!"); Audio::PlaySample("mod:Audio/FX/voices/Heimrauchmelder_true.wav"); p.SetCommandable(true); p.PushActionMove(ACTION_NEWLIST, house.GetChildPosition("ausgang")); } break; default: { Game::SetEventFinished(EinsatzID, true, 1); EinsatzID=-1; EinsatzInit=0; //Game::ExecuteCommand("estart", Caller,Caller); Audio::StopSample(Target->GetUserData()); house.RemoveCommand("Heim"); house.RemoveCommand("HeimAktiv"); house.SetUserData(0); Mission::PlayHint("Keine weitere Feststellung! Einsatz fuer die Feuerwehr beendet!"); p.SetCommandable(true); p.PushActionMove(ACTION_NEWLIST, house.GetChildPosition("ausgang")); } } } }; object CloseEvent : CommandScript { CloseEvent() { } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Game::SetEventFinished(EinsatzID, true, 1); } }; /************************************************************Sturmeinsatz************************************************************/ object Sturm : CommandScript { Sturm() { //SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(ChildID==0&&EinsatzID<0){ GameObjectList baeume=Game::GetGameObjects("baum"); if(baeume.GetNumObjects()>0){ int max=20; int anz=Math::rand()%max; GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p","Stormcatcher"); obj.SetUserData(anz); for(int i=0;i0;i++){ if(Math::rand()%2>0&&anz>0){ int treetype=Math::rand()%2+1; char proto[128];snprintf(proto,128,"mod:Prototypes/Objects/Trees/brokentree0%i%s.e4p",treetype,Math::rand()%2>0?"a":"b"); GameObject brok=Game::CreateObject(proto,"sturm"); float offsetback=300; float rot[9]; baeume.GetObject(i)->GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]); Vector offset(offsetback,0, 0); Math::RotateVector(offset.x, offset.y, offset.z, rot); brok.SetRotation(baeume.GetObject(i)); Xmlutil::DreheUm(brok,brok,180); brok.SetPosition(baeume.GetObject(i)->GetPosition()+offset); brok.Hide(); float wait=Math::rand()%300; brok.PushActionWait(ACTION_NEWLIST,wait); brok.PushActionShowHide(ACTION_APPEND,false); brok.PushActionExecuteCommand(ACTION_APPEND,"Sturm",&brok,1,false); brok.SetFlag(OF_CUTABLE); if(treetype==2){ GameObject stump=Game::CreateObject("mod:Prototypes/Objects/Trees/stump02a.e4p","Unnamed"); stump.SetPosition(baeume.GetObject(i)->GetPosition()); stump.Hide(); stump.PushActionWait(ACTION_NEWLIST,wait); stump.PushActionShowHide(ACTION_APPEND,false); } baeume.GetObject(i)->PushActionWait(ACTION_NEWLIST,wait); baeume.GetObject(i)->PushActionDeleteOwner(ACTION_APPEND); anz--; } } Weather::SetRainIntensity(1.0); Weather::SetStormIntensity(0.5); Weather::SetStormSpeed(0.4); Weather::SetRainVisible(true); Weather::SetStormVisible(true); obj.PushActionWait(ACTION_NEWLIST,300); obj.PushActionExecuteCommand(ACTION_APPEND,"Sturm",&obj,2,false); EinsatzID=Game::ShowEvent("BHint_1172", NULLVECTOR); Mission::PlayHint("BHint_117"); Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTP09"); }else System::Log("@Sturm: Missing Trees"); }else if(ChildID==1){ ActorList al; if(Game::GetPotentialCollisions(Caller, al, 30, ACTOR_PERSON|ACTOR_VEHICLE)){ for(int i=0;iGetType()==ACTOR_PERSON){System::Log("@Sturm: Collision Person"); Person p(al.GetActor(i));p.AssignCommand("Sturm"); p.Injure(INJUREREASON_UNKNOWN, false); p.SetLife(Math::rand()%500+500); }else if(al.GetActor(i)->GetType()==ACTOR_VEHICLE){System::Log("@Sturm: Collision Vehicle"); Vehicle v(al.GetActor(i)); if(v.IsCivilCar()){ v.AssignCommand("Sturm"); if(v.IsValid()){ Vehicle v2=Game::CreateVehicle("mod:prototypes/Vehicles/_wrecks/wrecktest_01.e4p","sturm"); System::Log("@Sturm: Collision build"); v2.SetPosition(v.GetPosition()); v2.SetRotation(&v); System::Log("@Sturm: Collision posed"); PersonList pl=v.GetPassengers(); for(int i=0;iPushActionLeaveCar(ACTION_NEWLIST,&v);} System::Log("@Sturm: Collision Passengers"); pl=v.GetTransports(); for(int i=0;iPushActionLeaveCar(ACTION_NEWLIST,&v);} System::Log("@Sturm: Collision Transportss"); v.PushActionWait(ACTION_NEWLIST,3); v.PushActionDeleteOwner(ACTION_APPEND); v2.Show(); System::Log("@Sturm: Collision Vehicle end"); char pnam[32];char pproto[128];snprintf(pnam,32,"%i",v.GetID());snprintf(pproto,128,"mod:Prototypes/Persons/Civil/Civil (%i).e4p",Math::rand()%6+1); Person p=Game::CreatePerson(pproto,pnam); System::Log("@Sturm: ppc build"); if(p.IsValid()){ p.Injure(INJUREREASON_UNKNOWN, false); p.SetLife(Math::rand()%500+500); p.SetPosition(v.GetPosition()); p.PushActionWait(ACTION_NEWLIST,5.0); System::Log("@Sturm: ppc2 build"); p.PushActionExecuteCommand(ACTION_APPEND,"Sturm",&v2,3,false); System::Log("@Sturm: Personenc build"); }//END if(p.IsValid) }//END if(v.IsValid) }//END if(not squad) }//END else if }System::Log("@Sturm: Collision end"); } } Caller->UnfreezePhysics(); Audio::PlaySample3D("mod:Audio/FX/misc/treefall01.wav",Caller->GetPosition()); Caller->SetUserData(Game::ShowEvent("TH # Sturmschaeden", Caller->GetPosition())); Mission::PlayHint("BHint_118"); Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTP10"); }else if(ChildID==2){ if(Game::GetGameObjects("sturm").GetNumObjects()==0){ Weather::SetRainIntensity(0); Weather::SetStormIntensity(0); Weather::SetStormSpeed(0); Game::SetEventFinished(EinsatzID,true,1);EinsatzID=-1; }else Caller->PushActionExecuteCommand(ACTION_APPEND,"Sturm",Caller,2,false); }else if(ChildID==3){System::Log("Penis"); Vehicle(Target).SetEnclosedPerson(Caller->GetName()); } } }; object CloseEvent : CommandScript { CloseEvent() { } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Game::SetEventFinished(ChildID,true,1); } }; /************************************************************Gefahrguteinsatz************************************************************/ object zufall_gefahrgut : CommandScript { zufall_gefahrgut() { SetIcon("gg_schild_lesen"); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(EinsatzID<0) { Vector gsgpos; char name[32]; snprintf(name, 32, "gsg%i", Math::rand()%11); GameObjectList gol = Game::GetGameObjects(name); if(gol.GetNumObjects() > 0) { for(int y=0; y 0) { for(int i=0; iIsValid() || Caller->GetType() != ACTOR_PERSON) return false; if (p.IsContaminated() || p.IsCarryingPerson() || p.IsLinkedWithPerson() || p.IsPulling() || p.IsEquipped() || p.GetEnteredCarID() !=-1) return false; if (p.HasCommand("Geraet_installiert")) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() == Caller->GetID()) return false; GameObject obj(Target); return (obj.HasCommand("gefahrgut") && obj.HasCommand("has_leck")); } void PushActions(GameObject *Caller, Actor *Target, int childID) { Person p(Caller); GameObject obj(Target); p.PushActionMove(ACTION_APPEND,Target,TARGET_ANY); p.PushActionSwitchAnim(ACTION_APPEND, "pumping_water"); p.PushActionWait(ACTION_APPEND, 10); p.PushActionExecuteCommand(ACTION_APPEND, "RemoveObjectInHand",Caller,0,false); p.PushActionSwitchAnim(ACTION_APPEND, "idle"); p.PushActionExecuteCommand(ACTION_APPEND, "RemoveContamination", &obj, 0, false); p.PushActionExecuteCommand(ACTION_APPEND, "EinsatzAbschliessen", &obj, 0, false); } }; object RemoveContamination : CommandScript { RemoveContamination() { } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Person p(Caller); p.RemoveCommand("leck_abdichten_zufall"); p.AssignCommand("GetDichtmittel"); GameObject obj(Target); obj.RemoveContaminationArea(); char childs[16]; snprintf(childs, 16, "%s_contam", obj.GetName()); GameObjectList objs = Game::GetGameObjects(childs); for(int i=0; iHide(); } } }; /************************************************************BMA************************************************************/ object bmaeinsatz : CommandScript { bmaeinsatz() { SetRestrictions(RESTRICT_SELFEXECUTE); SetIcon("bmaeinsatz"); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if (EinsatzID < 0) { VehicleList bl(VT_THW_FGRR_RL,VT_THW_FGRR_RL); Vehicle bma; int x=Math::rand()%bl.GetNumVehicles(); bma=bl.GetVehicle(x); Punkte=500; bool feuer=false; if ((Math::rand()%20)> 15) { GameObjectList ol; GameObject obj; FireObjectList fol; FireObject fob; bool open=false; Punkte=3000; Game::CollectObstaclesOnVirtualObject(bma.GetName(),ol, ACTOR_PERSON|ACTOR_OBJECT|ACTOR_OPEN_HOUSE|ACTOR_HOUSE); for (int bx=0;(bx0) { GameObjectList ol; GameObject obj; Game::CollectObstaclesOnVirtualObject(bma.GetName(),ol, ACTOR_PERSON); } Punkte=Punkte+1000; bma.EnableSpecialLights(true); int ZZAHL = (Math::rand()%5+1); char * BMA_SOUND=" "; int j=snprintf(BMA_SOUND,50,"mod:Audio/FX/Ambiente/BMA_0%u.wav",ZZAHL); int soundID = Audio::PlaySample3D(BMA_SOUND,bma.GetPosition(),true); bma.AttachSound(soundID); char * text=" "; char * format[]="%s"; int j=snprintf(text,50,format,bma.GetName()); Mission::PlayHint(text); char * BMAMELDUNG=" "; int j=snprintf(BMAMELDUNG,50,"%s --1--",bma.GetName()); System::Log(BMAMELDUNG); Vector BMAPosition=bma.GetPosition(); EinsatzID=Game::ShowEvent("BHint_16", BMAPosition); Mission::PlayHint("BHint_16"); Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTP01"); //ScriptInterface::ShowBriefing(); //ScriptInterface::OpenObjectives(); } } }; object bmaeinsatz_scharf : CommandScript { bmaeinsatz_scharf() { SetGroupID(20); } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { return false; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vehicle bma(Target); bma.Hide(); bool feuer=false; GameObjectList ol; GameObject obj; Game::CollectObstaclesOnVirtualObject(bma.GetName(),ol, ACTOR_OBJECT|ACTOR_HOUSE|ACTOR_OPEN_HOUSE); for (int i=0;(iGetType()==ACTOR_VEHICLE) { Vehicle v(Target); if (Caller->HasCommand("ich_bin_ein_einsatzleiter") && (v.GetVehicleType()==VT_THW_FGRR_RL)) { if (v.IsSpecialLightEnabled()) return true; else return false; } else return false; } else return false; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Person p(Caller); Vehicle v(Target); if(v.HasChild("BMA_POS")) Vector pos = v.GetChildPosition("BMA_POS"); else Vector pos = v.GetPosition(); Caller->PushActionMove(ACTION_NEWLIST,Target,TARGET_ANY); Caller->PushActionExecuteCommand(ACTION_APPEND,"BMA_DOOR",Target,1,false); Caller->PushActionExecuteCommand(ACTION_APPEND,"bmaeinsatz_reset",Target,0,false); Caller->PushActionWait(ACTION_APPEND,3.0f); Caller->PushActionExecuteCommand(ACTION_APPEND,"BMA_DOOR",Target,2,false); } }; object BMA_DOOR : CommandScript { BMA_DOOR() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Target); switch(childID) { case 1: { v.SetAnimation("open"); break; } case 2: { v.SetAnimation("close"); break; } } } }; /************************************************************Ölspureinsatz************************************************************/ object oelspureinsatz : CommandScript { oelspureinsatz() { SetRestrictions(RESTRICT_SELFEXECUTE); SetIcon("oelspur"); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(EinsatzID < 0) { int oelID = Math::rand() % 6 + 1; char oelName[6]; snprintf(oelName, 6, "oel_%i", oelID); if(oelID == 5) { Game::ExecuteCommand("estop", Caller,Caller); } VehicleList vl(oelName); Vehicle Oelspur0 = vl.GetVehicle(0); for(int i=0; iShow(); } Vector OelspurPos = Oelspur0.GetPosition(); char * text="TH-OEL # Ölspur"; EinsatzID=Game::ShowEvent("BHint_122", OelspurPos); Mission::PlayHint("BHint_122"); Mission::PlayComment("ID_SUPERV_EVENTP02");//mod:Lang/de/Melder/ } } }; /************************************************************P-Rett DLK************************************************************/ object pretteinsatz : CommandScript { pretteinsatz() { SetRestrictions(RESTRICT_SELFEXECUTE); SetIcon("prett"); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(EinsatzID < 0) { PersonList pl("prett"); Person patient = pl.GetPerson(Math::rand()%pl.GetNumPersons()); patient.Injure(INJUREREASON_UNKNOWN, false); patient.SetLife(Math::rand()%400+600); Vector PrettPos = patient.GetPosition(); char * text="P-RETT DLK # Medizinischer Notfall"; EinsatzID=Game::ShowEvent("BHint_15", PrettPos); patient.SetUserData(EinsatzID); Mission::PlayHint("BHint_15"); Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTP05"); } } }; /************************************************************Unklare Feuermeldung************************************************************/ object feueinsatz : CommandScript { feueinsatz() { SetRestrictions(RESTRICT_SELFEXECUTE); SetIcon("funbekannt"); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { EinsatzID = 0; GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "feuereinsatz"); mDummy.Hide(); GameObject *o1; GameObjectList ol; int rand = Math::rand() % 100; if(rand > 60) { ol = Game::GetGameObjects("feu"); rand = Math::rand() % ol.GetNumObjects(); o1 = *ol.GetObject(rand); } else { bool burnable = false; ol = Game::GetGameObjects(TYPE_OBJECT); while(!burnable) { rand = Math::rand() % ol.GetNumObjects(); o1 = *ol.GetObject(rand); if(o1->HasFireChilds()) burnable = true; } } rand = Math::rand() % 100; GameObject feuer(o1); if(rand > 20) feuer.Burn(); mDummy.PushActionWait(ACTION_NEWLIST, Math::rand() %180 + 20); mDummy.PushActionExecuteCommand(ACTION_APPEND, "melderfeu", &feuer, 0, false); } }; object melderfeu : CommandScript { melderfeu() { SetRestrictions(RESTRICT_SELFEXECUTE); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vector Pos = Target->GetPosition(); char * text="FEU 1 # Unklare Feuermeldung"; EinsatzID = Game::ShowEvent(text, Pos); Mission::PlayHint("BHint_121"); Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENT33"); GameObject mDummy(Caller); mDummy.PushActionWait(ACTION_NEWLIST, 120.f); mDummy.PushActionExecuteCommand(ACTION_APPEND, "FeuereinsatzAbschliessen", &mDummy, 0, false); } }; object FeuereinsatzAbschliessen : CommandScript { FeuereinsatzAbschliessen() { SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { GameObject mDummy(Caller); if(Mission::GetCounter("Burning Objects") == 0) { Game::SetEventFinished(EinsatzID, true, 1); EinsatzID=-1; EinsatzInit=0; Game::ExecuteCommand("estart", Caller,Caller); mDummy.PushActionDeleteOwner(ACTION_NEWLIST); }else{ mDummy.PushActionWait(ACTION_NEWLIST, 60.f); mDummy.PushActionExecuteCommand(ACTION_APPEND, "FeuerEinsatzAbschliessen", &mDummy, 0, false); } } }; object EinsatzAbschliessen : CommandScript { EinsatzAbschliessen() { SetGroupID(CGROUP_GETEQUIPMENT); SetIcon("ende"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Game::SetEventFinished(EinsatzID, true, 1); EinsatzID=-1; EinsatzInit=0; Game::ExecuteCommand("estart", Caller,Caller); } }; /************************************************************Ruhestörung************************************************************/ object ruhestoerung : CommandScript { ruhestoerung() { SetRestrictions(RESTRICT_SELFEXECUTE); SetIcon("ruhe"); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return EinsatzID==-1&&Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(EinsatzID < 0) { GameObjectList ol = Game::GetGameObjects("PolEinsatz"); GameObject house = ol.GetObject(Math::rand() % ol.GetNumObjects()); Vector housePos = house.GetPosition(); house.AssignCommand("PolEinsatz"); house.AssignCommand("PolEinsatzAktiv"); int sound = Math::rand()%6; char pfad[256]; if(sound == 6) { int ref = Audio::PlaySample3D("mod:Audio/FX/Polizei/Ruhestörung0.wav", housePos, true); }else{ snprintf(pfad, 256, "mod:Audio/FX/Polizei/Ruhestörung%i.wav", sound); int ref = Audio::PlaySample3D(pfad, housePos, true); } house.SetUserData(ref); char * text="POL # Ruhestörung"; EinsatzID=Game::ShowEvent("BHint_115", housePos); Mission::PlayHint("BHint_115"); Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTP07"); } } }; object ruhestoerungAbschliessen : CommandScript { ruhestoerungAbschliessen() { SetRestrictions(RESTRICT_SELFEXECUTE); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Game::SetEventFinished(EinsatzID, true, 1); EinsatzID=-1; EinsatzInit=0; Game::ExecuteCommand("estart", Caller,Caller); Audio::StopSample(Target->GetUserData()); Person p(Caller); GameObject house(Target); house.RemoveCommand("PolEinsatz"); house.RemoveCommand("PolEinsatzAktiv"); house.SetUserData(0); p.SetCommandable(true); p.PushActionMove(ACTION_NEWLIST, house.GetChildPosition("ausgang")); } }; /************************************************************Mord************************************************************/ object Mord : CommandScript { Mord() { SetRestrictions(RESTRICT_SELFEXECUTE); SetIcon("Mord"); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(ChildID==0){ if(EinsatzID>0)return; PersonList pl(ROLE_CIVILIAN); Person opfer; int oid=Math::rand()%(pl.GetNumPersons()*2/3); for(int i=0;i-1;i++){ if(!pl.GetPerson(i)->IsDead()&&!pl.GetPerson(i)->IsInjured()&&pl.GetPerson(i)->IsInsideMap()){ if(oid==0){opfer=Person(pl.GetPerson(i));oid--; }else oid--; } } opfer.Kill(); opfer.AssignCommand("Mord"); GameObjectList objs=opfer.GetObjectsInRange(1000,ACTOR_OBJECT); int found=0; for(int i=0;iHasCommand("Mord")&&(Game::HasNamePrefix(objs.GetObject(i)->GetPrototypeFileName(),"mod:Prototypes/Objects/Hedge")||Game::HasNamePrefix(objs.GetObject(i)->GetPrototypeFileName(),"mod:Prototypes/Objects/Bushes")||Game::HasNamePrefix(objs.GetObject(i)->GetPrototypeFileName(),"mod:Prototypes/Objects/Street/Litter Box"))){ found++; } } if(found==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Equipment/gun.e4p","Mordwaffe"); Vector vec=obj.GetPosition(); Game::FindAvailablePosition(&obj,vec,1000,true); obj.Show(); obj.SetPosition(vec); obj.AssignCommand("Mord"); }else{ int pos=Math::rand()%found; for(int i=0;i-1;i++){ if(!objs.GetObject(i)->HasCommand("Mord")&&(Game::HasNamePrefix(objs.GetObject(i)->GetPrototypeFileName(),"mod:Prototypes/Objects/Hedge")||Game::HasNamePrefix(objs.GetObject(i)->GetPrototypeFileName(),"mod:Prototypes/Objects/Bushes")||Game::HasNamePrefix(objs.GetObject(i)->GetPrototypeFileName(),"mod:Prototypes/Objects/Street/Litter Box"))){ if(pos==0){ objs.GetObject(i)->AssignCommand("Mord"); GameObject obj=objs.GetObject(i)->GetClosestObjectInRange(500,10,ACTOR_PERSON); if(!Person(&obj).IsDead()&&!Person(&obj).IsInjured()&&Person(&obj).GetRole()==ROLE_CIVILIAN){ obj.SetAnimation("wavehelp"); obj.PushActionNOP(ACTION_NEWLIST); obj.AssignCommand("Mord"); } } pos--; } } } int zu=Math::rand()%3; switch(zu){ case 0: Mission::PlayComment("ID_SUPERV_EVENT21"); EinsatzID=Game::ShowEvent("ID_FREEPLAY_EVENT_HEARTATTACK", opfer.GetPosition()); break; case 1: Mission::PlayComment("ID_SUPERV_EVENT17"); EinsatzID=Game::ShowEvent("ID_FREEPLAY_EVENT_FALL", opfer.GetPosition()); break; case 2: Mission::PlayComment("ID_SUPERV_EVENT19"); EinsatzID=Game::ShowEvent("ID_FREEPLAY_EVENT_CIRCULATORY_COLLAPSE", opfer.GetPosition()); break; } } } }; /************************************************************Bombenfund************************************************************/ object bombenfund : CommandScript { bombenfund() { SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return EinsatzID==-1&&Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(ChildID==1){ if(EinsatzID==Caller->GetUserData())EinsatzID=-1; Game::SetEventFinished(Caller->GetUserData(),false,0); Caller->Burn(); } else if(EinsatzID < 0) { GameObjectList ol = Game::GetGameObjects("bombe"); GameObject house = ol.GetObject(Math::rand() % ol.GetNumObjects()); house.Show(); Vector housePos = house.GetPosition(); char * text="KAT # Bombenfund"; EinsatzID=Game::ShowEvent("BHint_114", housePos); Mission::PlayHint("BHint_114"); Mission::PlayComment("ID_SUPERV_EVENT14"); house.SetUserData(EinsatzID); house.PushActionWait(ACTION_APPEND,(Math::rand()%120)+300); house.PushActionExecuteCommand(ACTION_APPEND,"bombenfund",&house,1); } } }; object bombeentschaerfen : CommandScript { bombeentschaerfen() { SetIcon("entschaerfen"); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->IsValid()&&Target->IsValid()&&Target->HasName("bombe"); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(ChildID==0){ Person p(Caller); if (p.GetEnteredCarID() == -1) { Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_TOUCHPERSON); Caller->PushActionTurnTo(ACTION_APPEND, Target); } else { Person pt(Target); if (pt.GetEnteredHouseID() == p.GetEnteredCarTargetID()) { Caller->PushActionEnterHouse(ACTION_NEWLIST, pt.GetEnteredHouseID()); Caller->PushActionMove(ACTION_APPEND, Target, TARGET_TOUCHPERSON); Caller->PushActionTurnTo(ACTION_APPEND, Target); } else Caller->PushActionTurnTo(ACTION_NEWLIST, Target); } Caller->PushActionSwitchAnim(ACTION_APPEND,"kneeldown"); Caller->PushActionWait(ACTION_APPEND,(Math::rand()%60)+30); Caller->PushActionExecuteCommand(ACTION_APPEND,"bombeentschaerfen",Target,1,false); }else if(ChildID==1){ if(Math::rand()%20<1){ GameObject(Target).PushActionExecuteCommand(ACTION_NEWLIST,"bombenfund",Caller,1,false); }else{ GameObject(Target).PushActionDeleteOwner(ACTION_NEWLIST); Caller->PushActionSwitchAnim(ACTION_APPEND,"standup"); Game::SetEventFinished(Target->GetUserData(),true,1); EinsatzID=-1; } } } }; /************************************************************Demonstration************************************************************/ object demo : CommandScript { demo() { SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return EinsatzID==-1&&Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(EinsatzID < 0) { System::Log("Erstelle Demo"); int demos=4,maxpers=20,maxtime=300; int id=Math::rand()%demos; char namt[32];char nama[32]; snprintf(namt,32,"demotarget_%i",id+1);snprintf(nama,32,"demoarea_%i",id+1); GameObject tar(Game::GetGameObjects(namt).GetObject(0)); Vector pos=ActorList(nama).GetActor(0)->GetPosition(); Mission::PlayHint("BHint_119"); Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTP08"); EinsatzID=Game::ShowEvent("BHint_119", pos); char nam[32];snprintf(nam,32,"%s_sound",tar.GetName()); GameObject bot=Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p",nam); bot.SetPosition(Caller->GetPosition());bot.Hide(); GameObjectList objs=tar.GetObjectsInRange(10000, ACTOR_PERSON); for(int i=0;i0&&objs.GetObject(i)->GetType()==ACTOR_PERSON&&objs.GetObject(i)->IsCurrentAction("EActionMove")){ Person p(objs.GetObject(i)); p.PlaceObjectInRightHand("Equipment/demosign01.v3o"); p.PushActionMove(ACTION_NEWLIST,pos); p.PushActionTurnTo(ACTION_APPEND,&tar); p.PushActionExecuteCommand(ACTION_APPEND,"demop",&bot,-1,false); p.PushActionSwitchAnim(ACTION_APPEND,"demonstrate"); p.PushActionWait(ACTION_APPEND,((maxtime+Math::rand()%maxtime)*2/3)); p.PushActionExecuteCommand(ACTION_APPEND,"demop",&tar,0,false); p.SetUserData(tar.GetID()); maxpers--; } } bot.SetUserData(0); tar.SetUserData(20-maxpers); tar.PushActionWait(ACTION_APPEND,maxtime); tar.PushActionExecuteCommand(ACTION_APPEND,"demop",&tar,2,false); /* int id=Audio::PlaySample3D("mod:Audio/FX/demo.wav",Caller->GetPosition(),true); bot.SetUserData(id); Audio::SetVolume(id,50);*/ } } }; object demop : CommandScript { demop() { } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==-2) { if(Target->GetUserData()>4&&!GameObject(Target).HasCommand("demop")){ GameObject(Target).AssignCommand("demop"); char pfad[64];snprintf(pfad,64,"mod:Audio/FX/Demo%i.wav",Math::rand()%3); int id=Audio::PlaySample3D(pfad,Caller->GetPosition(),true); Audio::SetVolume(id,50); Target->SetUserData(id); System::Log("@Demosound %i",id); } if(!GameObject(Target).HasCommand("demop")) Caller->PushActionExecuteCommand(ACTION_INSERT,"demop",Target,-2,false); }else if(childID==-1) { Caller->AssignCommand("demop"); if(!GameObject(Target).HasCommand("demop")) Target->SetUserData(Target->GetUserData()+1); System::Log("@Demosound-ud %i",Target->GetUserData()); Caller->PushActionExecuteCommand(ACTION_INSERT,"demop",Target,-2,false); }else if(childID==0) { Person(Caller).RemoveObjectInRightHand(); Caller->RemoveCommand("demop"); Target->SetUserData(Target->GetUserData()-1); }else if(childID==1){ if(Caller->GetUserData()<1){ Game::SetEventFinished(EinsatzID,true,1);EinsatzID=-1; char nam[32];snprintf(nam,32,"%s_sound",Target->GetName()); System::Log("Try to kill sound of: %s by %s",nam,Target->GetName()); if(GameObjectList(nam).GetNumObjects()>0){ GameObject bot(GameObjectList(nam).GetObject(0)); Audio::StopSample(bot.GetUserData()); System::Log("@Demosound-end %i",bot.GetUserData()); bot.PushActionDeleteOwner(ACTION_NEWLIST); } return; } System::Log("@Demo %i",Caller->GetUserData()); Caller->PushActionWait(ACTION_APPEND,3); Caller->PushActionExecuteCommand(ACTION_APPEND,"demop",Caller,1,false); }else if(childID==2||childID==20){ if((Math::rand()%100)<10||childID==20){ Audio::SetVolume(Audio::PlaySample("mod:Audio/FX/eskalation.wav"),50); char nam[32];snprintf(nam,32,"%s_sound",Caller->GetName()); System::Log("Try to kill sound of: %s by %s",nam,Caller->GetName()); if(GameObjectList(nam).GetNumObjects()>0){ GameObject bot(GameObjectList(nam).GetObject(0)); Audio::StopSample(bot.GetUserData()); System::Log("@Demosound-end %i",bot.GetUserData()); bot.PushActionDeleteOwner(ACTION_NEWLIST); } int maxstones=3,maxmolotow=1; Game::SetEventFinished(EinsatzID,false,0);EinsatzID=-1; GameObjectList objs=Caller->GetObjectsInRange(5000, ACTOR_PERSON); for(int i=0;iGetType()==ACTOR_PERSON&&objs.GetObject(i)->HasCommand("demop")){ objs.GetObject(i)->RemoveCommand("demop"); int id=Math::rand()%10;objs.GetObject(i)->RemoveObjectPath();Person(objs.GetObject(i)).SetRole(ROLE_GANGSTER); if(id==0&&maxmolotow>0){ Person(objs.GetObject(i)).SetBehaviour(BEHAVIOUR_GANGSTER_THROWMOLOTOV);maxmolotow--; objs.GetObject(i)->PushActionThrowMolotov(ACTION_NEWLIST,Caller->GetPosition(),1000); }else if(id<4&&maxstones>0){ Person(objs.GetObject(i)).SetBehaviour(BEHAVIOUR_GANGSTER_THROWSTONES);maxstones--; }else Person(objs.GetObject(i)).SetBehaviour(BEHAVIOUR_GANGSTER_FISTFIGHT); } } }else Caller->PushActionExecuteCommand(ACTION_APPEND,"demop",Caller,1,false); } } }; /************************************************************Zufälliger RD-Einsatz************************************************************/ object GenRD : CommandScript { GenRD() { SetIcon("heal"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { System::Log("GenRD"); if(Mission::GetCounter("Injured Persons")<11){ PersonList pl(ROLE_CIVILIAN); Person opfer; int oid=Math::rand()%(pl.GetNumPersons()*2/3); for(int i=0;i-1;i++){ if(!pl.GetPerson(i)->IsDead()&&!pl.GetPerson(i)->IsInjured()&&pl.GetPerson(i)->IsInsideMap()){ if(oid==0){opfer=Person(pl.GetPerson(i));oid--; }else oid--; } } int id=-1; int zu=Math::rand()%6; switch(zu){ case 0: Mission::PlayComment("ID_SUPERV_EVENT21"); id=Game::ShowEvent("ID_FREEPLAY_EVENT_HEARTATTACK", opfer.GetPosition()); break; case 1: Mission::PlayComment("ID_SUPERV_EVENT17"); id=Game::ShowEvent("ID_FREEPLAY_EVENT_FALL", opfer.GetPosition()); break; case 2: Mission::PlayComment("ID_SUPERV_EVENT19"); id=Game::ShowEvent("ID_FREEPLAY_EVENT_CIRCULATORY_COLLAPSE", opfer.GetPosition()); break; case 3: Mission::PlayComment("ID_SUPERV_EVENT20"); id=Game::ShowEvent("ID_FREEPLAY_EVENT_FOOD_POISONING", opfer.GetPosition()); break; case 4: Mission::PlayComment("ID_SUPERV_EVENT18"); id=Game::ShowEvent("ID_FREEPLAY_EVENT_SHOCK", opfer.GetPosition()); break; case 5: Mission::PlayComment("ID_SUPERV_EVENT22"); id=Game::ShowEvent("ID_FREEPLAY_EVENT_STROKE", opfer.GetPosition()); break; } char nam[10];snprintf(nam,10,"%i",id); Person on=Game::CreatePerson(opfer.GetPrototypeFileName(),nam); on.SetEnteredHouseID(opfer.GetEnteredHouseID()); on.SetPosition(opfer.GetPosition()); opfer.PushActionDeleteOwner(ACTION_NEWLIST); on.AssignCommand("GenRD"); on.Injure(INJUREREASON_UNKNOWN, false); on.SetLife(Math::rand()%900+100); on.SetInjuredLifeDrain(Math::rand()%4); } } }; object CheckEID : CommandScript { CheckEID() { } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(ChildID==EinsatzID)EinsatzID=-1; } }; /************************************************************Vermisste Person************************************************************/ object Vermisst : CommandScript { Vermisst() { //SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(ChildID==0){ if(EinsatzID>0)return; GameObjectList objs=Game::GetGameObjects(TYPE_OBJECT); int found=0; for(int i=0;iGetPrototypeFileName(),"mod:Prototypes/Objects/Trees"))){ found++; } } found=Math::rand()%found; GameObject baum; for(int i=0;iGetPrototypeFileName(),"mod:Prototypes/Objects/Trees"))){ if(found==0){baum=GameObject(objs.GetObject(i));i=objs.GetNumObjects();} found--; } } GameObjectList objs2=baum.GetObjectsInRange(5000); if(objs2.GetNumObjects()==0){System::Log("Error in Vermisst");return;} Mission::PlayComment("ID_SUPERV_EVENT_D07A"); EinsatzID=Game::ShowEvent("BHint_123", objs2.GetObject(Math::rand()%objs2.GetNumObjects())->GetPosition()); char pnam[128];char nam[10];snprintf(nam,10,"%i",EinsatzID); int pid=int((Math::rand()%8)+1); snprintf(pnam,128,"mod:Prototypes/Persons/Civil/Civil (%i).e4p",pid); Person p=Game::CreatePerson(pnam,nam); Vector vec=baum.GetPosition(); Game::FindFreePosition(&p,vec,1000); p.SetPosition(vec); p.AssignCommand("GenRD"); p.Hide(); Person p2=Game::CreatePerson("mod:Prototypes/Persons/Civil/empty.e4p",nam); p2.SetPosition(vec); p2.Injure(INJUREREASON_UNKNOWN, false); p2.SetLife(Math::rand()%900+100); p2.SetInjuredLifeDrain(0.5); p2.SetFlag(OF_BLOCKED); p2.PushActionExecuteCommand(ACTION_APPEND,"Vermisst",&p,1,false); }else if(ChildID==1){ if(Caller->GetClosestObjectInRange(200,ACTOR_PERSON).IsValid()){ Person p2(Caller); Person p(Target); p.Injure(INJUREREASON_UNKNOWN, false); p.SetLife(p2.GetLife()); p.SetInjuredLifeDrain(0.5); p.Show(); Mission::PlayHint("BHint_13"); p2.PushActionDeleteOwner(ACTION_NEWLIST); }else Caller->PushActionExecuteCommand(ACTION_APPEND,"Vermisst",Target,1,false); } } }; /************************************************************Betrunkene Person************************************************************/ object Betrunken : CommandScript { Betrunken() { } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(ChildID==0){ System::Log("Betrunken"); if(Mission::GetCounter("Injured Persons")<11){ PersonList pl(ROLE_CIVILIAN); Person opfer; int oid=Math::rand()%(pl.GetNumPersons()*2/3); for(int i=0;i-1;i++){ if(!pl.GetPerson(i)->IsDead()&&!pl.GetPerson(i)->IsInjured()&&pl.GetPerson(i)->IsInsideMap()&&pl.GetPerson(i)->GetEnteredCarID()==-1&&pl.GetPerson(i)->GetEnteredHouseID()==-1){ if(oid==0){opfer=Person(pl.GetPerson(i));oid--; }else oid--; } } int id=-1; int zu=Math::rand()%3; Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTP11"); id=Game::ShowEvent("ID_FREEPLAY_EVENT_DRUNK", opfer.GetPosition()); Mission::PlayHint("BHint_1116"); char nam[10];snprintf(nam,10,"%i",id); Person on=Game::CreatePerson(opfer.GetPrototypeFileName(),nam); on.SetEnteredHouseID(opfer.GetEnteredHouseID()); on.SetPosition(opfer.GetPosition()); opfer.PushActionDeleteOwner(ACTION_NEWLIST); on.AssignCommand("GenRD"); //on.Injure(INJUREREASON_UNKNOWN, false); on.SetHealth(((Math::rand()%2)>0?1000:1)); on.SetRole(ROLE_GANGSTER); on.SetCivilsFleeing(false); on.SetBehaviour(BEHAVIOUR_GANGSTER_FISTFIGHT); switch(zu){ case 0: on.SetAnimation("sit02"); break; case 1: on.SetAnimation("unconscious02"); break; case 2: on.SetAnimation("drunkenwaiting2"); break; } } } } }; /************************************************************Schrotthändler************************************************************/ object Schrotthaendler : CommandScript { Schrotthaendler() { //SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(ChildID==0){ char nam[32];snprintf(nam,32,"CivilCar%i",(1+Math::rand()%12)); SpawnPointList sl(nam); if(sl.GetNumSpawnPoints()>0){ Vector pos=NULLVECTOR; sl.GetSpawnPoint(0)->GetPosition(pos.x,pos.y,pos.z); Vehicle vec=Game::CreateVehicle("mod:Prototypes/Vehicles/Zivilfahrzeuge_Spezial/Schrotthaendler.e4p","Unnamed"); vec.SetPosition(pos); vec.SetObjectPath(nam, 6.4f, true); Path pa = vec.GetObjectPath(); Vector target = pa.GetNearestPoint(pos);char speeds[10]; Game::GetGameString("civilspeed", speeds, 10); float speed = Math::atof(speeds); vec.SetSpeed(speed); vec.PushActionMove(ACTION_NEWLIST, target,true); vec.PushActionUsePath(ACTION_APPEND, &pa, true, 6.5f); int sid=Audio::PlaySample3D("mod:Audio/FX/schrotthaendler.wav",vec.GetPosition(),true); vec.AttachSound(sid); GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p","Unnamed"); //obj.SetPosition(pos); obj.PushActionWait(ACTION_NEWLIST,10); obj.PushActionExecuteCommand(ACTION_APPEND,"ZZ_Schrotthaendler",&vec,sid,false); System::Log("@schrott: %i",sid); } } } }; object ZZ_Schrotthaendler : CommandScript { ZZ_Schrotthaendler() { } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(!Target->IsValid()){ Audio::StopSample(ChildID); }else{ Caller->PushActionWait(ACTION_APPEND,10); Caller->PushActionExecuteCommand(ACTION_APPEND,"Schrotthaendler",Target,ChildID,false); } } }; /************************************************************Weihnachten************************************************************/ object Weihnachten : CommandScript { Weihnachten() { } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(ChildID==0){ System::Log("Weihnachten"); GameObjectList objs=Game::GetGameObjectsWithPrefix("ding"); GameObject obj(objs.GetObject(Math::rand()%objs.GetNumObjects())); GameObjectList obj2(obj.GetName()); if(obj2.GetNumObjects()<3)return; Game::ShowObjects(obj2); Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTP12"); int id=Game::ShowEvent("Einbruch gemeldet", obj.GetPosition()); for(int i=0;iSetUserData(id); } }else if(ChildID==1){ Person p(Target); Game::SetEventFinished(Target->GetUserData(),true,1); Mission::PlayHint("Frohe Weihnachten Bieberfelde!!!"); p.PushActionWait(ACTION_APPEND,2.0); Vehicle v(VehicleList(p.GetName()).GetVehicle(0)); v.SetMaxPassengers(1); p.PushActionMove(ACTION_APPEND, &v, TARGET_PASSENGERDOOR); p.PushActionTurnTo(ACTION_APPEND, &v); p.PushActionEnterCar(ACTION_APPEND, &v); p.PushActionExecuteCommand(ACTION_APPEND,"Weihnachten",&v,2,false); }else if(ChildID==2){ Vehicle v(Target); float rot[9]; v.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]); Vector offset(5000, 0, 10000); Math::RotateVector(offset.x, offset.y, offset.z, rot); GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p","lalala"); obj.SetRotation(&v); obj.SetPosition(v.GetPosition()+offset); v.SetPlacementNone(); v.PushActionMoveToPoint(ACTION_NEWLIST,&obj,500); //v.PushActionPutInBase(ACTION_APPEND); v.PushActionExecuteCommand(ACTION_APPEND,"Weihnachten",&v,3,false); }else if(ChildID==3){ GameObjectList objs(Caller->GetName()); for(int i=0;iGetType()!=ACTOR_OBJECT)objs.GetObject(i)->PushActionDeleteOwner(ACTION_NEWLIST); } } } }; object civilInOpenHouse : CommandScript { civilInOpenHouse() { SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { OpenHouse oh; GameObject mDummy(Caller); int burning = 0; int tmp = 0; int fact = 0; GameObjectList ohlBurning=Game::GetGameObjects(TYPE_OPEN_HOUSE); for(int i=0; iIsBurning()) { burning++; oh = ohlBurning.GetObject(i); PersonList plsInside = oh.GetNonSquadPersonsInside(); for (int n=0; nGetHealth()/2; if (plsInside.GetPerson(n)->GetHealth() > 251.f) { fact = Math::rand()%tmp+20; plsInside.GetPerson(n)->SetHealth((tmp*2) - fact); } else if(!plsInside.GetPerson(n)->IsInjured()) { plsInside.GetPerson(n)->Injure(INJUREREASON_FIRE, false); plsInside.GetPerson(n)->SetLife(Math::rand()%400+600); } } } } mDummy.PushActionWait(ACTION_NEWLIST, Math::rand()%50+20); mDummy.PushActionExecuteCommand(ACTION_APPEND, "civilInOpenHouse", &mDummy, 0, false); } }; object FahrzeugPosition : CommandScript { FahrzeugPosition() { SetValidTargets(ACTOR_FLOOR | ACTOR_STREET); SetPossibleCallers(ACTOR_PERSON | ACTOR_VEHICLE); SetIcon("platz"); SetCursor("SendTo"); } bool CheckPossible(GameObject *Caller) { if(Caller->GetType() == ACTOR_VEHICLE) { Vehicle v(Caller); return (v.GetNumPassengers() > 0 && !v.IsInstalled()); } return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vector TargetPos = Game::GetCommandPos(); int id; if(Caller->GetType()==ACTOR_VEHICLE)id=Caller->GetID(); else id=VehicleList(Caller->GetName()).GetVehicle(0)->GetID(); char makerName[20]; snprintf(makerName, 20, "maker_%i", id); GameObjectList ol1 = Game::GetGameObjects(makerName); if(ol1.GetNumObjects() == 0) { Vehicle maker = Game::CreateVehicle("mod:Prototypes/Vehicles/__ Feuerwehr/pos_maker.e4p", makerName); maker.SetPosition(TargetPos); maker.SetPlayerMP(Caller->GetPlayerMP()); maker.PushActionShowHide(ACTION_NEWLIST, false); maker.AssignCommand("TurnTo"); maker.AssignCommand("makerLinks"); maker.AssignCommand("makerRechts"); maker.AssignCommand("makerHalt"); maker.AssignCommand("makerGo"); maker.SetCommandable(true); maker.SetUserData(id); if(Caller->GetType() == ACTOR_VEHICLE) { Vehicle v(Caller); v.Deselect(); } else if(Caller->GetType() == ACTOR_PERSON) { Person p(Caller); p.Deselect(); } maker.Select(); } else { Game::ShowHelpTextWindow("Für dieses Fahrzeug ist bereits ein Maker gesetzt.", 5.f); } } }; object TurnTo : CommandScript { TurnTo() { SetIcon("Install"); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_FLOOR||Target->GetType()==ACTOR_STREET; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vector pos=Game::GetCommandPos(); Caller->PushActionTurnTo(ACTION_NEWLIST, pos, 0.0f); } }; object makerRechts : CommandScript { makerRechts() { SetIcon("rechts"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Xmlutil::DreheUm(GameObject(Caller),GameObject(Caller),-15.0); } }; object makerLinks : CommandScript { makerLinks() { SetIcon("links"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Xmlutil::DreheUm(GameObject(Caller),GameObject(Caller),15.0); } }; object makerHalt : CommandScript { makerHalt() { SetIcon("stop"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vehicle maker(Caller); Vehicle v(&Game::GetActor(maker.GetUserData())); maker.PushActionDeleteOwner(ACTION_NEWLIST); v.SetCommandable(true); v.PushActionWait(ACTION_NEWLIST, 0.1f); } }; object makerGo : CommandScript { makerGo() { SetIcon("platz"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int linie) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vehicle maker(Caller); Vehicle v(&Game::GetActor(maker.GetUserData())); if(v.GetNumPassengers() == 0) { Game::ShowHelpTextWindow("Fahrzeug ist nicht besetzt!", 5.f); return; } v.SetCommandable(false); v.SetSpeed(4.f); v.PushActionMove(ACTION_NEWLIST, maker.GetPosition()); v.PushActionExecuteCommand(ACTION_APPEND, "command_frei", &maker, 0, false); } }; object command_frei : CommandScript { command_frei() { SetRestrictions(RESTRICT_SELFEXECUTE); } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vehicle v(Caller); Vehicle maker(Target); v.SetCommandable(true); Xmlutil::DreheUm(v,maker,0); v.SetPosition(maker.GetPosition()); maker.PushActionDeleteOwner(ACTION_NEWLIST); } }; object GF_Absitzen : CommandScript { GF_Absitzen() { SetIcon("gf"); SetCursor("gf"); SetValidTargets(ACTOR_VEHICLE); SetDoubleClickable(true); SetRestrictions(RESTRICT_SELFEXECUTE); SetPriority(100); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid() || Caller->GetType() != ACTOR_VEHICLE) return false; Vehicle v(Caller); if(v.HasCommand("FlyTo") && !v.IsOnGround()) return false; return v.GetNumPassengers() > 0; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target->IsValid()) return false; if(Caller->GetType()==ACTOR_VEHICLE && Target->GetType()==ACTOR_VEHICLE && Caller->GetID()==Target->GetID()) { Vehicle v(Caller); if (!v.IsValid() || v.IsDestroyed()) return false; if(v.HasCommand("FlyTo") && !v.IsOnGround()) return false; if(v.GetNumPassengers() > 0) return true; } return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); v.PushActionExecuteCommand(ACTION_NEWLIST, "EmptyCar", &v, 38, false); } }; // // VCmdDebug // object PCmDExAll : CommandScript { PCmDExAll() { SetIcon("Debug"); //Icon SetRestrictions(RESTRICT_SELFEXECUTE); SetGroupID(CGROUP_GETEQUIPMENT); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target->IsValid() || Caller->GetID() != Target->GetID()) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { GameObjectList objs=Game::GetGameObjects(); for(int i=0;iIsBurning()){ GameObject obj(objs.GetObject(i)); int length=obj.GetNumFireChilds(); for(int j=0;jIsValid() || !Target->IsValid() || Caller->GetID() != Target->GetID()) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->AssignCommand("ZZ_PCmDEndGame"); } }; object ZZ_PCmDEndGame : CommandScript { ZZ_PCmDEndGame() { SetIcon("Debug"); //Icon SetRestrictions(RESTRICT_SELFEXECUTE); SetGroupID(CGROUP_GETEQUIPMENT); } bool CheckPossible(GameObject *Caller){ GameObjectList ol; GameObject *o; ol = Game::GetGameObjects("Stadtfeld_43"); o = *ol.GetObject(0); Vehicle v(o); return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target->IsValid() || Caller->GetID() != Target->GetID()) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { } }; object PCmDDelAll : CommandScript { PCmDDelAll() { SetIcon("Debug"); //Icon SetRestrictions(RESTRICT_SELFEXECUTE); SetGroupID(CGROUP_GETEQUIPMENT); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target->IsValid() || Caller->GetID() != Target->GetID()) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { VehicleList vl(VT_NOSQUAD,VT_NOSQUAD); for(int i=0;iIsCurrentAction("EActionMove")){ vl.GetVehicle(i)->PushActionDeleteOwner(ACTION_NEWLIST); } } } }; object VCmdDebug : CommandScript { VCmdDebug() { SetIcon("Debug"); SetCursor("Debug"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { return Input::LShiftPressed(); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { int spring=0; char sn[40]; char sh[255]; GameObjectList l = Game::GetGameObjects(Caller->GetName()); PersonList pl(Caller->GetName()); PersonList pl2(ROLE_SQUAD); for(int i=0; iGetType() == ACTOR_VEHICLE) { Vehicle tmp(l.GetObject(i)); for (int j=pl2.GetNumPersons()-1; j>-1; j--) { if(tmp.IsUsingConnector(pl2.GetPerson(j))) { pl2.GetPerson(j)->Injure(INJUREREASON_SHOT, false); pl2.GetPerson(j)->PushActionWait(ACTION_NEWLIST, 0.5f); pl2.GetPerson(j)->PushActionDeleteOwner(ACTION_APPEND); } } Audio::StopSample(tmp.GetUserData()); tmp.SetCommandable(false); tmp.Deselect(); tmp.PushActionWait(ACTION_NEWLIST, 1.f); tmp.PushActionDeleteOwner(ACTION_APPEND); } } if (Input::LCtrlPressed() || Input::RCtrlPressed()) { Game::GetGameString(Caller->GetPrototypeName(), sn, 40); snprintf(sh, 255, "%s wurde gelöscht!", sn); } else { Game::GetGameString(Caller->GetPrototypeName(), sn, 40); snprintf(sh, 255, "%s wurde zurückgesetzt!", sn); Vehicle v = Game::CreateVehicle(Caller->GetPrototypeFileName(), Caller->GetPrototypeName()); if (Game::IsMultiplayer()) v.SetPlayerMP(Caller->GetPlayerMP()); v.PushActionExecuteCommand(ACTION_NEWLIST, "VCmdInit", &v, 0, false); v.Select(); } for (int i=pl.GetNumPersons()-1; i>-1; i--) { if(!pl.GetPerson(i)->IsParamedicTeam())pl.GetPerson(i)->Injure(INJUREREASON_SHOT, false); pl.GetPerson(i)->PushActionWait(ACTION_NEWLIST, 0.5f); pl.GetPerson(i)->PushActionDeleteOwner(ACTION_APPEND); } if(Caller->HasName("01_84_01") && childID == 5) return; if (Game::IsMultiplayer()) { ScriptInterface::ShowMessageTickerTextForAll(sh); } else { Game::ShowHelpTextWindow(sh); } } }; // // FMS // object FMS : CommandScript { FMS() { } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { int soundID = Math::rand()% 10; switch(soundID) { case 0: { Audio::PlaySample("mod:/Audio/FX/Wegberg/Status1.wav"); break; } case 1: { Audio::PlaySample("mod:/Audio/FX/Wegberg/Status2.wav"); break; } case 2: { Audio::PlaySample("mod:/Audio/FX/Wegberg/Status3.wav"); break; } case 3: { Audio::PlaySample("mod:/Audio/FX/Wegberg/Status4.wav"); break; } case 4: { Audio::PlaySample("mod:/Audio/FX/Wegberg/Status5.wav"); break; } case 5: { Audio::PlaySample("mod:/Audio/FX/Wegberg/Status6.wav"); break; } case 6: { Audio::PlaySample("mod:/Audio/FX/Wegberg/Status7.wav"); } case 7: case 8: case 9: case 10: case 11: case 12: Audio::PlaySample("mod:/Audio/FX/Wegberg/Status8.wav"); break; default: { Audio::PlaySample("mod:/Audio/FX/Wegberg/Status4.wav"); } break; } char * status_anzeige=" "; if (Caller->GetName()[0] == '0') { if(childID<10)char * status_text[]="Florian Sittingen %c%c.%c%c.%c%c --%u--"; else char * status_text[]="Florian Sittingen %c%c.%c%c.%c%c --%s--";//childID<10?childID:(childID==10?"C":(childID==11?"A":"E")) snprintf(status_anzeige,50,status_text,Caller->GetName()[0],Caller->GetName()[1],Caller->GetName()[3],Caller->GetName()[4],Caller->GetName()[6],Caller->GetName()[7],childID<10?childID:(childID==10?"0":(childID==11?"0":"6"))); } else if (Caller->GetName()[0] == '1') { if(childID<10)char * status_text[]="Rettung Sittingen %c%c.%c%c.%c%c --%u--"; else char * status_text[]="Rettung Sittingen %c%c.%c%c.%c%c --%s--"; snprintf(status_anzeige,50,status_text,Caller->GetName()[0],Caller->GetName()[1],Caller->GetName()[3],Caller->GetName()[4],Caller->GetName()[6],Caller->GetName()[7],childID<10?childID:(childID==10?"0":(childID==11?"0":"6"))); } else if (Caller->GetName()[0] == 'P') { if(childID<10)char * status_text[]="Sitti %c%c.%c%c --%u--"; else char * status_text[]="Sitti %c%c.%c%c --%s--"; snprintf(status_anzeige,50,status_text,Caller->GetName()[3],Caller->GetName()[4],Caller->GetName()[6],Caller->GetName()[7],childID<10?childID:(childID==10?"0":(childID==11?"0":"6"))); } else if (Caller->GetName()[0] == 'B') { if(childID<10)char * status_text[]="Stadt %c%c.%c%c --%u--"; else char * status_text[]="Stadt %c%c.%c%c --%s--"; snprintf(status_anzeige,50,status_text,Caller->GetName()[3],Caller->GetName()[4],Caller->GetName()[6],Caller->GetName()[7],childID<10?childID:(childID==10?"0":(childID==11?"0":"6"))); } else if (Caller->GetName()[0] == 'K') { if(childID<10)char * status_text[]="Land %c%c.%c%c --%u--"; else char * status_text[]="Landes %c%c.%c%c --%s--"; snprintf(status_anzeige,50,status_text,Caller->GetName()[3],Caller->GetName()[4],Caller->GetName()[6],Caller->GetName()[7],childID<10?childID:(childID==10?"0":(childID==11?"0":"6"))); } else status_anzeige="Unbekanntes Fahrzeug"; System::Log(status_anzeige); if (!Game::IsMultiplayer()) Game::ShowHelpTextWindow(status_anzeige); //else //Mission::PlayHint(status_anzeige); } }; // // VCmdAlarm // object SirDummy : CommandScript { SirDummy() { } void PushActions(GameObject *Caller, Actor *Target, int childID) { GameObject mDummy(Caller); mDummy.SetUserData(100); } }; object VCmdAlarm : CommandScript { VCmdAlarm() { SetIcon("alarm"); SetCursor("alarm"); //SetValidTargets(ACTOR_VEHICLE); //SetRestrictions(RESTRICT_SELFEXECUTE); SetPossibleCallers(ACTOR_VEHICLE); SetGroupID(26); SetPriority(201); } bool CheckGroupVisibility(GameObject *Caller) { return true; } bool CheckPossible(GameObject *Caller) { if(!Caller->IsValid()) return false; if(Caller->GetType()==ACTOR_VEHICLE) { Vehicle v(Caller); if(v.IsDecontaminating()) return false; if (v.HasCommand("ALARM_DUMMY")) return false; if ((v.HasName("01_83_02") && (!WACHE_1_SPRINGER && !WACHE_1_ALARMSTUFE)) || (v.HasName("01_24_01") && (!WACHE_1_SPRINGER && !WACHE_1_ALARMSTUFE)) || (v.HasName("02_72_01") && (!WACHE_2_SPRINGER && !WACHE_2_ALARMSTUFE)) || (v.HasName("02_52_01") && (!WACHE_2_SPRINGER && !WACHE_2_ALARMSTUFE)) || (v.HasName("02_46_02") && (!WACHE_1_ALARMSTUFE && !WACHE_2_ALARMSTUFE))) return false; if (v.IsInstalled()) { if(v.GetVehicleType() == VT_THW_FGRR_BKF && (!v.IsReady() || v.GetCarriedObjects().GetNumObjects()>0)) return false; if(v.GetVehicleType() == VT_FIREFIGHTERS_DLK && (v.IsUplifting() || v.IsInstalled() || v.IsUplifted())) return false; if(v.GetVehicleType() == VT_FIREFIGHTERS_GTF) return false; } } return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() //|| !Target->IsValid() || Target->GetID() != Caller->GetID() ) return false; Vehicle v(Caller); deinstall = false; SetPriority(0); if (v.HasCommand("ALARM_DUMMY")) return false; if(Target->GetType()==ACTOR_FLOOR||Target->GetType()==ACTOR_STREET){SetPriority(1000);return true;} if((v.GetVehicleType() == VT_AMBULANCE_RTW || v.GetVehicleType() == VT_AMBULANCE_ITW || v.GetVehicleType() == VT_AMBULANCE_RHC) && v.GetNumTransported() > 0) SetPriority(105); if(v.IsInstalled()) { if(v.GetVehicleType() == VT_THW_FGRR_BKF && (!v.IsReady() || v.GetCarriedObjects().GetNumObjects()>0)) return false; if(v.GetVehicleType() == VT_FIREFIGHTERS_DLK && (v.IsUplifting() || v.IsInstalled() || v.IsUplifted())) return false; if(v.GetVehicleType() == VT_FIREFIGHTERS_GTF) return false; deinstall = true; } if (v.IsDecontaminating()) return false; return Caller->GetID()==Target->GetID(); } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(Caller->HasCommand("ALARM_DUMMY"))return; Vehicle v(Caller); int Max; int Min; int h,m,s; ActorList al; Actor parkplatz; PersonList pl; GameObject SoundDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "alarmSound_X"); Game::GetTime(h,m,s); v.PushActionExecuteCommand(ACTION_NEWLIST,"COMMANDOSPERRE",Caller,0,true); v.PushActionExecuteCommand(ACTION_APPEND, "FMS",&v, 10, false); if (v.HasName("01_10_01")) { v.SetMaxPassengers(2); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 26, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 30, true); v.PushActionWait(ACTION_APPEND,1.0f); } else if (v.HasName("01_11_01")){ v.SetMaxPassengers(3); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 30, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 2, true); v.PushActionWait(ACTION_APPEND,1.0f); } else if (v.HasName("01_10_01")){ v.SetMaxPassengers(2); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 30, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 2, true); v.PushActionWait(ACTION_APPEND,1.5f); } else if (v.HasName("01_72_01")){ v.SetMaxPassengers(2); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); } else if (v.HasName("01_71_01")){ v.SetMaxPassengers(2); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); } else if (v.HasName("01_91_01")){ v.SetMaxPassengers(4); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 3, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); } else if (v.HasName("01_93_01")){ v.SetMaxPassengers(6); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 3, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); } else if (v.HasName("01_46_03")){ v.SetMaxPassengers(6); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 3, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 41, true); //v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 5, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 5, true); //v.PushActionWait(ACTION_APPEND,0.1f); } else if (v.HasName("01_52_01")){ v.SetMaxPassengers(3); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 3, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.3f); } else if (v.HasName("01_58_01")){ v.SetMaxPassengers(3); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 44, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); } else if (v.HasName("01_24_01")){ if (WACHE_1_SPRINGER || WACHE_1_ALARMSTUFE) { WACHE_1_SPRINGER = false; tlfeinsatz=true; v.SetMaxPassengers(6); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 3, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); v.PushActionWait(ACTION_APPEND,0.5f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); v.PushActionWait(ACTION_APPEND,0.5f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); v.PushActionWait(ACTION_APPEND,0.2f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); v.PushActionWait(ACTION_APPEND,0.2f); } else{ System::Log(""); Mission::PlayHint("BHint_19"); v.PushActionExecuteCommand(ACTION_APPEND, "FMS",&v, 12, false); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",Caller,1,true); break; } } else if (v.HasName("01_33_01") || v.HasName("01_65_01") || v.HasName("01_65_02") || v.HasName("02_33_01")){ v.SetMaxPassengers(3); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); v.PushActionWait(ACTION_APPEND,1.5f); } else if (v.HasName("01_46_01")){ v.SetMaxPassengers(6); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 3, true); //v.PushActionWait(ACTION_APPEND,0.1f); for (int z = 0; z < 5; z++) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1, true); //v.PushActionWait(ACTION_APPEND,0.1f); } v.PushActionWait(ACTION_APPEND,1.5f); } else if (v.HasName("01_82_01")){ if ((h > 7 && h < 19) || WACHE_1_ALARMSTUFE) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(2); if (ZUFALL > 4) v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 16, true); else v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 17, true); v.PushActionWait(ACTION_APPEND,3.5f); } else{ Mission::PlayHint("BHint_21"); v.PushActionExecuteCommand(ACTION_APPEND, "FMS",&v, 12, false); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",Caller,1,true); break; } } else if (v.HasName("01_83_01") || v.HasName("02_83_01")){ v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 13, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 13, true); v.PushActionWait(ACTION_APPEND,2.5f); } else if (v.HasName("01_83_03")){ if(WACHE_1_ALARMSTUFE){ v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 13, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 13, true); v.PushActionWait(ACTION_APPEND,2.5f); }else{ Mission::PlayHint("BHint_22"); v.PushActionExecuteCommand(ACTION_APPEND, "FMS",&v, 12, false); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",Caller,1,true); break; } } else if (v.HasName("01_83_02")){ if (WACHE_1_SPRINGER || WACHE_1_ALARMSTUFE) { WACHE_1_SPRINGER = false; zrtweinsatz=true; v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 15, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 15, true); v.PushActionWait(ACTION_APPEND,4.5f); } else { Mission::PlayHint("BHint_23"); v.PushActionExecuteCommand(ACTION_APPEND, "FMS",&v, 12, false); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",Caller,1,true); break; } } else if (v.HasName("03_62_01")) { Game::GetGameString("FF1_ATIME", AlarmString, 7); float Zeit = Math::atoi(AlarmString); v.PushActionWait(ACTION_APPEND,Zeit); v.SetMaxPassengers(3); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 5, true); v.PushActionWait(ACTION_APPEND,1.0f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 5, true); v.PushActionWait(ACTION_APPEND,1.0f); if (h > 7 && h < 19) { Max = 1; Min = 1; } else { Max = 1; Min = 1; } int y = (Math::rand()%Max+Min); for(int z=0; z 7 && h < 19) { Max = 4; Min = 2; } else { Max = 4; Min = 2; } int y = (Math::rand()%Max+Min); for(int z=0; z 7 && h < 19) { Max = 7; Min = 2; } else { Max = 6; Min = 3; } int y = (Math::rand()%Max+Min); if(y < 4) { v.PushActionExecuteCommand(ACTION_APPEND, "FMS",&v, 12, false); Mission::PlayHint("BHint_26"); Audio::PlaySample("mod:Audio/FX/Wegberg/radio_fail.wav"); v.PushActionWait(ACTION_APPEND,200.0f); v.PushActionExecuteCommand(ACTION_APPEND, "FMS",&v, 2, false); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",Caller,1,true); break; } v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 7, true); v.PushActionWait(ACTION_APPEND,1.0f); for(int z=0; z 7 && h < 19) { Max = 4; Min = 2; } else { Max = 4; Min = 2; } int y = (Math::rand()%Max+Min); for(int z=0; z 7 && h < 19) { Max = 4; Min = 2; } else { Max = 4; Min = 2; } int y = (Math::rand()%Max+Min); for(int z=0; z 7 && h < 19) { Max = 4; Min = 2; } else { Max = 4; Min = 2; } int y = (Math::rand()%Max+Min); for(int z=0; z 7 && h < 19) { Max = 5; Min = 2; } else { Max = 5; Min = 2; } int y = (Math::rand()%Max+Min); for(int z=0; z 4) v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 18, true); else v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 19, true); v.PushActionWait(ACTION_APPEND,3.5f); } else if (v.HasName("11_10_01")) { v.SetMaxPassengers(2); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 37, true); v.PushActionWait(ACTION_APPEND,0.1f); } else if (v.HasName("11_83_01") || v.HasName("11_83_02") || v.HasName("11_83_03") || v.HasName("11_83_04") || v.HasName("11_85_01") || v.HasName("11_85_02")) { v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,1.5f); } else if (v.HasName("11_26_01") || v.HasName("11_26_02")) { v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,1.5f); } else if (v.HasName("11_28_01")) { v.SetMaxPassengers(6); v.SetMaxTransports(0); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,1.5f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,0.4f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,1.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,1.2f); } else if (v.HasName("11_19_01")) { v.SetMaxPassengers(8); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,1.5f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,1.5f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,1.0f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,1.0f); } else if (v.HasName("12_83_01") || v.HasName("12_83_02")) { v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 13, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 13, true); v.PushActionWait(ACTION_APPEND,1.5f); } else if (v.HasName("11_49_01")) { v.SetMaxPassengers(2); v.SetMaxTransports(0); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 14, true); v.PushActionWait(ACTION_APPEND,0.1f); } else if (v.HasName("11_85_01")) { if ((h > 7 && h < 19)) { v.SetMaxPassengers(2); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 29, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 29, true); v.PushActionWait(ACTION_APPEND,3.5f); } else { Mission::PlayHint("BHint_27"); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",Caller,1,true); break; } } else if (v.HasName("12_82_01")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(2); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 16, true); v.PushActionWait(ACTION_APPEND,3.5f); }else if (v.HasName("PP_10_01")) { v.SetMaxPassengers(2); v.SetMaxTransports(2); int PolZufall = (Math::rand()%9+1); v.SetMaxPassengers(2); if (PolZufall > 6) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 921, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 921, true); } else if ((7 > PolZufall) && (PolZufall > 3)) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 922, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 922, true); } else if (PolZufall < 4) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 922, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 921, true); } v.PushActionWait(ACTION_APPEND,7.f); } else if (v.HasName("PP_10_02") || v.HasName("PP_10_03")) { v.SetMaxPassengers(2); v.SetMaxTransports(2); int PolZufall = (Math::rand()%9+1); v.SetMaxPassengers(2); if (PolZufall > 6) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1021, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1021, true); } else if ((7 > PolZufall) && (PolZufall > 3)) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1022, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1022, true); } else if (PolZufall < 4) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1022, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1021, true); } v.PushActionWait(ACTION_APPEND,7.f); } else if (v.HasName("PP_10_09")) { v.SetMaxPassengers(2); v.SetMaxTransports(2); int PolZufall = (Math::rand()%9+1); v.SetMaxPassengers(2); if (PolZufall > 6) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1027, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1027, true); } else if ((7 > PolZufall) && (PolZufall > 3)) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1027, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1028, true); } else if (PolZufall < 4) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1028, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1028, true); } v.PushActionWait(ACTION_APPEND,7.0f); } else if (v.HasName("PP_20_01") || v.HasName("PP_20_04")) { v.SetMaxPassengers(2); v.SetMaxTransports(2); int PolZufall = (Math::rand()%9+1); v.SetMaxPassengers(2); if (PolZufall > 6) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1121, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1121, true); } else if ((7 > PolZufall) && (PolZufall > 3)) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1122, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1122, true); } else if (PolZufall < 4) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1122, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1121, true); } v.PushActionWait(ACTION_APPEND,7.f); } else if (v.HasName("PP_10_04") || v.HasName("PP_10_05")) { v.SetMaxPassengers(2); v.SetMaxTransports(4); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 921, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 921, true); v.PushActionWait(ACTION_APPEND,0.1f); if (v.HasCommand("P02")) { v.SetMaxPassengers(4); v.SetMaxTransports(2); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 921, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 921, true); v.PushActionWait(ACTION_APPEND,7.0f); } else v.PushActionWait(ACTION_APPEND,7.0f); } else if (v.HasName("PP_20_02")) { if(v.HasCommand("P03")){ v.SetMaxPassengers(1); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1136, true); v.AddTransport(Game::CreatePerson("mod:Prototypes/Persons/Ambulance/rescuedog.e4p",v.GetName())); v.PushActionWait(ACTION_APPEND,7.0f); }else{ v.SetMaxPassengers(2); v.SetMaxTransports(4); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1121, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1122, true); v.PushActionWait(ACTION_APPEND,0.1f); if (v.HasCommand("P02")) { v.SetMaxPassengers(4); v.SetMaxTransports(2); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1121, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1122, true); v.PushActionWait(ACTION_APPEND,5.0f); } else v.PushActionWait(ACTION_APPEND,5.0f); } } else if (v.HasName("BS_01_01")){ v.SetMaxPassengers(6); v.SetMaxTransports(0); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 31, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 31, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 31, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 31, true); v.PushActionWait(ACTION_APPEND,2.5f); } else if (v.HasName("BS_02_01")){ v.SetMaxPassengers(2); v.SetMaxTransports(0); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 31, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 31, true); v.PushActionWait(ACTION_APPEND,2.5f); } else if (v.HasName("BS_03_01")){ v.SetMaxPassengers(1); v.SetMaxTransports(12); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 31, true); v.PushActionWait(ACTION_APPEND,2.5f); } else if (v.HasName("PP_10_06")) { v.SetMaxPassengers(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 920, true); v.PushActionWait(ACTION_APPEND,3.0f); v.SetChildEnabled("PERSON",true); } else if (v.HasName("PP_20_03")) { v.SetMaxPassengers(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 1120, true); v.PushActionWait(ACTION_APPEND,3.0f); v.SetChildEnabled("PERSON",true); // child erst beim aufsetzen enablen } else if (v.HasName("00_99_01")) { v.SetMaxPassengers(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 44, true); v.PushActionWait(ACTION_APPEND,3.0f); v.SetChildEnabled("PERSON",true); Audio::PlaySample("mod:Audio/FX/kasten.wav"); } else if (v.HasName("PP_10_07") || v.HasName("PP_10_08")) { if (v.HasCommand("B01")) { v.SetMaxPassengers(9); v.SetMaxTransports(0); for(int z=0; z<9; z++) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 1023, true); v.PushActionWait(ACTION_APPEND,0.1f); } v.PushActionWait(ACTION_APPEND,12.0f); } else if (v.HasCommand("B02")) { v.SetMaxPassengers(6); v.SetMaxTransports(3); for(int z=0; z<6; z++) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 1022, true); v.PushActionWait(ACTION_APPEND,0.1f); } v.PushActionWait(ACTION_APPEND,12.0f); } else if (v.HasCommand("B03")) { v.SetMaxPassengers(2); v.SetMaxTransports(7); for(int z=0; z<2; z++) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 1022, true); v.PushActionWait(ACTION_APPEND,0.1f); } v.PushActionWait(ACTION_APPEND,10.0f); } } else { Mission::PlayHint("BHint_28"); return; } if(v.HasNamePrefix("01_")&&!v.HasNamePrefix("01_8")) { GameObjectList l2; l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject *d1; GameObject *d2; d2 = *l2.GetObject(0); GameObject dummdumm(d2); if(dummdumm.GetUserData() == 100&&v.HasCommand("VCmdAutoSirenOff")) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 9, false); dummdumm.PushActionWait(ACTION_APPEND, 20.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } } if(v.HasNamePrefix("02_")&&!v.HasNamePrefix("02_8")) { GameObjectList l2; l2 = Game::GetGameObjects("Dummy_FW2"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW2"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW2"); GameObject *d1; GameObject *d2; d2 = *l2.GetObject(0); GameObject dummdumm(d2); if(dummdumm.GetUserData() == 100&&v.HasCommand("VCmdAutoSirenOff")) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 10, false); dummdumm.PushActionWait(ACTION_APPEND, 20.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } } else if(v.HasNamePrefix("03_")) { GameObjectList l2; l2 = Game::GetGameObjects("Dummy_FW3"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW3"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW3"); GameObject *d1; GameObject *d2; d2 = *l2.GetObject(0); GameObject dummdumm(d2); if(dummdumm.GetUserData() == 100&&v.HasCommand("VCmdAutoSirenOff")) { dummdumm.SetUserData(38); dummdumm.PushActionWait(ACTION_NEWLIST, 20.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); SoundDummy.PushActionExecuteCommand(ACTION_NEWLIST, "AlarmSoundFirst", &SoundDummy, 0, false); } else SoundDummy.PushActionExecuteCommand(ACTION_NEWLIST, "AlarmSoundFirst", &SoundDummy, 1, false); } else if(v.HasNamePrefix("04_")) { GameObjectList l2; l2 = Game::GetGameObjects("Dummy_FW4"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW4"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW4"); GameObject *d1; GameObject *d2; d2 = *l2.GetObject(0); GameObject dummdumm(d2); if(dummdumm.GetUserData() == 100&&v.HasCommand("VCmdAutoSirenOff")) { dummdumm.SetUserData(38); dummdumm.PushActionWait(ACTION_NEWLIST, 220.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); SoundDummy.PushActionExecuteCommand(ACTION_NEWLIST, "AlarmSoundFirst", &SoundDummy, 2, false); } else SoundDummy.PushActionExecuteCommand(ACTION_NEWLIST, "AlarmSoundFirst", &SoundDummy, 3, false); } else if(v.HasNamePrefix("PP_") || v.IsPolice()) SoundDummy.PushActionExecuteCommand(ACTION_NEWLIST, "AlarmSoundFirst", &SoundDummy, 4, false); else if(v.HasNamePrefix("01_") || v.HasNamePrefix("02_")) { if(v.HasNamePrefix("01_8") || v.HasNamePrefix("02_8")) SoundDummy.PushActionExecuteCommand(ACTION_NEWLIST, "AlarmSoundFirst", &SoundDummy, 5, false); else SoundDummy.PushActionExecuteCommand(ACTION_NEWLIST, "AlarmSoundFirst", &SoundDummy, 6, false); } else if(v.HasNamePrefix("11_")) SoundDummy.PushActionExecuteCommand(ACTION_NEWLIST, "AlarmSoundFirst", &SoundDummy, 7, false); else SoundDummy.PushActionExecuteCommand(ACTION_NEWLIST, "AlarmSoundFirst", &SoundDummy, 8, false); if (!v.IsPolice()); { v.PushActionWait(ACTION_APPEND, 2.5f); v.PushActionExecuteCommand(ACTION_APPEND,"OpenGate",Caller,42,true); } v.PushActionWait(ACTION_APPEND, 0.1f); v.PushActionExecuteCommand(ACTION_APPEND,"SOUND_PLAYER",Caller,0,true); v.PushActionWait(ACTION_APPEND, 0.1f); v.PushActionExecuteCommand(ACTION_APPEND,"LIGHTS",Caller,2,true); v.PushActionWait(ACTION_APPEND, 0.1f); if (!v.IsBlueLightEnabled()) v.PushActionExecuteCommand(ACTION_APPEND, "VCmdBlue", &v, 0, false); if (!v.IsPolice()) v.PushActionWait(ACTION_APPEND, 3.5f); v.AssignCommand("ALARM_DUMMY"); v.PushActionExecuteCommand(ACTION_APPEND, "FMS", Caller, 3, false); if(v.HasCommand("OHNE_PA"))v.PushActionExecuteCommand(ACTION_APPEND, "Pcmd_AGT", Caller, 0, false); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",Caller,1,true); if (v.HasName("04_44_01") || v.HasName("04_50_01") || v.HasName("04_46_01") || v.HasName("04_19_01") || v.HasName("04_74_01") || v.HasName("03_62_01") || v.HasName("03_46_01") || v.HasName("03_45_01") || v.HasName("03_19_01")) v.PushActionExecuteCommand(ACTION_APPEND, "DUMMY_ALLERTFINISHED", &v, 0, true); if(Target->GetType()==ACTOR_FLOOR||Target->GetType()==ACTOR_STREET){ if(v.HasNamePrefix("01_")) Game::ExecuteCommand("wachampel",Caller); GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); //v.PushActionWait(ACTION_APPEND,10); if (!v.HasCommand("DummyHasSiren") && v.HasCommand("VcmdAutoSirenOff") && !Input::RCtrlPressed()) { Vector tPos = obj.GetPosition(); Vector pos = v.GetPosition(); float CurrentDist = Math::dist(tPos.x, tPos.y, tPos.z, pos.x, pos.y, pos.z); if (CurrentDist > 1200) { v.SetSpeed(11.f); v.PushActionExecuteCommand(ACTION_APPEND,"VcmdSiren", &v); } else v.SetSpeed(4.f); } else if (v.IsBlueLightEnabled() && (Input::RCtrlPressed())) if (v.IsBlueLightEnabled()) v.PushActionExecuteCommand(ACTION_APPEND, "VCmdBlue", &v, 0, false); v.PushActionMove(ACTION_APPEND,obj.GetPosition()); }else v.PushActionUsePath(ACTION_APPEND, v.GetName(), v.GetSpeed()); } }; object VcmdB1 : CommandScript { VcmdB1() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdB1",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 8.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdB1",Target,1,false); }else if(childID==1){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); float wait=2.0; System::Log("Halbzug %i,0",childID); Vehicle v1(VehicleList("01_46_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} } } }; object VCmdB2 : CommandScript { VCmdB2() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB2",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 20.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB2",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB2",Target,2,false); }else if(childID==2){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_33_01").GetVehicle(0),VehicleList("01_33_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB2",Target,3,false); }else if(childID==3){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_03").GetVehicle(0),VehicleList("01_46_03").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB2",Target,4,false); }else if(childID==4){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); Vehicle *v;float wait=2.0; System::Log("zug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("zug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} System::Log("zug %i,2",childID); Vehicle v3(VehicleList("01_33_01").GetVehicle(0)); if(v3.IsCollidingWithVirtualObject("LZW1")){v3.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v3,obj);wait+=2.0;} System::Log("zug %i,3",childID); Vehicle v4(VehicleList("01_46_03").GetVehicle(0)); if(v4.IsCollidingWithVirtualObject("LZW2")){v4.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v4,obj);wait+=2.0;} System::Log("zug %i,4",childID); } } }; object VCmdB3 : CommandScript { VCmdB3() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB3",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 20.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB3",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB3",Target,2,false); }else if(childID==2){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_33_01").GetVehicle(0),VehicleList("01_33_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB3",Target,3,false); }else if(childID==3){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_03").GetVehicle(0),VehicleList("01_46_03").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB3",Target,4,false); }else if(childID==4){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_24_01").GetVehicle(0),VehicleList("01_24_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB3",Target,5,false); }else if(childID==5){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_10_01").GetVehicle(0),VehicleList("01_10_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB3",Target,6,false); }else if(childID==6){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); Vehicle *v;float wait=2.0; System::Log("zug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("zug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} System::Log("zug %i,2",childID); Vehicle v3(VehicleList("01_33_01").GetVehicle(0)); if(v3.IsCollidingWithVirtualObject("LZW1")){v3.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v3,obj);wait+=2.0;} System::Log("zug %i,3",childID); Vehicle v4(VehicleList("01_46_03").GetVehicle(0)); if(v4.IsCollidingWithVirtualObject("LZW2")){v4.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v4,obj);wait+=2.0;} System::Log("zug %i,4",childID); Vehicle v5(VehicleList("01_24_01").GetVehicle(0)); if(v5.IsCollidingWithVirtualObject("LZW1")){v5.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v5,obj);wait+=2.0;} System::Log("zug %i,5",childID); Vehicle v6(VehicleList("01_10_01").GetVehicle(0)); if(v6.IsCollidingWithVirtualObject("LZW2")){v6.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v6,obj);wait+=2.0;} System::Log("zug %i,6",childID); } } }; object VCmdB4 : CommandScript { VCmdB4() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB4",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 20.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB4",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB4",Target,2,false); }else if(childID==2){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_33_01").GetVehicle(0),VehicleList("01_33_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB4",Target,3,false); }else if(childID==3){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_03").GetVehicle(0),VehicleList("01_46_03").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB4",Target,4,false); }else if(childID==4){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_24_01").GetVehicle(0),VehicleList("01_24_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB4",Target,5,false); }else if(childID==5){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_10_01").GetVehicle(0),VehicleList("01_10_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB4",Target,6,false); }else if(childID==6){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); Vehicle *v;float wait=2.0; System::Log("zug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("zug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} System::Log("zug %i,2",childID); Vehicle v3(VehicleList("01_33_01").GetVehicle(0)); if(v3.IsCollidingWithVirtualObject("LZW1")){v3.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v3,obj);wait+=2.0;} System::Log("zug %i,3",childID); Vehicle v4(VehicleList("01_46_03").GetVehicle(0)); if(v4.IsCollidingWithVirtualObject("LZW2")){v4.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v4,obj);wait+=2.0;} System::Log("zug %i,4",childID); Vehicle v5(VehicleList("01_24_01").GetVehicle(0)); if(v5.IsCollidingWithVirtualObject("LZW1")){v5.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v5,obj);wait+=2.0;} System::Log("zug %i,5",childID); Vehicle v6(VehicleList("01_10_01").GetVehicle(0)); if(v6.IsCollidingWithVirtualObject("LZW2")){v6.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v6,obj);wait+=2.0;} System::Log("zug %i,6",childID); } } }; object VCmdB5 : CommandScript { VCmdB5() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB5",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 20.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB5",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB5",Target,2,false); }else if(childID==2){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_33_01").GetVehicle(0),VehicleList("01_33_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB5",Target,3,false); }else if(childID==3){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_03").GetVehicle(0),VehicleList("01_46_03").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB5",Target,4,false); }else if(childID==4){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_24_01").GetVehicle(0),VehicleList("01_24_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB5",Target,5,false); }else if(childID==5){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_10_01").GetVehicle(0),VehicleList("01_10_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdB5",Target,6,false); }else if(childID==6){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); Vehicle *v;float wait=2.0; System::Log("zug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("zug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} System::Log("zug %i,2",childID); Vehicle v3(VehicleList("01_33_01").GetVehicle(0)); if(v3.IsCollidingWithVirtualObject("LZW1")){v3.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v3,obj);wait+=2.0;} System::Log("zug %i,3",childID); Vehicle v4(VehicleList("01_46_03").GetVehicle(0)); if(v4.IsCollidingWithVirtualObject("LZW2")){v4.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v4,obj);wait+=2.0;} System::Log("zug %i,4",childID); Vehicle v5(VehicleList("01_24_01").GetVehicle(0)); if(v5.IsCollidingWithVirtualObject("LZW1")){v5.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v5,obj);wait+=2.0;} System::Log("zug %i,5",childID); Vehicle v6(VehicleList("01_10_01").GetVehicle(0)); if(v6.IsCollidingWithVirtualObject("LZW2")){v6.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v6,obj);wait+=2.0;} System::Log("zug %i,6",childID); } } }; object VCmdBWald : CommandScript { VCmdBWald() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBWald",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 20.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBWald",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBWald",Target,2,false); }else if(childID==2){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_03").GetVehicle(0),VehicleList("01_46_03").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBWald",Target,3,false); }else if(childID==3){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_24_01").GetVehicle(0),VehicleList("01_24_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBWald",Target,4,false); }else if(childID==4){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_10_01").GetVehicle(0),VehicleList("01_10_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBWald",Target,5,false); }else if(childID==5){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); Vehicle *v;float wait=2.0; System::Log("zug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("zug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} System::Log("zug %i,2",childID); Vehicle v3(VehicleList("01_46_03").GetVehicle(0)); if(v3.IsCollidingWithVirtualObject("LZW2")){v3.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v3,obj);wait+=2.0;} System::Log("zug %i,3",childID); Vehicle v4(VehicleList("01_24_01").GetVehicle(0)); if(v4.IsCollidingWithVirtualObject("LZW1")){v4.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v4,obj);wait+=2.0;} System::Log("zug %i,4",childID); Vehicle v5(VehicleList("01_10_01").GetVehicle(0)); if(v5.IsCollidingWithVirtualObject("LZW2")){v5.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v5,obj);wait+=2.0;} System::Log("zug %i,5",childID); } } }; object VCmdGefahrgut : CommandScript { VCmdGefahrgut() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdGefahrgut",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 20.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdGefahrgut",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdGefahrgut",Target,2,false); }else if(childID==2){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_03").GetVehicle(0),VehicleList("01_46_03").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdGefahrgut",Target,3,false); }else if(childID==3){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_10_01").GetVehicle(0),VehicleList("01_10_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdGefahrgut",Target,4,false); }else if(childID==4){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_91_01").GetVehicle(0),VehicleList("01_91_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdGefahrgut",Target,5,false); }else if(childID==5){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_93_01").GetVehicle(0),VehicleList("01_93_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdGefahrgut",Target,6,false); }else if(childID==6){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); Vehicle *v;float wait=2.0; System::Log("zug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("zug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} System::Log("zug %i,2",childID); Vehicle v3(VehicleList("01_46_03").GetVehicle(0)); if(v3.IsCollidingWithVirtualObject("LZW2")){v3.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v3,obj);wait+=2.0;} System::Log("zug %i,3",childID); Vehicle v4(VehicleList("01_10_01").GetVehicle(0)); if(v4.IsCollidingWithVirtualObject("LZW2")){v4.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v4,obj);wait+=2.0;} System::Log("zug %i,4",childID); Vehicle v5(VehicleList("01_91_01").GetVehicle(0)); if(v5.IsCollidingWithVirtualObject("LZW4")){v5.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v5,obj);wait+=2.0;} System::Log("zug %i,5",childID); Vehicle v6(VehicleList("01_93_01").GetVehicle(0)); if(v6.IsCollidingWithVirtualObject("LZW4")){v6.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v6,obj);wait+=2.0;} System::Log("zug %i,6",childID); } } }; object VCmdBombe : CommandScript { VCmdBombe() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBombe",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 20.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBombe",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBombe",Target,2,false); }else if(childID==2){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_03").GetVehicle(0),VehicleList("01_46_03").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBombe",Target,3,false); }else if(childID==3){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_10_01").GetVehicle(0),VehicleList("01_10_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBombe",Target,4,false); }else if(childID==4){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_24_01").GetVehicle(0),VehicleList("01_24_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VCmdBombe",Target,5,false); }else if(childID==5){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); Vehicle *v;float wait=2.0; System::Log("zug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("zug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} System::Log("zug %i,2",childID); Vehicle v3(VehicleList("01_46_03").GetVehicle(0)); if(v3.IsCollidingWithVirtualObject("LZW2")){v3.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v3,obj);wait+=2.0;} System::Log("zug %i,3",childID); Vehicle v4(VehicleList("01_10_01").GetVehicle(0)); if(v4.IsCollidingWithVirtualObject("LZW2")){v4.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v4,obj);wait+=2.0;} System::Log("zug %i,4",childID); Vehicle v5(VehicleList("01_24_01").GetVehicle(0)); if(v5.IsCollidingWithVirtualObject("LZW1")){v5.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v5,obj);wait+=2.0;} System::Log("zug %i,5",childID); } } }; object VcmdBMA : CommandScript { VcmdBMA() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdBMA",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 8.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdBMA",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdBMA",Target,2,false); }else if(childID==2){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_33_01").GetVehicle(0),VehicleList("01_33_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdBMA",Target,3,false); }else if(childID==3){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_03").GetVehicle(0),VehicleList("01_46_03").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdBMA",Target,4,false); }else if(childID==4){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); float wait=2.0; System::Log("Halbzug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v3(VehicleList("01_33_01").GetVehicle(0)); if(v3.IsCollidingWithVirtualObject("LZW1")){v3.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v3,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v4(VehicleList("01_46_03").GetVehicle(0)); if(v4.IsCollidingWithVirtualObject("LZW2")){v4.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v4,obj);wait+=2.0;} } } }; object VcmdPWohnung : CommandScript { VcmdPWohnung() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdPWohnung",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 8.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_72_01").GetVehicle(0),VehicleList("01_72_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdPWohnung",Target,1,false); }else if(childID==1){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); float wait=2.0; System::Log("Halbzug %i,0",childID); Vehicle v1(VehicleList("01_72_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW2")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} } } }; object VcmdVU1: CommandScript { VcmdVU1() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdVU1",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 8.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdVU1",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdVU1",Target,2,false); }else if(childID==2){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_52_01").GetVehicle(0),VehicleList("01_52_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdVU1",Target,3,false); }else if(childID==3){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); float wait=2.0; System::Log("Halbzug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v3(VehicleList("01_52_01").GetVehicle(0)); if(v3.IsCollidingWithVirtualObject("LZW1")){v3.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v3,obj);wait+=2.0;} } } }; object VcmdVU2: CommandScript { VcmdVU2() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdVU2",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 8.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdVU2",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdVU2",Target,2,false); }else if(childID==2){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_03").GetVehicle(0),VehicleList("01_46_03").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdVU2",Target,3,false); }else if(childID==3){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_71_01").GetVehicle(0),VehicleList("01_71_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,2.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdVU2",Target,4,false); }else if(childID==4){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_52_01").GetVehicle(0),VehicleList("01_52_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdVU2",Target,5,false); }else if(childID==5){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); float wait=2.0; System::Log("Halbzug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v3(VehicleList("01_46_03").GetVehicle(0)); if(v3.IsCollidingWithVirtualObject("LZW2")){v3.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v3,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v4(VehicleList("01_71_01").GetVehicle(0)); if(v4.IsCollidingWithVirtualObject("LZW4")){v4.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v4,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v5(VehicleList("01_52_01").GetVehicle(0)); if(v5.IsCollidingWithVirtualObject("LZW1")){v5.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v5,obj);wait+=2.0;} } } }; object VcmdOelspur: CommandScript { VcmdOelspur() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdOelspur",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 8.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_11_01").GetVehicle(0),VehicleList("01_11_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdOelspur",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdOelspur",Target,2,false); }else if(childID==2){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); float wait=2.0; System::Log("Halbzug %i,0",childID); Vehicle v1(VehicleList("01_11_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v2(VehicleList("01_46_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW1")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} } } }; object VcmdDLK: CommandScript { VcmdDLK() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdDLK",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 8.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_33_01").GetVehicle(0),VehicleList("01_33_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdDLK",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_03").GetVehicle(0),VehicleList("01_46_03").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdDLK",Target,2,false); }else if(childID==2){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); float wait=2.0; System::Log("Halbzug %i,0",childID); Vehicle v1(VehicleList("01_33_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v2(VehicleList("01_46_03").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW2")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} } } }; object VcmdWasserettung: CommandScript { VcmdWasserettung() { SetIcon("alarm"); SetCursor("alarm"); SetPriority(201); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed"); obj.SetPosition(Game::GetCommandPos()); obj.Show(); obj.PushActionWait(ACTION_APPEND,120); obj.PushActionDeleteOwner(ACTION_APPEND); Game::ExecuteCommand("wachampel",Caller); Caller->PushActionWait(ACTION_APPEND,3.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdWasserettung",&obj,-1,false); GameObjectList l2 = Game::GetGameObjects("Dummy_FW1"); if(l2.GetNumObjects() == 0) { GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1"); mDummy.Hide(); mDummy.SetUserData(100); } l2 = Game::GetGameObjects("Dummy_FW1"); GameObject dummdumm(l2.GetObject(0)); if(dummdumm.GetUserData() == 100) { dummdumm.SetUserData(-1); dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false); dummdumm.PushActionWait(ACTION_APPEND, 8.f); dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false); } }else if(childID==-1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,1.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdWasserettung",Target,1,false); }else if(childID==1){ Game::ExecuteCommand("VcmdAlarm",VehicleList("01_58_01").GetVehicle(0),VehicleList("01_58_01").GetVehicle(0)); Caller->PushActionWait(ACTION_APPEND,14.0); Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdWasserettung",Target,2,false); }else if(childID==2){ GameObject obj(Target); obj.PushActionWait(ACTION_APPEND,60); obj.PushActionDeleteOwner(ACTION_APPEND); float wait=2.0; System::Log("Halbzug %i,0",childID); Vehicle v1(VehicleList("01_46_01").GetVehicle(0)); if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;} System::Log("Halbzug %i,1",childID); Vehicle v2(VehicleList("01_58_01").GetVehicle(0)); if(v2.IsCollidingWithVirtualObject("LZW2")){v2.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v2,obj);wait+=2.0;} } } }; object ABC_erkunden : CommandScript { ABC_erkunden() { } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_FLOOR||Target->GetType()==ACTOR_STREET; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==0){ Caller->PushActionMove(ACTION_NEWLIST,Game::GetCommandPos()); Caller->PushActionSwitchAnim(ACTION_APPEND,"hostage_down"); Caller->PushActionExecuteCommand(ACTION_APPEND,"ABC_erkunden",Target,1,false); }else if(childID==1){ Mission::PlayHint("BHint_29"); } } }; object Create_Person : CommandScript { Create_Person() { } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); int x; x=childID%100; int y = childID-x; if (childID > 100) { if(y == 100) ActorList l1("BF01"); // BF Alarmgruppe if(y == 200) ActorList l1("BF02"); // BF Hof if(y == 300) ActorList l1("FF01"); // FF Wache Groß if(y == 400) ActorList l1("FF02"); // FF Wache Klein if(y == 500) ActorList l1("RD01"); // Wache Krankenhaus if(y == 600) ActorList l1("RD02"); // Wache Südost if(y == 700) ActorList l1("RD03"); // BF Rettungsdienst if(y == 800) ActorList l1("WF01"); // Werkfeuerwehr Chemiewerk if(y == 900) ActorList l1("PP01"); // Polizei Präsidium if(y == 1000) ActorList l1("PP02"); // Polizei Präsidium if(y == 1100) ActorList l1("PP03"); // Polizei Präsidium if(y == 1200) ActorList l1("notaufnahme"); // Notaufnahme if(y == 1300) ActorList l1("FF03"); // FF Oberzell if(l1.GetNumActors() > 0) { eing = *l1.GetActor(0); eingang = eing.GetPosition(); } } p=Xmlutil::CreateSquad(x,Caller->GetName()); p.SetAutoHealDistance(0.0f); if(x == 10||x == 11||x == 26)p.AssignCommand("ich_bin_ein_einsatzleiter"); if(x == 21||x==22||x==36) p.AssignCommand("DummyIsOfficer"); if(x == 26) { p.AssignCommand("einsatzleiter_bma_reset"); p.AssignCommand("PCmDExAll"); p.AssignCommand("Extinguish"); } if(x==44)p.AssignCommand("Knockout"); if(x == 36)p.AssignCommand("GetDog"); p.SetPlayerMP(v.GetPlayerMP()); if((x<=7&&x!=4)||x==26||x>38){ Game::GetGameString("RESISTANCE_FWM_FIRE", FireResistance, 3); float FeuerResistenz = Math::atoi(FireResistance); p.SetResistance(INJUREREASON_FIRE, FeuerResistenz); } if(x==4||x==8||x==38){ Game::GetGameString("RESISTANCE_AGT_FIRE", FireResistance, 3); float FeuerResistenz = Math::atoi(FireResistance); p.SetResistance(INJUREREASON_FIRE, FeuerResistenz); } if(x==21||x==22||x==27||x==28||x==33||x==36){ p.SetResistance(INJUREREASON_FIRE, 50.0f); }else if(x>=13&&x<=36){ Game::GetGameString("RESISTANCE_ZIV_FIRE", FireResistance, 3); float FeuerResistenz = Math::atoi(FireResistance); p.SetResistance(INJUREREASON_FIRE, FeuerResistenz); } if (childID > 100) { Game::FindFreePosition(&p,eingang,200); p.SetPosition(eingang); p.PushActionMove(ACTION_NEWLIST, &v, TARGET_PASSENGERDOOR); p.PushActionTurnTo(ACTION_APPEND, &v); p.PushActionEnterCar(ACTION_APPEND, &v); } else{ eingang=v.GetTargetPoint(&p,TARGET_PASSENGERDOOR); Game::FindFreePosition(&p,eingang,200); p.SetPosition(eingang); p.PushActionMove(ACTION_NEWLIST, &v, TARGET_PASSENGERDOOR); p.PushActionTurnTo(ACTION_APPEND, &v); p.PushActionEnterCar(ACTION_APPEND, &v); } } }; object aufsitzen : CommandScript { aufsitzen() { } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Person p; Vehicle v(Caller); bool pinbasket = false; if(v.GetVehicleType() == VT_THW_FGRR_BKF && v.IsInstalled()) v.PushActionDeinstall(ACTION_APPEND); PersonList l2(Caller->GetName()); for(int i = 0; i < l2.GetNumPersons(); i++) { if (!l2.GetPerson(i)->IsInjured() && !l2.GetPerson(i)->IsDead() && !l2.GetPerson(i)->IsRescueDog()) { p = *l2.GetPerson(i); p.SetCommandable(true); if(p.GetPersonType() == PT_POLICEMEN && p.IsLinkedWithPerson()) { p.PushActionMove(ACTION_NEWLIST, &v, TARGET_ANY); p.PushActionTurnTo(ACTION_APPEND, &v); p.PushActionPutInCar(ACTION_APPEND, &v); p.PushActionExecuteCommand(ACTION_APPEND,"entercar",&v,1,false); } else if(v.GetVehicleType() == VT_FIREFIGHTERS_DLK && v.IsUplifted() && p.IsInDLKBasket()) { pinbasket = true; v.PushActionBasketDown(ACTION_APPEND, Vector(0.f, 0.f, 0.f)); v.PushActionExecuteCommand(ACTION_APPEND, "einsteigen", &p, 0, false); v.PushActionDeinstall(ACTION_APPEND); v.PushActionWait(ACTION_APPEND, 3.0f); v.PlayAnimCloseDoor(DAT_SPECIAL, 3.0f, Caller); } else if(v.GetVehicleType() == VT_FIREFIGHTERS_DLK && v.IsInstalled() && !p.IsInDLKBasket() && !pinbasket) { v.PushActionBasketDown(ACTION_APPEND, Vector(0.f, 0.f, 0.f)); v.PushActionDeinstall(ACTION_APPEND); v.PushActionWait(ACTION_APPEND, 3.0f); v.PlayAnimCloseDoor(DAT_SPECIAL, 3.0f, Caller); } else if(p.GetEquipment()==EQUIP_FIREHOSE && p.GetFirehoseID() != 0){ p.PushActionExecuteCommand(ACTION_NEWLIST, "RemoveFirehose", Caller, 1); }else if(v.IsFirefighter() && (p.IsCarryingPerson() || p.IsCarryingContaminatedPerson())) { p.PushActionUnloadPerson(ACTION_NEWLIST); p.PushActionMove(ACTION_APPEND, &v, TARGET_PASSENGERDOOR); p.PushActionTurnTo(ACTION_APPEND, &v); p.PushActionEnterCar(ACTION_APPEND, &v); } else if(v.IsFirefighter() && (p.IsLinkedWithPerson() || p.IsLinkedWithContaminatedPerson())) { p.PushActionRelease(ACTION_NEWLIST); p.PushActionMove(ACTION_APPEND, &v, TARGET_PASSENGERDOOR); p.PushActionTurnTo(ACTION_APPEND, &v); p.PushActionEnterCar(ACTION_APPEND, &v); } else if(p.GetPersonType() == PT_PARAMEDIC && p.IsCurrentAction("EActionTreatPerson")) { GameObjectList l4; l4 = p.GetObjectsInRange(5,ACTOR_PERSON); for (int j=0;jIsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); if (v.GetVehicleType() == VT_AMBULANCE_RTW) { if (v.GetNumTransported() > 0) return; } //Check Klinik /*PersonList tl=v.GetTransports(); for(int i=0;iIsInjured()){ v.PushActionExecuteCommand(ACTION_NEWLIST,"VCmdHospital",Caller,childID,true); return; } }*/ //END Check Klinik ActorList l1; if(!v.HasName("01_84_01")) l1 = Game::GetActors(Caller->GetName()); else l1 = Game::GetActors("CH31"); v.PushActionWait(ACTION_NEWLIST, 1); if (v.IsBlueLightEnabled()) { int ref = Caller->GetUserData(); Audio::StopSample(ref); if (v.IsBlueLightEnabled()) v.PushActionExecuteCommand(ACTION_APPEND, "VCmdBlue", &v, 0, false); } for(int i = 0; i < l1.GetNumActors(); i++) { if (l1.GetActor(i)->GetType() == ACTOR_VIRTUAL) fz = *l1.GetActor(i); } wache=fz.GetPosition(); if (Caller->HasName("11_83_01") || Caller->HasName("04_50_01") || Caller->HasName("04_46_01") || Caller->HasName("04_19_01") || Caller->HasName("04_74_01") || Caller->HasName("04_44_01") || Caller->HasName("01_11_01") || Caller->HasName("01_46_01") || Caller->HasName("01_24_01") || Caller->HasName("01_52_01") || Caller->HasName("01_33_01") || Caller->HasName("11_83_02") || Caller->HasName("11_83_03") || Caller->HasName("11_82_01") || Caller->HasName("11_82_02") || Caller->HasName("14_86_01") || Caller->HasName("BS_01_01") || Caller->HasName("BS_02_01")) { wendep = wache + Vector(0,-700,0); richtung = wendep + Vector(0,-8000,0); } if (Caller->HasName("12_82_01") || Caller->HasName("12_83_01") || Caller->HasName("12_83_02") || Caller->HasName("11_83_04") || Caller->HasName("11_85_01") || Caller->HasName("11_85_02") || Caller->HasName("11_10_01") || Caller->HasName("01_46_03") || Caller->HasName("01_10_01") || Caller->HasName("01_72_01") || Caller->HasName("01_58_01") || Caller->HasName("02_83_01") || Caller->HasName("PP_10_06") || Caller->HasName("PP_10_07") || Caller->HasName("PP_10_08") || Caller->HasName("PP_10_09") || Caller->HasName("BS_03_01")) { wendep = wache + Vector(0,700,0); richtung = wendep + Vector(0,8000,0); } if (Caller->HasName("PP_20_04") || Caller->HasName("AB_MANV") || Caller->HasName("01_91_01") || Caller->HasName("01_93_01") || Caller->HasName("01_71_01") || Caller->HasName("11_49_01") || Caller->HasName("11_28_01") || Caller->HasName("11_26_01") || Caller->HasName("11_26_02") || Caller->HasName("11_19_01") || Caller->HasName("01_83_01") || Caller->HasName("01_83_02") || Caller->HasName("03_46_01") || Caller->HasName("03_45_01") || Caller->HasName("03_19_01") || Caller->HasName("03_62_01") || Caller->HasName("06_46_01") || Caller->HasName("06_11_01") || Caller->HasName("06_24_01") || Caller->HasName("06_46_02") || Caller->HasName("02_11_01") || Caller->HasName("02_46_01") || Caller->HasName("02_46_02") || Caller->HasName("05_62_01") || Caller->HasName("PP_20_01") || Caller->HasName("PP_20_02") || Caller->HasName("KR_01_01") || Caller->HasName("13_80_01") || Caller->HasName("13_82_01") || Caller->HasName("13_83_01") || Caller->HasName("13_83_02") || Caller->HasName("PP_10_01") || Caller->HasName("PP_10_04") || Caller->HasName("PP_20_03") || v.HasName("13_85_01")) { wendep = wache + Vector(-700,0,0); richtung = wendep + Vector(-8000,0,0); } if (Caller->HasName("15_82_01") || Caller->HasName("15_83_01") || Caller->HasName("15_85_01") || Caller->HasName("15_85_02") || Caller->HasName("15_83_02") || Caller->HasName("15_89_01") || Caller->HasName("15_19_01") || Caller->HasName("AB_MULDE") || Caller->HasName("AB_AS") || Caller->HasName("AB_DEKON") || Caller->HasName("PP_10_03") || Caller->HasName("PP_10_02") || Caller->HasName("PP_10_05") || Caller->HasName("PP_30_01") || Caller->HasName("PP_30_02") || Caller->HasName("PP_30_03") || Caller->HasName("PP_30_04") || Caller->HasName("PP_30_07") || Caller->HasName("PP_30_06") || Caller->HasName("PP_10_10") || Caller->HasName("01_65_01") || Caller->HasName("01_65_02") || v.HasName("00_99_01") || Caller->HasName("01_83_03")) { wendep = wache + Vector(700,0,0); richtung = wendep + Vector(8000,0,0); } Game::FindFreePosition(Caller,wendep,50); if (v.HasCommand("DUMMY_PU")) { v.PlayAnimCloseDoor("PU", 1.0f, 0); v.RemoveCommand("DUMMY_PU"); } if (v.HasCommand("DUMMY_AS")) { v.PlayAnimCloseDoor("AS", 1.0f, 0); v.RemoveCommand("DUMMY_AS"); } if (v.HasCommand("DUMMY_RS")) { v.PlayAnimCloseDoor("RS", 1.0f, 0); v.RemoveCommand("DUMMY_RS"); } if (v.HasCommand("DUMMY_GR")) { v.PlayAnimCloseDoor("G_R", 1.0f, 0); v.RemoveCommand("DUMMY_GR"); } if (v.HasCommand("DUMMY_PLANE")) { v.PlayAnimCloseDoor("plane", 1.0f, 0); v.RemoveCommand("DUMMY_PLANE"); } if (v.HasCommand("KRA")) Game::ExecuteCommand("VCmdWarnAb", &v); Audio::StopSample(v.GetUserData()); for (int h = 1; h < 9; h++) { char e[14]; char l[6]; snprintf(e, 14, "DUMMY_G%i", h); snprintf(l, 6, "G_%i", h); if (v.HasCommand(e)) { v.PlayAnimCloseDoor(l, 1.0f, 0); v.RemoveCommand(e); } } if (v.IsSpecialLightEnabled()) v.EnableSpecialLights(false); v.SetChildEnabled("VH", true); v.SetChildEnabled("SH", true); if(v.GetUserData() == 6) v.PushActionExecuteCommand(ACTION_APPEND, "FMS", Caller, 6, false); else v.PushActionExecuteCommand(ACTION_APPEND, "FMS", Caller, 1, false); if(!v.HasName("01_84_01")) { //Geschwindigkeit anpassen char speeds[10]; Game::GetGameString("civilspeed", speeds, 10); float speed = Math::atof(speeds); v.SetSpeed(speed); v.PushActionMove(ACTION_APPEND,wendep); v.PushActionTurnTo(ACTION_APPEND, richtung); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",Caller,0,true); v.PushActionWait(ACTION_APPEND, 2.5f); if (v.HasCommand("TOR_H")) v.PushActionExecuteCommand(ACTION_APPEND,"OpenGateH",Caller,0,true); v.PushActionExecuteCommand(ACTION_APPEND,"OpenGate",Caller,0,true); v.PushActionWait(ACTION_APPEND, 2.5f); if(v.HasChild("WARN") && !v.HasCommand("TOR_H")) v.PushActionExecuteCommand(ACTION_APPEND,"SOUND_PLAYER",Caller,4,true); } if(!v.HasName("01_84_01")) v.PushActionMove(ACTION_APPEND,wache); else { v.PushActionFlyTo(ACTION_APPEND, wache, true, -1.0f); v.PushActionExecuteCommand(ACTION_APPEND, "VCmdDebug", &v, 5, false); return; } v.PushActionWait(ACTION_APPEND, 2.5f); v.PushActionExecuteCommand(ACTION_APPEND,"GoWache",Caller,0,true); v.PushActionTurnTo(ACTION_APPEND, richtung); if(v.HasChild("BRAKE")) v.PushActionExecuteCommand(ACTION_APPEND,"SOUND_PLAYER",Caller,1,true); v.PushActionExecuteCommand(ACTION_APPEND,"ActionEmptyPF",Caller,childID,true); v.PushActionWait(ACTION_APPEND, 2.0f); v.PushActionExecuteCommand(ACTION_APPEND,"ActionEmptyPF",Caller,childID,true); v.PushActionWait(ACTION_APPEND, 0.5f); if(v.GetUserData() != 6) v.PushActionExecuteCommand(ACTION_APPEND, "FMS", Caller, 2, false); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",Caller,1,true); v.PushActionExecuteCommand(ACTION_APPEND,"LIGHTS",Caller,1,true); v.PushActionWait(ACTION_APPEND, 1.5f); if (v.HasCommand("TOR_H")) v.PushActionExecuteCommand(ACTION_APPEND,"CloseGateH",Caller,0,true); v.PushActionExecuteCommand(ACTION_APPEND,"CloseGate",Caller,0,true); v.PushActionWait(ACTION_APPEND, 2.5f); if(v.GetUserData() == 6) { v.PushActionWait(ACTION_APPEND, Math::rand() % 200+100); v.PushActionExecuteCommand(ACTION_APPEND, "Desi_Startklar", &v, 0, false); return; } if (Caller->HasName("02_11_01") || Caller->HasName("02_46_02") || Caller->HasName("02_46_01") || Caller->HasName("02_33_01") || Caller->HasName("06_11_01") || Caller->HasName("06_24_01") || Caller->HasName("06_46_01") || Caller->HasName("06_46_02") || Caller->HasName("13_80_01") || Caller->HasName("13_82_01") || Caller->HasName("13_83_01") || Caller->HasName("13_83_02") || Caller->HasName("15_82_01") || Caller->HasName("14_86_01") || Caller->HasName("15_83_01") || Caller->HasName("15_83_02") || Caller->HasName("15_89_01") || Caller->HasName("15_85_01") || Caller->HasName("15_85_02") || Caller->HasName("PP_30_01") || Caller->HasName("PP_30_02") || Caller->HasName("PP_30_03") || Caller->HasName("PP_30_04") || Caller->HasName("PP_30_06") || Caller->HasName("PP_30_07") || Caller->HasName("PP_10_10") || Caller->HasName("13_85_01") || Caller->HasName("15_19_01")) { Caller->EnableHeadLights(true); } v.PushActionExecuteCommand(ACTION_APPEND,"GetBindemittel",&v,2,false); v.PushActionExecuteCommand(ACTION_APPEND,"END_ALARM",Caller,0,true); } }; object Desi_Startklar : CommandScript { Desi_Startklar() { } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vehicle v(Caller); v.SetUserData(2); v.SetCommandable(true); v.SetSelectable(true); v.PushActionExecuteCommand(ACTION_NEWLIST,"END_ALARM",Caller,0,true); v.PushActionExecuteCommand(ACTION_APPEND, "FMS", Caller, 2, false); char Namestring[255]; char Hint[255]; Game::GetGameString(v.GetPrototypeName(), Namestring, 255); snprintf(Hint, 255, "%s: Desinfektion abgeschlossen, Fahrzeug wieder einsatzbereit.", Namestring); if (Game::IsMultiplayer()){ScriptInterface::ShowMessageTickerTextForAll(Hint);} else{Game::ShowHelpTextWindow(Hint);} } }; object GoWache : CommandScript { GoWache() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Actor fzb; ActorList Lbase(Caller->GetName()); for(int i = 0; i < Lbase.GetNumActors(); i++) { if (Lbase.GetActor(i)->GetType() == ACTOR_VIRTUAL) fzb = *Lbase.GetActor(i); } Caller->SetPosition(fzb.GetPosition()); if (Caller->HasName("KR_01_01") || Caller->HasName("02_11_01") || Caller->HasName("02_46_02") || Caller->HasName("02_46_01") || Caller->HasName("02_33_01") || Caller->HasName("06_11_01") || Caller->HasName("06_24_01") || Caller->HasName("06_46_01") || Caller->HasName("06_46_02") || Caller->HasName("13_80_01") || Caller->HasName("13_82_01") || Caller->HasName("13_83_01") || Caller->HasName("13_83_02") || Caller->HasName("15_82_01") || Caller->HasName("14_86_01") || Caller->HasName("15_83_01") || Caller->HasName("15_83_02") || Caller->HasName("15_89_01") || Caller->HasName("15_85_01") || Caller->HasName("15_85_02") || Caller->HasName("PP_30_01") || Caller->HasName("PP_30_02") || Caller->HasName("PP_30_03") || Caller->HasName("PP_30_04") || Caller->HasName("PP_30_06") || Caller->HasName("PP_30_07") || Caller->HasName("PP_10_10") || Caller->HasName("13_85_01") || Caller->HasName("15_19_01")) { Caller->Hide(); Caller->EnableHeadLights(true); } } }; object LIGHTS : CommandScript { LIGHTS() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); switch(childID) { case 1: // Alle Lichter aus v.EnableHeadLights(false); v.EnableBlinker(BLT_NONE); if (v.IsBlueLightEnabled()) v.PushActionExecuteCommand(ACTION_APPEND, "VCmdBlue", &v, 0, false); break; case 2: // Scheinwerfer an v.EnableHeadLights(true); break; } } }; object COMMANDOSPERRE : CommandScript { COMMANDOSPERRE() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { switch(childID) { case 0: GameObject obj(Caller); obj.SetCommandable(false); Game::ExecuteCommand("RESETAGT", &obj, &obj); break; case 1: Caller->SetCommandable(true); break; } } }; object END_ALARM : CommandScript { END_ALARM() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(Caller->HasCommand("ALARM_DUMMY")) Caller->RemoveCommand("ALARM_DUMMY"); if(Caller->HasCommand("TOR_H")) Caller->RemoveCommand("TOR_H"); if(Caller->HasCommand("ICH_HABE_STRETCHER")) Caller->RemoveCommand("ICH_HABE_STRETCHER"); if(Caller->HasName("01_52_01") && !zrtweinsatz && !tlfeinsatz) { if (!Caller->HasCommand("OHNE_WT")){WACHE_1_SPRINGER = true;} } if(Caller->HasName("02_46_01") && !rweinsatz && !lrfeinsatz) { if (!Caller->HasCommand("OHNE_WT")){WACHE_2_SPRINGER = true;} } if(Caller->HasName("02_52_01")){WACHE_2_SPRINGER = true; rweinsatz=false;} if(Caller->HasName("02_72_01")){WACHE_2_SPRINGER = true; lrfeinsatz=false;} if(Caller->HasName("01_24_01")){WACHE_1_SPRINGER=true; tlfeinsatz=false;} if(Caller->HasName("01_83_02")){WACHE_1_SPRINGER=true; zrtweinsatz=false;} if(Caller->HasName("01_11_01")){WACHE_1_ALARMSTUFE = false;} if(Caller->HasName("02_11_01")){WACHE_2_ALARMSTUFE = false;} Game::ExecuteCommand("ZZ_Shears",Caller,Caller); } }; object OpenGate : CommandScript { OpenGate() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { const char *TORTEMP; const char *FAHRZEUGNAME; char TORNAME[255]; TORTEMP = "gate"; FAHRZEUGNAME = Caller->GetName(); snprintf(TORNAME, 255, "%s_%s",TORTEMP,FAHRZEUGNAME); GameObjectList gates(TORNAME); for(int i = 0; i < gates.GetNumObjects(); i++) { GameObject * gate = gates.GetObject(i); if (gate) { gate->SetAnimation("open"); gate->SetUserData(1); if(ChildID==42){ gate->PushActionWait(ACTION_APPEND,10); gate->PushActionSwitchAnim(ACTION_APPEND,"close"); } } } } }; object CloseGate : CommandScript { CloseGate() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { const char *TORTEMP; const char *FAHRZEUGNAME; char TORNAME[255]; TORTEMP = "gate"; FAHRZEUGNAME = Target->GetName(); snprintf(TORNAME, 255, "%s_%s",TORTEMP,FAHRZEUGNAME); GameObjectList gates(TORNAME); // Name des Tores bzw. Fahrzeuges for(int i = 0; i < gates.GetNumObjects(); i++) { GameObject * gate = gates.GetObject(i); if (gate) { gate->SetAnimation("close"); gate->SetUserData(1); } } } }; object OpenGateH : CommandScript { OpenGateH() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { const char *TORTEMP; const char *FAHRZEUGNAME; char TORNAME[255]; TORTEMP = "gate"; FAHRZEUGNAME = Caller->GetName(); snprintf(TORNAME, 255, "%s_%s_H",TORTEMP,FAHRZEUGNAME); GameObjectList gates(TORNAME); // Name des Tores bzw. Fahrzeuges for(int i = 0; i < gates.GetNumObjects(); i++) { GameObject * gate = gates.GetObject(i); if (gate) { gate->SetAnimation("open"); gate->SetUserData(1); } } } }; object CloseGateH : CommandScript { CloseGateH() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { const char *TORTEMP; const char *FAHRZEUGNAME; char TORNAME[255]; TORTEMP = "gate"; FAHRZEUGNAME = Caller->GetName(); snprintf(TORNAME, 255, "%s_%s_H",TORTEMP,FAHRZEUGNAME); GameObjectList gates(TORNAME); // Name des Tores bzw. Fahrzeuges for(int i = 0; i < gates.GetNumObjects(); i++) { GameObject * gate = gates.GetObject(i); if (gate) { gate->SetAnimation("close"); gate->SetUserData(1); } } } }; object ActionEmptyPF : CommandScript { ActionEmptyPF() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vehicle v(Caller); PersonList crew = v.GetPassengers(); for(int i=0; i < crew.GetNumPersons(); i++) { crew.GetPerson(i)->PushActionLeaveCar(ACTION_NEWLIST, Caller); crew.GetPerson(i)->PushActionWait(ACTION_APPEND,0.1f); crew.GetPerson(i)->PushActionDeleteOwner(ACTION_APPEND); crew.GetPerson(i)->PushActionWait(ACTION_APPEND,0.1f); } if (v.HasCommand("DUMMY_BIKE")) v.SetChildEnabled("PERSON",false); PersonList transports = v.GetTransports(); for(int i = 0; i < transports.GetNumPersons(); i++) { transports.GetPerson(i)->PushActionLeaveCar(ACTION_NEWLIST, Caller); if(transports.GetPerson(i)->GetRole() == ROLE_GANGSTER) { if(transports.GetPerson(i)->HasCommand("Mord")){ Game::SetEventFinished(EinsatzID, true, 1); EinsatzID=0; } if(transports.GetPerson(i)->HasCommand("GenRD")){ int xyz=Math::atoi(transports.GetPerson(i)->GetName()); System::Log("@GenRD end: %i",xyz); Game::SetEventFinished(xyz, true, 1); transports.GetPerson(i)->PushActionExecuteCommand(ACTION_INSERT,"CheckEID",NULL,xyz,false); } transports.GetPerson(i)->SetRole(ROLE_CIVILIAN); transports.GetPerson(i)->SetBehaviour(BEHAVIOUR_CIVILIAN_NORMAL); } transports.GetPerson(i)->PushActionWait(ACTION_APPEND, 0.1f); transports.GetPerson(i)->PushActionDeleteOwner(ACTION_APPEND); } } }; object SOUND_PLAYER : CommandScript { SOUND_PLAYER() { } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID() || Caller->GetType() != ACTOR_VEHICLE) return false; return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); switch(childID) { case 0: char DATEIPFAD[255]; snprintf(DATEIPFAD,60,"mod:Audio/FX/car sounds/%s_starting.wav", Caller->GetName(), childID); Audio::PlaySample3D(DATEIPFAD, Caller->GetPosition(), false); break; case 1: Audio::PlaySample3D("mod:Audio/FX/car sounds/pressure.wav", Caller->GetPosition(), false); break; case 2: Audio::PlaySample3D("mod:Audio/FX/car sounds/hydra.wav", Caller->GetPosition(), false); break; case 3: Audio::PlaySample3D("mod:Audio/FX/car sounds/pkw_starting2.wav", Caller->GetPosition(), false); break; case 4: Audio::PlaySample3D("mod:Audio/FX/car sounds/rueckw.wav", Caller->GetPosition(), false); break; case 5: Audio::StopSample(Caller->GetUserData()); int PUMPE_SOUND = Audio::PlaySample3D("mod:Audio/FX/car sounds/pumpe.wav",Caller->GetPosition(),true); Caller->SetUserData(PUMPE_SOUND); Caller->AssignCommand("PUMPE_ON"); break; case 6: if (Caller->HasName("01_46_01") || Caller->HasName("03_46_01") || Caller->HasName("02_46_01")) int GENERATOR_SOUND = Audio::PlaySample3D("mod:Audio/FX/car sounds/generator_n.wav",Caller->GetPosition(),true); else if (Caller->HasName("02_52_01")) int GENERATOR_SOUND = Audio::PlaySample3D("mod:Audio/FX/car sounds/pumpe.wav",Caller->GetPosition(),true); else int GENERATOR_SOUND = Audio::PlaySample3D("mod:Audio/FX/car sounds/generator_a.wav",Caller->GetPosition(),true); Caller->SetUserData(GENERATOR_SOUND); Caller->AssignCommand("GENERATOR_ON"); break; case 7: Audio::PlaySample3D("mod:Audio/FX/car sounds/Alarmstufe.wav", Caller->GetPosition(), false); break; } } }; object Alarmstufe : CommandScript { Alarmstufe() { SetIcon("Alarmstufe"); SetCursor("Alarmstufe"); SetValidTargets(ACTOR_VEHICLE); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->HasCommand("ALARM_DUMMY")) return false; if (Mission::GetCounter("Burning Houses") > 5 || Mission::GetCounter("Burning Objects") > 30 || Mission::GetCounter("Injured Civils") > 7 || Mission::GetCounter("Injured Squads") > 4 || Mission::GetCounter("Dead Squads") > 2 || Mission::GetCounter("Contaminated Persons") > 1) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); if (v.HasName("01_11_01") || v.HasName("02_11_01")) { WACHE_1_ALARMSTUFE = true; WACHE_2_ALARMSTUFE = true; } Vehicle v2=Game::CreateVehicle("mod:Prototypes/Vehicles/Dummy/missing.e4p",v.GetName()); v2.PushActionExecuteCommand(ACTION_NEWLIST, "FMS", Caller, 11, false); v2.PushActionExecuteCommand(ACTION_APPEND, "SOUND_PLAYER", Caller, 7, true); v2.PushActionDeleteOwner(ACTION_APPEND); if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_30"); else Game::ShowHelpTextWindow("BHint_30"); Mission::PlayComment("mod:Lang/de/Melder/ID_SUPERV_EVENTALARMSTUFE"); } }; object OHNE_WT : CommandScript { OHNE_WT() { SetIcon("OHNE_WT"); SetCursor("OHNE_WT"); SetGroupID(DummyGroup_b); SetGroupLeader(true); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->RemoveCommand("OHNE_WT"); Caller->AssignCommand("MIT_WT"); } }; object MIT_WT : CommandScript { MIT_WT() { SetIcon("MIT_WT"); SetCursor("MIT_WT"); SetGroupID(DummyGroup_b); SetGroupLeader(true); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->RemoveCommand("MIT_WT"); Caller->AssignCommand("OHNE_WT"); } }; object OHNE_NA : CommandScript { OHNE_NA() { SetIcon("OHNE_NA"); SetCursor("OHNE_NA"); SetGroupID(DummyGroup_b); SetGroupLeader(true); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->RemoveCommand("OHNE_NA"); Caller->AssignCommand("MIT_NA"); } }; object MIT_NA : CommandScript { MIT_NA() { SetIcon("MIT_NA"); SetCursor("MIT_NA"); SetGroupID(DummyGroup_b); SetGroupLeader(true); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->RemoveCommand("MIT_NA"); Caller->AssignCommand("OHNE_NA"); } }; object P01 : CommandScript { P01() { SetIcon("P_01"); SetCursor("P_01"); SetGroupID(DummyGroup_b); SetGroupLeader(true); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->RemoveCommand("P01"); Caller->AssignCommand("P02"); } }; object P02 : CommandScript { P02() { SetIcon("P_02"); SetCursor("P_02"); SetGroupID(DummyGroup_b); SetGroupLeader(true); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->RemoveCommand("P02"); Caller->AssignCommand(Caller->HasName("PP_20_02")?"P03":"P01"); } }; object P03 : CommandScript { P03() { SetIcon("P_03"); SetCursor("P_03"); SetGroupID(DummyGroup_b); SetGroupLeader(true); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->RemoveCommand("P03"); Caller->AssignCommand("P01"); } }; object B01 : CommandScript { B01() { SetIcon("B_01"); SetCursor("B_01"); SetGroupID(DummyGroup_b); SetGroupLeader(true); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->RemoveCommand("B01"); Caller->AssignCommand("B02"); } }; object B02 : CommandScript { B02() { SetIcon("B_02"); SetCursor("B_02"); SetGroupID(DummyGroup_b); SetGroupLeader(true); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->RemoveCommand("B02"); Caller->AssignCommand("B03"); } }; object B03 : CommandScript { B03() { SetIcon("B_03"); SetCursor("B_03"); SetGroupID(DummyGroup_b); SetGroupLeader(true); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->RemoveCommand("B03"); Caller->AssignCommand("B01"); } }; Object Alarm_13_80_01 : CommandScript { Alarm_13_80_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("13_80_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("13_80_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; else return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("13_80_01") && !v.HasCommand("Alarm_Dummy")) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_31"); else Mission::PlayHint("BHint_31"); v.SetMaxPassengers(2); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 37, true); Xmlutil::Alarmext(v,TargetPos,65.0f,8); } } } }; Object Alarm_13_82_01 : CommandScript { Alarm_13_82_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("13_82_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("13_82_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_32"); else Mission::PlayHint("BHint_32"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("13_82_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(2); if (ZUFALL > 4) v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 18, true); else v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 19, true); Xmlutil::Alarmext(v,TargetPos,65.0f,8); } } } }; Object Alarm_01_84_01 : CommandScript { Alarm_01_84_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("RTH"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("01_84_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { int h,m,s; Game::GetTime(h,m,s); if (h > 19 || h < 6) { Mission::PlayHint("BHint_33"); return; } if(Weather::IsFlashing() || Weather::GetRainIntensity()>0.6 || Weather::GetFogIntensity()>0.5 || Weather::GetStormIntensity()>0.5) { Mission::PlayHint("BHint_34"); return; } if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_35"); else Mission::PlayHint("BHint_35"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("01_84_01")&& !v.HasCommand("Alarm_Dummy")) { v.EnableBlinker(BLT_NONE); v.EnableHeadLights(true); ZUFALL = (Math::rand()%10); v.SetMaxPassengers(3); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 43, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 34, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 34, true); v.PushActionWait(ACTION_APPEND,65.0f); v.PushActionShowHide(ACTION_APPEND, false); Game::FindFreePosition(&v, TargetPos, 100); v.PushActionExecuteCommand(ACTION_APPEND, "FMS", Caller, 3, false); v.SetSpeed(15.f); v.PushActionFlyTo(ACTION_APPEND, TargetPos, true, -1.0f); v.PushActionExecuteCommand(ACTION_APPEND, "FMS", &v, 4, false); GameObject SoundDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "alarmSound_X"); SoundDummy.PushActionExecuteCommand(ACTION_NEWLIST, "AlarmSoundFirst", &SoundDummy, 8, false); v.PushActionWait(ACTION_APPEND, 0.1f); v.PushActionExecuteCommand(ACTION_APPEND,"SOUND_PLAYER",Caller,0,true); v.PushActionWait(ACTION_APPEND, 0.1f); v.AssignCommand("ALARM_DUMMY"); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",Caller,1,true); } } } }; Object Alarm_13_83_01 : CommandScript { Alarm_13_83_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("13_83_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("13_83_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_36"); else Mission::PlayHint("BHint_36"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("13_83_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 14, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 14, true); Xmlutil::Alarmext(v,TargetPos,65.0f,8); } } } }; Object Alarm_13_83_02 : CommandScript { Alarm_13_83_02() { SetValidTargets(ACTOR_FLOOR); SetIcon("13_83_02"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("13_83_02"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_37"); else Mission::PlayHint("BHint_37"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("13_83_02")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 14, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 14, true); Xmlutil::Alarmext(v,TargetPos,65.0f,8); } } } }; Object Alarm_13_85_01 : CommandScript { Alarm_13_85_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("13_85_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("13_85_01"); if(vl.GetNumVehicles()==0)return false; int h,m,s; Game::GetTime(h,m,s); return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy")&&(h > 7 && h < 19); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_38"); else Mission::PlayHint("BHint_38"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); int h,m,s; Game::GetTime(h,m,s); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("13_85_01")&& !v.HasCommand("Alarm_Dummy")) { if ((h > 7 && h < 19)) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(2); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 29, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 29, true); Xmlutil::Alarmext(v,TargetPos,65.0f,8); } else { Mission::PlayHint("BHint_27"); break; } } } } }; Object Alarm_15_82_01 : CommandScript { Alarm_15_82_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("15_82_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("15_82_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_39"); else Mission::PlayHint("BHint_39"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("15_82_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(2); if (ZUFALL > 4) v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 18, true); else v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person",&v, 19, true); Xmlutil::Alarmext(v,TargetPos,65.0f,7); } } } }; Object Alarm_15_83_01 : CommandScript { Alarm_15_83_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("15_83_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("15_83_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_40"); else Mission::PlayHint("BHint_40"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("15_83_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 14, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 14, true); Xmlutil::Alarmext(v,TargetPos,65.0f,7); } } } }; Object Alarm_15_83_02 : CommandScript { Alarm_15_83_02() { SetValidTargets(ACTOR_FLOOR); SetIcon("15_83_02"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("15_83_02"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_41"); else Mission::PlayHint("BHint_41"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("15_83_02")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 14, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 14, true); Xmlutil::Alarmext(v,TargetPos,65.0f,7); } } } }; Object Alarm_14_86_01 : CommandScript { Alarm_14_86_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("14_81_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("14_86_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_42"); else Mission::PlayHint("BHint_42"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("14_86_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 18, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 14, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 14, true); Xmlutil::Alarmext(v,TargetPos,65.0f,7); } } } }; Object Alarm_SEG_Transport : CommandScript { Alarm_SEG_Transport() { SetValidTargets(ACTOR_FLOOR); SetIcon("SEG_Trans"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("15_85_01"); if(vl.GetNumVehicles()==0)return false; VehicleList vl2("15_85_02"); if(vl2.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy")||!vl2.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_43"); else Mission::PlayHint("BHint_43"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("15_85_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); Xmlutil::Alarmext(v,TargetPos,160.0f,7); } if(v.HasName("15_85_02")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(4); v.SetMaxTransports(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); Xmlutil::Alarmext(v,TargetPos,162.0f,7); } } } }; Object Alarm_SEG_Behandlung : CommandScript { Alarm_SEG_Behandlung() { SetValidTargets(ACTOR_FLOOR); SetIcon("SEG_Behand"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("15_19_01"); if(vl.GetNumVehicles()==0)return false; VehicleList vl2("11_28_01"); if(vl2.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy")||!vl2.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_44"); else Mission::PlayHint("BHint_44"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("15_19_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(6); v.SetMaxTransports(0); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); Xmlutil::Alarmext(v,TargetPos,166.0f,7); } if(v.HasName("15_89_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(4); v.SetMaxTransports(0); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 32, true); Xmlutil::Alarmext(v,TargetPos,166.0f,7); } } } }; Object Alarm_KRD : CommandScript { Alarm_KRD() { SetValidTargets(ACTOR_FLOOR); SetIcon("KMRD"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("KR_01_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_45"); else Mission::PlayHint("BHint_45"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("KR_01_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(1); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 35, true); Xmlutil::Alarmext(v,TargetPos,65.0f,7); } } } }; Object Alarm_05_19_01 : CommandScript { Alarm_05_19_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("05_19_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("02_11_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_46"); else Mission::PlayHint("BHint_46"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("02_11_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(4); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 39, true); v.PushActionWait(ACTION_APPEND,0.1f); for (int h=1; h < 2; h++) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); v.PushActionWait(ACTION_APPEND,0.1f); } Xmlutil::Alarmext(v,TargetPos,65.0f,6); } } } }; Object Alarm_05_24_01 : CommandScript { Alarm_05_24_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("05_24_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("02_46_02"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_47"); else Mission::PlayHint("BHint_47"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("02_46_02")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(6); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 40, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); v.PushActionWait(ACTION_APPEND,0.2f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); v.PushActionWait(ACTION_APPEND,0.2f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); Xmlutil::Alarmext(v,TargetPos,65.0f,7); } } } }; Object Alarm_05_44_01 : CommandScript { Alarm_05_44_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("05_44_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("02_46_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_47"); else Mission::PlayHint("BHint_48"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("02_46_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(6); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 40, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); v.PushActionWait(ACTION_APPEND,0.2f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); v.PushActionWait(ACTION_APPEND,0.2f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); v.PushActionWait(ACTION_APPEND,0.3f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); Xmlutil::Alarmext(v,TargetPos,65.0f,7); } } } }; Object Alarm_05_63_01 : CommandScript { Alarm_05_63_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("05_63_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("02_33_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_49"); else Mission::PlayHint("BHint_49"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("02_33_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(3); for (int h=1; h < 3; h++) { v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 41, true); v.PushActionWait(ACTION_APPEND,0.1f); } Xmlutil::Alarmext(v,TargetPos,65.0f,5); } } } }; Object Alarm_06_10_01 : CommandScript { Alarm_06_10_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("06_10_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("06_11_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_50"); else Mission::PlayHint("BHint_50"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("06_11_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(2); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 6, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); Xmlutil::Alarmext(v,TargetPos,65.0f,5); } } } }; Object Alarm_06_23_01 : CommandScript { Alarm_06_23_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("06_23_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("06_24_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_51"); else Mission::PlayHint("BHint_51"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("06_24_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(6); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 7, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); Xmlutil::Alarmext(v,TargetPos,65.0f,5); } } } }; Object Alarm_06_46_01 : CommandScript { Alarm_06_46_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("06_46_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("06_46_01"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_52"); else Mission::PlayHint("BHint_52"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("06_46_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(9); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 7, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); Xmlutil::Alarmext(v,TargetPos,65.0f,5); } } } }; Object Alarm_06_58_01 : CommandScript { Alarm_06_58_01() { SetValidTargets(ACTOR_FLOOR); SetIcon("06_58_01"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("06_46_02"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_53"); else Mission::PlayHint("BHint_53"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("06_46_02")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(9); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 7, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 5, true); Xmlutil::Alarmext(v,TargetPos,65.0f,5); } } } }; Object Alarm_AutobahnPo : CommandScript { Alarm_AutobahnPo() { SetValidTargets(ACTOR_FLOOR); SetIcon("BAB_Pol"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { if(Game::IsMultiplayer())return true; VehicleList vl("PP_10_10"); if(vl.GetNumVehicles()==0)return false; return !vl.GetVehicle(0)->HasCommand("Alarm_Dummy"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid()) return false; Vector pos=Game::GetCommandPos(); if(Game::GetActors("AUTOBAHN_1").GetActor(0)->IsInsideVirtualObject(pos)||Game::GetActors("AUTOBAHN_2").GetActor(0)->IsInsideVirtualObject(pos)) return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_54"); else Mission::PlayHint("BHint_54"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("PP_10_10")&& !v.HasCommand("Alarm_Dummy")) { if(v.IsHidden()){ char nam[255]; snprintf(nam,255,"AUTOBAHN_%i_sp",Game::GetActors("AUTOBAHN_1").GetActor(0)->IsInsideVirtualObject(TargetPos)?1:2); Vector pos=Game::GetActors(nam).GetActor(0)->GetPosition(); Game::FindFreePosition(&v,pos,300); v.SetPosition(pos); } ZUFALL = (Math::rand()%10); v.SetMaxPassengers(2); v.SetMaxTransports(0); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 33, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 33, true); v.PushActionWait(ACTION_APPEND,0.1f); Xmlutil::Alarmext(v,TargetPos,30.0f,7); } } } }; Object Alarm_BePo : CommandScript { Alarm_BePo() { SetValidTargets(ACTOR_FLOOR); SetIcon("BePol"); SetCursor("alarm"); } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (Caller->GetID() == Target->GetID() || Target->GetType() == ACTOR_VEHICLE || Target->GetType() == ACTOR_HOUSE || Target->GetType() == ACTOR_OPEN_HOUSE || Target->GetType() == ACTOR_PERSON || Target->GetType() == ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll("BHint_55"); else Mission::PlayHint("BHint_55"); Vector TargetPos=Game::GetCommandPos(); GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i = 0; i < l0.GetNumObjects(); i++) { Vehicle v(l0.GetObject(i)); if(v.HasName("PP_30_02")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(6); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); Xmlutil::Alarmext(v,TargetPos,150.0f,7); } if(v.HasName("PP_30_03")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(6); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); Xmlutil::Alarmext(v,TargetPos,152.0f,7); } if(v.HasName("PP_30_06")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(6); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); Xmlutil::Alarmext(v,TargetPos,155.0f,7); } if(v.HasName("PP_30_04")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(3); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); Xmlutil::Alarmext(v,TargetPos,157.0f,7); } if(v.HasName("PP_30_01")&& !v.HasCommand("Alarm_Dummy")) { ZUFALL = (Math::rand()%10); v.SetMaxPassengers(2); v.SetMaxTransports(12); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); v.PushActionExecuteCommand(ACTION_APPEND, "Create_Person", &v, 23, true); v.PushActionWait(ACTION_APPEND,0.1f); Xmlutil::Alarmext(v,TargetPos,159.0f,7); } } } }; // // VCmdAufsitzen // int DummyGroup_af = "29"; object VCmdParking : CommandScript { VCmdParking() { SetIcon("Park"); SetCursor("Park"); SetValidTargets(ACTOR_VEHICLE); SetRestrictions(RESTRICT_SELFEXECUTE); SetPossibleCallers(ACTOR_VEHICLE); SetGroupID(DummyGroup_af); } bool CheckGroupVisibility(GameObject *Caller) { return true; } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid() || Caller->GetType() != ACTOR_VEHICLE) return false; if (Input::LShiftPressed() || Input::RShiftPressed()) SetPriority(400); else SetPriority(100); Vehicle v(Caller); if (v.GetVehicleType() == VT_AMBULANCE_RTW) { if (v.GetNumTransported() > 0) return false; } if (!v.HasCommand("ALARM_DUMMY") || v.HasCommand("has_wv") || v.HasCommand("TLF_Cool")) return false; if (v.HasCommand("DummyAttachFirehose") || v.GetNumUsedConnectors()>0 || v.IsInstalled()) return false; if (v.IsValid() && !v.IsDestroyed()) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || Caller->GetType() != ACTOR_VEHICLE) return false; if (Input::LShiftPressed() || Input::RShiftPressed()) SetPriority(400); else SetPriority(100); Vehicle v(Caller); if (v.GetVehicleType() == VT_AMBULANCE_RTW) { if (v.GetNumTransported() > 0) return false; } if (!v.HasCommand("ALARM_DUMMY") || v.HasCommand("has_wv") || v.HasCommand("TLF_Cool")) return false; if (v.HasCommand("DummyAttachFirehose") || v.GetNumUsedConnectors()>0 || v.IsInstalled()) return false; if (v.IsValid() && !v.IsDestroyed()) return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Caller->PushActionWait(ACTION_NEWLIST,0.5f); int cid=1; // Keine Automatik int free; Vehicle Fz(Caller); if (Fz.GetFreePassengers()< free) Caller->PushActionExecuteCommand(ACTION_NEWLIST,"gohome_pfs",Caller,1,false); if(Fz.GetVehicleType() == VT_AMBULANCE_RTW) { Fz.PushActionExecuteCommand(ACTION_APPEND, "hide_childs", Caller, 0, false); } if (Fz.HasCommand("LMA")) { Fz.PushActionExecuteCommand(ACTION_APPEND,"TurnLM",Caller,0,true); Fz.PushActionWait(ACTION_APPEND, 5.0f); Fz.PushActionExecuteCommand(ACTION_APPEND,"VCmdParking",Caller,0,true); }else{ PersonList pl(Caller->GetName()); for (int i=pl.GetNumPersons()-1; i > -1; i--) { if (i == 0) cid=113; // Der letzte löst Status 3 und Rückfahrt Wache aus Person *p=pl.GetPerson(i); GameObject *obj(p); if (Fz.GetVehicleType() == VT_FIREFIGHTERS_DLK && Fz.IsUplifted() && p->IsInDLKBasket()) { Fz.PushActionBasketDown(ACTION_APPEND, Vector(0.f, 0.f, 0.f)); Fz.PushActionDeinstall(ACTION_APPEND); Fz.PushActionExecuteCommand(ACTION_APPEND,"VCmdParking",Caller,0,true); } if (!p->IsInjured() && !p->IsRescueDog()) { obj->PushActionWait(ACTION_NEWLIST, 0.1f); if (obj->HasCommand("Verteiler_block")) Game::ShowHelpTextWindow("Ein Verteiler ist noch angeschlossen"); else { if (p->GetUserData() > 0 && !p->HasCommand("ich_bin_ein_notarzt") && !p->HasCommand("Arrest")) { obj->PushActionExecuteCommand(ACTION_APPEND,"Geraet_abbauen",Caller,cid,false); } else if(p->GetEquipment()==EQUIP_FIREHOSE && p->GetFirehoseID() != 0) { obj->PushActionExecuteCommand(ACTION_APPEND,"RemoveFirehose",Caller,cid,false); } obj->PushActionExecuteCommand(ACTION_APPEND,"entercar",Caller,cid,false); } } else { if (i == 0) { Caller->PushActionExecuteCommand(ACTION_APPEND,"await_bording_personal",Caller,1,false); Caller->PushActionExecuteCommand(ACTION_APPEND,"gohome_pfs",Caller,1,false); } } } } } }; object VCmdEinsteigen : CommandScript { VCmdEinsteigen() { SetIcon("status_1"); SetCursor("status_1"); SetValidTargets(ACTOR_VEHICLE); SetRestrictions(RESTRICT_SELFEXECUTE); SetPossibleCallers(ACTOR_VEHICLE); } bool CheckGroupVisibility(GameObject *Caller) { return true; } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid() || Caller->GetType() != ACTOR_VEHICLE) return false; if (Input::LShiftPressed() || Input::RShiftPressed()) SetPriority(400); else SetPriority(100); Vehicle v(Caller); if (v.GetVehicleType() == VT_AMBULANCE_RTW) { if (v.GetNumTransported() > 0) return false; } if (!v.HasCommand("ALARM_DUMMY") || v.HasCommand("has_wv") || v.HasCommand("TLF_Cool")) return false; if (v.HasCommand("DummyAttachFirehose") || v.GetNumUsedConnectors()>0 || v.IsInstalled()) return false; if (v.IsValid() && !v.IsDestroyed()) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || Caller->GetType() != ACTOR_VEHICLE) return false; if (Input::LShiftPressed() || Input::RShiftPressed()) SetPriority(400); else SetPriority(100); Vehicle v(Caller); if (v.GetVehicleType() == VT_AMBULANCE_RTW) { if (v.GetNumTransported() > 0) return false; } if (!v.HasCommand("ALARM_DUMMY") || v.HasCommand("has_wv") || v.HasCommand("TLF_Cool")) return false; if (v.HasCommand("DummyAttachFirehose") || v.GetNumUsedConnectors()>0 || v.IsInstalled()) return false; if (v.IsValid() && !v.IsDestroyed()) return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID==42){ Vehicle v(Caller); if (v.HasCommand("DUMMY_PU")) { v.PlayAnimCloseDoor("PU", 1.0f, 0); v.RemoveCommand("DUMMY_PU"); } if (v.HasCommand("DUMMY_AS")) { v.PlayAnimCloseDoor("AS", 1.0f, 0); v.RemoveCommand("DUMMY_AS"); } if (v.HasCommand("DUMMY_RS")) { v.PlayAnimCloseDoor("RS", 1.0f, 0); v.RemoveCommand("DUMMY_RS"); } if (v.HasCommand("DUMMY_GR")) { v.PlayAnimCloseDoor("G_R", 1.0f, 0); v.RemoveCommand("DUMMY_GR"); }if (v.HasCommand("DUMMY_PLANE")) { v.PlayAnimCloseDoor("plane", 1.0f, NULL); v.RemoveCommand("DUMMY_PLANE"); } if (v.HasCommand("KRA")) Game::ExecuteCommand("VCmdWarnAb", &v); Audio::StopSample(v.GetUserData()); for (int h = 1; h < 9; h++) { char e[14]; char l[6]; snprintf(e, 14, "DUMMY_G%i", h); snprintf(l, 6, "G_%i", h); if (v.HasCommand(e)) { v.PlayAnimCloseDoor(l, 1.0f, 0); v.RemoveCommand(e); } } if (v.IsSpecialLightEnabled()) v.EnableSpecialLights(false); v.SetChildEnabled("VH", true); v.SetChildEnabled("SH", true); Caller->PushActionExecuteCommand(ACTION_APPEND, "FMS", Caller, 1, false); return; } Caller->PushActionWait(ACTION_NEWLIST,0.5f); int cid=1; // Keine Automatik int free; Vehicle Fz(Caller); if(Fz.GetVehicleType() == VT_AMBULANCE_RTW) { Fz.PushActionExecuteCommand(ACTION_APPEND, "hide_childs", Caller, 0, false); } if (Fz.HasCommand("LMA")) { Fz.PushActionExecuteCommand(ACTION_APPEND,"TurnLM",Caller,0,true); Fz.PushActionWait(ACTION_APPEND, 5.0f); Fz.PushActionExecuteCommand(ACTION_APPEND,"VCmdEinsteigen",Caller,0,true); } else { PersonList pl(Caller->GetName()); for (int i=pl.GetNumPersons()-1; i > -1; i--) { if (i == 0) cid=113; // Der letzte löst Status 3 und Rückfahrt Wache aus Person *p=pl.GetPerson(i); GameObject *obj(p); if (Fz.GetVehicleType() == VT_FIREFIGHTERS_DLK && Fz.IsUplifted() && p->IsInDLKBasket()) { Fz.PushActionBasketDown(ACTION_APPEND, Vector(0.f, 0.f, 0.f)); Fz.PushActionDeinstall(ACTION_APPEND); Fz.PushActionExecuteCommand(ACTION_APPEND,"VCmdEinsteigen",Caller,0,true); } if (!p->IsInjured()) { obj->PushActionWait(ACTION_NEWLIST, 0.1f); if (obj->HasCommand("Verteiler_block")) Game::ShowHelpTextWindow("Ein Verteiler ist noch angeschlossen"); else { if (p->GetUserData() > 0 && !p->HasCommand("ich_bin_ein_notarzt") && !p->HasCommand("Arrest")) { obj->PushActionExecuteCommand(ACTION_APPEND,"Geraet_abbauen",Caller,cid,false); } else if(p->GetEquipment()==EQUIP_FIREHOSE && p->GetFirehoseID() != 0) { obj->PushActionExecuteCommand(ACTION_APPEND,"RemoveFirehose",Caller,cid,false); } obj->PushActionExecuteCommand(ACTION_APPEND,"entercar",Caller,0,false); } } if (i == 0) { Caller->PushActionExecuteCommand(ACTION_APPEND,"await_bording_personal",Caller,1,false); Caller->PushActionExecuteCommand(ACTION_APPEND, "VcmdEinsteigen", Caller, 42, false); } } } } }; // // DeleteFahrzeug // object DeleteFahrzeug : CommandScript { DeleteFahrzeug() { SetGroupID(CGROUP_GETEQUIPMENT); SetIcon("loeschen"); SetCursor("aim"); //SetValidTargets(ACTOR_VEHICLE); SetPriority(10000); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return Target->GetType()==ACTOR_PERSON||Target->GetType()==ACTOR_VEHICLE; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); GameObject tar(Target); tar.Hide(); tar.PushActionDeleteOwner(ACTION_NEWLIST); } }; // // InstallELW (Auf-/Abbau ELW-Leitstand) // const char INVISIBLE_CHILD[] = "Unsichtbar"; // Name des unsichtbaren Childs am Fahrzeug object VCmdInstallELW : CommandScript { VCmdInstallELW() { SetIcon("Install"); SetCursor("Install"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { Vehicle v(Caller); if (Caller->GetType() != ACTOR_VEHICLE || !Caller->HasCommand("ALARM_DUMMY")) return false; if(v.GetNumPassengers() < 2) return false; PersonList pl = v.GetPassengers(); bool success = false; for(int i = 0; i < pl.GetNumPersons(); i++) { if( !StrCompare(pl.GetPerson(i)->GetPrototypeFileName(),"mod:Prototypes/Persons/__ Bieberfelde/BFE.e4p") || !StrCompare(pl.GetPerson(i)->GetPrototypeFileName(),"mod:Prototypes/Persons/__ Bieberfelde/BFZi.e4p") || !StrCompare(pl.GetPerson(i)->GetPrototypeFileName(),"mod:Prototypes/Persons/__ Bieberfelde/BFB.e4p")) { if(success) return true; success = true; } } return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); if (!v.IsSpecialLightEnabled()) v.PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", &v, 0, false); if (v.HasCommand("DummyHasSiren")) v.PushActionExecuteCommand(ACTION_APPEND, "VcmdSiren", &v, 0, false); if (v.IsChildEnabled(INVISIBLE_CHILD)) { v.PlayAnimOpenDoor(DAT_SPECIAL, 0.6f, 0); v.SetChildEnabled(INVISIBLE_CHILD, false); } v.PushActionExecuteCommand(ACTION_NEWLIST,"COMMANDOSPERRE",&v,0,false); v.PushActionSwitchAnim(ACTION_APPEND, "a"); v.PushActionWait(ACTION_APPEND, 4.0f); v.RemoveCommand("MoveTo"); v.PushActionWait(ACTION_APPEND, 0.1f); v.PushActionExecuteCommand(ACTION_APPEND,"COMMANDOSPERRE",&v,1,false); v.AssignCommand("VCmdUninstallELW"); v.AssignCommand("Alarm_05_19_01"); v.AssignCommand("Alarm_05_44_01"); v.AssignCommand("Alarm_05_24_01"); v.AssignCommand("Alarm_05_63_01"); v.AssignCommand("Alarm_06_10_01"); v.AssignCommand("Alarm_06_46_01"); v.AssignCommand("Alarm_06_23_01"); v.AssignCommand("Alarm_06_58_01"); v.RemoveCommand("VCmdInstallELW"); v.RemoveCommand("VCmdParking"); v.RemoveCommand("VCmdSiren"); } }; object VCmdUninstallELW : CommandScript { VCmdUninstallELW() { SetIcon("Deinstall"); SetCursor("Deinstall"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { Vehicle v(Caller); if (v.GetNumPassengers() == 0) return false; if (Caller->GetType() != ACTOR_VEHICLE || !Caller->HasCommand("ALARM_DUMMY")) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); switch(childID) { case 0: { if (!v.IsSpecialLightEnabled()) v.PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", &v, 0, false); if (v.HasCommand("DummyHasSiren")) v.PushActionExecuteCommand(ACTION_APPEND, "VcmdSiren", &v, 0, false); v.SetCommandable(false); v.PushActionSwitchAnim(ACTION_NEWLIST, "b"); v.PushActionWait(ACTION_APPEND, 4.0f); v.PushActionExecuteCommand(ACTION_APPEND, "VCmdUninstallELW", &v, 1, false); } break; case 1: { if (v.IsChildEnabled(INVISIBLE_CHILD)) { v.PlayAnimOpenDoor(DAT_SPECIAL, 0.6f, 0); v.SetChildEnabled(INVISIBLE_CHILD, false); }else{ v.PlayAnimCloseDoor(DAT_SPECIAL, 0.6f, 0); v.SetChildEnabled(INVISIBLE_CHILD, true); } v.AssignCommand("MoveTo"); v.AssignCommand("VCmdInstallELW"); v.RemoveCommand("Alarm_05_19_01"); v.RemoveCommand("Alarm_05_24_01"); v.RemoveCommand("Alarm_05_44_01"); v.RemoveCommand("Alarm_05_63_01"); v.RemoveCommand("Alarm_06_10_01"); v.RemoveCommand("Alarm_06_23_01"); v.RemoveCommand("Alarm_06_46_01"); v.RemoveCommand("Alarm_06_58_01"); v.RemoveCommand("VCmdUninstallELW"); v.AssignCommand("VCmdParking"); v.AssignCommand("VCmdEinsteigen"); v.AssignCommand("VCmdSiren"); v.SetCommandable(true); } break; } } }; // // InstallCrane (Auf-/Abbau RW-Kran) // object VCmdInstallCrane : CommandScript { VCmdInstallCrane() { SetIcon("Install"); SetCursor("Install"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { Vehicle v(Caller); if (v.GetNumPassengers() == 0) return false; if (Caller->GetType() != ACTOR_VEHICLE || !Caller->HasCommand("ALARM_DUMMY")) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { float r[9]; Vehicle v(Caller); switch (childID) { case 0: if (!v.IsSpecialLightEnabled()) v.PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", &v, 0, false); if (v.HasCommand("DummyHasSiren")) v.PushActionExecuteCommand(ACTION_APPEND, "VcmdSiren", &v, 0, false); v.SetCommandable(false); v.PushActionSwitchAnim(ACTION_NEWLIST, "aufbau"); v.PushActionWait(ACTION_APPEND, 8.0f); v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); v.PushActionExecuteCommand(ACTION_APPEND, "VCmdInstallCrane", Target, 1, false); break; case 1: Vehicle k = Game::CreateVehicle("mod:Prototypes/Vehicles/__ Feuerwehr/RW2_01_1_Aufgebaut.e4p", v.GetName()); k.SetMaxPassengers(3); PersonList l = v.GetPassengers(); for(int i=0; iGetPrototypeFileName(), l.GetPerson(i)->GetName()); p.SetPlayerMP(v.GetPlayerMP()); k.AddPassenger(&p); } k.SetPlayerMP(v.GetPlayerMP()); if (v.IsSelected()) k.Select(); v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); k.SetPlayerMP(v.GetPlayerMP()); k.SetSpeed(v.GetSpeed()); k.SetPosition(v.GetPosition()); k.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); k.EnableTrafficLight(TLT_NONE); k.EnableBlinker(BLT_NONE); k.PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", &k, 0, false); k.EnableHeadLights(true); if (!k.IsBlueLightEnabled()) k.PushActionExecuteCommand(ACTION_APPEND, "VCmdBlue", &k, 0, false); k.RemoveCommand("GoHome"); k.RemoveCommand("VCmdInit"); if (k.HasCommand("MoveTo")) k.RemoveCommand("MoveTo"); k.AssignCommand("DUMMY_INIT"); k.AssignCommand("VCmdDebug"); k.AssignCommand("VCmdWarning"); k.AssignCommand("VCmdBlue"); k.AssignCommand("VCmdLiMa"); if (!k.HasCommand("ALARM_DUMMY")) k.AssignCommand("ALARM_DUMMY"); if (k.HasCommand("VCmdInstallCrane")) k.RemoveCommand("VCmdInstallCrane"); if (!k.HasCommand("VCmdUninstallCrane")) k.AssignCommand("VCmdUninstallCrane"); v.PushActionWait(ACTION_APPEND, 0.1f); v.PushActionDeleteOwner(ACTION_APPEND); break; } } }; object VCmdUninstallCrane : CommandScript { VCmdUninstallCrane() { SetIcon("Deinstall"); SetCursor("Deinstall"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { Vehicle v(Caller); if (v.GetNumPassengers() == 0) return false; if (Caller->GetType() != ACTOR_VEHICLE || !Caller->HasCommand("ALARM_DUMMY")) return false; GameObjectList ol = Caller->GetCarriedObjects(); if(ol.GetNumObjects() > 0) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { float r[9]; Vehicle v(Caller); switch (childID) { case 0: if (!v.IsSpecialLightEnabled()) v.PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", &v, 0, false); if (v.HasCommand("DummyHasSiren")) v.PushActionExecuteCommand(ACTION_APPEND, "VcmdSiren", &v, 0, false); v.SetCommandable(false); v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); v.PushActionExecuteCommand(ACTION_APPEND, "VCmdUninstallCrane", Target, 1, false); break; case 1: Vehicle k = Game::CreateVehicle("mod:Prototypes/Vehicles/__ Feuerwehr/RW2_01_1.e4p", v.GetName()); k.SetMaxPassengers(3); PersonList l = v.GetPassengers(); for(int i=0; iGetPrototypeFileName(), l.GetPerson(i)->GetName()); p.SetPlayerMP(v.GetPlayerMP()); k.AddPassenger(&p); } k.SetPlayerMP(v.GetPlayerMP()); if (v.IsSelected()) k.Select(); v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); k.SetPlayerMP(v.GetPlayerMP()); k.SetSpeed(v.GetSpeed()); k.SetPosition(v.GetPosition()); k.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); k.EnableTrafficLight(TLT_NONE); k.EnableBlinker(BLT_NONE); k.PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", &k, 0, false); k.PushActionSwitchAnim(ACTION_NEWLIST, "abbau"); k.PushActionWait(ACTION_APPEND, 8.0f); k.EnableHeadLights(true); if (!k.IsBlueLightEnabled()) k.PushActionExecuteCommand(ACTION_APPEND, "VCmdBlue", &k, 0, false); k.RemoveCommand("GoHome"); k.RemoveCommand("VCmdInit"); k.AssignCommand("MoveTo"); k.AssignCommand("DUMMY_INIT"); k.AssignCommand("VCmdDebug"); k.AssignCommand("VCmdWarning"); k.AssignCommand("VCmdBlue"); k.AssignCommand("VCmdAlarm"); k.AssignCommand("VCmdParking"); k.AssignCommand("VcmdEinsteigen"); k.AssignCommand("VCmdLiMa"); k.AssignCommand("FahrzeugPosition"); k.AssignCommand("DummyHasBesen"); if (!k.HasCommand("ALARM_DUMMY")) k.AssignCommand("ALARM_DUMMY"); if (!k.HasCommand("VCmdInstallCrane")) k.AssignCommand("VCmdInstallCrane"); if (k.HasCommand("VCmdUninstallCrane")) k.RemoveCommand("VCmdUninstallCrane"); v.PushActionWait(ACTION_APPEND, 0.1f); v.PushActionDeleteOwner(ACTION_APPEND); break; } } }; // // InstallTent (Auf-/Abbau Zelte: MANV, DEKON, ...) // object VcmdInstallTent : CommandScript { VcmdInstallTent() { SetIcon("install"); SetCursor("install"); SetValidTargets(ACTOR_VEHICLE); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid() || Caller->GetType() != ACTOR_VEHICLE || !Caller->HasCommand("ALARM_DUMMY")) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { float r[9]; float rot[9]; Vector CarPos = Caller->GetPosition(); Caller->PushActionWait(ACTION_NEWLIST, 0.1f); Caller->GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); if (Caller->HasName("01_93_01")) { if (!Caller->IsSpecialLightEnabled()) Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", Caller, 0, false); if (Caller->HasCommand("DummyHasSiren")) Caller->PushActionExecuteCommand(ACTION_APPEND, "VcmdSiren", Caller, 0, false); if (!Caller->HasCommand("DUMMY_GR")) { Vehicle v(Caller); v.PlayAnimOpenDoor("G_R", 1.0f, 0); v.AssignCommand("DUMMY_GR"); } } if (Caller->HasName("11_28_01")) { if (!Caller->HasCommand("DUMMY_GR")) { Vehicle v(Caller); v.PlayAnimOpenDoor("G_R", 1.0f, 0); v.AssignCommand("DUMMY_GR"); } if (!Caller->HasCommand("DUMMY_G1")) { Vehicle v(Caller); v.PlayAnimOpenDoor("G_1", 1.0f, 0); v.AssignCommand("DUMMY_G1"); } if (!Caller->HasCommand("DUMMY_G2")) { Vehicle v(Caller); v.PlayAnimOpenDoor("G_2", 1.0f, 0); v.AssignCommand("DUMMY_G2"); } } Caller->EnableCommand("VCmdParking", false); Caller->EnableCommand("MoveTo", false); if (Game::FindFreePosition(Caller, CarPos)) { Vehicle v; if (Caller->HasName("AB_MANV")) v = Game::CreateVehicle("mod:Prototypes/Vehicles/__RD_FEUERWEHR/SEG_ZELT_01_1.e4p", Caller->GetName()); if (Caller->HasName("11_28_01")) v = Game::CreateVehicle("mod:Prototypes/Vehicles/__RD_FEUERWEHR/SEG_ZELT_01_1.e4p", Caller->GetName()); if (Caller->HasName("01_93_01")) v = Game::CreateVehicle("mod:Prototypes/Vehicles/__ Feuerwehr/ABC_Dekon.e4p", Caller->GetName()); if (Caller->HasName("AB_DEKON")) v = Game::CreateVehicle("mod:Prototypes/Vehicles/__ Feuerwehr/ABC_Dekon.e4p", Caller->GetName()); if (Caller->IsValid()) { if (Caller->HasName("AB_MANV")){ float dx = -400.f, dy = 0.f, dz = 0.f,winkel=180; }else if (Caller->HasName("11_28_01")){ float dx = -500.f, dy = 0.f, dz = 0.f,winkel=180; }else{ float dx = -600.f, dy = 0.f, dz = 0.f,winkel=0;} Math::RotateVector(dx, dy, dz, r); Math::EulerToMatrix(0.f, 0.f, 0.f, rot); Math::MultiplyMatrices(rot, r); CarPos = CarPos + Vector(dx, dy, 0); float dreh2[9]; Math::EulerToMatrix(winkel, 0, 0, dreh2); Math::MultiplyMatrices(dreh2, rot); v.SetRotation(dreh2[0], dreh2[1], dreh2[2], dreh2[3], dreh2[4], dreh2[5], dreh2[6], dreh2[7], dreh2[8]); v.SetPosition(CarPos); v.UpdatePlacement(); } if (Caller->HasName("AB_MANV") || Caller->HasName("11_28_01")) { v.SetMaxPassengers(4); v.SetMaxTransports(12); v.AssignCommand("EmptyCar"); } if (Caller->HasName("AB_DEKON")) { v.SetMaxPassengers(9); v.SetMaxTransports(8); v.AssignCommand("EmptyCar"); } if (Caller->HasName("01_93_01")) { v.SetMaxPassengers(6); v.SetMaxTransports(8); v.AssignCommand("EmptyCar"); } if (!Caller->HasCommand("DummyTentInstalled")) Caller->AssignCommand("DummyTentInstalled"); if (Caller->HasCommand("VcmdInstallTent")) Caller->RemoveCommand("VcmdInstallTent"); if (!Caller->HasCommand("VcmdDeinstallTent")) Caller->AssignCommand("VcmdDeinstallTent"); if (Game::IsMultiplayer()) v.SetPlayerMP(Caller->GetPlayerMP()); Audio::PlaySample3D("mod:Audio/FX/Misc/Tools01.wav", Caller->GetPosition()); } else { char Namestring[255]; char Hint[255]; Game::GetGameString(Caller->GetPrototypeName(), Namestring, 255); snprintf(Hint, 255, "%s: Nicht genügend Platz vorhanden!", Namestring); if (Game::IsMultiplayer()) ScriptInterface::ShowMessageTickerTextForAll(Hint); else Mission::PlayHint(Hint); Caller->AssignCommand("VcmdInstallTent"); } } }; object VcmdDeinstallTent : CommandScript { VcmdDeinstallTent() { SetIcon("deinstall"); SetCursor("deinstall"); SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT); SetPossibleCallers(ACTOR_VEHICLE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (Caller->GetType() == ACTOR_VEHICLE) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Target); if (StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/ABC_Dekon.e4p") && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__RD_FEUERWEHR/SEG_ZELT_01_1.e4p")) return false; if(v.GetNumPassengers() != 0 && v.GetNumTransported() != 0) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); Vehicle m(Target); PersonList pl = m.GetTransports(); if(pl.GetNumPersons() == 0) { Audio::PlaySample3D("mod:Audio/FX/Misc/Tools01.wav", Caller->GetPosition()); m.PushActionDeleteOwner(ACTION_NEWLIST); if (v.HasCommand("DummyTentInstalled")) Caller->RemoveCommand("DummyTentInstalled"); if (!v.HasCommand("VcmdInstallTent")) Caller->AssignCommand("VcmdInstallTent"); if (v.HasCommand("VcmdDeinstallTent")) Caller->RemoveCommand("VcmdDeinstallTent"); if (v.HasName("01_93_01")) { if (v.HasCommand("DUMMY_GR")) { v.PlayAnimCloseDoor("G_R", 1.0f, 0); v.RemoveCommand("DUMMY_GR"); } } if (v.HasName("11_28_01")) { if (v.HasCommand("DUMMY_GR")) { v.PlayAnimCloseDoor("G_R", 1.0f, 0); v.RemoveCommand("DUMMY_GR"); } } v.EnableCommand("VCmdParking", true); v.EnableCommand("MoveTo", true); if (v.IsSpecialLightEnabled()) v.PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", Caller, 0, false); }else{ ScriptInterface::ShowMessageTickerTextForSinglePlayer(&v, "BHint_56"); } } }; // // VCmdWarntafel (Aufklappen der Tafel am LRF) // object VCmdWarn : CommandScript { VCmdWarn() { SetIcon("install"); SetCursor("install"); SetValidTargets(ACTOR_VEHICLE); SetRestrictions(RESTRICT_SELFEXECUTE); SetPriority(95); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid() || Caller->GetType() != ACTOR_VEHICLE) return false; if (!Caller->HasCommand("ALARM_DUMMY")) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if (!Caller->HasCommand("KRA")) { Caller->EnableCommand("MoveTo", false); Caller->EnableCommand("VCmdWarn", false); Caller->EnableCommand("FahrzeugPosition", false); Caller->AssignCommand("KRA"); Caller->AssignCommand("VCmdWarnAb"); Caller->RemoveCommand("VCmdWarn");//EDIT Caller->SetAnimation("KR_UP"); Caller->PushActionWait(ACTION_APPEND, 5.f); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWarn", Target, 1, false); } if (childID == 1) { char t[54]; float r[9]; snprintf(t, 54, "Tafel_%s", Caller->GetName()); Caller->GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); if (Caller->HasName("02_72_01")) { GameObject w = Game::CreateObject("mod:Prototypes/Objects/_VehicleParts_childs/02_72_01_Kreuz.e4p", t); } else { GameObject w = Game::CreateObject("mod:Prototypes/Objects/_VehicleParts_childs/PP_10_10_Kreuz.e4p", t); } w.SetPosition(Caller->GetPosition()); w.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); w.UpdatePlacement(); w.EnableSpecialLights(true); Caller->SetChildEnabled("KR", false); } } }; object VCmdWarnAb : CommandScript { VCmdWarnAb() { SetIcon("deinstall"); SetCursor("deinstall"); SetValidTargets(ACTOR_VEHICLE); SetRestrictions(RESTRICT_SELFEXECUTE); SetPriority(95); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid() || Caller->GetType() != ACTOR_VEHICLE) return false; if (!Caller->HasCommand("ALARM_DUMMY")) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle c(Caller); char t[54]; if (Caller->HasCommand("KRA")) { Caller->EnableCommand("MoveTo", true); Caller->EnableCommand("VCmdWarn", true); Caller->EnableCommand("FahrzeugPosition", true); Caller->RemoveCommand("KRA"); Caller->RemoveCommand("VCmdWarnAb"); Caller->AssignCommand("VCmdWarn"); Caller->SetChildEnabled("KR", true); Caller->SetAnimation("KR_DOWN"); snprintf(t, 54, "Tafel_%s", Caller->GetName()); GameObjectList l = Game::GetGameObjects(t); for(int i=0; iPushActionDeleteOwner(ACTION_APPEND); } } }; // // VCmdASF_Bestatter (Abwicklung für ASF und Bestatter) // object rufe_ASF : CommandScript { rufe_ASF() { SetIcon("ASF2"); SetCursor("liftwithcrane"); SetValidTargets(ACTOR_FLOOR | ACTOR_VEHICLE); } bool CheckPossible(GameObject *Caller) { if (Input::LCtrlPressed() || Input::RCtrlPressed()) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { GameObject obj(Target); if (obj.IsFlagSet(OF_PERSON_ENCLOSED)) return false; if (Target->GetType() == ACTOR_VEHICLE) { Vehicle v(Target); if (v.GetEnergy() <= 0.1f * v.GetMaxEnergy() && !v.IsSmoking()) return true; // Fahrzeug kaputt und gelöscht if (v.IsDestroyed()) return true; // Fahrzeug zerstört if (!v.IsParking()) return false; // normales Fahrzeug, welches nicht parkt } return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vector TargetPos; char asfname[255]; char asfvo[255]; char asfpath[255]; Actor fz; char speeds[10]; if(Target->GetType() == ACTOR_VEHICLE) TargetPos = Target->GetPosition(); else TargetPos = Game::GetCommandPos(); float distu = Caller->Distance(TargetPos.x,TargetPos.y,TargetPos.z); if (distu > 500.0f) { if (!Game::IsMultiplayer()) Game::ShowHelpTextWindow("BHint_57"); else ScriptInterface::ShowMessageTickerTextForAll("BHint_57"); return; // ehemals break; } else { if (!Game::IsMultiplayer()) Game::ShowHelpTextWindow("BHint_58"); else ScriptInterface::ShowMessageTickerTextForAll("BHint_58"); snprintf(asfvo, 255, "ASF_%u", Math::rand()%8+1); ActorList l1(asfvo); if(l1.GetNumActors() > 0) fz = *l1.GetActor(0); else System::Error("rufe_ASF: SpawnPoint nicht gefunden"); snprintf(asfpath, 255, "mod:Prototypes/Vehicles/__ TechOrg/ASF_%i.e4p", Math::rand()%3+1); snprintf(asfname, 255, "ASF%i", Caller->GetID()); if(!Game::IsSquadInVirtualObject(asfvo)) { Vehicle v = Game::CreateVehicle(asfpath, asfname); Game::GetGameString("civilspeed", speeds, 10); v.SetSpeed(Math::atof(speeds)); Vector fzpos = fz.GetPosition(); Game::FindFreePosition(&v, fzpos); v.SetMaxPassengers(2); v.SetPlayerMP(Caller->GetPlayerMP()); v.SetPosition(fzpos); v.AssignCommand("VCmdDebug"); v.AssignCommand("EmptyCar"); v.AssignCommand("DummyHasBesen"); v.SetChildEnabled("plane",false); v.PushActionExecuteCommand(ACTION_NEWLIST, "Create_Person", &v, 24, true); if (v.IsBlueLightEnabled()) v.EnableBlueLights(false); if(Target->GetType() == ACTOR_VEHICLE) { v.PushActionExecuteCommand(ACTION_APPEND, "LoadUp", Target, 0, false); v.PushActionWait(ACTION_APPEND, 2.0f); } else { Game::FindFreePosition(&v,TargetPos); v.PushActionMove(ACTION_APPEND, TargetPos); } }else{ Game::ExecuteCommand("rufe_ASF", Caller,Target); } } } }; object alarm_BSW : CommandScript { alarm_BSW() { SetIcon("bestatter"); SetCursor("bestatter"); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { Person pat(Target); if(pat.IsDead()||pat.HasCommand("PERSON_TOT")){return true;} else{return false;} } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vector TargetPos; char bswname[255]; char bswvo[255]; char bswpath[255]; Actor fz; Person pat(Target); char speeds[10]; if(Target->GetType() == ACTOR_VEHICLE) TargetPos = Target->GetPosition(); else TargetPos = Game::GetCommandPos(); float distu = Caller->Distance(TargetPos.x,TargetPos.y,TargetPos.z); if (distu > 500.0f) { if (!Game::IsMultiplayer()) Game::ShowHelpTextWindow("BHint_59"); else ScriptInterface::ShowMessageTickerTextForAll("BHint_59"); return; } else { if (!Game::IsMultiplayer()) Game::ShowHelpTextWindow("BHint_60"); else ScriptInterface::ShowMessageTickerTextForAll("BHint_60"); snprintf(bswvo, 255, "ASF_%u", Math::rand()%7+1); ActorList l1(bswvo); if(l1.GetNumActors() > 0) fz = *l1.GetActor(0); else System::Error("alarm_BSW: SpawnPoint nicht gefunden"); snprintf(bswpath, 255, "mod:Prototypes/Vehicles/__ TechOrg/Bestatter_%i.e4p", Math::rand()%2+1); snprintf(bswname, 255, "BSW%i", Caller->GetID()); if(!Game::IsSquadInVirtualObject(bswvo)) { Vehicle v = Game::CreateVehicle(bswpath, bswname); Vector fzpos = fz.GetPosition(); Game::FindFreePosition(&v, fzpos); Game::GetGameString("civilspeed", speeds, 10); v.SetSpeed(Math::atof(speeds)); Person p = Game::CreatePerson("mod:Prototypes/Persons/__ Bieberfelde/Bestatter.e4p", "BSW"); p.SetPlayerMP(Caller->GetPlayerMP()); p.SetCommandable(true); v.AddPassenger(&p); pat.AssignCommand("Dummy_tot"); v.SetMaxPassengers(1); v.SetMaxTransports(1); v.SetPlayerMP(Caller->GetPlayerMP()); v.SetPosition(fzpos); v.AssignCommand("VCmdDebug"); v.AssignCommand("EmptyCar"); v.PushActionExecuteCommand(ACTION_NEWLIST, "BSW_abtransport", &pat, 0, false); }else{ Game::ExecuteCommand("alarm_BSW", Caller,Target); } } } }; object BSW_abtransport : CommandScript { BSW_abtransport() { } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); Person pat(Target); if(!pat.IsValid())return; switch(childID) { //Zum Einsatzort case 0 : Vector PatPos; PatPos = pat.GetPosition(); Game::FindFreePosition(&v,PatPos,500); v.PushActionMove(ACTION_APPEND, PatPos, true); v.PushActionExecuteCommand(ACTION_APPEND, "BSW_abtransport", &pat, 1, false); break; //Verstorbenen aufladen case 1 : PersonList pl = v.GetPassengers(); Person p = *pl.GetPerson(0); p.PushActionLeaveCar(ACTION_NEWLIST, &v); p.PushActionMove(ACTION_APPEND, Target, TARGET_TOUCHPERSON); p.PushActionTurnTo(ACTION_APPEND, Target); p.PushActionLift(ACTION_APPEND, Target); p.PushActionExecuteCommand(ACTION_APPEND, "EnterCar", Caller, 0, false); p.PushActionExecuteCommand(ACTION_APPEND, "BSW_abtransport", &v, 2, false); break; //Zur Basis case 2 : System::Log("test - BSW"); Vehicle v(Target); v.PushActionExecuteCommand(ACTION_APPEND,"await_bording",Target,1,false); v.PushActionExecuteCommand(ACTION_APPEND, "BSW_abtransport", &v, 3, false); v.PushActionExecuteCommand(ACTION_APPEND, "GoHome", Caller, 0, false); break; case 3 : PersonList pl=v.GetTransports(); for(int i=0;iHasName("Leiche")){ Person(&Game::GetActor(pl.GetPerson(i)->GetUserData())).PushActionDeleteOwner(ACTION_NEWLIST); } } break; } } }; // // VCmdWechsellader // object VCmdWLFUnload : CommandScript { VCmdWLFUnload() // absatteln { SetValidTargets(ACTOR_VEHICLE); SetIcon("WLFac"); SetCursor("drop"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckPossible(GameObject *Caller) { Vehicle v(Caller); if (v.GetNumPassengers() == 0) return false; if (Caller->GetType() != ACTOR_VEHICLE || !Caller->HasCommand("ALARM_DUMMY")) return false; if(v.IsChildEnabled("ABMANV")||v.IsChildEnabled("ABAS")||v.IsChildEnabled("ABDEKON")||v.IsChildEnabled("ABMULDE")) return true; return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { switch(childID) { case 0: case 10: if (!Caller->IsSpecialLightEnabled()) Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", Caller, 0, false); if (Caller->HasCommand("DummyHasSiren")) Caller->PushActionExecuteCommand(ACTION_APPEND, "VcmdSiren", Caller, 0, false); Caller->SetCommandable(false); Caller->PushActionSwitchAnim(ACTION_NEWLIST, "wlf_ab"); Caller->PushActionWait(ACTION_APPEND, 20.f); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWLFUnload", Target, 1, false); break; case 1: float r[9]; float y[9]; Vehicle c; Vector a = Caller->GetPosition(); Caller->GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); if (Game::FindFreePosition(Caller, a)) { if (Caller->IsChildEnabled("ABMULDE")) c = Game::CreateVehicle("mod:Prototypes/Vehicles/__ Feuerwehr/AB_MU_01.e4p", "AB_MULDE"); if (Caller->IsChildEnabled("ABAS")) c = Game::CreateVehicle("mod:Prototypes/Vehicles/__ Feuerwehr/AB_AS_01.e4p", "AB_AS"); if (Caller->IsChildEnabled("ABDEKON")) c = Game::CreateVehicle("mod:Prototypes/Vehicles/__ Feuerwehr/AB_DE_01.e4p", "AB_DEKON"); if (Caller->IsChildEnabled("ABMANV")) c = Game::CreateVehicle("mod:Prototypes/Vehicles/__ Feuerwehr/AB_MN_01.e4p", "AB_MANV"); if (Caller->IsChildEnabled("ABMANV")) c.AssignCommand("VcmdInstallTent"); float fx = -415.f, fy = 0.f, fz = 0.f; Math::RotateVector(fx, fy, fz, r); Math::EulerToMatrix(0.f, 0.f, 0.f, y); Math::MultiplyMatrices(y, r); a = a + Vector(fx, fy, fz); c.AssignCommand("ALARM_DUMMY"); c.SetRotation(y[0], y[1], y[2], y[3], y[4], y[5], y[6], y[7], y[8]); c.SetPosition(a); c.UpdatePlacement(); if (Game::IsMultiplayer()) c.SetPlayerMP(Caller->GetPlayerMP()); } if (StrCompare(c.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_MN_01.e4p") == 0) Caller->SetChildEnabled("ABMANV", false); if (StrCompare(c.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_AS_01.e4p") == 0) Caller->SetChildEnabled("ABAS", false); if (StrCompare(c.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_MU_01.e4p") == 0) Caller->SetChildEnabled("ABMULDE", false); if (StrCompare(c.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_DE_01.e4p") == 0) Caller->SetChildEnabled("ABDEKON", false); c.SetCommandable(true); if (Caller->IsBlueLightEnabled()) c.PushActionExecuteCommand(ACTION_APPEND, "VCmdBlue", &c, 0, false); if (!c.IsSpecialLightEnabled()) c.EnableSpecialLights(true); c.RemoveCommand("VCmdInit"); if(Caller->HasChild("LM")) c.AssignCommand("VCmdLiMa"); if(Caller->HasChild("KR")) c.AssignCommand("VCmdWarn"); c.RemoveCommand("GoHome"); c.AssignCommand("DUMMY_INIT"); c.AssignCommand("VCmdDebug"); Caller->PushActionWait(ACTION_APPEND, 1.5f); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWLFUnload", Target, 2, false); break; case 2: Caller->PushActionSwitchAnim(ACTION_NEWLIST, "wlf_auf"); Caller->PushActionWait(ACTION_APPEND, 18.f); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWLFUnload", Target, 3, false); break; case 3: Caller->SetCommandable(true); Caller->AssignCommand("VCmdWLFLoadup"); Caller->RemoveCommand("VCmdWLFUnload"); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", Caller, 0, false); break; } } }; object VCmdWLFLoadup : CommandScript { VCmdWLFLoadup() // aufsatteln { SetValidTargets(ACTOR_VEHICLE|ACTOR_OBJECT); SetIcon("WLFac"); SetCursor("liftwithcrane"); } bool CheckPossible(GameObject *Caller) { Vehicle v(Caller); if (v.GetNumPassengers() == 0) return false; if (Caller->GetType() != ACTOR_VEHICLE || !Caller->HasCommand("ALARM_DUMMY")) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(Target->GetType()==ACTOR_OBJECT&&(Target->HasNamePrefix("AB_")||Game::IsMultiplayer()))return true; Vehicle container(Target); if (StrCompare(container.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_MN_01.e4p") &&StrCompare(container.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_AS_01.e4p") &&StrCompare(container.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_MU_01.e4p") &&StrCompare(container.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_DE_01.e4p")) return false; if (container.HasCommand("DummyTentInstalled") || container.GetNumPassengers() > 0) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { bool toor=false; if(Target->GetType()==ACTOR_OBJECT){ if(!Target->HasNamePrefix("AB_"))return; GameObject obj(Target); VehicleList vl(obj.GetName()); if(vl.GetNumVehicles()!=0){ Vehicle c(vl.GetVehicle(0)); }else Vehicle c=Vehicle(); toor=true; }else{ Vehicle c(Target); if(childID==0&&c.IsCollidingWithVirtualObject(c.GetName())){ GameObjectList objs=Game::GetGameObjects(c.GetName()); for(int i=0;iIsValid()&&objs.GetObject(i)->GetType()==ACTOR_OBJECT){ Target=objs.GetObject(i); toor=true; } } } } float r[9]; float rot[9]; Vector a = c.GetPosition(); c.SetSelectable(false); c.SetCommandable(false); c.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); float fx = 415.f, fy = 0.f, fz = 0.f; Math::RotateVector(fx, fy, fz, r); Math::EulerToMatrix(0.f, 0.f, 0.f, rot); Math::MultiplyMatrices(rot, r); a = a + Vector(fx, fy, 0); switch(childID) { case 0: Caller->PushActionMove(ACTION_NEWLIST, a); Caller->PushActionWait(ACTION_APPEND, 0.5f); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWLFLoadup", Target, 1, false); break; case 1: if(toor)GameObject(Target).SetAnimation("open"); Caller->SetCommandable(false); Caller->SetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]); Caller->SetPosition(a); Caller->UpdatePlacement(); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWLFLoadup", Target, 2, false); break; case 2: Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", Caller, 0, false); if (Caller->HasCommand("DummyHasSiren")) Caller->PushActionExecuteCommand(ACTION_APPEND, "VcmdSiren", Caller, 0, false); Caller->PushActionWait(ACTION_APPEND, 0.5f); Caller->PushActionSwitchAnim(ACTION_APPEND, "wlf_ab"); Caller->PushActionWait(ACTION_APPEND, 20.f); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWLFLoadup", Target, 3, false); break; case 3: if (StrCompare(c.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_MN_01.e4p") == 0) Caller->SetChildEnabled("ABMANV", true); if (StrCompare(c.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_AS_01.e4p") == 0) Caller->SetChildEnabled("ABAS", true); if (StrCompare(c.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_MU_01.e4p") == 0) Caller->SetChildEnabled("ABMULDE", true); if (StrCompare(c.GetPrototypeFileName(), "mod:Prototypes/Vehicles/__ Feuerwehr/AB_DE_01.e4p") == 0) Caller->SetChildEnabled("ABDEKON", true); Caller->SetAnimation("wlf_abgesattelt"); Caller->PushActionWait(ACTION_APPEND, 0.5f); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWLFLoadup", Target, 4, false); c.PushActionDeleteOwner(ACTION_APPEND); break; case 4: Caller->PushActionSwitchAnim(ACTION_APPEND, "wlf_auf"); Caller->PushActionWait(ACTION_APPEND, 18.f); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWLFLoadup", Target, 5, false); break; case 5: if(toor)GameObject(Target).SetAnimation("close"); Caller->PushActionExecuteCommand(ACTION_APPEND, "VCmdWarning", Caller, 0, false); Caller->SetCommandable(true); if (Caller->HasCommand("VCmdWLFLoadup")) Caller->RemoveCommand("VCmdWLFLoadup"); if (!Caller->HasCommand("VCmdWLFUnload")) Caller->AssignCommand("VCmdWLFUnload"); break; } } }; // // VCmdABParken // object ab_parken : CommandScript { ab_parken() { SetValidTargets(ACTOR_VEHICLE); SetIcon("WLFp"); SetCursor("WLFp"); SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) return false; else return true; } bool CheckPossible(GameObject *Caller) { if(!Caller->IsValid()) return false; Vehicle v(Caller); if (v.GetNumPassengers() == 0) return false; if(v.IsChildEnabled("ABMANV")||v.IsChildEnabled("ABAS")||v.IsChildEnabled("ABDEKON")||v.IsChildEnabled("ABMULDE")) return true; return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); Vector anfahrpos; const char *pname; switch(childID) { case 0: { if(v.IsChildEnabled("ABMANV")) { pname = "P_ABMANV"; }else if(v.IsChildEnabled("ABAS")){ pname = "P_ABAS"; }else if(v.IsChildEnabled("ABDEKON")){ pname = "P_ABDEKON"; }else if(v.IsChildEnabled("ABMULDE")){ pname = "P_ABMULDE"; } GameObjectList gol = Game::GetGameObjects(pname); GameObject pos(gol.GetObject(0)); v.PushActionWait(ACTION_APPEND, 1.f); v.PushActionMove(ACTION_APPEND, pos.GetPosition(), false); v.PushActionExecuteCommand(ACTION_APPEND, "ab_parken", &pos, 1, false); } break; case 1: { if(v.IsChildEnabled("ABMANV")) { pname = "AB_MANV"; }else if(v.IsChildEnabled("ABAS")){ pname = "AB_AS"; }else if(v.IsChildEnabled("ABDEKON")){ pname = "AB_DEKON"; }else if(v.IsChildEnabled("ABMULDE")){ pname = "AB_MULDE"; } GameObject pos(Target); v.SetRotation(&pos); v.SetPosition(pos.GetPosition()); v.PushActionExecuteCommand(ACTION_APPEND, "VCmdWLFUnload", &v, 0, false); GameObjectList objs=Game::GetGameObjects(pname); for(int i=0;iGetType()==ACTOR_OBJECT){ objs.GetObject(i)->SetAnimation("open"); objs.GetObject(i)->PushActionWait(ACTION_NEWLIST,35); objs.GetObject(i)->PushActionExecuteCommand(ACTION_APPEND, "ab_parken", objs.GetObject(i), 2, false); } } } break; case 2: { GameObject(Target).SetAnimation("close"); } break; } } }; object AlarmSoundFirst : CommandScript { AlarmSoundFirst() { SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { GameObjectList ol1 = Game::GetGameObjects("alarmSound"); GameObject *o1; o1 = *ol1.GetObject(0); GameObject SoundID(o1); GameObject mdummy(Caller); mdummy.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &SoundID, ChildID, false); } }; object PlayAlarmSound : CommandScript { PlayAlarmSound() { SetRestrictions(RESTRICT_SELFEXECUTE); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { GameObject mdummy(Caller); GameObject SoundID(Target); if(Audio::IsPlaying(SoundID.GetUserData())) { mdummy.PushActionWait(ACTION_NEWLIST, 2.f); mdummy.PushActionExecuteCommand(ACTION_APPEND, "PlayAlarmSound", &SoundID, ChildID, false); } else { switch(ChildID) { case 0: { GameObject *d2; GameObjectList l2 = Game::GetGameObjects("sirene_1"); d2 = *l2.GetObject(0); GameObject sir(d2); Audio::PlaySample3D("mod:Audio/FX/Wegberg/Feuer.wav", sir.GetPosition(), false); SoundID.SetUserData(Audio::PlaySample("mod:Audio/FX/Wegberg/zug.wav")); } break; case 1: { SoundID.SetUserData(Audio::PlaySample("mod:Audio/FX/Wegberg/gruppe1.wav")); } break; case 2: { GameObject *d2; GameObjectList l2 = Game::GetGameObjects("sirene_2"); d2 = *l2.GetObject(0); GameObject sir(d2); Audio::PlaySample3D("mod:Audio/FX/Wegberg/Feuer.wav", sir.GetPosition(), false); SoundID.SetUserData(Audio::PlaySample("mod:Audio/FX/Wegberg/zug_n.wav")); } break; case 3: { SoundID.SetUserData(Audio::PlaySample("mod:Audio/FX/Wegberg/gruppe2.wav")); } break; case 4: { SoundID.SetUserData(Audio::PlaySample("mod:Audio/FX/Wegberg/pol.wav")); } break; case 5: { SoundID.SetUserData(Audio::PlaySample("mod:Audio/FX/Wegberg/staffel2.wav")); } break; case 6: { SoundID.SetUserData(Audio::PlaySample("mod:Audio/FX/Wegberg/staffel1.wav")); } break; case 7: { SoundID.SetUserData(Audio::PlaySample("mod:Audio/FX/Wegberg/staffel3.wav")); } break; case 8: { SoundID.SetUserData(Audio::PlaySample("mod:Audio/FX/Wegberg/staffel4.wav")); } break; case 9: { GameObject *d2; GameObjectList l2 = Game::GetGameObjects("wachgong1"); d2 = *l2.GetObject(0); GameObject sir(d2); Audio::PlaySample3D("mod:Audio/FX/Wegberg/wachgong.wav", sir.GetPosition(), false); } break; case 10: { GameObject *d2; GameObjectList l2 = Game::GetGameObjects("wachgong1"); d2 = *l2.GetObject(0); GameObject sir(d2); Audio::PlaySample3D("mod:Audio/FX/Wegberg/wachgong.wav", sir.GetPosition(), false); } break; case 11: { GameObject *d2; GameObjectList l2 = Game::GetGameObjects("wachgong1"); d2 = *l2.GetObject(0); GameObject sir(d2); Audio::PlaySample3D("mod:Audio/FX/BFE/HZW1.wav", sir.GetPosition(), false); } break; case 12: { GameObject *d2; GameObjectList l2 = Game::GetGameObjects("wachgong1"); d2 = *l2.GetObject(0); GameObject sir(d2); Audio::PlaySample3D("mod:Audio/FX/BFE/LZW1.wav", sir.GetPosition(), false); } break; case 13: { GameObject *d2; GameObjectList l2 = Game::GetGameObjects("wachgong1"); d2 = *l2.GetObject(0); GameObject sir(d2); Audio::PlaySample3D("mod:Audio/FX/BFE/LZW2.wav", sir.GetPosition(), false); } break; case 14: { GameObject *d2; GameObjectList l2 = Game::GetGameObjects("wachgong1"); d2 = *l2.GetObject(0); GameObject sir(d2); Audio::PlaySample3D("mod:Audio/FX/BFE/RZW1.wav", sir.GetPosition(), false); } break; case 15: { GameObject *d2; GameObjectList l2 = Game::GetGameObjects("wachgong1"); d2 = *l2.GetObject(0); GameObject sir(d2); Audio::PlaySample3D("mod:Audio/FX/BFE/RZW2.wav", sir.GetPosition(), false); } break; } mdummy.PushActionDeleteOwner(ACTION_APPEND); } } }; object Knockout : CommandScript { Knockout() { SetValidTargets(ACTOR_PERSON); SetCursor("Aim"); SetIcon("Aim"); SetPriority(1000); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(p.IsInjured()) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Person p(Caller); Person pt(Target); switch(childID) { case 0: Audio::PlaySample("mod:Audio/FX/zugriff.wav"); pt.ClearActions(); p.PushActionMove(ACTION_NEWLIST, pt.GetPosition()); p.PushActionTurnTo(ACTION_APPEND, &pt); p.PushActionExecuteCommand(ACTION_APPEND, "Knockout", &pt, 1, false); break; case 1: Audio::PlaySample("mod:Audio/FX/knockout.wav"); p.PushActionSwitchAnim(ACTION_APPEND, "fistfight"); p.PushActionWait(ACTION_APPEND, 3.5f); p.PushActionExecuteCommand(ACTION_APPEND, "Knockout", &pt, 2, false); break; case 2: pt.Injure(INJUREREASON_UNKNOWN); p.PushActionSwitchAnim(ACTION_APPEND, "idle"); break; } } };