Aller au contenu

Photo

how do I do this again?


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Who said that I

Who said that I
  • Members
  • 492 messages

okay I kinda forgot how to add one script to another script without pasting the entire thing at the bottom of the script....

 

kinda wanna replace the old subrace system with the new one (Shayan's)  seeing that I keep having trouble with it.

 

 

#include "x2_inc_switches"
#include "habd_include"
#include "subdual_inc"
#include "fugue_xpdebt_inc"
#include "vg_pal_include"
#include "ww_inc"
#include "sha_subr_methds"
void main()
{
    object oItem = GetItemActivated();
    object oPC = GetItemActivator();
    object oTarget = GetItemActivatedTarget();
    string sTag = GetTag(oItem);
    string sPCName;
    string sPlayerName;
 
       if (sTag == "faction_editor")
        ExecuteScript("faction_editor", oPC);
 
    // Subrace system: Some player models normally used were changed due to lack of CEP
    if(GetLocalInt(GetModule(),"Subraces")==1)
        {
        ExecuteScript("_cb_activateitem",oPC);
        }
 
    // Werewolf System Addon
    if(GetLocalInt(GetModule(),"Werewolf")==1)
        {
        Werewolf_Form(oPC,oItem,oTarget);
        Wolf_Form(oPC,oItem,oTarget);
        Belladonna(oPC,oItem,oTarget);
        }
 
    // Vampire PC subrace Addon
    if(GetLocalInt(GetModule(),"Vampire")==1)
        {
        ExecuteScript("vamp_on_used", OBJECT_SELF);
        }
 
    // Bleeding/Death system item activation manager
    if (HABDOnActivateItem(oPC, oTarget, oItem)) return;
 
    // Subdual Tool Mode Switch
    if(sTag=="pcsubdualtool")
        {
        int iMode = GetLocalInt(oPC,"SUBDUAL");
        int iNextMode;
        // Only three possible options
        iNextMode = (iMode + 1) % 3;
        // Advance the state of the toggle item by setting the state of it up as an INT
        SetLocalInt(oItem,"Mode",iNextMode);
 
        // Inform them about the notification switch
        switch (iNextMode)
            {
            case 0:
                SetLocalInt(oPC,"SUBDUAL",0);
                SendMessageToPC(oPC,"You are currently doing full damage.");
                break;
            case 1:
                SetLocalInt(oPC,"SUBDUAL",1);
                SendMessageToPC(oPC,"You are currently doing subdual damage.");
                break;
            case 2:
                SetLocalInt(oPC,"SUBDUAL",2);
                SendMessageToPC(oPC,"You are currently in sparring mode.");
                break;
            }
        return;
        }
 
    // This handles the canteen for the dehydration system
    if (GetStringLeft(sTag,4)=="DH2_") ExecuteScript("vg_source_act",OBJECT_SELF);
 
    // This handles the items for the "PnP" Door system
    if (sTag=="IDSBook")
        AssignCommand(oPC, ActionStartConversation(oPC,"ids_book_conv",TRUE,FALSE));
    else if (sTag=="HoldPortal")
        {
        if (GetObjectType(oTarget) ==  OBJECT_TYPE_DOOR)
            {
            SetLocalInt(oTarget,"Magic Lock",1);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_KNOCK), oTarget);
            }
        }
 
    //Paladin's Badge of Courage script
    if (sTag=="vg_pal_courage")
        {
        vg_pal_courage(oPC);
        return;
        }
 
    //Enchant Rod script
    if (sTag=="EnchantRod")
        {
        ExecuteScript("ench_start", oPC);
        return;
        }
 
    //Soul Stone script
    if (sTag=="SoulStone")
        {
        SetLocalObject(oPC, "SoulStone", oItem);
        AssignCommand(oPC, ActionStartConversation(oPC, "SoulStoneConv", TRUE, FALSE));
        return;
        }
 
    // DM Epic Level Allow Wand
    if(sTag=="dm_epic_tool" && GetIsDM(oPC) && oTarget!=oPC && GetIsObjectValid(oTarget) && GetIsPC(oTarget))
        {
        sPCName = GetName(oTarget);
        sPlayerName = GetPCPlayerName(oTarget);
        int iMode = GetLocalInt(oTarget,"Allow_Level");
        int iNextMode;
        // Only two possible options
        iNextMode = (iMode + 1) % 2;
        // Advance the state of the toggle item by setting the state of it up as an INT
        SetLocalInt(oItem,"Mode",iNextMode);
 
        // Inform them about the notification switch
        switch (iNextMode)
            {
            case 0:
                SetDBInt("EpicPCs","Allow_Level",0,oTarget);
                SetLocalInt(oTarget,"Allow_Level",0);
                SendMessageToAllDMs("The PC '"+sPCName+"' belonging to '"+sPlayerName+"' is not currently allowed to take epic levels");
                SendMessageToPC(oTarget,"You are not currently allowed to take epic levels");
                break;
            case 1:
                SetDBInt("EpicPCs","Allow_Level",1,oTarget);
                SetLocalInt(oTarget,"Allow_Level",1);
                SendMessageToAllDMs("The PC '"+sPCName+"' belonging to '"+sPlayerName+"' is allowed to take epic levels");
                SendMessageToPC(oTarget,"You are now allowed to take epic levels");
                break;
            }
        return;
        }
     if (sTag=="dm_epic_tool" && GetIsDM(oPC) && oTarget==oPC && GetIsObjectValid(oTarget))
        {
        SendMessageToAllDMs("The DM '"+sPCName+"' belonging to '"+sPlayerName+"' is trying to give themselves Epic Level Permission!");
        SendMessageToPC(oTarget,"You are not allowed to give yourself Epic Level Permission!!!");
        return;
        }
     if (sTag=="dm_epic_tool" && !GetIsDM(oPC))
        {
        SendMessageToAllDMs("The PC '"+sPCName+"' belonging to '"+sPlayerName+"' has a DM Epic Level Allow Tool!");
        SendMessageToPC(oPC,"Only DMs may use this tool!!!");
        return;
        }
 
     // DM Item Modifier
     if(sTag=="dm_item_manipula"&&GetIsDM(oPC))
        {
            if(GetIsObjectValid(oTarget) == TRUE && GetObjectType(oTarget) == OBJECT_TYPE_ITEM)
            {
                SetLocalObject(oPC, "TARGETED_ITEM", oTarget);
                AssignCommand(oPC, ActionStartConversation(oPC, "dm_wand_item", TRUE, FALSE));
            }
            else
                SendMessageToPC(oPC, "That is not a valid item");
            return;
        }
     if (sTag=="dm_item_manipula"&&!GetIsDM(oPC))
            {
            SendMessageToAllDMs("The PC '"+sPCName+"' belonging to '"+sPlayerName+"' has a DM Item Manipulation Tool!");
            SendMessageToPC(oPC,"Only DMs may use this tool!!!");
            }
 
     // This will allow DMs to clear XP Debts as a VERY special reward.
     if (GetTag(oItem)=="xpdebtclearer")
     {
        if ((oTarget!=oPC)&&GetIsDM(oPC))
            {
            //to clear out xp via a dm wand
            ClearDebt(oTarget);
            SendMessageToPC(oTarget,"Your XP Debt has been cleared!");
            SendMessageToAllDMs(GetName(oTarget)+" has had their XP Debt cleared by "+GetName(oPC));
            }
        if ((oTarget==oPC)&&GetIsDM(oPC))
            {
            //to clear out xp via a dm wand
            SendMessageToPC(oPC,"Your XP Debt has NOT been cleared!  Do not try to clear your own debt . . . it is just wrong!");
            SendMessageToAllDMs(GetName(oPC)+" has tried to clear their own XP Debt!  Go smack them!");
            }
        if ((oTarget==oPC)&&(!GetIsDM(oPC)))
            {
            //to clear out xp via a dm wand
            SendMessageToPC(oPC,"Your XP Debt has NOT been cleared!  This tool is for DM use only!");
            SendMessageToAllDMs(GetName(oPC)+" has tried to clear their own XP Debt!  They are not a DM so go take the tool from them!");
            }
     }
 
     // * Generic Item Script Execution Code
     // * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
     // * it will execute a script that has the same name as the item's tag
     // * inside this script you can manage scripts for all events by checking against
     // * GetUserDefinedItemEventNumber(). See x2_it_example.nss
     if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
     {
        SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACTIVATE);
        int nRet =   ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
        if (nRet == X2_EXECUTE_SCRIPT_END)
        {
           return;
        }
}
ExecuteScript ("cnr_module_onact", OBJECT_SELF);
ExecuteScript ("zep_on_activate", OBJECT_SELF);
 
}

 

 

