Post by Werehound Silverfang on Jul 12, 2010 1:09:05 GMT
Success!
Ruh Roh!
Do I have to change the vaultpath for NWNx-Leto to start working?
The nwnx_funcs commands are working but leto stopped.
OnAcquierdItem
OnClientEnter
OnClientExit
OnModuleLoad
Some notes:
"ws_include" contains "fky_chat_inc" which has the "Leto(string sScript)" which is identical to HGLL's "LetoScript(string sScript)" except in name. I replaced the "LetoScript" command in OnClientExit because it was just using an extra include including "hgll_leto_inc"
Ruh Roh!
Do I have to change the vaultpath for NWNx-Leto to start working?
The nwnx_funcs commands are working but leto stopped.
OnAcquierdItem
#include "x2_inc_switches"
// Returns the spell that applied a Polymorph Effect currently on the player.
// -1 if it was no spell, -2 if no polymorph effect found.
int ScanForPolymorphEffect(object oPC);
string GetBaseItemTypeName(object oItem){
int nStrRef = StringToInt(Get2DAString("baseitems", "Name", GetBaseItemType(oItem)));
return GetStringByStrRef(nStrRef);
}
void main()
{
object oPC = GetModuleItemAcquiredBy();
if(!GetIsPC(oPC)) return;
if(GetIsDM(oPC) ||GetIsDMPossessed(oPC)) return;
object oItem = GetModuleItemAcquired();
string sRecieved = GetName(oItem);
string sType = GetBaseItemTypeName(oItem);
if(GetLocalInt(oPC, "ShoutTimer") != 1)
{
SetLocalInt(oPC, "ShoutTimer", 1);
if (GetStringLength(sRecieved) >= 1 && IsInConversation(oPC) == FALSE && GetIdentified(oItem) == TRUE){
AssignCommand(oPC, ActionSpeakString("I found a " + sRecieved + "!", TALKVOLUME_TALK));
}
else if (GetStringLength(sRecieved) >= 1 && IsInConversation(oPC) == FALSE && GetIdentified(oItem) == FALSE){
AssignCommand(oPC, ActionSpeakString("I found an unidentified " + sType + "!", TALKVOLUME_TALK));
}
else if (GetStringLength(sRecieved) <= 1 && IsInConversation(oPC) == FALSE){
AssignCommand(oPC, ActionSpeakString("I found some gold!", TALKVOLUME_TALK));
}
DelayCommand(0.1, DeleteLocalInt(oPC, "ShoutTimer"));
if (!GetIsInCombat(oPC) && ScanForPolymorphEffect(oPC) < 0)
ExportSingleCharacter(oPC);
}
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACQUIRE);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
}
}
// Returns the spell that applied a Polymorph Effect currently on the player.
// -1 if it was no spell, -2 if no polymorph effect found.
int ScanForPolymorphEffect(object oPC)
{
effect eInvalid;
effect eEffect = GetFirstEffect(oPC);
while ( GetIsEffectValid(eEffect) )
{
if ( GetEffectType( eEffect ) == EFFECT_TYPE_POLYMORPH )
{
return GetEffectSpellId(eEffect);
}
eEffect = GetNextEffect(oPC);
}
return -2;
}
OnClientEnter
#include "ws_include"
void main()
{
//Declare Major Variables..
object oPC = GetEnteringObject();
object oTarget;
object oPlayer = oPC;
string sCDKey = GetPCPublicCDKey(oPC);
Speech_OnClientEnter(oPC);
int nPerm, nPerm2;
if (USING_NWNX_DB)
{
nPerm = GetPersistentInt(GetModule(), "FKY_CHT_BANSHOUT" + sCDKey);
nPerm2 = GetPersistentInt(GetModule(), "FKY_CHT_BANPLAYER" + sCDKey);;
if (ENABLE_LANGUAGES) DoLanguageSetupNWNX(oPC);
}
else //using Bioware db
{
nPerm = GetCampaignInt("FKY_CHT", "FKY_CHT_BANSHOUT" + sCDKey);
nPerm2 = GetCampaignInt("FKY_CHT", "FKY_CHT_BANPLAYER" + sCDKey);
if (ENABLE_LANGUAGES) DoLanguageSetupBio(oPC);
}
if (nPerm) SetLocalInt(oPC, "FKY_CHT_BANSHOUT", TRUE);
if (nPerm2 || GetLocalInt(oPC, "FKY_CHT_BANPLAYER")) DoBoot(oPC);//Boot them if Valid Object
if (VAULTPATH_CHAT != "")
{
string Script = GetLocalString(oPC, "LetoScript");
if( Script != "" ) SetLocalString(oPC, "LetoScript", "");
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//This is for the rest of the script, if it's not a PC stop here!
if(!GetIsPC(oPC))return;
AddJournalQuestEntry("impinfo", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("spells", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("classes", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("classes2", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("classes3", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("legendarylevels", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("requirements", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("socketsystem", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("paragons", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("bll", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("donation", 1, oPC, FALSE, FALSE);
////////////////////////////////////////////////////////////////////////
DelayCommand(10.0, ApplyBonuses(oPC));
if (GetSubRace(oPC) == "Paragon" && GetXP(oPC) == 0){
ModifyAbilityScore(oPC, ABILITY_CHARISMA, 8);
ModifyAbilityScore(oPC, ABILITY_CONSTITUTION, 8);
ModifyAbilityScore(oPC, ABILITY_DEXTERITY, 8);
ModifyAbilityScore(oPC, ABILITY_INTELLIGENCE, 8);
ModifyAbilityScore(oPC, ABILITY_STRENGTH, 8);
ModifyAbilityScore(oPC, ABILITY_WISDOM, 8);
ModifySkillRank (oPC, SKILL_ANIMAL_EMPATHY, 6);
ModifySkillRank (oPC, SKILL_APPRAISE, 6);
ModifySkillRank (oPC, SKILL_BLUFF, 6);
ModifySkillRank (oPC, SKILL_CONCENTRATION, 6);
ModifySkillRank (oPC, SKILL_CRAFT_ARMOR, 6);
ModifySkillRank (oPC, SKILL_CRAFT_TRAP, 6);
ModifySkillRank (oPC, SKILL_CRAFT_WEAPON, 6);
ModifySkillRank (oPC, SKILL_DISABLE_TRAP, 6);
ModifySkillRank (oPC, SKILL_DISCIPLINE, 6);
ModifySkillRank (oPC, SKILL_HEAL, 6);
ModifySkillRank (oPC, SKILL_HIDE, 6);
ModifySkillRank (oPC, SKILL_INTIMIDATE, 6);
ModifySkillRank (oPC, SKILL_LISTEN, 6);
ModifySkillRank (oPC, SKILL_LORE, 6);
ModifySkillRank (oPC, SKILL_MOVE_SILENTLY, 6);
ModifySkillRank (oPC, SKILL_OPEN_LOCK, 6);
ModifySkillRank (oPC, SKILL_PARRY, 6);
ModifySkillRank (oPC, SKILL_PERFORM, 6);
ModifySkillRank (oPC, SKILL_PERSUADE, 6);
ModifySkillRank (oPC, SKILL_PICK_POCKET, 6);
ModifySkillRank (oPC, SKILL_RIDE, 6);
ModifySkillRank (oPC, SKILL_SEARCH, 6);
ModifySkillRank (oPC, SKILL_SPELLCRAFT, 6);
ModifySkillRank (oPC, SKILL_SET_TRAP, 6);
ModifySkillRank (oPC, SKILL_SPOT, 6);
ModifySkillRank (oPC, SKILL_TAUNT, 6);
ModifySkillRank (oPC, SKILL_TUMBLE, 6);
ModifySkillRank (oPC, SKILL_USE_MAGIC_DEVICE, 6);
AddKnownFeat(oPC, FEAT_WEAPON_PROFICIENCY_EXOTIC);
AddKnownFeat(oPC, FEAT_ARMOR_PROFICIENCY_HEAVY);
AddKnownFeat(oPC, FEAT_ARMOR_PROFICIENCY_LIGHT);
AddKnownFeat(oPC, FEAT_ARMOR_PROFICIENCY_MEDIUM);
AddKnownFeat(oPC, FEAT_SHIELD_PROFICIENCY);
AddKnownFeat(oPC, FEAT_WEAPON_PROFICIENCY_MARTIAL);
GiveXPToCreature(oPC, 1);
return;
}
}
OnClientExit
#include "ws_include"
void main()
{
object PC = GetExitingObject();
Speech_OnClientExit(PC);
string Script = GetLocalString(PC, "LetoScript");
if( Script != "" ){
Leto(Script);
SetLocalString(PC, "LetoScript", "");
}
}
OnModuleLoad
//Script Name: onmoduleload
////////////////////////////////////////
#include "x2_inc_switches"
#include "ws_include"
#include "nwnx_defenses"
void main()
{
//Initialize NWNX DB support
SQLInit();
// Init placeholders for chat gateway
InitSpeech();
SetDefenseOption (NWNX_DEFENSES_OPT_SNEAKATT_IGNORE_CRIT_IMM, 1);
SetDefenseOption (NWNX_DEFENSES_OPT_DEATHATT_IGNORE_CRIT_IMM, 1);
ApplyEffectsToObjectInArea(GetObjectByTag("HallsoftheUnderworld"));
//////////////////////////////////////////////////////////////////////////////
STANDARD BIOWARE XP2 FUNCTIONS
//////////////////////////////////////////////////////////////////////////////
if (GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT)
{
SetModuleSwitch (MODULE_SWITCH_ENABLE_UMD_SCROLLS, TRUE);
}
SetModuleSwitch (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE);
SetLocalInt(GetModule(), "X2_L_NOTREASURE", TRUE);
ExecuteScript("module_hb", GetModule());
}
Some notes:
"ws_include" contains "fky_chat_inc" which has the "Leto(string sScript)" which is identical to HGLL's "LetoScript(string sScript)" except in name. I replaced the "LetoScript" command in OnClientExit because it was just using an extra include including "hgll_leto_inc"