Added CCOH and missing areas Changed some areas to be craftable, Fixed some on death issues, Fixed the Gaurd
157 lines
5.9 KiB
Plaintext
157 lines
5.9 KiB
Plaintext
|
|
void DoDirection(object oPC, location lChest, int iMapLevel);
|
|
|
|
|
|
void main()
|
|
{
|
|
|
|
object oPC = OBJECT_SELF;
|
|
|
|
object oMapUsed = GetLocalObject(oPC,"oMapUsed");
|
|
|
|
DeleteLocalObject(oPC,"oMapUsed");
|
|
if (GetLocalInt(oMapUsed,"iAmInUse")!=0)
|
|
{
|
|
AssignCommand(oMapUsed,ClearAllActions());
|
|
AssignCommand(oMapUsed,DelayCommand(30.1,DeleteLocalInt(oMapUsed,"iAmInUse")));
|
|
return;
|
|
}
|
|
SetLocalInt(oMapUsed,"iAmInUse",99);
|
|
AssignCommand(oMapUsed,DelayCommand(30.1,DeleteLocalInt(oMapUsed,"iAmInUse")));
|
|
|
|
int iMapSkill = GetCampaignInt("UOACraft","iMapSkill",oPC);
|
|
int iMapChance = iMapSkill;
|
|
|
|
if (iMapChance <350)
|
|
{
|
|
iMapChance = GetAbilityScore(oPC,ABILITY_INTELLIGENCE)*5;
|
|
iMapChance = iMapChance +(GetAbilityScore(oPC,ABILITY_WISDOM)*3);
|
|
iMapChance = iMapChance +(GetAbilityScore(oPC,ABILITY_DEXTERITY)*2);
|
|
iMapChance = iMapChance * 3;
|
|
if (iMapChance >350) iMapChance = 350;
|
|
if (iMapSkill > iMapChance) iMapChance = iMapSkill;
|
|
}
|
|
|
|
int iMapLevel = StringToInt(GetStringRight(GetResRef(oMapUsed),2));
|
|
int iMapChanceNeeded = iMapLevel*100;
|
|
|
|
if (iMapChance<iMapChanceNeeded)
|
|
{
|
|
FloatingTextStringOnCreature("You are not skilled enough in cartography to follow this map!",oPC,FALSE);
|
|
return;
|
|
}
|
|
|
|
string sMapTag = GetTag(oMapUsed);
|
|
string sTemp;
|
|
sMapTag = GetStringRight(sMapTag,GetStringLength(sMapTag)-10);
|
|
sTemp ="0000"+sMapTag;
|
|
sMapTag = GetStringRight(sTemp,4);
|
|
string sMapWaypointTag = "_UOA_TCHEST_NUMBER_"+sMapTag;
|
|
|
|
object oMapWaypoint = GetWaypointByTag(sMapWaypointTag);
|
|
|
|
if (oMapWaypoint==OBJECT_INVALID)
|
|
{
|
|
SendMessageToPC(oPC,"Chest location not valid!");
|
|
SendMessageToAllDMs(GetName(oPC)+" cannot locate treasure map location do to invalid location: "+sMapWaypointTag);
|
|
return;
|
|
}
|
|
|
|
object oPCArea = GetArea(oPC);
|
|
object oMapArea = GetArea(oMapWaypoint);
|
|
|
|
if (oPCArea!=oMapArea)
|
|
{
|
|
FloatingTextStringOnCreature("You do not believe the treasure to be anywhere nearby.",oPC,FALSE);
|
|
return;
|
|
}
|
|
|
|
if (GetLocalInt(oPC,"iAmFollowingMap")!=0)
|
|
{
|
|
FloatingTextStringOnCreature("You are already following a treasure map!",oPC,FALSE);
|
|
return;
|
|
}
|
|
|
|
SetLocalInt(oPC,"iAmFollowingMap",99);
|
|
AssignCommand(oMapUsed,DelayCommand(31.0,DeleteLocalInt(oPC,"iAmFollowingMap")));
|
|
|
|
location lChestLocation = GetLocation(oMapWaypoint);
|
|
location lPCLocation = GetLocation(oPC);
|
|
|
|
float fDistance = GetDistanceBetweenLocations(lChestLocation,lPCLocation);
|
|
|
|
AssignCommand(oMapUsed,DelayCommand(0.1,DoDirection(oPC,lChestLocation,iMapLevel)));
|
|
AssignCommand(oMapUsed,DelayCommand(3.0,DoDirection(oPC,lChestLocation,iMapLevel)));
|
|
AssignCommand(oMapUsed,DelayCommand(9.0,DoDirection(oPC,lChestLocation,iMapLevel)));
|
|
AssignCommand(oMapUsed,DelayCommand(12.0,DoDirection(oPC,lChestLocation,iMapLevel)));
|
|
AssignCommand(oMapUsed,DelayCommand(15.0,DoDirection(oPC,lChestLocation,iMapLevel)));
|
|
AssignCommand(oMapUsed,DelayCommand(18.0,DoDirection(oPC,lChestLocation,iMapLevel)));
|
|
AssignCommand(oMapUsed,DelayCommand(21.0,DoDirection(oPC,lChestLocation,iMapLevel)));
|
|
AssignCommand(oMapUsed,DelayCommand(24.0,DoDirection(oPC,lChestLocation,iMapLevel)));
|
|
AssignCommand(oMapUsed,DelayCommand(27.0,DoDirection(oPC,lChestLocation,iMapLevel)));
|
|
AssignCommand(oMapUsed,DelayCommand(30.0,DoDirection(oPC,lChestLocation,iMapLevel)));
|
|
}
|
|
|
|
void DoDirection(object oPC, location lChest, int iMapLevel)
|
|
{
|
|
object oArea = GetArea(oPC);
|
|
object oTemp;
|
|
location lTemp = GetLocation(oPC);
|
|
vector vTemp = GetPositionFromLocation(lTemp);
|
|
location lPCLocation = GetLocation(oPC);
|
|
float fDistance = GetDistanceBetweenLocations(lChest,lPCLocation);
|
|
vTemp.z = vTemp.z+5.0;
|
|
lTemp = Location(oArea,vTemp,GetFacing(oPC));
|
|
|
|
int iColor = VFX_DUR_GLOW_GREY;
|
|
int iColor2 = 0;
|
|
int iDistance=iMapLevel;
|
|
if (iMapLevel<3) iDistance=3;
|
|
string sArrowResRef="plc_flrdesigns3";
|
|
float fDistanceLevel1 = IntToFloat(iDistance)*5.0;
|
|
float fDistanceLevel2 = IntToFloat(iDistance)*6.0;
|
|
float fDistanceLevel3 = IntToFloat(iDistance)*7.0;
|
|
float fDistanceLevel4 = IntToFloat(iDistance)*8.0;
|
|
float fDistanceLevel5 = IntToFloat(iDistance)*9.0;
|
|
float fDistanceLevel6 = IntToFloat(iDistance)*10.0;
|
|
float fDistanceLevel7 = IntToFloat(iDistance)*11.0;
|
|
float fDistanceLevel8 = IntToFloat(iDistance)*12.0;
|
|
float fDistanceLevel9 = IntToFloat(iDistance)*13.0;
|
|
float fDistanceLevel10 = IntToFloat(iDistance)*15.0;
|
|
|
|
if ((IntToFloat(iMapLevel)*5.0)>fDistance) sArrowResRef="x2_plc_hole_s"; //if too close then turn off the beacon
|
|
|
|
if (fDistance <= fDistanceLevel10) iColor = VFX_DUR_GLOW_PURPLE;
|
|
if (fDistance <= fDistanceLevel9) iColor = VFX_DUR_GLOW_LIGHT_PURPLE;
|
|
if (fDistance <= fDistanceLevel8) iColor = VFX_DUR_GLOW_RED;
|
|
if (fDistance <= fDistanceLevel7) iColor = VFX_DUR_GLOW_LIGHT_RED;
|
|
if (fDistance <= fDistanceLevel6) iColor = VFX_DUR_GLOW_ORANGE;
|
|
if (fDistance <= fDistanceLevel5)
|
|
{
|
|
iColor = VFX_DUR_GLOW_LIGHT_ORANGE;
|
|
iColor2 = VFX_DUR_PIXIEDUST;
|
|
}
|
|
if (fDistance <= fDistanceLevel4) iColor = VFX_DUR_GLOW_YELLOW;
|
|
if (fDistance <= fDistanceLevel3) iColor = VFX_DUR_GLOW_LIGHT_YELLOW;
|
|
|
|
if (fDistance <= fDistanceLevel2) iColor = VFX_DUR_GLOW_LIGHT_BLUE;
|
|
if (fDistance <= fDistanceLevel1)
|
|
{
|
|
iColor = VFX_DUR_GHOST_SMOKE;
|
|
iColor2 = VFX_DUR_GLOW_WHITE;
|
|
}
|
|
|
|
|
|
oTemp = CreateObject(OBJECT_TYPE_PLACEABLE,sArrowResRef,lTemp,FALSE);
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(iColor,FALSE),oTemp,2.4);
|
|
if (iColor2!=0)ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(iColor2,FALSE),oTemp,2.4);
|
|
DestroyObject(oTemp,2.5);
|
|
AssignCommand(oTemp,PlaySound("as_hr_x2ghost1"));
|
|
AssignCommand(oTemp,SetFacingPoint(GetPositionFromLocation(lChest)));
|
|
DelayCommand(0.3,AssignCommand(oTemp,SetFacingPoint(GetPositionFromLocation(lChest))));
|
|
DelayCommand(0.6,AssignCommand(oTemp,SetFacingPoint(GetPositionFromLocation(lChest))));
|
|
DelayCommand(0.9,AssignCommand(oTemp,SetFacingPoint(GetPositionFromLocation(lChest))));
|
|
return;
|
|
}
|
|
|