this script added....

 

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//:::::::::::::::::::::::: Shayan's Subrace Engine::::::::::::::::::::::::::::::
//:::::::::::::::::File Name: sha_on_itemactiv :::::::::::::::::::::::::::::::::
//::::::::::::::::::::: OnItemActivated script :::::::::::::::::::::::::::::::::
//:: Written By: Shayan.
//:: Contact: mail_shayan@yahoo.com
 
#include "sha_subr_methds"
void main()
{
     SubraceOnItemActivated();
}

 

 

 

anyone wanna help me out with this? :D

 


#2
meaglyn

meaglyn
  • Members
  • 807 messages

There are examples already in the code you posted of doing it with ExecuteScript. In fact there is one near the top that does your current subrace activation script.  You can have the new script executed there instead. You need to change the oPC to OBJECT_SELF since the shayan script you posted looks like it wants to run as the module.


  • Who said that I aime ceci

#3
Who said that I

Who said that I
  • Members
  • 492 messages

There are examples already in the code you posted of doing it with ExecuteScript. In fact there is one near the top that does your current subrace activation script.  You can have the new script executed there instead. You need to change the oPC to OBJECT_SELF since the shayan script you posted looks like it wants to run as the module.


Then I must be doing something wrong then since It is not working for me since i did that and it just did not work....

#4
meaglyn

meaglyn
  • Members
  • 807 messages

Do you want to post the relevant lines?   It should "Just Work".



#5
Who said that I

Who said that I
  • Members
  • 492 messages

