Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 03-11-2003, 04:30 PM   #1 (permalink)
Twisted Intel
 
silverwolfe's Avatar
 
Join Date: Feb 2003
Location: Fort Smith, AR
Age: 39
Posts: 1,081
Send a message via ICQ to silverwolfe Send a message via MSN to silverwolfe
Default Attack.Good

I was wondering, if it is possible to make creatures able to attack only evil players or npc would it not also be mutually benificial to the red comunity to have monsters that only attack blues or good players and npc's.
dug arround a little but i have a feeling this is out of my league any suggestions where to start looking?
silverwolfe is offline   Reply With Quote
Old 03-11-2003, 04:39 PM   #2 (permalink)
Forum Expert
 
Mortis's Avatar
 
Join Date: Oct 2002
Location: In My Cold Cell
Age: 44
Posts: 1,848
Default

Script an AI for it. Your best bet is a custom AI.
__________________
I'm waiting in my cold cell when the bell begins to chime
Reflecting on my past life and it doesn't have much time.
Mortis is offline   Reply With Quote
Old 03-11-2003, 09:00 PM   #3 (permalink)
 
Join Date: Dec 2002
Posts: 269
Send a message via ICQ to Dougan_Ironfist
Default

You don't need a custom AI. Just add FightMode Good to BaseCreature. Then go to the section for FightMode.Evil in BaseAI and add in your code for FightMode.Good. That is what I did and it works great.
Dougan_Ironfist is offline   Reply With Quote
Old 03-12-2003, 12:26 AM   #4 (permalink)
Twisted Intel
 
silverwolfe's Avatar
 
Join Date: Feb 2003
Location: Fort Smith, AR
Age: 39
Posts: 1,081
Send a message via ICQ to silverwolfe Send a message via MSN to silverwolfe
Default

ok ummm little unsure here is this what i am looking to edit/reverse dupe?
Quote:
if (bCheckIt)
{
if ( acqType == FightMode.Agressor || acqType == FightMode.Evil )
{
bCheckIt = false;

for ( int a=0; a < m_Mobile.Aggressors.Count; a++ )
{
if ( ((AggressorInfo)m_Mobile.Aggressors[a]).Attacker == m )
{
bCheckIt = true;
}
}

if ( acqType == FightMode.Evil && !bCheckIt )
bCheckIt = ( m.Karma < 0 );
}
}
silverwolfe is offline   Reply With Quote
Old 03-12-2003, 05:13 PM   #5 (permalink)
 
Join Date: Dec 2002
Posts: 269
Send a message via ICQ to Dougan_Ironfist
Default

[code:1]if (bCheckIt)
{
if ( acqType == FightMode.Agressor || acqType == FightMode.Evil || acqType == FightMode.Good )
{
bCheckIt = false;

for ( int a=0; a < m_Mobile.Aggressors.Count; a++ )
{
if ( ((AggressorInfo)m_Mobile.Aggressors[a]).Attacke r == m )
{
bCheckIt = true;
}
}

if ( acqType == FightMode.Evil && !bCheckIt )
bCheckIt = ( m.Karma < 0 );
else if ( acqType == FightMode.Good && !bCheckIt )
bCheckIt = ( m.Karma > 0 );
}
}[/code:1]
Dougan_Ironfist is offline   Reply With Quote
Old 03-12-2003, 06:05 PM   #6 (permalink)
Forum Expert
 
Mortis's Avatar
 
Join Date: Oct 2002
Location: In My Cold Cell
Age: 44
Posts: 1,848
Default

Well I would do my own AI just in case I did not want this to be spread out through all creatures. Say I only wanted it for 10 creatures to behave this way and not all. Or for that matter these 10 attack evil and these other 10 attack good (not being the same creatures). Then what you suggest would not be right for my needs. In this case I would want a CustomBaseAI or CustomAI.
__________________
I'm waiting in my cold cell when the bell begins to chime
Reflecting on my past life and it doesn't have much time.
Mortis is offline   Reply With Quote
Old 03-13-2003, 01:35 PM   #7 (permalink)
 
Join Date: Dec 2002
Posts: 269
Send a message via ICQ to Dougan_Ironfist
Default

It is easier to reset a FightMode than to write a new AI. I know, I have done both. lol
Dougan_Ironfist is offline   Reply With Quote
Old 03-13-2003, 01:40 PM   #8 (permalink)
Forum Expert
 
Mortis's Avatar
 
Join Date: Oct 2002
Location: In My Cold Cell
Age: 44
Posts: 1,848
Default

LOL. Yeah.

I at times just copy the current AI and modify it to my needs and give it another name in all the proper places.
__________________
I'm waiting in my cold cell when the bell begins to chime
Reflecting on my past life and it doesn't have much time.
Mortis is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5