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

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.
 
Code:
Expand Collapse Copy
        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;
                    }
 

Donations

Total amount
$50.00
Goal
$500.00

Shards

Back