void SetLightAndReligion(bool whiteLighter, WurmReligions religion) { if (whiteLighter != IsWhiteLighter || religion != PlayerReligion) { IsWhiteLighter = whiteLighter; PlayerReligion = religion; PerformAsyncInits(); } }
public static bool CheckConditions(LogEntry line, bool isWhiteLight, WurmReligions religion) { //Holding a sermon (+/- 1) if (line.Content.Contains("You finish this sermon")) { return(true); } //Listening to a sermon (up to +/- 4 (depends on preaching success)) if (line.Content.Contains("finishes the sermon by asking you")) { return(true); } //Converting someone to your religion (+/- 1) //Sacrificing items in an altar (at least worth 50c get price) (+/- 1) if (isWhiteLight) { //Burying a human corpse (+ 2) if (line.Content.Contains("You bury")) { if (Regex.IsMatch(line.Content, @"You bury the corpse of \w+", RegexOptions.Compiled)) { if (!Regex.IsMatch(line.Content, @"You bury the corpse of \w+ \w+", RegexOptions.Compiled)) { return(true); } } if (line.Content.Contains("tower guar")) { return(true); } } //Healing someone else (+ 1) if (line.Content.Contains("You treat the wound") || line.Content.Contains("You bandage the wound")) { return(true); } //Casting Bless on players (seems random). (+ 1) //Praying at the White Light on the Wild server. (+ 3) //Killing of a blacklighter (+ 5) no way to tell light = NOT POSSIBLE } else if (!isWhiteLight) { //Butchering a human corpse (- 1) if (line.Content.Contains("You butcher")) { if (Regex.IsMatch(line.Content, @"You butcher the corpse of \w+", RegexOptions.Compiled)) { if (!Regex.IsMatch(line.Content, @"You butcher the corpse of \w+ \w+", RegexOptions.Compiled)) { return(true); } } if (line.Content.Contains("tower guar")) { return(true); } } //Successful Lockpicking (-5) //Praying at the Black Light on the Wild server. (- 3) //Desecrating an altar (- 2) //Killing of a whitelighter (- 5) no way to tell light = NOT POSSIBLE } if (religion == WurmReligions.Fo) { //Listening to a confession (+/- 1) if (line.Content.Contains("You decide that a good penance is for")) { return(true); } //Confessing to a priest (+/- 5) if (line.Content.Contains("thinks for a while and asks you")) { return(true); } //Fo special: plant a sprout or a flower (+ 1) if (line.Content.Contains("You plant the sprout")) { return(true); } if (line.Content.Contains("You plant the")) { if (Regex.IsMatch(line.Content, @"You plant the.+flowers\.", RegexOptions.Compiled)) { return(true); } } } else if (religion == WurmReligions.Vynora) { //Listening to a confession (+/- 1) if (line.Content.Contains("You decide that a good penance is for")) { return(true); } //Confessing to a priest (+/- 5) if (line.Content.Contains("thinks for a while and asks you")) { return(true); } //Vynora special: cutting down an old, very old or overaged tree (+ 1) NOTE: doesn't care about the age if (line.Content.Contains("You cut down the")) { return(true); } //Vynora special: working on walls (+ 0.5) (what walls? fences? house walls? roofs floors?) } else if (religion == WurmReligions.Magranon) { //Listening to a confession (+/- 1) if (line.Content.Contains("You decide that a good penance is for")) { return(true); } //Confessing to a priest (+/- 5) if (line.Content.Contains("thinks for a while and asks you")) { return(true); } //Magranon special: mine (+ 0.5) if (line.Content.Contains("You mine some")) { return(true); } //Magranon special: kill a creature (+ 0.5) if (line.Content.Contains("is dead. R.I.P.")) { if (!line.Content.Contains("tower guard")) { return(true); } } } else if (religion == WurmReligions.Libila) { //Listening to a confession (+/- 1) if (line.Content.Contains("You decide that you can probably fool")) { return(true); } //Confessing to a priest (+/- 5) if (line.Content.Contains("scorns you and tells you to give")) { return(true); } //Libila special: kill a creature (- 0.5) if (line.Content.Contains("is dead. R.I.P.")) { if (!line.Content.Contains("tower guard")) { return(true); } } } return(false); }