Do you want to post the relevant lines?   It should "Just Work".

 
 You mean this line? 
  // Subrace system: Some player models normally used were changed due to lack of CEP
    if(GetLocalInt(GetModule(),"Subraces")==1)
        {
        ExecuteScript("_cb_activateitem",oPC);
        }

 

 

I changed that but it is probably also the other module scripts that i need to change >.< 
 
Like with here.... I added basically the executescript function of the appropriate function used to the thingie but it is not working apparently...
 
on enter: 
#include "habd_include"
#include "fugue_xpdebt_inc"
#include "pgs_inc_events"
#include "pgs_inc_uidsys"
#include "pqj_inc"
#include "omw_plns"
#include "vg_give_items"
#include "vg_move_rates"
#include "doa_gold_hrtbt"
#include "vg_factions_inc"
#include "_cb_client_enter"
#include "ww_inc"
#include "vamp_inc"
#include "b_rep_factions"
#include "sha_subr_methds"
//#include "x3_inc_horse"
void main()
{
object oMod = GetModule();
// The object entering the area
object oPC = GetEnteringObject();
// Used to check if PC is new to module or not
string sRegion = GetCampaignString("Regions","Region",oPC);
// Possible region codes PC could be native to
int iRegion01 = TestStringAgainstPattern("01",sRegion);
int iRegion02 = TestStringAgainstPattern("02",sRegion);
int iRegion03 = TestStringAgainstPattern("03",sRegion);
int iRegion04 = TestStringAgainstPattern("04",sRegion);
int iRegion05 = TestStringAgainstPattern("05",sRegion);
int iRegion06 = TestStringAgainstPattern("06",sRegion);
// Prep the STARTING_GOLD INT for use in section giving starting gold
int STARTING_GOLD = 0;
 
// update 1.69 ridable horses add-on
ExecuteScript("x3_mod_def_enter",OBJECT_SELF);
 
// Remove invulnerability
DelayCommand(2.0,SetPlotFlag(oPC, FALSE));
 
// Rebuild the persistant journals for clients when they enter
DelayCommand(2.2,RebuildJournalQuestEntries(oPC));
 
// Sets up subraces
if(GetLocalInt(GetModule(),"Subraces")==1)
    {
    _cb_client_enter(oPC);
    }
 
// Handles the initialization of the werewolf system and vampire subrace
if(GetIsPC(oPC))
    {
    if(GetLocalInt(GetModule(),"Werewolf")==1)
        {
        // werewolf system initialization
        DelayCommand(2.4,SetLocalInts(oPC));
 
        // run pseudo heartbeat for werewolf system
        DelayCommand(2.6,WWHrtbt(oPC));
        }
 
    if(GetLocalInt(GetModule(),"Vampire")==1)
        {
        // vampire system initialization
        if (GetSubRace(oPC) == "VAMPIRE")
            {
            init_subrace(oPC);
            }
        }
    }
 
// Get DB info and make sure clients have Death/Bleed items when they enter
HABDGetDBOnClientEnter(oPC);
DelayCommand(2.8, HABDItemsOnClientEnter(oPC));
 
// Set up XPDebt Persistence
DelayCommand(3.0,XPonEnter(oPC));
 
// Set up player guild info when client enters
DelayCommand(3.2,PGS_OnClientEnter (oPC));
 
// Set up Loot Notification
if (GetLocalInt(oMod,"PCLootTool")==1)
    {
    DelayCommand(3.4,PLNSLoadNotificationOnClientEnter(oPC));
    }
 
// Give PC a Subdual Tool if they dont have one and set Subdual Mode to "Full Damage"
if (GetLocalInt(oMod,"PCSubdualTool")==1)
    {
    DelayCommand(3.6,GivePCSubdualTool(oPC));
    DelayCommand(3.8, SetLocalInt(oPC,"SUBDUAL",0));
    }
 
// Set up factions for persistence
if (GetLocalInt(oMod,"Factions")==1)
    {
    // This tracks what faction the PC started with in the very beginning
    int nOriginalFaction = GetCampaignInt("Factions",CHAR_FACTION_ORIGINAL(oPC),oMod);
    SetLocalInt(GetModule(),CHAR_FACTION_ORIGINAL(oPC),nOriginalFaction);
    // This tracks what faction the PC currently belongs to
    int nCurrentFaction = GetCampaignInt("Factions",CHAR_FACTION(oPC),oMod);
    SetLocalInt(GetModule(),CHAR_FACTION(oPC),nCurrentFaction);
    }
 
// Give PC a Persistent Location Saving Tool
if (GetLocalInt(oMod,"PLSTool")==0)
    {
    GivePCPLSTool(oPC);
    }
 
// Give PC their DMFI tools
if (GetLocalInt(oMod,"DMFITools")==1)
    {
    GiveDMFITools(oPC);
    }
 
// Give PC their climb tool
if (GetLocalInt(oMod,"PCClimbTool")==1)
    {
    GivePCClimbTool(oPC);
    }
 
// Set up the player's starting gold as per PnP rules (two variants included)
if (!iRegion01&&!iRegion02&&!iRegion03&&!iRegion04&&!iRegion05&&!iRegion06&&GetLocalInt(oMod,"STARTING_GOLD")!=0)
    {
    if (GetLocalInt(oMod,"STARTING_GOLD")==0)       // Full amount of class based gold
        {
        if (GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC))     STARTING_GOLD = 160;
        else if (GetLevelByClass(CLASS_TYPE_BARD, oPC))     STARTING_GOLD = 160;
        else if (GetLevelByClass(CLASS_TYPE_CLERIC, oPC))   STARTING_GOLD = 200;
        else if (GetLevelByClass(CLASS_TYPE_DRUID, oPC))    STARTING_GOLD = 80;
        else if (GetLevelByClass(CLASS_TYPE_FIGHTER, oPC))  STARTING_GOLD = 240;
        else if (GetLevelByClass(CLASS_TYPE_MONK, oPC))     STARTING_GOLD = 20;
        else if (GetLevelByClass(CLASS_TYPE_PALADIN, oPC))  STARTING_GOLD = 240;
        else if (GetLevelByClass(CLASS_TYPE_RANGER, oPC))   STARTING_GOLD = 240;
        else if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC))    STARTING_GOLD = 200;
        else if (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)) STARTING_GOLD = 120;
        else if (GetLevelByClass(CLASS_TYPE_WIZARD, oPC))   STARTING_GOLD = 120;
        else STARTING_GOLD = 160;
        }
    if (GetLocalInt(oMod,"STARTING_GOLD")==0)       // Roll for amount of class based gold
        {
        if (GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC))     STARTING_GOLD = d4(4)*10;
        else if (GetLevelByClass(CLASS_TYPE_BARD, oPC))     STARTING_GOLD = d4(4)*10;
        else if (GetLevelByClass(CLASS_TYPE_CLERIC, oPC))   STARTING_GOLD = d4(5)*10;
        else if (GetLevelByClass(CLASS_TYPE_DRUID, oPC))    STARTING_GOLD = d4(2)*10;
        else if (GetLevelByClass(CLASS_TYPE_FIGHTER, oPC))  STARTING_GOLD = d4(6)*10;
        else if (GetLevelByClass(CLASS_TYPE_MONK, oPC))     STARTING_GOLD = d4(5);
        else if (GetLevelByClass(CLASS_TYPE_PALADIN, oPC))  STARTING_GOLD = d4(6)*10;
        else if (GetLevelByClass(CLASS_TYPE_RANGER, oPC))   STARTING_GOLD = d4(6)*10;
        else if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC))    STARTING_GOLD = d4(5)*10;
        else if (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)) STARTING_GOLD = d4(3)*10;
        else if (GetLevelByClass(CLASS_TYPE_WIZARD, oPC))   STARTING_GOLD = d4(3)*10;
        else STARTING_GOLD = d4(4)*10;
        }
        AssignCommand(oPC, DelayCommand(3.6, TakeGoldFromCreature(GetGold(oPC), oPC, FALSE)));
        AssignCommand(oPC, DelayCommand(3.8, GiveGoldToCreature(oPC, STARTING_GOLD)));
    }
 
