<commit_before>#load "TwoStateAbility.csx"

using System;

public static class Necro
{
    public static TwoStateAbility DarkPower { get; } = new TwoStateAbility(".darkpower",
        "Nyni ti muze byt navracena spotrebovana mana.", "Jsi zpatky v normalnim stavu.");
    public static TwoStateAbility StandCast { get; } = new TwoStateAbility(".standcast",
        "Nyni budes kouzlit s vetsim usilim.", "Tve usili polevilo.");
}<commit_msg>Adding summon creature for necro.<commit_after>#load "Specs.csx"
#load "party.csx"
#load "TwoStateAbility.csx"

using System;

public static class Necro
{
    private static EventJournal eventJournal = UO.CreateEventJournal();

    public static TwoStateAbility DarkPower { get; } = new TwoStateAbility(".darkpower",
        "Nyni ti muze byt navracena spotrebovana mana.", "Jsi zpatky v normalnim stavu.");
    public static TwoStateAbility StandCast { get; } = new TwoStateAbility(".standcast",
        "Nyni budes kouzlit s vetsim usilim.", "Tve usili polevilo.");
    
    
    public static void SummonCreature(string creatureName)
    {
        UO.Log($"Where do you want to summon {creatureName}"); 
        var targetInfo = UO.Info();
        if (!targetInfo.HasValue)
        {
            UO.Log("Targeting cancelled");
            return;
        }
        
        UO.WarModeOff();
        UO.CastSpell(Spell.SummonCreature);
        UO.WaitForDialogBox();
        UO.TriggerDialogBox(creatureName);
        UO.WaitForTarget();
        UO.Target(targetInfo.Value.Location);
        
        bool spellFailed = false;
        
        eventJournal
            .When<MobileEnteredViewEvent>(
                e => Specs.Satan.Matches(e.Mobile) 
                        && (Location2D)e.Mobile.Location == (Location2D)targetInfo.Value.Location,
                e => { })
            .When<SpeechReceivedEvent>(e => e.Speech.Message.Contains("Kouzlo se nezdarilo."), e => spellFailed = true)
            .WaitAny();
        
        if (spellFailed)
            return;
            
        UO.Say("all stay");
    }
}

UO.RegisterCommand("summon-satan", () => Necro.SummonCreature("Satan"));
{'fraction_non_alphanumeric': 0.11407199625993455, 'fraction_numerical': 0.0009350163627863488, 'mean_word_length': 2.502454991816694, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1861977', 'n_tokens_mistral': 675, 'n_tokens_neox': 670, 'n_words': 150}