const char PROTO_HupfAGT[] = "mod:Prototypes/Persons/Feuerwehr/Hupf_Guertel.e4p"; const char PROTO_Bayern2000AGT[] = "mod:Prototypes/Persons/Feuerwehr/Bayern2000_Ueberjacke_Guertel.e4p"; const char PROTO_HupfAGT_PA[] = "mod:Prototypes/Persons/Feuerwehr/Hupf_Atemschutz.e4p"; const char PROTO_Bayern2000AGT_PA[] = "mod:Prototypes/Persons/Feuerwehr/Bayern2000_Ueberjacke_Atemschutz.e4p"; object PCmdChangeToMask: CommandScript { PCmdChangeToMask() { SetIcon("pa"); SetCursor("use"); SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT); } bool CheckPossible(GameObject *Caller) { Person p(Caller); if (p.IsContaminated()) return false; if (!p.IsEquipped()) return true; return false; } bool CheckGroupVisibility(GameObject *Caller) { if (Caller->GetType() != ACTOR_PERSON) return false; return !Caller->IsEquipped(); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetType() != ACTOR_VEHICLE) return false; Vehicle v(Target); if (v.HasName("Fl_Germersheim_40_1") || v.HasName("Fl_Germersheim_21_1") || v.HasName("Fl_Schwab_46_1") || v.HasName("Fl_Behringshausen_44_1") || v.HasName("Fl_Heidhaus_40_1") || v.HasName("Fl_Meissen_40_1") || v.HasName("Fl_Maierheim_43_1")) { return true; } return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Target); Person p(Caller); Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_EQUIPMENTDOOR); Caller->PushActionTurnTo(ACTION_APPEND, Target); p.PushActionSwitchAnim(ACTION_APPEND,"useobjmid"); p.PushActionWait(ACTION_APPEND, 3.f); if (StrCompare(p.GetPrototypeFileName(), PROTO_HupfAGT) == 0) { p.PushActionExecuteCommand(ACTION_APPEND, "DummyChange", Target, 1, false); } if (StrCompare(p.GetPrototypeFileName(), PROTO_Bayern2000AGT) == 0) { p.PushActionExecuteCommand(ACTION_APPEND, "DummyChange", Target, 2, false); } } }; const char PROTO_HupfAGT[] = "mod:Prototypes/Persons/Feuerwehr/Hupf_Guertel.e4p"; const char PROTO_Bayern2000AGT[] = "mod:Prototypes/Persons/Feuerwehr/Bayern2000_Ueberjacke_Guertel.e4p"; const char PROTO_HupfAGT_PA[] = "mod:Prototypes/Persons/Feuerwehr/Hupf_Atemschutz.e4p"; const char PROTO_Bayern2000AGT_PA[] = "mod:Prototypes/Persons/Feuerwehr/Bayern2000_Ueberjacke_Atemschutz.e4p"; object PCmdChangeToFirefighter: CommandScript { PCmdChangeToFirefighter() { SetIcon("hupf"); SetCursor("use"); SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT); } bool CheckPossible(GameObject *Caller) { Person p(Caller); if (p.IsContaminated()) return false; if (!p.IsEquipped()) return true; return false; } bool CheckGroupVisibility(GameObject *Caller) { if (Caller->GetType() != ACTOR_PERSON) return false; return !Caller->IsEquipped(); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->IsValid() || Target->GetType() != ACTOR_VEHICLE) return false; Vehicle v(Target); if (v.HasName("Fl_Germersheim_40_1") || v.HasName("Fl_Germersheim_21_1") || v.HasName("Fl_Schwab_46_1") || v.HasName("Fl_Behringshausen_44_1") || v.HasName("Fl_Heidhaus_40_1") || v.HasName("Fl_Meissen_40_1") || v.HasName("Fl_Maierheim_43_1")) { return true; } return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Target); Person p(Caller); Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_EQUIPMENTDOOR); Caller->PushActionTurnTo(ACTION_APPEND, Target); Caller->PushActionSwitchAnim(ACTION_APPEND,"useobjmid"); Caller->PushActionWait(ACTION_APPEND, 3.f); if (StrCompare(p.GetPrototypeFileName(), PROTO_HupfAGT_PA) == 0) { Caller->PushActionExecuteCommand(ACTION_APPEND, "DummyChange", Target, 3, false); } if (StrCompare(p.GetPrototypeFileName(), PROTO_Bayern2000AGT_PA) == 0) { Caller->PushActionExecuteCommand(ACTION_APPEND, "DummyChange", Target, 4, false); } } }; object DummyChange: CommandScript { DummyChange() { SetGroupID(20); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; } bool CheckPossible(GameObject *Caller) { Person p(Caller); return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { switch (childID) { case 1: Vector Pos; float r[9]; Person p; int enter = 0; Pos=Caller->GetPosition(); Caller->GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); Caller->PushActionSwitchAnim(ACTION_NEWLIST,"useobjmid"); Caller->PushActionWait(ACTION_APPEND, 5.f); Caller->SetCommandable(false); Caller->PushActionDeleteOwner(ACTION_APPEND); p = Game::CreatePerson("mod:Prototypes/Persons/Feuerwehr/Hupf_Atemschutz.e4p", Target->GetName()); p.SetPosition(Pos); p.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); p.Hide(); p.PushActionWait(ACTION_NEWLIST, 5.f); p.PushActionShowHide(ACTION_APPEND, false); break; case 2: Vector Pos; float r[9]; Person p; int enter = 0; Pos=Caller->GetPosition(); Caller->GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); Caller->PushActionSwitchAnim(ACTION_NEWLIST,"useobjmid"); Caller->PushActionWait(ACTION_APPEND, 5.f); Caller->SetCommandable(false); Caller->PushActionDeleteOwner(ACTION_APPEND); p = Game::CreatePerson("mod:Prototypes/Persons/Feuerwehr/Bayern2000_Ueberjacke_Atemschutz.e4p", Target->GetName()); p.SetPosition(Pos); p.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); p.Hide(); p.PushActionWait(ACTION_NEWLIST, 5.f); p.PushActionShowHide(ACTION_APPEND, false); break; case 3: Vector Pos; float r[9]; Person p; int enter = 0; Pos=Caller->GetPosition(); Caller->GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); Caller->PushActionSwitchAnim(ACTION_NEWLIST,"useobjmid"); Caller->PushActionWait(ACTION_APPEND, 5.f); Caller->SetCommandable(false); Caller->PushActionDeleteOwner(ACTION_APPEND); p = Game::CreatePerson("mod:Prototypes/Persons/Feuerwehr/Hupf_Guertel.e4p", Target->GetName()); p.SetPosition(Pos); p.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); p.Hide(); p.PushActionWait(ACTION_NEWLIST, 5.f); p.PushActionShowHide(ACTION_APPEND, false); break; case 4: Vector Pos; float r[9]; Person p; int enter = 0; Pos=Caller->GetPosition(); Caller->GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); Caller->PushActionSwitchAnim(ACTION_NEWLIST,"useobjmid"); Caller->PushActionWait(ACTION_APPEND, 5.f); Caller->SetCommandable(false); Caller->PushActionDeleteOwner(ACTION_APPEND); p = Game::CreatePerson("mod:Prototypes/Persons/Feuerwehr/Bayern2000_Ueberjacke_Guertel.e4p", Target->GetName()); p.SetPosition(Pos); p.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); p.Hide(); p.PushActionWait(ACTION_NEWLIST, 5.f); p.PushActionShowHide(ACTION_APPEND, false); break; } } };