// Set up PC with proper racial movement rate if system is turned on
if (GetLocalInt(oMod,"RacialMovement")==1)
    {
    SetRacialMovementRate(oPC);
    }
 
/* ===== PC pseudo-heartbeat ====
DOA Gold Encumbrance System 1.0   */
if (GetLocalInt(oMod,"GoldEncumbrance")==1)
    {
    GoldHrtbt(oPC);
 
    // Get the creature who triggered this event.
    object oPC = GetEnteringObject();
 
    // Only fire for (real) PCs.
    if ( !GetIsPC(oPC)  ||  GetIsDMPossessed(oPC) )
        return;
 
    // Update all players' journals.
    AddJournalQuestEntry("RULES", 1, oPC, FALSE, TRUE);
 
    // Update the party's journals.
    AddJournalQuestEntry("GAME INFO", 1, oPC);
}
 
ExecuteScript ("cnr_module_oce", OBJECT_SELF);
ExecuteScript ("x3_mod_def_enter", OBJECT_SELF);
ExecuteScript ("sha_on_cl_enter", OBJECT_SELF);
 
RestoreReputations(oPC);
}

 

 

Basically want to switch out the CB/Idillicus subrace system but I would like to keep the vampire and werewolf system that is installed here. it looks like here it is very much intertwined >.< 

 

(on leave) 

#include "habd_include"
#include "vamp_inc"
#include "b_rep_factions"
#include "sha_subr_methds"
void main()
{
// Handles Death and Dying Persistance
HABDSetDBOnClientLeave(GetName(GetExitingObject()));
 
// Handles Vampire Subrace Persistant Data
if(GetLocalInt(GetModule(),"Vampire")==1)
    {
    vamp_on_exit(GetExitingObject());
    }
ExecuteScript ("sha_on_cl_leave", OBJECT_SELF);
}

 

 

 

 

Mod_HB

 

