As far as not being able to equip weapons gos you will need to alter your module "OnPlayerEquipItem" script so that it checks to see if the player possesses the corpse item. If so then just unequip the weapon the player tried to equip. This is what it would look like using the default "x2_mod_def_equ":
Note: I took the super easy route and just made it so that the player couldn't equip anything in the right or left hand. So this includes sheilds, torches, etc. Otherwise you have to check for weapon base items and whether or not you are using CEP weapons and all that jazz. Also the only parts I added to the 2 scripts below are between the red "
/////". Also make sure you plug in your corpse tag where it says "
TEST_CORPSE".
//::///////////////////////////////////////////////
//:: Example XP2 OnItemEquipped
//:: x2_mod_def_equ
//:: © 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Put into: OnEquip Event
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-16
//:://////////////////////////////////////////////
//:: Modified By: Deva Winblood
//:: Modified On: April 15th, 2008
//:: Added Support for Mounted Archery Feat penalties
//:://////////////////////////////////////////////
#include "x2_inc_switches"
#include "x2_inc_intweapon"
#include "x3_inc_horse"
void main()
{
object oItem = GetPCItemLastEquipped();
object oPC = GetPCItemLastEquippedBy();
////////////////////////////////////////////////////////////////////
if (GetItemPossessedBy(oPC, "TEST_CORPSE") != OBJECT_INVALID)
{
if (oItem == GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC) ||
oItem == GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC))
{
DelayCommand(1.0, AssignCommand(oPC, ActionUnequipItem(oItem)));
SendMessageToPC(oPC, "You can not equip a weapon or shield while carrying a corpse.");
}
}
////////////////////////////////////////////////////////////////////
// -------------------------------------------------------------------------
// Intelligent Weapon System
// -------------------------------------------------------------------------
if (IPGetIsIntelligentWeapon(oItem))
//etc........
Now you 2 choices for the second part. You can either alter your modules "OnPlayerAcquireItem" script or you can make a tag based script for the corpse. I'll just put the alteration to the "OnPlayerAcquireItem" script for now. If you want it tag based so you don't have to mess with this event then just let us know.
So this would be the alteration to the default "x2_mod_def_aqu":
//::///////////////////////////////////////////////
//:: Example XP2 OnItemAcquireScript
//:: x2_mod_def_aqu
//:: © 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Put into: OnItemAcquire Event
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-16
//:://////////////////////////////////////////////
#include "x2_inc_switches"
void main()
{
object oItem = GetModuleItemAcquired();
/////////////////////////////////////////////////////////////////
object oPC = GetModuleItemAcquiredBy();
object oSlotRH = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);
object oSlotLH = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC);
if (GetTag(oItem) == "TEST_CORPSE")
{
AssignCommand(oPC, ActionUnequipItem(oSlotRH));
AssignCommand(oPC, ActionUnequipItem(oSlotLH));
SendMessageToPC(oPC, "You can not equip a weapon or shield while carrying a corpse.");
}
/////////////////////////////////////////////////////////////////
// * Generic Item Script Execution Code
//etc......
As far as the spells go you are going to have to get into the spell hooking which I haven't done for awhile. And if I remember right, the player will still be able to use spell items and cast spells using the spellhook...the spells/items will just fail.
Hope this helps.
Modifié par GhostOfGod, 15 juin 2011 - 05:37 .