public override bool OnFirstHeartbeat(GameObject attachee, GameObject triggerer) { // Respawn if ((!GetGlobalFlag(912))) { StartTimer(604800000, () => respawn(attachee)); // 604800000ms is 1 week SetGlobalFlag(912, true); } // The 'evac' routine if (ScriptDaemon.get_f("boatmens_tavern_evac_on") && SelectedPartyLeader.GetMap() == 5052) { StartTimer(300, () => ScriptDaemon.set_f("boatmens_tavern_evac_on", false)); if (attachee.GetNameId() == 14133 && !ScriptDaemon.get_f("lodriss_killed_outside")) // For Lodriss { attachee.ClearObjectFlag(ObjectFlag.OFF); } else { // else : # For the others attachee.ClearObjectFlag(ObjectFlag.OFF); } } // game.new_sid = 0 if (attachee.GetNameId() == 14152 && SelectedPartyLeader.GetMap() == 5051) // Tolub, outside { attachee.ClearObjectFlag(ObjectFlag.OFF); } return(RunDefault); }
public override bool OnDialog(GameObject attachee, GameObject triggerer) { if (ScriptDaemon.get_f("dala_ran_off")) { triggerer.BeginDialog(attachee, 200); } else if ((GetGlobalFlag(88))) { triggerer.BeginDialog(attachee, 1); } else if ((GetQuestState(37) == QuestState.Completed)) { triggerer.BeginDialog(attachee, 20); } else if ((attachee.HasMet(triggerer))) { triggerer.BeginDialog(attachee, 60); } else { triggerer.BeginDialog(attachee, 110); } return(SkipDefault); }
public static bool goons_attack(GameObject attachee) { if (GetQuestState(42) != QuestState.Completed && !ScriptDaemon.get_f("s_skole_goons_scheduled") && !ScriptDaemon.get_f("skole_dead")) { ScriptDaemon.set_f("s_skole_goons_scheduled"); SetQuestState(42, QuestState.Botched); SetGlobalFlag(202, true); QueueRandomEncounter(3004); } return(RunDefault); }
public static void ghouls_harpies_join_in(GameObject attachee) { foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC)) { if ((new[] { 14095, 14128, 14129 }).Contains(obj.GetNameId()) && ScriptDaemon.within_rect_by_corners(obj, 415, 556, 419, 590) && obj.GetLeader() == null) { // ghouls in the eastern room - should join the fray, per the module obj.Attack(SelectedPartyLeader); } if (obj.GetNameId() == 14243 && obj.GetLeader() == null) { // other harpies obj.Attack(SelectedPartyLeader); } } if (attachee.GetMap() == 5066 && (!ScriptDaemon.get_f("j_ghouls_corridor_temple_1"))) // temple level 1 { ScriptDaemon.set_f("j_ghouls_corridor_temple_1"); var yyp_max = 556; var yyp_o = 561; foreach (var pc in PartyLeader.GetPartyMembers()) { var(xxp, yyp) = pc.GetLocation(); if (xxp >= 433 && yyp >= 561) { if (yyp > yyp_max) { yyp_max = yyp; } } } var y_ghoul = yyp_max + 18; y_ghoul = Math.Min(603, y_ghoul); var y_ghoul_add = new[] { 0, 0, 2, 2, -2 }; var x_ghoul_add = new[] { 0, 2, 0, 2, 0 }; var x_ghoul = 433; var ghoul_counter = 0; foreach (var npc in ObjList.ListVicinity(new locXY(463, 603), ObjectListFilter.OLC_NPC)) { if (npc.GetNameId() == 14129 && npc.GetLeader() == null && !npc.IsUnconscious()) { npc.Move(new locXY(x_ghoul + x_ghoul_add[ghoul_counter], y_ghoul + y_ghoul_add[ghoul_counter]), 0, 0); ghoul_counter += 1; npc.Attack(SelectedPartyLeader); } } } }
public static void spawn_grate_object() { if (!ScriptDaemon.get_f("harpy_grate")) { var should_drop_grate = false; foreach (var pc in PartyLeader.GetPartyMembers()) { var(xx, yy) = pc.GetLocation(); if (xx <= 415 && yy < 580 && yy > 500) { should_drop_grate = true; } if (should_drop_grate) { ScriptDaemon.set_f("harpy_grate"); GameObject grate_obj = null; foreach (var obj in ObjList.ListVicinity(new locXY(415, 556), ObjectListFilter.OLC_PORTAL)) { if (obj.GetNameId() == 120) { grate_obj = obj; } } if (grate_obj == null) { grate_obj = GameSystems.MapObject.CreateObject(120, new locXY(415, 556)); grate_obj.Move(new locXY(415, 556), 0, 11f); grate_obj.Rotation = 1.57f * 3 / 2; grate_obj.SetPortalFlag(PortalFlag.JAMMED); grate_obj.SetObjectFlag(ObjectFlag.SHOOT_THROUGH); grate_obj.SetObjectFlag(ObjectFlag.SEE_THROUGH); grate_obj.SetObjectFlag(ObjectFlag.CLICK_THROUGH); grate_obj.SetObjectFlag(ObjectFlag.TRANSLUCENT); grate_obj.SetObjectFlag(ObjectFlag.NO_BLOCK); grate_obj.SetObjectFlag(ObjectFlag.NOHEIGHT); } // game.timevent_add( grate_npc_timed_event, ( ), 250, 1 ) AttachParticles("Orb-Summon-Earth Elemental", grate_obj); GameSystems.Scroll.ShakeScreen(50, 500); Sound(4180, 1); } } } }
public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript) { switch (lineNumber) { case 11: case 14: originalScript = "game.quests[46].state == qs_unknown"; return(GetQuestState(46) == QuestState.Unknown); case 12: case 13: case 15: case 16: originalScript = "game.quests[46].state != qs_unknown"; return(GetQuestState(46) != QuestState.Unknown); case 41: case 42: originalScript = "game.quests[46].state == qs_unknown and game.global_flags[105] == 0"; return(GetQuestState(46) == QuestState.Unknown && !GetGlobalFlag(105)); case 43: case 44: originalScript = "game.quests[52].state == qs_unknown and game.global_flags[107] == 0"; return(GetQuestState(52) == QuestState.Unknown && !GetGlobalFlag(107)); case 61: case 62: case 91: case 92: originalScript = "( get_v(454) & (2**1) == 0 )"; return((ScriptDaemon.get_v(454) & (0x2)) == 0); case 93: case 94: originalScript = "( get_v(454) & (2**1) != 0 )"; return((ScriptDaemon.get_v(454) & (0x2)) != 0); case 161: case 162: case 1601: case 1602: originalScript = "game.global_flags[105] == 0"; return(!GetGlobalFlag(105)); case 163: case 1603: originalScript = "game.global_flags[105] == 1"; return(GetGlobalFlag(105)); case 164: case 165: case 1604: case 1605: originalScript = "game.global_flags[108] == 1 and game.global_vars[11] < 5"; return(GetGlobalFlag(108) && GetGlobalVar(11) < 5); case 171: case 172: originalScript = "get_v(454) & (2**2) == 0"; return((ScriptDaemon.get_v(454) & (0x4)) == 0); case 173: originalScript = "( get_v(454) & (2**2) != 0 ) and should_open_sw_doors() == 0"; return(((ScriptDaemon.get_v(454) & (0x4)) != 0) && should_open_sw_doors() == 0); case 174: originalScript = "( get_v(454) & (2**2) != 0 ) and should_open_sw_doors() == 0"; return(((ScriptDaemon.get_v(454) & (0x4)) != 0) && should_open_sw_doors() == 0); case 175: originalScript = "( get_v(454) & (2**2) != 0 ) and should_open_sw_doors() == 1"; return(((ScriptDaemon.get_v(454) & (0x4)) != 0) && should_open_sw_doors() == 1); case 176: originalScript = "( get_v(454) & (2**2) != 0 ) and should_open_sw_doors() == 1"; return(((ScriptDaemon.get_v(454) & (0x4)) != 0) && should_open_sw_doors() == 1); case 181: case 185: case 1201: case 1205: originalScript = "game.global_vars[11] > 0 and game.global_vars[11] < 5"; return(GetGlobalVar(11) > 0 && GetGlobalVar(11) < 5); case 182: case 186: case 1202: case 1206: originalScript = "game.global_vars[11] == 5"; return(GetGlobalVar(11) == 5); case 231: case 232: originalScript = "game.global_flags[104] == 0"; return(!GetGlobalFlag(104)); case 233: originalScript = "game.global_flags[104] == 1"; return(GetGlobalFlag(104)); case 281: case 282: originalScript = "(game.quests[49].state == qs_mentioned or game.quests[49].state == qs_accepted) and game.global_vars[11] == 5"; return((GetQuestState(49) == QuestState.Mentioned || GetQuestState(49) == QuestState.Accepted) && GetGlobalVar(11) == 5); case 283: case 284: case 285: case 286: originalScript = "game.quests[49].state == qs_mentioned"; return(GetQuestState(49) == QuestState.Mentioned); case 287: case 288: originalScript = "game.quests[49].state == qs_accepted and game.global_flags[108] == 1 and game.global_vars[11] < 5"; return(GetQuestState(49) == QuestState.Accepted && GetGlobalFlag(108) && GetGlobalVar(11) < 5); case 289: case 290: originalScript = "game.quests[50].state == qs_mentioned"; return(GetQuestState(50) == QuestState.Mentioned); case 291: case 292: originalScript = "game.quests[50].state == qs_accepted and game.global_flags[109] == 1"; return(GetQuestState(50) == QuestState.Accepted && GetGlobalFlag(109)); case 293: case 294: case 295: case 296: originalScript = "game.quests[51].state == qs_mentioned"; return(GetQuestState(51) == QuestState.Mentioned); case 297: case 298: originalScript = "game.quests[51].state == qs_accepted and game.global_flags[105] == 1 and game.global_flags[107] == 1"; return(GetQuestState(51) == QuestState.Accepted && GetGlobalFlag(105) && GetGlobalFlag(107)); case 299: case 300: originalScript = "game.quests[51].state == qs_accepted and game.global_flags[105] == 1 and game.global_flags[107] == 0"; return(GetQuestState(51) == QuestState.Accepted && GetGlobalFlag(105) && !GetGlobalFlag(107)); case 301: case 302: originalScript = "game.quests[51].state == qs_accepted and game.global_flags[105] == 0 and game.global_flags[107] == 1"; return(GetQuestState(51) == QuestState.Accepted && !GetGlobalFlag(105) && GetGlobalFlag(107)); case 303: case 304: originalScript = "game.quests[51].state == qs_completed"; return(GetQuestState(51) == QuestState.Completed); case 305: case 306: originalScript = "get_f('realized_grurz_new_situation') and (game.quests[49].state == qs_accepted or game.quests[49].state == qs_mentioned)"; return(ScriptDaemon.get_f("realized_grurz_new_situation") && (GetQuestState(49) == QuestState.Accepted || GetQuestState(49) == QuestState.Mentioned)); case 341: case 346: originalScript = "game.global_flags[105] == 1 and game.global_flags[107] == 1"; return(GetGlobalFlag(105) && GetGlobalFlag(107)); case 342: case 347: originalScript = "game.global_flags[105] == 1 and game.global_flags[107] == 0"; return(GetGlobalFlag(105) && !GetGlobalFlag(107)); case 343: case 348: originalScript = "game.global_flags[105] == 0 and game.global_flags[107] == 1"; return(!GetGlobalFlag(105) && GetGlobalFlag(107)); case 344: case 345: case 349: case 350: originalScript = "game.global_flags[105] == 0 and game.global_flags[107] == 0"; return(!GetGlobalFlag(105) && !GetGlobalFlag(107)); case 413: case 414: originalScript = "game.global_vars[11] > 0"; return(GetGlobalVar(11) > 0); case 415: case 416: originalScript = "game.global_vars[11] == 0"; return(GetGlobalVar(11) == 0); case 442: case 591: case 592: originalScript = "pc.skill_level_get(npc,skill_listen) <= 5"; throw new NotSupportedException("Conversion failed."); case 443: case 593: case 594: originalScript = "pc.skill_level_get(npc,skill_listen) >= 6"; throw new NotSupportedException("Conversion failed."); case 471: case 484: case 485: originalScript = "game.global_flags[104] == 1 and game.global_flags[107] == 0 and game.global_flags[105] == 0"; return(GetGlobalFlag(104) && !GetGlobalFlag(107) && !GetGlobalFlag(105)); case 472: case 493: case 495: originalScript = "game.global_flags[104] == 0 and game.global_flags[107] == 1 and game.global_flags[105] == 0"; return(!GetGlobalFlag(104) && GetGlobalFlag(107) && !GetGlobalFlag(105)); case 473: case 501: case 505: originalScript = "game.global_flags[104] == 0 and game.global_flags[107] == 0 and game.global_flags[105] == 1"; return(!GetGlobalFlag(104) && !GetGlobalFlag(107) && GetGlobalFlag(105)); case 474: case 494: case 496: originalScript = "game.global_flags[104] == 1 and game.global_flags[107] == 1 and game.global_flags[105] == 0"; return(GetGlobalFlag(104) && GetGlobalFlag(107) && !GetGlobalFlag(105)); case 475: case 502: case 506: originalScript = "game.global_flags[104] == 1 and game.global_flags[107] == 0 and game.global_flags[105] == 1"; return(GetGlobalFlag(104) && !GetGlobalFlag(107) && GetGlobalFlag(105)); case 476: case 491: case 503: case 507: originalScript = "game.global_flags[104] == 0 and game.global_flags[107] == 1 and game.global_flags[105] == 1"; return(!GetGlobalFlag(104) && GetGlobalFlag(107) && GetGlobalFlag(105)); case 477: case 492: case 504: case 508: originalScript = "game.global_flags[104] == 1 and game.global_flags[107] == 1 and game.global_flags[105] == 1"; return(GetGlobalFlag(104) && GetGlobalFlag(107) && GetGlobalFlag(105)); case 481: originalScript = "game.global_flags[107] == 1 and game.global_flags[105] == 0"; return(GetGlobalFlag(107) && !GetGlobalFlag(105)); case 482: originalScript = "game.global_flags[107] == 0 and game.global_flags[105] == 1"; return(!GetGlobalFlag(107) && GetGlobalFlag(105)); case 483: originalScript = "game.global_flags[107] == 1 and game.global_flags[105] == 1"; return(GetGlobalFlag(107) && GetGlobalFlag(105)); case 521: originalScript = "get_v(454) & 2**2 == 0"; return((ScriptDaemon.get_v(454) & 0x4) == 0); case 522: originalScript = "get_v(454) & 2**2 != 0"; return((ScriptDaemon.get_v(454) & 0x4) != 0); case 561: case 562: originalScript = "( get_v(454) & (2**1) == 0)"; return((ScriptDaemon.get_v(454) & (0x2)) == 0); case 563: case 564: originalScript = "( get_v(454) & (2**1) != 0)"; return((ScriptDaemon.get_v(454) & (0x2)) != 0); default: originalScript = null; return(true); } }
public override bool OnStartCombat(GameObject attachee, GameObject triggerer) { if (attachee.GetMap() == 5005) // Moathouse Dungeon { foreach (var npc in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC)) { if ((new[] { 14066, 14067, 14078, 14079, 14080 }).Contains(npc.GetNameId()) && npc.GetLeader() == null && npc.GetScriptId(ObjScriptEvent.StartCombat) == 0) { npc.SetScriptId(ObjScriptEvent.StartCombat, 75); } } } else if (attachee.GetMap() == 5066) // Temple level 1 { foreach (var npc in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC)) { if (npc.GetLeader() == null && npc.GetScriptId(ObjScriptEvent.StartCombat) == 0) { npc.SetScriptId(ObjScriptEvent.StartCombat, 2); } } } if ((GetGlobalVar(709) == 2 && attachee.GetMap() == 5005)) { SetGlobalVar(709, 3); foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC)) { if ((obj.GetNameId() == 14079 || obj.GetNameId() == 14080 || obj.GetNameId() == 14067 || obj.GetNameId() == 14078 || obj.GetNameId() == 14066)) { obj.TurnTowards(triggerer); obj.Attack(triggerer); } } } if (attachee.GetMap() == 5066 && (!ScriptDaemon.get_f("j_ogre_temple_1"))) // temple level 1 - gnolls near southern stairs { var(xx, yy) = attachee.GetLocation(); if ((Math.Pow((xx - 564), 2) + Math.Pow((yy - 599), 2)) < 200) { ScriptDaemon.set_f("j_ogre_temple_1"); var xxp_min = 564; var xxp_o = 564; foreach (var pc in PartyLeader.GetPartyMembers()) { var(xxp, yyp) = pc.GetLocation(); if (yyp >= 599) { if (xxp < xxp_min) { xxp_min = xxp; } } else if (yyp < 599 && xxp >= 519 && xxp <= 546 && yyp >= 589) { if (xxp < xxp_o) { xxp_o = xxp; } } } var x_ogre = Math.Min(xxp_min, xxp_o) - 20; x_ogre = Math.Max(507, x_ogre); foreach (var npc in ObjList.ListVicinity(new locXY(507, 603), ObjectListFilter.OLC_NPC)) { if (npc.GetNameId() == 14448 && npc.GetLeader() == null && !npc.IsUnconscious()) { npc.Move(new locXY(x_ogre, 601), 0, 0); npc.Attack(SelectedPartyLeader); } } } } // THIS IS USED FOR BREAK FREE var found_nearby = 0; foreach (var obj in PartyLeader.GetPartyMembers()) { if ((obj.DistanceTo(attachee) <= 3 && obj.GetStat(Stat.hp_current) >= -9)) { found_nearby = 1; } } if (found_nearby == 0) { while ((attachee.FindItemByName(8903) != null)) { attachee.FindItemByName(8903).Destroy(); } } // if (attachee.d20_query(Q_Is_BreakFree_Possible)): # workaround no longer necessary! // create_item_in_inventory( 8903, attachee ) // attachee.d20_send_signal(S_BreakFree) // Spiritual Weapon Shenanigens # CombatStandardRoutines.Spiritual_Weapon_Begone(attachee); return(RunDefault); }
public static void romag_call_help(GameObject attachee) { if (attachee.GetMap() == 5066 && (!ScriptDaemon.get_f("j_earth_commander_troops_temple_1")) && ScriptDaemon.within_rect_by_corners(attachee, 440, 432, 440, 451)) // temple level 1 { attachee.FloatLine(1000, attachee); ScriptDaemon.set_f("j_earth_commander_troops_temple_1"); var yyp_max = 439; var party_in_troop_room = false; var party_in_romag_room = false; var party_outside_romag_room = false; foreach (var pc in PartyLeader.GetPartyMembers()) { var(xxp, yyp) = pc.GetLocation(); if ((xxp >= 440 && xxp <= 452 && yyp >= 439 && yyp <= 451)) { party_in_romag_room = true; if (yyp > yyp_max) { yyp_max = yyp; } } if (xxp >= 453 && yyp <= 451) { party_outside_romag_room = true; } if ((yyp >= 455 && yyp <= 471 && xxp >= 439 && xxp <= 457) || ((xxp - yyp) <= 1 && yyp <= 471 && xxp >= 456)) { party_in_troop_room = true; } } var y_troop = yyp_max + 18; y_troop = Math.Min(465, y_troop); var y_troop_add = new[] { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; var x_troop_add = new[] { 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, -1, -2, -3 }; var x_troop = 446; var troop_counter = 0; if (party_outside_romag_room && !party_in_romag_room) { y_troop = 446; x_troop = 445; y_troop_add = new[] { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 0, 1, 2, 3, 0, 1 }; x_troop_add = new[] { 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, -1, -1, -1, -1, -2, -2 }; } if (!party_in_troop_room) { foreach (var npc in ObjList.ListVicinity(new locXY(453, 463), ObjectListFilter.OLC_NPC)) { if ((new[] { 14162, 14163, 14165, 14337, 14339, 14156 }).Contains(npc.GetNameId()) && npc.GetLeader() == null && !npc.IsUnconscious()) { var(xx, yy) = npc.GetLocation(); if (yy > y_troop) { npc.Move(new locXY(x_troop + x_troop_add[troop_counter], y_troop + y_troop_add[troop_counter]), 0, 0); troop_counter += 1; } } } } // npc.attack(game.leader) foreach (var npc in ObjList.ListVicinity(new locXY(453, 463), ObjectListFilter.OLC_NPC)) { if ((new[] { 14162, 14163, 14165, 14337, 14339, 14156 }).Contains(npc.GetNameId()) && npc.GetLeader() == null) { npc.Attack(SelectedPartyLeader); } } } }
public override bool OnDialog(GameObject attachee, GameObject triggerer) { if ((ScriptDaemon.get_v(454) & 2) != 0 && !GetGlobalFlag(108)) // Water Temple regrouped, and he's stuck there { if ((!attachee.HasMet(triggerer))) { if ((triggerer.GetPartyMembers().Any(o => o.HasEquippedByName(3017)))) { triggerer.BeginDialog(attachee, 140); } else { triggerer.BeginDialog(attachee, 1000); } } else { if (ScriptDaemon.get_f("realized_grurz_new_situation")) { if (ScriptDaemon.get_v("grurz_float_counter") < 5) { var rand1 = RandomRange(0, 1); attachee.FloatLine(1100 + rand1, triggerer); ScriptDaemon.inc_v("grurz_float_counter"); } else if (ScriptDaemon.get_v("grurz_float_counter") == 5) { attachee.FloatLine(1102, triggerer); ScriptDaemon.inc_v("grurz_float_counter"); } else if (ScriptDaemon.get_v("grurz_float_counter") == 6) { attachee.FloatLine(1103, triggerer); ScriptDaemon.inc_v("grurz_float_counter"); } else if (ScriptDaemon.get_v("grurz_float_counter") == 7) { attachee.FloatLine(1104, triggerer); ScriptDaemon.inc_v("grurz_float_counter"); } else if (ScriptDaemon.get_v("grurz_float_counter") == 8) { attachee.FloatLine(1105, triggerer); attachee.Attack(triggerer); } } else { triggerer.BeginDialog(attachee, 900); } } } else if ((!attachee.HasMet(triggerer))) { if ((triggerer.GetPartyMembers().Any(o => o.HasFollowerByName(8023)))) { triggerer.BeginDialog(attachee, 60); } else if ((triggerer.GetPartyMembers().Any(o => o.HasEquippedByName(3020)))) { triggerer.BeginDialog(attachee, 120); } else if ((triggerer.GetPartyMembers().Any(o => o.HasEquippedByName(3017)))) { triggerer.BeginDialog(attachee, 140); } else { triggerer.BeginDialog(attachee, 1); } } else { triggerer.BeginDialog(attachee, 100); } return(SkipDefault); }
public override bool OnHeartbeat(GameObject attachee, GameObject triggerer) { attachee.SetScriptId(ObjScriptEvent.EnterCombat, 109); // assign enter_combat script if ((GameSystems.Combat.IsCombatActive())) { if ((attachee != null && !attachee.IsUnconscious() && !attachee.D20Query(D20DispatcherKey.QUE_Prone))) { run_off(attachee, triggerer); return(SkipDefault); } } if ((!GameSystems.Combat.IsCombatActive() && ScriptDaemon.tpsts("dala_buggered_off", 1))) { var downed_bozos = 0; foreach (var hostel_patron in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC)) { if ((new[] { 8018, 14145, 14074 }).Contains(hostel_patron.GetNameId())) { if (hostel_patron.IsUnconscious() || hostel_patron.GetLeader() != null) { downed_bozos += 1; } } } if (downed_bozos >= 2) { // attachee.float_mesfile_line( 'mes\\test.mes', 1, 0 ) attachee.FadeTo(255, 1, 50); foreach (var hostel_patron in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC)) { foreach (var pc in SelectedPartyLeader.GetPartyMembers()) { hostel_patron.AIRemoveFromShitlist(pc); hostel_patron.SetReaction(pc, 80); } } attachee.ClearObjectFlag(ObjectFlag.CLICK_THROUGH); attachee.ClearObjectFlag(ObjectFlag.OFF); foreach (var hostel_patron in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC)) { foreach (var pc in SelectedPartyLeader.GetPartyMembers()) { hostel_patron.AIRemoveFromShitlist(pc); hostel_patron.SetReaction(pc, 80); } } attachee.SetBaseStat(Stat.strength, 10); if (!ScriptDaemon.get_f("have_talked_to_dala_post_battle")) // initiate Dala monologue where she faints { foreach (var pc in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_PC)) { if (ScriptDaemon.is_safe_to_talk_rfv(attachee, pc, 40)) { ScriptDaemon.set_f("have_talked_to_dala_post_battle"); pc.BeginDialog(attachee, 200); } } } } } else if ((!GameSystems.Combat.IsCombatActive())) // this takes care of the infinite battle loop { // attachee.float_mesfile_line( 'mes\\test.mes', 2, 0 ) foreach (var hostel_patron in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC)) { if (!((new[] { 8018, 14145, 14074 }).Contains(hostel_patron.GetNameId()))) // added condition because apparently sometimes combat doesn't start before this heartbeat fires and thus it sets them to non-hostile status and no combat actually commences { foreach (var pc in SelectedPartyLeader.GetPartyMembers()) { hostel_patron.AIRemoveFromShitlist(pc); hostel_patron.SetReaction(pc, 80); } } } } if ((GetQuestState(37) == QuestState.Completed)) { // game.new_sid = 0 # commented by S.A. - the heartbeat is now needed var dummy = 1; } else if ((!GetGlobalFlag(89))) { if ((!GameSystems.Combat.IsCombatActive())) { var(xx, yy) = attachee.GetLocation(); if (xx == 478 && yy == 504 && !attachee.HasLineOfSight(SelectedPartyLeader)) { attachee.TurnTowards(SelectedPartyLeader); } foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_PC)) { if ((attachee.HasLineOfSight(obj))) { SetGlobalFlag(89, true); StartTimer(7200000, () => reset_global_flag_89(attachee)); // call reset_global_flag_89 in 2 hours attachee.StealFrom(obj); return(RunDefault); } } } } return(RunDefault); }
public static bool should_display_dialog_node(string node_name) { var cur_map = SelectedPartyLeader.GetMap(); if (node_name == "Temple Entrance") { if (cur_map == 5064) { return(false); } } else if (node_name == "Temple Tower Exterior") { if (cur_map == 5113) { return(false); } if (ScriptDaemon.get_f("visited_temple_tower_exterior")) { return(true); } } else if (node_name == "More Upper Proper") { var option_count = 0; if (cur_map != 5064) { option_count += 1; } if (cur_map != 5113 && ScriptDaemon.get_f("visited_temple_tower_exterior")) { option_count += 1; } if (cur_map != 5065 && ScriptDaemon.get_f("visited_temple_tower_interior")) { option_count += 1; } if (cur_map != 5093 && ScriptDaemon.get_f("visited_temple_burnt_farmhouse")) { option_count += 1; } if (cur_map != 5092 && ScriptDaemon.get_f("visited_temple_escape_tunnel")) { option_count += 1; } if (cur_map != 5112 && ScriptDaemon.get_f("visited_temple_ruined_building")) { option_count += 1; } return(option_count >= 5); } else if (node_name == "Level 1") { if (cur_map == 5066) { return(false); } if (ScriptDaemon.get_f("visited_level_1_north_entrance") || ScriptDaemon.get_f("visited_level_1_south_entrance") || ScriptDaemon.get_f("visited_level_1_south_entrance") || SelectedPartyLeader.HasReputation(11) || ScriptDaemon.get_f("visited_secret_spiral_staircase")) { return(true); } } else if (node_name == "Level 1 - North") { if (ScriptDaemon.get_f("visited_level_1_north_entrance")) { return(true); } } else if (node_name == "Level 1 - South") { if (ScriptDaemon.get_f("visited_level_1_south_entrance")) { return(true); } } else if (node_name == "Level 1 - Romag") { if (SelectedPartyLeader.HasReputation(11)) { return(true); } } else if (node_name == "Secret Spiral Staircase") { if (ScriptDaemon.get_f("visited_secret_spiral_staircase")) { return(true); } } else if (node_name == "Level 2") { if (cur_map == 5067) { return(false); } if (ScriptDaemon.get_f("visited_level_2_north_west_entrance") || ScriptDaemon.get_f("visited_level_2_centre_entrance") || SelectedPartyLeader.HasReputation(13) || SelectedPartyLeader.HasReputation(12) || SelectedPartyLeader.HasReputation(10)) { return(true); } } else if (node_name == "Level 2 - North West") { if (ScriptDaemon.get_f("visited_level_2_north_west_entrance")) { return(true); } } else if (node_name == "Level 2 - Centre") { if (ScriptDaemon.get_f("visited_level_2_centre_entrance")) { return(true); } } else if (node_name == "Level 2 - Alrrem") { if (SelectedPartyLeader.HasReputation(13)) { return(true); } } else if (node_name == "Level 2 - Belsornig") { if (SelectedPartyLeader.HasReputation(12)) { return(true); } } else if (node_name == "Level 2 - Kelno") { if (SelectedPartyLeader.HasReputation(10)) { return(true); } } else if (node_name == "Level 2 More") { var option_count = 0; if (ScriptDaemon.get_f("visited_level_2_north_west_entrance")) { option_count += 1; } if (ScriptDaemon.get_f("visited_level_2_centre_entrance")) { option_count += 1; } if (SelectedPartyLeader.HasReputation(13)) { option_count += 1; } if (SelectedPartyLeader.HasReputation(12)) { option_count += 1; } if (SelectedPartyLeader.HasReputation(10)) { option_count += 1; } return(option_count >= 5); } else if (node_name == "Secret Spiral Staircase") { if (ScriptDaemon.get_f("visited_secret_spiral_staircase")) { return(true); } } else if (node_name == "Level 3") { if (cur_map == 5105) { return(false); } if (ScriptDaemon.get_f("visited_level_3_east_entrance") || ScriptDaemon.get_f("visited_level_3_west_entrance") || ScriptDaemon.get_f("visited_level_3_south_west_entrance") || ScriptDaemon.get_f("visited_level_3_falrinth")) { return(true); } } else if (node_name == "Level 3 - East") { if (ScriptDaemon.get_f("visited_level_3_east_entrance")) { return(true); } } else if (node_name == "Level 3 - West") { if (ScriptDaemon.get_f("visited_level_3_west_entrance")) { return(true); } } else if (node_name == "Level 3 - South") { if (ScriptDaemon.get_f("visited_level_3_south_west_entrance")) { return(true); } } else if (node_name == "Level 3 - Falrinth") { if (ScriptDaemon.get_f("visited_level_3_falrinth")) { return(true); } } else if (node_name == "Level 4") { if (cur_map == 5080) { return(false); } if (ScriptDaemon.get_f("visited_level_4_main_entrance") || ScriptDaemon.get_f("visited_level_4_nexus") || ScriptDaemon.get_f("visited_level_4_hedrack")) { return(true); } } else if (node_name == "Level 4 - Main") { if (ScriptDaemon.get_f("visited_level_4_main_entrance")) { return(true); } } else if (node_name == "Level 4 - Nexus") { if (ScriptDaemon.get_f("visited_level_4_nexus")) { return(true); } } else if (node_name == "Level 4 - Hedrack") { if (ScriptDaemon.get_f("visited_level_4_hedrack")) { return(true); } } else if (node_name == "Nodes") { if (ScriptDaemon.get_f("visited_air_node") || ScriptDaemon.get_f("visited_earth_node") || ScriptDaemon.get_f("visited_fire_node") || ScriptDaemon.get_f("visited_water_node")) { return(true); } } else if (node_name == "Air Node") { if (ScriptDaemon.get_f("visited_air_node")) { return(true); } } else if (node_name == "Earth Node") { if (ScriptDaemon.get_f("visited_earth_node")) { return(true); } } else if (node_name == "Fire Node") { if (ScriptDaemon.get_f("visited_fire_node")) { return(true); } } else if (node_name == "Water Node") { if (ScriptDaemon.get_f("visited_water_node")) { return(true); } } else if (node_name == "Zuggtmoy Level") { if (cur_map == 5079) { return(false); } if (ScriptDaemon.get_f("visited_zuggtmoy_level")) { return(true); } } return(true); }