Just a question that popped in the my mind - the servuo/runuo Melee and MAgic AIs are quite similar to original OSI AIs, and i imagine that's done on purpose.
But in the spirit of making things more interesting, have there been any attempts at modernizing the creature AIs?
 
There are alternate AIs out there. I forget what they're called so I can't give you a useful term to look up.

One of them makes ranged weapon users and mages keep their distance from the player. It makes sense that someone holding a bow wouldn't run up to you and start beating you with it. My players weren't appreciative of the change though, because they had to chase those mobs and not just wait for them to come to their slaughter.
 
Hmm i can see that, though it does make more sense for mages to keep away. I'd be keep to try it if you can remember the search phrase
 
It was written by Hawkeye but I can't find any mention of it here.

I've attached the MageAI file. The change for archers is just one edit to the default ArcherAI code.

Code:
        public override bool DoActionCombat()
        {
            if ( m_Mobile.Combatant == null || m_Mobile.Combatant.Deleted || !m_Mobile.Combatant.Alive || m_Mobile.Combatant.IsDeadBondedPet )
            {
                m_Mobile.DebugSay("My combatant is deleted");
                Action = ActionType.Guard;
                return true;
            }

            if ( (m_Mobile.LastMoveTime + TimeSpan.FromSeconds( 1.0 )) < DateTime.Now )
            {
//
// Makes archers keep a distance from their opponent
//
                if (WalkMobileRange(m_Mobile.Combatant, 2, true, 9, 12))
                if (WalkMobileRange(m_Mobile.Combatant, 1, true, m_Mobile.RangeFight, m_Mobile.Weapon.MaxRange))

// Original line
//                if (WalkMobileRange(m_Mobile.Combatant, 1, true, m_Mobile.RangeFight, m_Mobile.Weapon.MaxRange))
//
                {
                    // Be sure to face the combatant
                    m_Mobile.Direction = m_Mobile.GetDirectionTo(m_Mobile.Combatant.Location);
                }

Your file may not be identical to that but you can see where the change was made.
 

Attachments

  • Mage2AI.cs
    23.5 KB · Views: 8
Hi Falkor, In my odyssey server (Runuo), the script compiles without errors, however when applied the mobile doesn't cast any spells.

I've debugged as far as i can: I can confirm that the mobile mage 1. finds a mobile.combatant, 2. finds a spell to cast, and 3. attempts to cast the spell (the script executes the line myspell.cast(). However, nothing happens ingame.

I can also confirm that mobile.target is null during this entire process. Is the spell not casting because the mobile doesn't have a target assigned??
 
Well, I hate to admit it, but it seems I never actually implemented that mage AI! It's present but isn't called by any mobs currently used on the server.

I haven't done any coding on that shard in a couple of years so I don't remember things as well as I used to. Any scripting I've done since then is all for a new shard using ServUO so the details from past years are fuzzy at best. I do hope to use this AI though so I'll have to find out what's up with that targeting at some point.
 
okay well if you could let me know if it works for you (or anyone else reading this), let me know. I can't figure out for the love of me why myspell.cast() isn't casting spells.
 
That Mage2AI is working properly on runuo 2.1,
casting spells, healing self, walking around ect all working.

Have you edited basecreature.cs and baseAI.cs?
 
yes i did... now that i know it works for you ill have ot see what the issue is on my end. thanks for testing it
Post automatically merged:

did you make any changes to the script?
 
Last edited:
Back