HoS_PRC8/_mod/_module/nss/hos_acp.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

223 lines
9.2 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
// hos_acp - Support for ACP 4.0
// By Deva Winblood. August 19th, 2008
////////////////////////////////////////////////////////////////////////////////
void main()
{
object oPC=OBJECT_SELF;
int nAppearance=GetAppearanceType(oPC);
object oLeftHand=GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
object oRightHand=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
int nLevel=GetLevelByPosition(1,oPC)+GetLevelByPosition(2,oPC)+GetLevelByPosition(3,oPC);
int nMonk=GetLevelByClass(CLASS_TYPE_MONK,oPC);
int nFighter=GetLevelByClass(CLASS_TYPE_ROGUE,oPC);
int nBarbarian=GetLevelByClass(CLASS_TYPE_BARBARIAN,oPC);
int nRanger=GetLevelByClass(CLASS_TYPE_RANGER,oPC);
int nBard=GetLevelByClass(CLASS_TYPE_BARD,oPC);
int nAssassin=GetLevelByClass(CLASS_TYPE_ASSASSIN,oPC);
int nWeaponMaster=GetLevelByClass(CLASS_TYPE_WEAPON_MASTER,oPC);
int nPaladin=GetLevelByClass(CLASS_TYPE_PALADIN,oPC);
int nRogue=GetLevelByClass(CLASS_TYPE_ROGUE,oPC);
int nBTL;
int nBTR;
int nMainPhenoType;
int nCPT=GetPhenoType(oPC);
int nTrainedWarrior=nFighter+nRanger+nBard+nPaladin;
if (nAppearance>6) return;
if (nCPT!=0&&(nCPT<15||(nCPT>21&&nCPT<29)||nCPT>33)) return; // invalid phenotype
if (!GetLocalInt(oPC,"bSetMainPhenoType"))
{ // set main phenotype
SetLocalInt(oPC,"nMainPhenoType",GetPhenoType(oPC));
SetLocalInt(oPC,"bSetMainPhenoType",TRUE);
} // set main phenotype
nMainPhenoType=GetLocalInt(oPC,"nMainPhenoType");
if (nAssassin<1&&nWeaponMaster<1&&nLevel<4)
{ // no special animations
return;
} // no special animations
nBTL=GetBaseItemType(oLeftHand);
nBTR=GetBaseItemType(oRightHand);
if (GetIsObjectValid(oLeftHand)&&GetIsObjectValid(oRightHand)&&(nBTL==BASE_ITEM_LARGESHIELD||nBTL==BASE_ITEM_SMALLSHIELD||nBTL==BASE_ITEM_TOWERSHIELD))
{ // Shield Wielding
if (nBTR==BASE_ITEM_KATANA||nBTR==BASE_ITEM_RAPIER||nBTR==BASE_ITEM_SCIMITAR||nBTR==BASE_ITEM_SHORTSPEAR||nBTR==BASE_ITEM_SHORTSWORD||nBTR==BASE_ITEM_LONGSWORD)
{ // 300 style
if (nCPT!=21) { SetPhenoType(21,oPC);
SendMessageToPC(oPC,"Combat Style: Shield + Spear/Sword"); }
} // 300 style
else if (nBTR==BASE_ITEM_BATTLEAXE||nBTR==BASE_ITEM_BASTARDSWORD||nBTR==BASE_ITEM_MORNINGSTAR||nBTR==BASE_ITEM_WARHAMMER)
{ // Heavy
if (nCPT!=17) { SetPhenoType(17,oPC);
SendMessageToPC(oPC,"Combat Style: Shield + Heavy"); }
} // Heavy
else
{ // Standard
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // Standard
} // Shield Wielding
else if (GetIsObjectValid(oLeftHand)&&GetIsObjectValid(oRightHand)&&nBTL!=BASE_ITEM_TORCH)
{ // Wielding two weapons
if (nMonk>2||nBard>4||nAssassin>0||nWeaponMaster>0)
{ // assassin style
if (nCPT!=16) { SetPhenoType(16,oPC);
SendMessageToPC(oPC,"Combat Style: Assassin"); }
} // assassin style
else
{ // standard
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // standard
} // Wielding two weapons
else if (GetIsObjectValid(oRightHand)&&(nBTR==BASE_ITEM_HEAVYCROSSBOW||nBTR==BASE_ITEM_LIGHTCROSSBOW||nBTR==BASE_ITEM_LONGBOW||nBTR==BASE_ITEM_SHORTBOW))
{ // Bow's
if (nTrainedWarrior>3||nAssassin>1||nWeaponMaster>1)
{ // fancy style
if (nCPT!=16) { SetPhenoType(16,oPC);
SendMessageToPC(oPC,"Combat Style: Assassin");}
} // fancy style
else
{ // standard style
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // standard style
} // Bow's
else if (GetIsObjectValid(oRightHand)&&(nBTR==BASE_ITEM_BASTARDSWORD||nBTR==BASE_ITEM_BATTLEAXE||nBTR==BASE_ITEM_GREATAXE||nBTR==BASE_ITEM_GREATSWORD||nBTR==BASE_ITEM_MORNINGSTAR))
{ // Heavy Weapons
if (nCPT!=17) { SetPhenoType(17,oPC);
SendMessageToPC(oPC,"Combat Style: Heavy"); }
} // Heavy Weapons
else if (GetIsObjectValid(oRightHand)&&nBTR==BASE_ITEM_RAPIER)
{ // Rapier
if (nTrainedWarrior>0)
{ // use in fencing style
if (nCPT!=18) { SetPhenoType(18,oPC);
SendMessageToPC(oPC,"Combat Style: Fencing"); }
} // use in fencing style
else
{ // standard style
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // standard style
} // Rapier
else if (GetIsObjectValid(oRightHand)&&nBTR==BASE_ITEM_KATANA)
{ // Katana
if (nMonk>0&&nAssassin>0)
{ // Assassin Style
if (nCPT!=16) { SetPhenoType(16,oPC);
SendMessageToPC(oPC,"Combat Style: Assassin"); }
} // Assassin Style
else if (nWeaponMaster>0||nMonk>4)
{ // Weapon Master
if (nCPT!=15) { SetPhenoType(15,oPC);
SendMessageToPC(oPC,"Combat Style: Kensai"); }
} // Weapon Master
else
{ // standard
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // standard
} // Katana
else if (GetIsObjectValid(oRightHand)&&(nBTR==BASE_ITEM_KUKRI||nBTR==BASE_ITEM_KAMA))
{ // Martial Arts Weapons
if (nWeaponMaster>0||nFighter>14)
{ // Kensai
if (nCPT!=15) { SetPhenoType(15,oPC);
SendMessageToPC(oPC,"Combat Style: Kensai"); }
} // Kensai
else if (nAssassin>0||nMonk>7||nBard>9)
{ // Assassin
if (nCPT!=16) { SetPhenoType(16,oPC);
SendMessageToPC(oPC,"Combat Style: Assassin"); }
} // Assassin
else
{ // standard
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // standard
} // Martial Arts Weapons
else if (GetIsObjectValid(oRightHand)&&nBTR==BASE_ITEM_SLING)
{ // Sling
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // Sling
else if (GetIsObjectValid(oRightHand)&&(nBTR==BASE_ITEM_LONGSWORD||nBTR==BASE_ITEM_SHORTSWORD))
{ // typical swords
if (nWeaponMaster>0||nFighter>14||nRanger>15||nPaladin>17||nBard>18)
{ // Kensai
if (nCPT!=15) { SetPhenoType(15,oPC);
SendMessageToPC(oPC,"Combat Style: Kensai"); }
} // Kensai
else if (nAssassin>0||nMonk>7||nRogue>14)
{ // Assassin
if (nCPT!=16) { SetPhenoType(16,oPC);
SendMessageToPC(oPC,"Combat Style: Assassin"); }
} // Assassin
else
{ // standard
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // standard
} // typical swords
else if (GetIsObjectValid(oRightHand)&&(nBTR==BASE_ITEM_DAGGER))
{ // Dagger
if (nAssassin>0||nMonk>7||nRogue>14)
{ // Assassin
if (nCPT!=16) { SetPhenoType(16,oPC);
SendMessageToPC(oPC,"Combat Style: Kensai"); }
} // Assassin
else
{ // standard
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // standard
} // Dagger
else if (!GetIsObjectValid(oRightHand)&&!GetIsObjectValid(oLeftHand))
{ // Unarmed
if (nMonk>6)
{ // Monk Style
int nAGE=GetAlignmentGoodEvil(oPC);
if (nMonk>15)
{ // Dragon Style
if (nCPT!=32) { SetPhenoType(32,oPC);
SendMessageToPC(oPC,"Combat Style: Dragon Palm"); }
} // Dragon Style
else if (nAGE==ALIGNMENT_EVIL)
{ // Evil
if (nCPT!=31) { SetPhenoType(31,oPC);
SendMessageToPC(oPC,"Combat Style: Sun Fist"); }
} // Evil
else if (nAGE==ALIGNMENT_NEUTRAL)
{ // Neutral
if (nCPT!=30) { SetPhenoType(30,oPC);
SendMessageToPC(oPC,"Combat Style: Tiger Strike"); }
} // Neutral
else if (nAGE==ALIGNMENT_GOOD)
{ // Good
if (nCPT!=33) { SetPhenoType(33,oPC);
SendMessageToPC(oPC,"Combat Style: Bear Claw"); }
} // Good
} // Monk Style
else if (nAssassin>1)
{ // Assassin Style
if (nCPT!=16) { SetPhenoType(16,oPC);
SendMessageToPC(oPC,"Combat Style: Assassin"); }
} // Assassin Style
else if (nWeaponMaster>1)
{ // Weapon Master Style
if (nCPT!=15) { SetPhenoType(15,oPC);
SendMessageToPC(oPC,"Combat Style: Kensai"); }
} // Weapon Master Style
else
{ // standard
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // standard
} // Unarmed
else
{ // typical style
if (nCPT!=nMainPhenoType) { SetPhenoType(nMainPhenoType,oPC);
SendMessageToPC(oPC,"Combat Style: Standard"); }
} // typical style
}