/::////////////////////////////////////////////////////////////////////////////
// Setting this to TRUE will force the clock to update which fixes a problem
// with time not progressing on large modules.
const int VG_BIG_MODULE_CLOCK_FIX = TRUE;
//::////////////////////////////////////////////////////////////////////////////
#include "nbde_inc"
#include "vg_party_inc"
#include "_cb_heartbeat"
#include "j_inc_other_ai"
#include "sha_subr_methds"
void main()
{
object oPC = GetFirstPC();
object oMod = GetModule();
 
// update 1.69 ridable horses add-on
ExecuteScript("x3_mod_def_hb",OBJECT_SELF);
 
// Check for subbrace specific negative effects (ie. daylight sensitivity for drow)
if(GetLocalInt(GetModule(),"Subraces")==1)
    {
    _cb_heartbeat(oPC);
    }
 
// Check for proper party leader designation
if (GetLocalInt(oMod,"PartyLeader")==1)
    {
    party_leader(oPC);
    }
 
// Torches and lanterns check.
if (GetLocalInt(oMod, "RealTorch"))
    {
    if (!GetIsDM(oPC))
        {
        object oTorch = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC);
        string sTag = GetTag(oTorch);
 
        if (sTag == "NW_IT_TORCH001" || sTag == "ZEP_LANTERN")
            {
            // Update burn count, get burn limit.
            int nBurnCount = GetLocalInt(oTorch, "BURNCOUNT") + 1;
            int nBurnLimit = GetLocalInt(oMod, "TorchBurn") * FloatToInt(HoursToSeconds(1) / 6.0);
 
            if (nBurnCount >= nBurnLimit)
                {
                // If burned out then ...
                if (sTag == "NW_IT_TORCH001" || sTag == "hc_torch")
                    {
                    // ... destroy torches ...
                    DestroyObject(oTorch);
                    SendMessageToPC(oPC,"Your torch has burned out.");
                    }
                else
                    {
                    // ... and unequip lanterns ...
                    AssignCommand(oPC, ActionUnequipItem(oTorch));
                    SendMessageToPC(oPC, "Your lantern is out of fuel.");
                    }
                }
            else
                {
                // .. otherwise store updated burn count
                SetLocalInt(oTorch, "BURNCOUNT", nBurnCount);
                }
            }
        }
    }
oPC = GetNextPC();
 
// Forced time update.
if (VG_BIG_MODULE_CLOCK_FIX)
    {
    SetTime(GetTimeHour(), GetTimeMinute(), GetTimeSecond(), GetTimeMillisecond());
    }
 
/* Commented because this is not really needed for a small module like this
// Knats Database Extension Flushing functions
int iCount=GetLocalInt(oMod,"FlushCount");
if (iCount<5)
    {
    iCount=iCount+1;
    SetLocalInt(oMod,"FlushCount",iCount);
    }
if (iCount==5)
    {
    NBDE_FlushCampaignDatabase("DMFI");
    NBDE_UnloadCampaignDatabase("DMFI");
    DelayCommand(1.0,NBDE_FlushCampaignDatabase("PLAYERSTARTLOC"));
    DelayCommand(1.1,NBDE_UnloadCampaignDatabase("PLAYERSTARTLOC"));
    DelayCommand(2.0,NBDE_FlushCampaignDatabase("Message_Board"));
    DelayCommand(2.1,NBDE_UnloadCampaignDatabase("Message_Board"));
    DelayCommand(3.0,NBDE_FlushCampaignDatabase("XP_Debt"));
    DelayCommand(3.1,NBDE_UnloadCampaignDatabase("XP_Debt"));
    DelayCommand(4.0,NBDE_FlushCampaignDatabase("LDClock"));
    DelayCommand(4.1,NBDE_UnloadCampaignDatabase("LDClock"));
    DelayCommand(5.0,NBDE_FlushCampaignDatabase("J_NEWSPAPER"));
    DelayCommand(5.1,NBDE_UnloadCampaignDatabase("J_NEWSPAPER"));
    DelayCommand(6.0,NBDE_FlushCampaignDatabase("EPICPCS"));
    DelayCommand(6.1,NBDE_UnloadCampaignDatabase("EPICPCS"));
    DelayCommand(7.0,NBDE_FlushCampaignDatabase("SoulCharge"));
    DelayCommand(7.1,NBDE_UnloadCampaignDatabase("SoulCharge"));
    DelayCommand(8.0,NBDE_FlushCampaignDatabase("HABD_DB"));
    DelayCommand(8.1,NBDE_UnloadCampaignDatabase("HABD_DB"));
    DelayCommand(9.0,NBDE_FlushCampaignDatabase("PGS_Module_Info"));
    DelayCommand(9.1,NBDE_UnloadCampaignDatabase("PGS_Module_Info"));
    DelayCommand(10.0,NBDE_FlushCampaignDatabase("PGS_Territory_Info"));
    DelayCommand(10.1,NBDE_UnloadCampaignDatabase("PGS_Territory_Info"));
    DelayCommand(11.0,NBDE_FlushCampaignDatabase("PGS_Module_Time"));
    DelayCommand(11.1,NBDE_UnloadCampaignDatabase("PGS_Module_Time"));
    DelayCommand(12.0,NBDE_FlushCampaignDatabase("PGS_Player_Info"));
    DelayCommand(12.1,NBDE_UnloadCampaignDatabase("PGS_Player_Info"));
    DelayCommand(13.0,NBDE_FlushCampaignDatabase("PPISSTORE"));
    DelayCommand(13.1,NBDE_UnloadCampaignDatabase("PPISSTORE"));
    DelayCommand(14.0,NBDE_FlushCampaignDatabase("Bank"));
    DelayCommand(14.1,NBDE_UnloadCampaignDatabase("Bank"));
 
    SendMessageToAllDMs("Database has Flushed!");
    SetLocalInt(oMod,"FlushCount",0);
    }
*/
ExecuteScript ("sha_mod_hb", OBJECT_SELF);
}

 

 

