Ok more help needed,
i am using this script to drop equiped items to a placable corpse on death and works just fine problem is i dont want it to check for creature items skins etc, as is every now and then it drops creature skin etc to corpse
#include "color_include"
void main()
{
object oPC = GetLastPlayerDied();
if (!GetIsPC(oPC)) return;
int xCount, xGold;
object xPC, xCorpse, xItem;
location xLoc;
//Get player and find locations
xPC = GetLastPlayerDied();
xLoc = GetLocation(xPC);
//Create corpse at player's feet
xCorpse = CreateObject(OBJECT_TYPE_PLACEABLE,"sc_corpse",xLoc);
//Drop equipment on corpse
for (xCount = 0; xCount < NUM_INVENTORY_SLOTS; xCount++)
{
xItem=GetItemInSlot(xCount, xPC);
AssignCommand(xCorpse,ActionTakeItem(xItem,xPC));
}
/////Now drop player's gold.//////
// xGold = (GetGold(xPC));
// AssignCommand(xCorpse, TakeGoldFromCreature(xGold,xPC,TRUE));
// CreateItemOnObject ("nw_it_gold001", xCorpse, xGold);
//////////////////////////////////
DelayCommand(2.0, FloatingTextStringOnCreature(PALEBLUE+"You have died. You're belongings have been dropped on the floor.", oPC));
DelayCommand(4.0, FloatingTextStringOnCreature(PALEBLUE+"you can either respawn or wait to bo rescued from another player.", oPC));
DelayCommand(8.0, PopUpGUIPanel(oPC,GUI_PANEL_PLAYER_DEATH));
}
I found this in my loot system and prevents this happening when loot is droped to pc inventory but dont know how to merge these
//Get items in slots
for (nCounter = 0; nCounter <= NUM_INVENTORY_SLOTS; nCounter++)
{
//Skip creature items
if(nCounter != INVENTORY_SLOT_CARMOUR &&
nCounter != INVENTORY_SLOT_CWEAPON_B &&
nCounter != INVENTORY_SLOT_CWEAPON_L &&
nCounter != INVENTORY_SLOT_CWEAPON_R)
{
oItem = GetItemInSlot(nCounter, OBJECT_SELF);
if(GetIsObjectValid(oItem))
{
ActionGiveItem(oItem, oPC);
}
thanks in advance
Death System
Débuté par
Madasahatter
, oct. 30 2010 02:20
#1
Posté 30 octobre 2010 - 02:20
#2
Posté 30 octobre 2010 - 02:28
Make the skin plot and have it only drop items that are nonplot.
#3
Posté 30 octobre 2010 - 02:31
i was hoping to be able to merge these two, as players may be using plot items, and would not be dropped.
#4
Posté 30 octobre 2010 - 02:57
All i need is ondeath create a placable, stip all equiped items from dead players inventory except creature items, delay abit, float some txt, delay again then pop the death gui. I know what i need but suck at scripting
#5
Posté 30 octobre 2010 - 04:42
Give this a try. It should do the trick. The posted script was a bit confusing to read(all ints, objects and locs used an "x" naming convention. Should do something specific for each one to recognize what it is. Most people use "o" for object, "l" for location and "n" or "i" for integers.) so I altered for the purpose of this post. Also took out a bit of redundancy. You were defining the player who died twice.
#include "color_include"
void main()
{
//Get the player
object oPC = GetLastPlayerDied();
//Make sure the object that died is actually a player character. If not,
//reutrn.
if (!GetIsPC(oPC)) return;
int nCount, nGold;
object oCorpse, oItem;
location lLoc = GetLocation(oPC);
//Create corpse at player's feet
oCorpse = CreateObject(OBJECT_TYPE_PLACEABLE,"sc_corpse",lLoc);
//Drop equipment on corpse
for (nCount = 0; nCount < NUM_INVENTORY_SLOTS; nCount++)
{
//Skip creature items
if(nCount != INVENTORY_SLOT_CARMOUR &&
nCount != INVENTORY_SLOT_CWEAPON_B &&
nCount != INVENTORY_SLOT_CWEAPON_L &&
nCount != INVENTORY_SLOT_CWEAPON_R)
{
oItem = GetItemInSlot(nCount, oPC);
if(GetIsObjectValid(oItem))
{
AssignCommand(oCorpse,ActionTakeItem(oItem,oPC));
}
}
}
/////Now drop player's gold.//////
//nGold = (GetGold(oPC));
//AssignCommand(oCorpse, TakeGoldFromCreature(nGold,oPC,TRUE));
//CreateItemOnObject ("nw_it_gold001", oCorpse, nGold);
//////////////////////////////////
DelayCommand(2.0, FloatingTextStringOnCreature(PALEBLUE+"You have died. You're belongings have been dropped on the floor.", oPC));
DelayCommand(4.0, FloatingTextStringOnCreature(PALEBLUE+"you can either respawn or wait to bo rescued from another player.", oPC));
DelayCommand(8.0, PopUpGUIPanel(oPC,GUI_PANEL_PLAYER_DEATH));
}
Hope that works for ya. Good luck.
#include "color_include"
void main()
{
//Get the player
object oPC = GetLastPlayerDied();
//Make sure the object that died is actually a player character. If not,
//reutrn.
if (!GetIsPC(oPC)) return;
int nCount, nGold;
object oCorpse, oItem;
location lLoc = GetLocation(oPC);
//Create corpse at player's feet
oCorpse = CreateObject(OBJECT_TYPE_PLACEABLE,"sc_corpse",lLoc);
//Drop equipment on corpse
for (nCount = 0; nCount < NUM_INVENTORY_SLOTS; nCount++)
{
//Skip creature items
if(nCount != INVENTORY_SLOT_CARMOUR &&
nCount != INVENTORY_SLOT_CWEAPON_B &&
nCount != INVENTORY_SLOT_CWEAPON_L &&
nCount != INVENTORY_SLOT_CWEAPON_R)
{
oItem = GetItemInSlot(nCount, oPC);
if(GetIsObjectValid(oItem))
{
AssignCommand(oCorpse,ActionTakeItem(oItem,oPC));
}
}
}
/////Now drop player's gold.//////
//nGold = (GetGold(oPC));
//AssignCommand(oCorpse, TakeGoldFromCreature(nGold,oPC,TRUE));
//CreateItemOnObject ("nw_it_gold001", oCorpse, nGold);
//////////////////////////////////
DelayCommand(2.0, FloatingTextStringOnCreature(PALEBLUE+"You have died. You're belongings have been dropped on the floor.", oPC));
DelayCommand(4.0, FloatingTextStringOnCreature(PALEBLUE+"you can either respawn or wait to bo rescued from another player.", oPC));
DelayCommand(8.0, PopUpGUIPanel(oPC,GUI_PANEL_PLAYER_DEATH));
}
Hope that works for ya. Good luck.
Modifié par GhostOfGod, 30 octobre 2010 - 05:03 .
#6
Posté 30 octobre 2010 - 05:11
i have just tested this and it dont drop anything to corpse, dead player still has all gear.
This script works but sometime you get pc properties etc in corpse and cannot remove it
#include "color_include"
void main()
{
object oPC = GetLastPlayerDied();
if (!GetIsPC(oPC)) return;
int xCount, xGold;
object xPC, xCorpse, xItem;
location xLoc;
//Get player and find locations
xPC = GetLastPlayerDied();
xLoc = GetLocation(xPC);
//Create corpse at player's feet
xCorpse = CreateObject(OBJECT_TYPE_PLACEABLE,"sc_corpse",xLoc);
//Drop equipment on corpse
for (xCount = 0; xCount < NUM_INVENTORY_SLOTS; xCount++)
{
xItem=GetItemInSlot(xCount, xPC);
AssignCommand(xCorpse,ActionTakeItem(xItem,xPC));
}
/////Now drop player's gold.//////
// xGold = (GetGold(xPC));
// AssignCommand(xCorpse, TakeGoldFromCreature(xGold,xPC,TRUE));
// CreateItemOnObject ("nw_it_gold001", xCorpse, xGold);
//////////////////////////////////
DelayCommand(2.0, FloatingTextStringOnCreature(PALEBLUE+"You have died. You're belongings have been dropped on the floor.", oPC));
DelayCommand(4.0, FloatingTextStringOnCreature(PALEBLUE+"you can either respawn or wait to bo rescued from another player.", oPC));
DelayCommand(8.0, PopUpGUIPanel(oPC,GUI_PANEL_PLAYER_DEATH));
}
This script works but sometime you get pc properties etc in corpse and cannot remove it
#include "color_include"
void main()
{
object oPC = GetLastPlayerDied();
if (!GetIsPC(oPC)) return;
int xCount, xGold;
object xPC, xCorpse, xItem;
location xLoc;
//Get player and find locations
xPC = GetLastPlayerDied();
xLoc = GetLocation(xPC);
//Create corpse at player's feet
xCorpse = CreateObject(OBJECT_TYPE_PLACEABLE,"sc_corpse",xLoc);
//Drop equipment on corpse
for (xCount = 0; xCount < NUM_INVENTORY_SLOTS; xCount++)
{
xItem=GetItemInSlot(xCount, xPC);
AssignCommand(xCorpse,ActionTakeItem(xItem,xPC));
}
/////Now drop player's gold.//////
// xGold = (GetGold(xPC));
// AssignCommand(xCorpse, TakeGoldFromCreature(xGold,xPC,TRUE));
// CreateItemOnObject ("nw_it_gold001", xCorpse, xGold);
//////////////////////////////////
DelayCommand(2.0, FloatingTextStringOnCreature(PALEBLUE+"You have died. You're belongings have been dropped on the floor.", oPC));
DelayCommand(4.0, FloatingTextStringOnCreature(PALEBLUE+"you can either respawn or wait to bo rescued from another player.", oPC));
DelayCommand(8.0, PopUpGUIPanel(oPC,GUI_PANEL_PLAYER_DEATH));
}
#7
Posté 30 octobre 2010 - 05:18
ok it works, for some reason the line AssignCommand(oCorpse,ActionTakeItem(oItem,oPC)); was commented out.... so thanks for all your help and i will test some more





Retour en haut






