128 lines
4.0 KiB
Plaintext
128 lines
4.0 KiB
Plaintext
|
////////////////////////////////////////////////////////////////////////////////
|
||
|
//
|
||
|
// Olander's AI
|
||
|
// oai_cust_spawn
|
||
|
// by Don Anderson
|
||
|
// dandersonru@msn.com
|
||
|
//
|
||
|
// Place your custom Spawn requirements here.
|
||
|
// This script will be called once when a creature spawns (by the Creature).
|
||
|
//
|
||
|
////////////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
#include "oai_inc_spawn"
|
||
|
|
||
|
//DMFI v1.07
|
||
|
#include "dmfi_dmw_inc"
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
object oNPC = OBJECT_SELF;
|
||
|
|
||
|
/******************************************************************************/
|
||
|
//:: DMFI CODE ADDITIONS BEGIN HERE
|
||
|
|
||
|
if((DMFI_LISTENING_GLOBAL) || (GetLocalInt(oNPC, "DMFI_LISTEN")==1))
|
||
|
{
|
||
|
SetListening(oNPC, TRUE);
|
||
|
SetListenPattern(oNPC, "**", 20600);
|
||
|
SetLocalInt(oNPC, "hls_Listening", 1); //listen to all text
|
||
|
}
|
||
|
|
||
|
//:: DMFI CODE ADDITIONS END HERE
|
||
|
/******************************************************************************/
|
||
|
|
||
|
/******************************************************************************/
|
||
|
//: CUSTOM ADDITONS BELOW HERE
|
||
|
|
||
|
//Racial Movement Rate for Small Creatures (Configured in opw_mod_onload)
|
||
|
int nRacial = GetLocalInt(GetModule(),"RACIALMOVE");
|
||
|
if(nRacial == 1) SetRacialMovementRate(oNPC);
|
||
|
|
||
|
/* Provided as Examples
|
||
|
|
||
|
//Allegiance System
|
||
|
int nFaction = GetLocalInt(oNPC,"FACTION");
|
||
|
if(nFaction == 0)
|
||
|
{
|
||
|
SetNPCFactionInt(oNPC);
|
||
|
StoreCapitol(oNPC);
|
||
|
}
|
||
|
|
||
|
//Military Creature
|
||
|
object oInsignia = GetItemPossessedBy(oNPC,"RankInsignia");
|
||
|
if(oInsignia != OBJECT_INVALID)
|
||
|
{
|
||
|
string sResRef = GetResRef(oInsignia);
|
||
|
string sRight = GetStringRight(sResRef,1);
|
||
|
int nRank = StringToInt(sRight);
|
||
|
SetLocalInt(oNPC,"OAS_RANK",nRank);
|
||
|
}
|
||
|
|
||
|
//Incursion Resources - Every Spawn Removes a Resource
|
||
|
// NOTE: Military grab 1 in each the Capitol and the Local Area
|
||
|
object oArea = GetArea(oNPC);
|
||
|
int nAR = GetLocalInt(oArea,"ALLEGE_AR");//Area Resources
|
||
|
if(nAR > 0)
|
||
|
{
|
||
|
if(GetLocalInt(oNPC,"OAS_RANK") > 0) UseCapitolResource(oNPC);
|
||
|
UseAreaResource(oNPC);
|
||
|
}
|
||
|
|
||
|
//Olander's Horses
|
||
|
object oCityProper = GetNearestObjectByTag("CityProper",oNPC);
|
||
|
object oHBlack = GetItemPossessedBy(oNPC,"HorseBlack");
|
||
|
object oHWhite = GetItemPossessedBy(oNPC,"HorseWhite");
|
||
|
object oHBrown = GetItemPossessedBy(oNPC,"HorseBrown");
|
||
|
object oPWhite = GetItemPossessedBy(oNPC,"PonyWhite");
|
||
|
object oPPinto = GetItemPossessedBy(oNPC,"PonyPinto");
|
||
|
object oPBrown = GetItemPossessedBy(oNPC,"PonyBrown");
|
||
|
int nType = 0;
|
||
|
if(GetIsObjectValid(oHBrown) && !GetIsObjectValid(oCityProper))
|
||
|
{
|
||
|
SetPhenoType(5);
|
||
|
effect eSpeed = SupernaturalEffect(EffectMovementSpeedIncrease(50));
|
||
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT , eSpeed, oNPC);
|
||
|
SetLocalInt(oNPC,"AMHORSEMAN",1);
|
||
|
}
|
||
|
if(GetIsObjectValid(oPPinto) && !GetIsObjectValid(oCityProper))
|
||
|
{
|
||
|
SetPhenoType(5);
|
||
|
effect eSpeed = SupernaturalEffect(EffectMovementSpeedIncrease(40));
|
||
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT , eSpeed, oNPC);
|
||
|
SetLocalInt(oNPC,"AMHORSEMAN",1);
|
||
|
}
|
||
|
if(GetIsObjectValid(oHWhite) && !GetIsObjectValid(oCityProper))
|
||
|
{
|
||
|
SetPhenoType(6);
|
||
|
effect eSpeed = SupernaturalEffect(EffectMovementSpeedIncrease(50));
|
||
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT , eSpeed, oNPC);
|
||
|
SetLocalInt(oNPC,"AMHORSEMAN",1);
|
||
|
}
|
||
|
if(GetIsObjectValid(oPBrown) && !GetIsObjectValid(oCityProper))
|
||
|
{
|
||
|
SetPhenoType(6);
|
||
|
effect eSpeed = SupernaturalEffect(EffectMovementSpeedIncrease(40));
|
||
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT , eSpeed, oNPC);
|
||
|
SetLocalInt(oNPC,"AMHORSEMAN",1);
|
||
|
}
|
||
|
if(GetIsObjectValid(oHBlack) && !GetIsObjectValid(oCityProper))
|
||
|
{
|
||
|
SetPhenoType(7);
|
||
|
effect eSpeed = SupernaturalEffect(EffectMovementSpeedIncrease(50));
|
||
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT , eSpeed, oNPC);
|
||
|
SetLocalInt(oNPC,"AMHORSEMAN",1);
|
||
|
}
|
||
|
if(GetIsObjectValid(oPWhite) && !GetIsObjectValid(oCityProper))
|
||
|
{
|
||
|
SetPhenoType(7);
|
||
|
effect eSpeed = SupernaturalEffect(EffectMovementSpeedIncrease(40));
|
||
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT , eSpeed, oNPC);
|
||
|
SetLocalInt(oNPC,"AMHORSEMAN",1);
|
||
|
}
|
||
|
|
||
|
//: CUSTOM ADDITONS ABOVE HERE
|
||
|
/******************************************************************************/
|
||
|
|
||
|
}
|