generated from Jaysyn/ModuleTemplate
80 lines
2.6 KiB
Plaintext
80 lines
2.6 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Default On Enter for Module
|
|
//:: x3_mod_def_enter
|
|
//:: Copyright (c) 2008 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
This script adds the horse menus to the PCs.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Deva B. Winblood
|
|
//:: Created On: Dec 30th, 2007
|
|
//:: Last Update: April 21th, 2008
|
|
//:://////////////////////////////////////////////
|
|
//:: Modified By: Proleric
|
|
//:: Modified On: 17-May-2008
|
|
//
|
|
// Travel Builder
|
|
//
|
|
// Example of an OnClient Enter script
|
|
//
|
|
//:://////////////////////////////////////////////
|
|
|
|
#include "x3_inc_horse"
|
|
|
|
// Custom include
|
|
|
|
#include "bh_travel_inc"
|
|
|
|
void main()
|
|
{
|
|
object oPC=GetEnteringObject();
|
|
ExecuteScript("x3_mod_pre_enter",OBJECT_SELF); // Override for other skin systems
|
|
if ((GetIsPC(oPC)||GetIsDM(oPC))&&!GetHasFeat(FEAT_HORSE_MENU,oPC))
|
|
{ // add horse menu
|
|
HorseAddHorseMenu(oPC);
|
|
if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB"))
|
|
{ // restore PC horse status from database
|
|
DelayCommand(2.0,HorseReloadFromDatabase(oPC,X3_HORSE_DATABASE));
|
|
} // restore PC horse status from database
|
|
} // add horse menu
|
|
if (GetIsPC(oPC))
|
|
{ // more details
|
|
// restore appearance in case you export your character in mounted form, etc.
|
|
if (!GetSkinInt(oPC,"bX3_IS_MOUNTED")) HorseIfNotDefaultAppearanceChange(oPC);
|
|
// pre-cache horse animations for player as attaching a tail to the model
|
|
HorsePreloadAnimations(oPC);
|
|
DelayCommand(3.0,HorseRestoreHenchmenLocations(oPC));
|
|
} // more details
|
|
|
|
// Custom code for Proleric's travel system
|
|
|
|
// First PC must validate the 2da files (mandatory)
|
|
// otherwise very strange things will happen.
|
|
|
|
if (oPC == GetFirstPC())
|
|
bhtValidateTravelNetwork();
|
|
|
|
// Optionally, flag selected nodes as "known" to the PC.
|
|
|
|
bhtSetTravelNodeKnown(oPC, "Sea", "New York");
|
|
bhtSetTravelNodeKnown(oPC, "Sea", "London");
|
|
bhtSetTravelNodeKnown(oPC, "Sea", "Glasgow");
|
|
bhtSetTravelNodeKnown(oPC, "Cog", "New York");
|
|
bhtSetTravelNodeKnown(oPC, "Cog", "Coney Island");
|
|
bhtSetTravelNodeKnown(oPC, "CityShip", "Chicago");
|
|
bhtSetTravelNodeKnown(oPC, "CityShip", "Green Bay");
|
|
bhtSetTravelNodeKnown(oPC, "MerchantShip", "Green Bay");
|
|
bhtSetTravelNodeKnown(oPC, "MerchantShip", "Lake Michigan");
|
|
|
|
// Optionally, load PC former position (if any) from a data base.
|
|
|
|
// Most modules won't need this.
|
|
|
|
bhtImportTravelDataBase(oPC, "bhTravel");
|
|
|
|
// This is only a demo. Scrap the data base.
|
|
|
|
DestroyCampaignDatabase("bhTravel");
|
|
}
|