|Mod_load

 

#include "x2_inc_switches"
#include "x2_inc_restsys"
#include "pgs_inc_events"
#include "gm_include"
#include "ld_clock_inc"
#include "weather_inc"
#include "weather_inc_area"
#include "sha_subr_methds"
void main()
{
    object oMod = GetModule();
    //:://////////////////////////////////////////////
    //:: PW Clock Code Start
    //:://////////////////////////////////////////////
    if (GetLocalInt(oMod,"PersistDate")==1)
        {
        event DEvent = EventUserDefined(5000);
        if(GetDateInitialized())
            {
            int iDate = GetSavedDate();
            DelayCommand(HoursToSeconds(1),SignalEvent(oMod,DEvent));
            struct Date D = DecodeDate(iDate);
            SetTime(D.Hour,1,0,0);
            SetCalendar(D.Year,D.Month,D.Day);
            } else {
            SignalEvent(oMod,DEvent);
            InitializeDate();
            }
        }
    //:://////////////////////////////////////////////
    //:: PW Clock Code End
    //:://////////////////////////////////////////////
 
    //:://////////////////////////////////////////////
    // Weather System
    //:://////////////////////////////////////////////
    // Initialize Area List
        InitializeAreaList();
    // Global Weather Script
        if (DEBUG == 1)
            {
            PrintString("Setting Global Weather");
            }
        SetGlobalWeather();
    //:://////////////////////////////////////////////
    // Weather System Ends
    //:://////////////////////////////////////////////
 
    if(GetLocalInt(GetModule(),"Werewolf")==1)
        {
        // Werewolf Settings
        int iHourLength = 120;  //Tells the werewolf system how many seconds are in an hour.
        int iStartDay = 6;      //Tells the werewolf system what hour dawn starts
        int iStartNight = 18;   //Tells the werewolf system what hour dusk starts
        int iFullMoon1 = 26;    //Tells the werewolf system what the first day of full moon is
        int iFullMoon2 = 27;    //Tells the werewolf system what the second day of full moon is
        int iFullMoon3 = 28;    //Tells the werewolf system what the third day of full moon is
 
        SetLocalInt(oMod,"HourLength",iHourLength);
        SetLocalInt(oMod,"StartDay",iStartDay);
        SetLocalInt(oMod,"StartNight",iStartNight);
        SetLocalInt(oMod,"FullMoon1",iFullMoon1);
        SetLocalInt(oMod,"FullMoon2",iFullMoon2);
        SetLocalInt(oMod,"FullMoon3",iFullMoon3);
        }
 
    if(GetLocalInt(GetModule(),"Vampire")==1)
        {
        //Starts the vampire subrace system
        ExecuteScript("vamp_settings", OBJECT_SELF);
        }
 
   // Spell Hooking Code
   SetModuleOverrideSpellscript ("vg_spell_hook");//<--This was added for under water areas
 
   // Player Guild System Code
   PGS_OnModuleLoad();
 
   // Player Unique ID System - Not turned on!
   //UID_OnModuleLoad();
 
   //Starts Darklamps system
   ExecuteScript("Darklamp_init", oMod);
 
   // Gambling House Gold Setup
   SetHouse(HOUSESTART);
 
   if (GetGameDifficulty() ==  GAME_DIFFICULTY_CORE_RULES || GetGameDifficulty() ==  GAME_DIFFICULTY_DIFFICULT)
   {
        // * Setting the switch below will enable a seperate Use Magic Device Skillcheck for
        // * rogues when playing on Hardcore+ difficulty. This only applies to scrolls
        SetModuleSwitch (MODULE_SWITCH_ENABLE_UMD_SCROLLS, TRUE);
 
       // * Activating the switch below will make AOE spells hurt neutral NPCS by default
       // SetModuleSwitch (MODULE_SWITCH_AOE_HURT_NEUTRAL_NPCS, TRUE);
   }
 
   // * AI: Activating the switch below will make the creaures using the WalkWaypoint function
   // * able to walk across areas
   // SetModuleSwitch (MODULE_SWITCH_ENABLE_CROSSAREA_WALKWAYPOINTS, TRUE);
 
   // * Spells: Activating the switch below will make the Glyph of Warding spell behave differently:
   // * The visual glyph will disappear after 6 seconds, making them impossible to spot
   // SetModuleSwitch (MODULE_SWITCH_ENABLE_INVISIBLE_GLYPH_OF_WARDING, TRUE);
 
   // * Craft Feats: Want 50 charges on a newly created wand? We found this unbalancing,
   // * but since it is described this way in the book, here is the switch to get it back...
   // SetModuleSwitch (MODULE_SWITCH_ENABLE_CRAFT_WAND_50_CHARGES, TRUE);
 
   // * Craft Feats: Use this to disable Item Creation Feats if you do not want
   // * them in your module
   // SetModuleSwitch (MODULE_SWITCH_DISABLE_ITEM_CREATION_FEATS, TRUE);
 
   // * Palemaster: Deathless master touch in PnP only affects creatures up to a certain size.
   // * We do not support this check for balancing reasons, but you can still activate it...
   // SetModuleSwitch (MODULE_SWITCH_SPELL_CORERULES_DMASTERTOUCH, TRUE);
 
   // * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this
   // * did not fit into NWNs spell system and was confusing, so we took it out...
   // SetModuleSwitch (MODULE_SWITCH_EPIC_SPELLS_HURT_CASTER, TRUE);
 
   // * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this
   // * did not fit into NWNs spell system and was confusing, so we took it out...
   // SetModuleSwitch (MODULE_SWITCH_RESTRICT_USE_POISON_TO_FEAT, TRUE);
 
    // * Spellcasting: Some people don't like caster's abusing expertise to raise their AC
    // * Uncommenting this line will drop expertise mode whenever a spell is cast by a player
    // SetModuleSwitch (MODULE_VAR_AI_STOP_EXPERTISE_ABUSE, TRUE);
 
 
    // * Item Event Scripts: The game's default event scripts allow routing of all item related events
    // * into a single file, based on the tag of that item. If an item's tag is "test", it will fire a
    // * script called "test" when an item based event (equip, unequip, acquire, unacquire, activate,...)
    // * is triggered. Check "x2_it_example.nss" for an example.
    // * This feature is disabled by default.
   SetModuleSwitch (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE);
 
   if (GetModuleSwitchValue (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
   {
        // * If Tagbased scripts are enabled, and you are running a Local Vault Server
        // * you should use the line below to add a layer of security to your server, preventing
        // * people to execute script you don't want them to. If you use the feature below,
        // * all called item scrips will be the prefix + the Tag of the item you want to execute, up to a
        // * maximum of 16 chars, instead of the pure tag of the object.
        // * i.e. without the line below a user activating an item with the tag "test",
        // * will result in the execution of a script called "test". If you uncomment the line below
        // * the script called will be "1_test.nss"
        // SetUserDefinedItemEventPrefix("1_");
 
   }
   // * This initializes Bioware's wandering monster system as used in Hordes of the Underdark
   // * You can deactivate it, making your module load faster if you do not use it.
   // * If you want to use it, make sure you set "x2_mod_def_rest" as your module's OnRest Script
   // SetModuleSwitch (MODULE_SWITCH_USE_XP2_RESTSYSTEM, TRUE);
   if (GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == FALSE)
   {
 
       // * This allows you to specify a different 2da for the wandering monster system.
       // SetWanderingMonster2DAFile("des_restsystem");
 
       //* Do not change this line.
       WMBuild2DACache();
   }
 
   // CUSTOM CODE FOR HORSES
   // See x3_inc_horse for full explanation of the module options.
   // Similar lines in the official Bioware script have been consolidated into this section.
   SetMaxHenchmen(99);
 
   // Area Control
   SetLocalInt(GetModule(), "X3_MOUNTS_EXTERNAL_ONLY", TRUE);          // Horses not allowed in indoor areas
   SetLocalInt(GetModule(), "X3_MOUNTS_NO_UNDERGROUND", TRUE);         // Horses not allowed underground
  // SetLocalInt(GetObjectByTag("AreaTag"), "X3_NO_HORSES", TRUE);                // Horses not allowed in this area
   SetLocalInt(GetObjectByTag("DismountZone"), "X3_NO_MOUNTING", TRUE);         // No mounting in this area
   SetLocalInt(GetObjectByTag("DismountZone"), "X3_MOUNT_OK_EXCEPTION", TRUE);  // Horses allowed in this area
  // SetLocalFloat(GetObjectByTag("DismountZone"), "fX3_MOUNT_MULTIPLE", 0.5);    // Mount animation faster or slower in this area
  // SetLocalFloat(GetObjectByTag("DismountZone"), "fX3_DISMOUNT_MULTIPLE", 0.5); // Dismount animation faster or slower in this area
  // SetLocalInt(GetObjectByTag("AreaTag"), "X3_ABORT_WHEN_STUCK", TRUE);         // Abort mount if unable to run to horse in this area
 
   // Abilities & Combat
  // SetLocalInt(GetModule(), "X3_HORSE_DISABLE_SPEED", TRUE);           // No speed increase on mounting
  // SetLocalInt(GetModule(), "X3_HORSE_DISABLE_SKILL", TRUE);           // No skill penalties to Hide etc on mounting
  // SetLocalInt(GetModule(), "X3_MOUNT_NO_REST_DISMOUNT", TRUE);        // Allow rest when mounted
  // SetLocalInt(GetModule(), "X3_HORSE_ENABLE_ACBOOST", TRUE);          // Increase rider AC to match horse on mounting
  // SetLocalInt(GetModule(), "X3_NO_MOUNTED_COMBAT_FEAT", TRUE);        // Disable Mounted Combat feat
  // SetLocalInt(GetModule(), "X3_HORSE_ENABLE_HPBOOST", TRUE);          // Give rider temporary hit points on mounting
  // SetLocalInt(GetModule(), "X3_ENABLE_MOUNT_DAMAGE", TRUE);           // Horse shares damage on dismounting
  // SetLocalInt(GetModule(), "X3_HORSE_NO_CORPSES", TRUE);              // Mounted horses leave no corpses
  // SetLocalInt(GetModule(), "X3_NO_SHAPESHIFT_SPELL_CHECK", TRUE);     // Allow mounted creatures to be shapeshifted by spells
 
   // Henchman Control
  SetLocalInt(GetModule(), "X3_RESTORE_HENCHMEN_LOCATIONS", TRUE);      // Henchmen's horses respawn near henchmen on loading saved game
  // SetLocalInt(GetModule(), "X3_HORSE_NO_HENCHMAN_INCREASE", TRUE);    // No increase in maximum henchmen to accommodate horses
  // SetLocalInt(GetModule(), "X3_HORSE_MAX_HENCHMEN ", 5);              // Upper limit on maximum henchmen to accommodate horses
 
   // Saddlebags
   SetLocalInt(GetModule(), "X3_HORSE_ENABLE_SADDLEBAGS", TRUE);       // Enable saddlebags
   SetLocalString(GetModule(), "X3_SADDLEBAG_DATABASE", "Saddlebags"); // Name of saddlebag database
 
   // Paladin Mounts
  // SetLocalInt(GetModule(), "X3_HORSE_PALADIN_USE_PHB", TRUE);         // Paladin mount summoning duration as Player's Handbook
  // SetLocalInt(GetModule(), "X3_MOUNT_NO_REST_DESPAWN", TRUE);         // Paladin mount does not despawn on rest
  // SetLocalString(GetModule(), "X3_PALMOUNT_SUMMONOVR", "MyScript");   // Custom summoning script
  // SetLocalString(GetModule(), "X3_EXTEND_PALMOUNT", "MyScript");      // Custom post-mount script
  // SetLocalString(GetModule(), "X3_EXTEND_PALDMOUNT", "MyScript");     // Custom post-dismount script
 
   // Mounting System
  // SetLocalInt(GetModule(), "X3_NO_MOUNT_COMMANDABLE", TRUE);          // Allow horse and rider to be commandable during mount / dismount
  // SetLocalInt(GetModule(), "X3_HORSE_ACT_VS_DELAY", TRUE);            // Use actions rather than delays when mounting/dismounting
  // SetLocalFloat(GetModule(), "fX3_MOUNT_DELAY", 2.0);                 // Mount animation additional time in seconds
  // SetLocalFloat(GetModule(), "fX3_TIMEOUT_TO_MOUNT", 6.0);            // Maximum time allowed to run to horse in seconds
  SetLocalInt(GetModule(), "bX3_MOUNT_NO_ZAXIS", TRUE);                 // Enabled in official Bioware script
  // SetLocalFloat(GetModule(), "fX3_FREQUENCY", 2.0);                   // Frequency of pathfinding during run to horse in seconds
 
   // Database
  SetLocalInt(GetModule(), "X3_ENABLE_MOUNT_DB", TRUE);               // Enable data base functions
 
ExecuteScript ("cnr_module_oml", OBJECT_SELF);
ExecuteScript ("sha_mod_load", OBJECT_SELF);
}

 

Mod_ lvl_up

 

 
#include "deity_onlevelup"
#include "sha_subr_methds"
void main()
{
    object oMod=GetModule();
    object oPC=GetPCLevellingUp();
    int iLevel=GetHitDice(oPC);
 
    // If the PC is already level 20 or higher, check and make sure a DM has given them permission
    // to take on epic levels.  If not, delevel them then give them back their XP along with feedback.
    if((iLevel >= 21) && (GetLocalInt(oPC,"Allow_Level") == 0))
        {
            int iXPLastLvl = ((iLevel - 1) * 1000) + ((((iLevel - 1) * (iLevel - 2)) / 2) * 1000)-1;
            int iXP=GetXP(oPC);
 
            SetLocalInt(oPC, "sXPValue", iXP);
            int iNewXP = GetLocalInt(oPC, "sXPValue");
 
            FloatingTextStringOnCreature("You must seek DM permission to take epic levels.",oPC);
            SetXP(oPC, iXPLastLvl);
            DelayCommand(0.5, SetXP(oPC, iNewXP));
        }
 
    // If PC is less than level 20, let them go ahead and level up.
    if((iLevel <= 20) || (GetLocalInt(oPC,"Allow_Level") == 1))
        {
        Deity_Onlevelup(oMod,oPC);
        }
        ExecuteScript ("sha_on_pc_lvlup", OBJECT_SELF);
}

 

 

 

So...help?

 

 



#6
meaglyn

meaglyn
  • Members
  • 807 messages

In that first one I don't see your changes for the sha_  script. I think for the others you should probably remove the calls to the old system - they may be stepping on each other.   Beyond that what you have posted looks like it should work, but I don't know anything specific about either subrace engine. 



#7
Who said that I

Who said that I
  • Members
  • 492 messages

okay deleted alll includes and any lines remotely related to the Cb subrace system....

 

and still my pixie does not change into a pixie.....