Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
81
_module/nss/x2_im_prevpart.nss
Normal file
81
_module/nss/x2_im_prevpart.nss
Normal file
@@ -0,0 +1,81 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/*
|
||||
Item Appearance Modification Conversation
|
||||
Cycle prev part
|
||||
Changes the appearance of the currently active armorpart
|
||||
on the tailor to the previous appearance
|
||||
*/
|
||||
// created/updated 2003-06-24 Georg Zoeller, Bioware Corp
|
||||
//////////////////////////////////////////////////////////
|
||||
#include "prc_x2_craft"
|
||||
#include "jw_inc_craft"
|
||||
|
||||
void main()
|
||||
{
|
||||
int nPart = GetLocalInt(OBJECT_SELF,"X2_TAILOR_CURRENT_PART");
|
||||
|
||||
object oPC = GetPCSpeaker();
|
||||
object oItem = CIGetCurrentModItem(oPC);
|
||||
|
||||
int nCurrentAppearance;
|
||||
if (CIGetCurrentModMode(oPC) == X2_CI_MODMODE_ARMOR)
|
||||
{
|
||||
nCurrentAppearance = GetItemAppearance(oItem,ITEM_APPR_TYPE_ARMOR_MODEL,nPart);
|
||||
}
|
||||
|
||||
if(GetIsObjectValid(oItem) == TRUE)
|
||||
{
|
||||
object oNew;
|
||||
int nCost;
|
||||
int nDC;
|
||||
AssignCommand(oPC,ClearAllActions(TRUE));
|
||||
if (CIGetCurrentModMode(oPC) == X2_CI_MODMODE_ARMOR)
|
||||
{
|
||||
oNew = IPGetModifiedArmor(oItem, nPart, X2_IP_ARMORTYPE_PREV, TRUE);
|
||||
CISetCurrentModItem(oPC,oNew);
|
||||
AssignCommand(oPC, ActionEquipItem(oNew, INVENTORY_SLOT_CHEST));
|
||||
nCost = CIGetArmorModificationCost(CIGetCurrentModBackup(oPC),oNew);
|
||||
nDC = CIGetArmorModificationDC(CIGetCurrentModBackup(oPC),oNew);
|
||||
}else if (CIGetCurrentModMode(oPC) == X2_CI_MODMODE_WEAPON)
|
||||
{
|
||||
oNew = IPGetModifiedWeapon(oItem, nPart, X2_IP_WEAPONTYPE_PREV, TRUE);
|
||||
CISetCurrentModItem(oPC,oNew);
|
||||
AssignCommand(oPC, ActionEquipItem(oNew, INVENTORY_SLOT_RIGHTHAND));
|
||||
nCost = CIGetWeaponModificationCost(CIGetCurrentModBackup(oPC),oNew); //CIGetArmorModificationCost(CIGetCurrentModBackup(oPC),oNew);
|
||||
nDC = JWGetWeaponModificationDC(CIGetCurrentModBackup(oPC),oNew);
|
||||
if (GetBaseItemType(oNew)==BASE_ITEM_MAGICSTAFF)
|
||||
{
|
||||
nDC = nDC+10;
|
||||
}
|
||||
}
|
||||
|
||||
else if (CIGetCurrentModMode(oPC) == X2_CI_MODMODE_HELMET)
|
||||
{ //
|
||||
oNew = JWGetModifiedHelmet (oItem, X2_IP_ARMORTYPE_PREV, TRUE);
|
||||
CISetCurrentModItem(oPC,oNew);
|
||||
AssignCommand(oPC, ActionEquipItem(oNew, INVENTORY_SLOT_HEAD));
|
||||
nDC=JWGetHelmetModificationDC(oNew); // 10 for normal helmets 20 for nice ones
|
||||
nCost=JWGetHelmetModificationCost(oNew); // 100 for normal helmets 500 for nice ines
|
||||
}
|
||||
else if (CIGetCurrentModMode(oPC) == X2_CI_MODMODE_SHIELD)
|
||||
{ //
|
||||
oNew = JWGetModifiedShield (oItem, X2_IP_ARMORTYPE_PREV, TRUE);
|
||||
CISetCurrentModItem(oPC,oNew);
|
||||
AssignCommand(oPC, ActionEquipItem(oNew, INVENTORY_SLOT_LEFTHAND));
|
||||
|
||||
nDC=JWGetShieldModificationDC(oNew); // from 5 to 25
|
||||
nCost=JWGetShieldModificationCost(oNew); // from 50 to 800
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (GetIsDM(GetPCSpeaker())||GetIsDMPossessed(GetPCSpeaker()))
|
||||
{
|
||||
nCost=0;
|
||||
nDC=0;
|
||||
}
|
||||
CIUpdateModItemCostDC(oPC, nDC, nCost);
|
||||
|
||||
}
|
||||
// Store the cost for modifying this item here
|
||||
}
|
||||
Reference in New Issue
Block a user