76 lines
2.6 KiB
Plaintext
76 lines
2.6 KiB
Plaintext
// contest_cnv_set
|
|
void main()
|
|
{
|
|
string sTag=GetLocalString(OBJECT_SELF,"sControl");
|
|
int nParm=GetLocalInt(OBJECT_SELF,"nParm");
|
|
object oWP=GetWaypointByTag("CONTESTANT_"+sTag);
|
|
object oNPC;
|
|
int nN;
|
|
float fD;
|
|
DeleteLocalString(OBJECT_SELF,"sControl");
|
|
DeleteLocalInt(OBJECT_SELF,"nParm");
|
|
if (GetIsObjectValid(oWP))
|
|
{ // contestant waypoint exists
|
|
SendMessageToPC(OBJECT_SELF,"Setting contestants");
|
|
nN=1;
|
|
oNPC=GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,oWP,nN);
|
|
fD=GetDistanceBetween(oWP,oNPC);
|
|
while(GetIsObjectValid(oNPC)&&fD<16.0)
|
|
{ // set contestant ai
|
|
SendMessageToPC(OBJECT_SELF,"Contestant: "+GetName(oNPC));
|
|
switch(nParm)
|
|
{ // switch
|
|
case 1: { // bioware default
|
|
DeleteLocalInt(oNPC,"bCOMBAT_AI_ON");
|
|
DeleteLocalString(oNPC,"sCOMBAT_AI_TYPE");
|
|
break;
|
|
} // bioware default
|
|
case 2: { // melee
|
|
SetLocalInt(oNPC,"bCOMBAT_AI_ON",1);
|
|
SetLocalString(oNPC,"sCOMBAT_AI_TYPE","melee");
|
|
break;
|
|
} // melee
|
|
case 3: { // ranged
|
|
SetLocalInt(oNPC,"bCOMBAT_AI_ON",1);
|
|
SetLocalString(oNPC,"sCOMBAT_AI_TYPE","ranged");
|
|
break;
|
|
} // ranged
|
|
case 4: { // caster
|
|
SetLocalInt(oNPC,"bCOMBAT_AI_ON",1);
|
|
SetLocalString(oNPC,"sCOMBAT_AI_TYPE","caster");
|
|
break;
|
|
} // caster
|
|
case 5: { // summon
|
|
SetLocalInt(oNPC,"bCOMBAT_AI_ON",1);
|
|
SetLocalString(oNPC,"sCOMBAT_AI_TYPE","summon");
|
|
break;
|
|
} // summon
|
|
case 6: { // support
|
|
SetLocalInt(oNPC,"bCOMBAT_AI_ON",1);
|
|
SetLocalString(oNPC,"sCOMBAT_AI_TYPE","support");
|
|
break;
|
|
} // support
|
|
case 7: { // stealth
|
|
SetLocalInt(oNPC,"bCOMBAT_AI_ON",1);
|
|
SetLocalString(oNPC,"sCOMBAT_AI_TYPE","stealth");
|
|
break;
|
|
} // stealth
|
|
case 8: { // hold
|
|
SetLocalInt(oNPC,"bCOMBAT_AI_ON",1);
|
|
SetLocalString(oNPC,"sCOMBAT_AI_TYPE","hold");
|
|
break;
|
|
} // hold
|
|
case 9: { // flee
|
|
SetLocalInt(oNPC,"bCOMBAT_AI_ON",1);
|
|
SetLocalString(oNPC,"sCOMBAT_AI_TYPE","flee");
|
|
break;
|
|
} // flee
|
|
default: break;
|
|
} // switch
|
|
nN++;
|
|
oNPC=GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,oWP,nN);
|
|
fD=GetDistanceBetween(oWP,oNPC);
|
|
} // set contestant ai
|
|
} // contestant waypoint exists
|
|
}
|