//sets appearance for swimming
//unequips cloak.
int GetSwimmingAppearanceType(object oTarget)
{
int nSwimAppearance;
int nAppearance = GetAppearanceType(oTarget);
switch(nAppearance)
{
case 0://dwarf
nSwimAppearance=4000;
break;
case 1://elf
nSwimAppearance=4001;
break;
case 2://gnome
nSwimAppearance=4002;
break;
case 3://halfling
nSwimAppearance=4003;
break;
case 4://half-elf
nSwimAppearance=4004;
break;
case 5://half-orc
nSwimAppearance=4005;
break;
case 6://human
nSwimAppearance=4006;
break;
case 563://assimar
nSwimAppearance=4007;
break;
case 564://tiefling
nSwimAppearance=4008;
break;
case 565://sun elf
nSwimAppearance=4009;
break;
case 566://wood elf
nSwimAppearance=4010;
break;
case 567://drow elf
nSwimAppearance= 4011;
break;
case 568://svirfneblin
nSwimAppearance=4012;
break;
case 569://gold dwarf
nSwimAppearance=4013;
break;
case 570://duergar dwarf
nSwimAppearance=4014;
break;
case 571://strongheart halfling
nSwimAppearance=4015;
break;
case 1036://wild elf
nSwimAppearance=4016;
break;
case 1037://earth gensai
nSwimAppearance=4017;
break;
case 1038://fire genasi
nSwimAppearance=4018;
break;
case 1039://air genasi
nSwimAppearance=4019;
break;
case 1040://water genasi
nSwimAppearance=4020;
break;
case 1041://half-drow elf
nSwimAppearance=4021;
break;
case 40://yuan-ti pureblood
nSwimAppearance=40;
break;
default://default = appearance invalid
nSwimAppearance=-1;
}
return nSwimAppearance;
}
//***************************************************************************
#include "inc_gui_timer"
#include "x0_i0_partywide"
void main()
{
object oEnter = GetEnteringObject();
int nOriginalAppearance = GetAppearanceType(oEnter);
int nAppearanceType = GetSwimmingAppearanceType(oEnter);
int nInWater = GetLocalInt(oEnter,"nInWater201");
object oCloak = GetItemInSlot(INVENTORY_SLOT_CLOAK,oEnter);
object oComp1 = GetNearestObjectByTag("bub_elwita");
object oComp2 = GetNearestObjectByTag("bub_freda");
object oComp3 = GetNearestObjectByTag("bub_blodgett");
object oComp4 = GetNearestObjectByTag("bub_dread_delgath");
object oComp5 = GetNearestObjectByTag("bub_karraway");
object oComp6 = GetNearestObjectByTag("bub_kayen");
if (nInWater == 1)
{
return;
}
SetLocalInt(oEnter,"nInWater201",1);
if (GetIsObjectValid(oCloak))
{
AssignCommand(oEnter,ActionUnequipItem(oCloak));
SetLocalString(oEnter,"s201SwimmingCloakTag",GetTag(oCloak));
}
SetLocalInt(oEnter,"nAppearanceType",nOriginalAppearance);
if (nAppearanceType == -1)
{
SendMessageToPC(oEnter,"appearance type invalid, swimming not enabled");
return;
}
SetCreatureAppearanceType(oComp1, 4000);
SetCreatureAppearanceType(oComp2, 4006);
SetCreatureAppearanceType(oComp3, 4003);
SetCreatureAppearanceType(oComp4, 4006);
SetCreatureAppearanceType(oComp5, 4006);
SetCreatureAppearanceType(oComp6, 4001);
SetCreatureAppearanceType(oEnter,nAppearanceType);
StartTimer(60, "d10_timer_endscript", oEnter);
SetLocalIntOnAll(oEnter, "UNDER_WATER_IMMUNE", 1);
}
//turns off swimming animations by changing entering object's appearance
//also re-equips cloaks since they are not supported by swimming yet.
#include "x0_i0_partywide"
#include "gogs_uw_inc"
#include "inc_gui_timer"
void main()
{
object oExit = GetExitingObject();
object oComp1 = GetNearestObjectByTag("bub_elwita");
object oComp2 = GetNearestObjectByTag("bub_freda");
object oComp3 = GetNearestObjectByTag("bub_blodgett");
object oComp4 = GetNearestObjectByTag("bub_dread_delgath");
object oComp5 = GetNearestObjectByTag("bub_karraway");
object oComp6 = GetNearestObjectByTag("bub_kayen");
string sCloakTag = GetLocalString(oExit,"s201SwimmingCloakTag");
int nOriginalAppearance = GetLocalInt(oExit,"nAppearanceType");
object oCloak = GetItemPossessedBy(oExit,sCloakTag);
RemoveUnderWaterEffects(oExit);
ClearUpTimer(oExit);
SetLocalIntOnAll(oExit, "UNDER_WATER_IMMUNE", 0);
if ((sCloakTag!="")&&
(GetIsObjectValid(oCloak)))
{
AssignCommand(oExit,ActionEquipItem(oCloak,INVENTORY_SLOT_CLOAK));
}
SetCreatureAppearanceType(oComp1, 0);
SetCreatureAppearanceType(oComp2, 6);
SetCreatureAppearanceType(oComp3, 3);
SetCreatureAppearanceType(oComp4, 6);
SetCreatureAppearanceType(oComp5, 6);
SetCreatureAppearanceType(oComp6, 1);
SetCreatureAppearanceType(oExit,nOriginalAppearance);
SetLocalInt(oExit,"nInWater201",0);
}
Hey everyone, I've been trying to edit these scripts, but I'm just not getting it.
The scripts go OnClientEnter and OnExit of an area.
I've added a countdown timer, when it reaches 0, you start to drown.
I want it to effect the PC and which ever companions happen to be there.
Both scripts work fine for the PC, and the timer works fine, but I can't get the comps to change. And then OnExit, the comps all change to dwarf.
Can any one spot where I'm going wrong?





Retour en haut







