faves

Initiate
I wrote a section of code, want to change the AI of the pet, but is invalid, who can help me,thanks a lot.


As if this code has no effect:
-------------------------------------------------
switch (info.ButtonID)
{
case 0:
{
if (ct.Controlled)
{
ct.ChangeAIType(AIType.AI_NecroMage);
from.SendMessage("changeAI to Necromancy!");
}
break;
}
 

Attachments

  • changeAi.cs
    4.6 KB · Views: 7
If you got the sendmessage, then look in basecreature.ChangeAIType if AI_NecroMage is listed in the switch.

If it is, look at targeted creature, if its ForcedAI is defined.
 
My pet is not define ForcedAI,defaultAI is NinjaAI,
I use [props to see pet‘s AI,it still shows the original AI,but in fact work normal,It is indeed in the use of AI_NecroMage,
It's very strange.
And thank you for your reply.
 
My pet is not define ForcedAI,defaultAI is NinjaAI,
I use [props to see pet‘s AI,it still shows the original AI,but in fact work normal,It is indeed in the use of AI_NecroMage,
It's very strange.
And thank you for your reply.
If I recall, NecroMage AI was added, but as a custom AI and it does need some ironing out. It was based off the regular Mage AI.
 
If use NecroMage AI ,it seems to need high necromancy and spiritspeak skill for cast Necromany spell,
 
Code:
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;
          
            switch (info.ButtonID)
            {
                case 0:
                    {
                        from.SendMessage("Test");
                        break;
                    }
                case 10:
                    {
                        if (ct.Controlled&& ct.ControlMaster == from && ct.Skills.Necromancy.Value>=50)
                        {
                            ct.ChangeAIType(AIType.AI_NecroMage);
                            from.SendMessage("{0} changeAI to Necromancy!", ct.Name);
                        }
                        else from.SendMessage("{0}'s Necromancy Skill value is too low ! AI will not change.", ct.Name);
                        break;
                    }
 
If use NecroMage AI ,it seems to need high necromancy and spiritspeak skill for cast Necromany spell,
Yes. Anytime you switch to a casting AI (or any AI that relies on specific skills) it will require at least GM skill in order to be utilized.
 

Active Shards

  • Unchained
    Custom (Classic)
    • Players
    • 105 Online
    • 273 Peak
  • Insane UO
    Endless Journey
    • Players
    • 101 Online
    • 128 Peak
  • UO Eventine
    Custom (Classic)
    • Players
    • 80 Online
    • 137 Peak
  • The Crossroads
    Mondain's Legacy
    • Players
    • 62 Online
    • 190 Peak
  • Arth
    Custom (Modern)
    • Players
    • 43 Online
    • 48 Peak
  • UO Enigma
    Custom (Modern)
    • Players
    • 30 Online
    • 172 Peak
  • UO Phoenix
    Custom (Classic)
    • Players
    • 23 Online
    • 48 Peak
  • CALYPSO
    Custom (Modern)
    • Players
    • 20 Online
    • 30 Peak
  • UO: New Renaissance
    Custom (Classic)
    • Players
    • 20 Online
    • 85 Peak
  • Heritage
    New Legacy
    • Players
    • 18 Online
    • 41 Peak

Donations

Total amount
$0.00
Goal
$500.00
Back