Rune_PRC8/_module/nss/fes_mod_onenter.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

192 lines
7.4 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
// First Enter Strip - On Client Enter
// fes_mod_onenter
// By Don Anderson
// dandersonru@msn.com
//
// We want strip the New Players who have ZERO XP
// and give them some Gold and some XP.
//
// NOTE: Make sure a Merchant is close to the Start area
// So the Player can purchase some supplies.
//
// NEW! Now this is PHB Compatible...just set the PHB Switches in opw_mod_onload
//
// Place this script in the Module On Enter Event
/*
INFORMATION:
Amount of XP to Give to set the Initial Level
L1 = 1
L2 = 1000
L3 = 3000
L4 = 6000
L5 = 10000
L6 = 15000
L7 = 21000
L8 = 28000
L9 = 36000
L10 = 45000
L11 = 55000
L12 = 66000
L13 = 78000
L14 = 91000
L15 = 105000
L16 = 120000
L17 = 136000
L18 = 153000
L19 = 171000
L20 = 190000
L21 = 210000
L22 = 231000
L23 = 253000
L24 = 276000
L25 = 300000
L26 = 325000
L27 = 351000
L28 = 378000
L29 = 406000
L30 = 435000
L31 = 465000
L32 = 496000
L33 = 528000
L34 = 561000
L35 = 595000
L36 = 630000
L37 = 666000
L38 = 703000
L39 = 741000
L40 = 780000
*/
//
////////////////////////////////////////////////////////////////////////////////
#include "nbde_inc"
void main()
{
object oPC = GetEnteringObject();
object oMod = GetModule();
int nBSSys = GetLocalInt(oMod,"BS_ENABLE");
int nXP = GetLocalInt(oMod,"STARTXP");
int nPHBStrip = GetLocalInt(oMod,"PHBSTRIP");
int nGiveGold = GetLocalInt(oMod,"GIVEGOLD");
//Don't go further if this is not a Player
if(!GetIsPC(oPC)) return;
if(GetIsDM(oPC)) return;
//Now we check to see if the are still in the Tutorial Area
/* int nTutor = NBDE_GetCampaignInt("OPW","TUTORIAL",oPC);
object oSTutor = GetObjectByTag("STARTTUTORIAL");//To the Tutorial Area
if(nTutor == 1 && GetIsObjectValid(oSTutor) == TRUE)
{
effect eFX1 = EffectVisualEffect(VFX_IMP_BREACH);
effect eFX2 = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
effect eFX3 = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
effect eFX4 = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2);
effect eFX5 = EffectVisualEffect(VFX_IMP_RESTORATION_GREATER);
effect eFX6 = EffectVisualEffect(VFX_IMP_HEALING_G);
float fDelay = 1.5;
SendMessageToPC(oPC,"You did not leave the Tutorial Properly....so you are going back.");
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX1, oPC));
DelayCommand(fDelay + 1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX2, oPC));
DelayCommand(fDelay + 2.0, AssignCommand(oPC, ActionJumpToLocation(GetLocation(oSTutor))));
DelayCommand(fDelay + 3.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oPC, 3.0));
DelayCommand(fDelay + 4.0, ApplyEffectToObject (DURATION_TYPE_INSTANT, eFX3, oPC));
DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oPC, 5.0));
DelayCommand(fDelay + 6.0, ApplyEffectToObject (DURATION_TYPE_INSTANT, eFX4, oPC));
DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oPC)), oPC));
return;
} */
//Set XP here to the Mod for Binding Stone OnEnter
//SetLocalInt(oMod,"STARTXP",nXP);
//Check to see if the Player is New or not
int nNewXP = GetXP(oPC);
if(nNewXP == 0)
{
//Now we Destroy all the objects in the inventory
object oItem = GetFirstItemInInventory(oPC);
while (oItem != OBJECT_INVALID)
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARMS, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_NECK, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOOTS, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_HEAD, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BELT, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOLTS, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARROWS, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BULLETS, oPC), 0.0);
//Now we give the Player the amount of XP above IF Binding Stones is OFF
GiveXPToCreature(oPC, nXP);
//Give Gold for Starting Characters PHB Rules
if(nPHBStrip == 1)
{
if(GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC)) nGiveGold = d4(4)*10;
else if(GetLevelByClass(CLASS_TYPE_BARD, oPC)) nGiveGold = d4(4)*10;
else if(GetLevelByClass(CLASS_TYPE_CLERIC, oPC)) nGiveGold = d4(5)*10;
else if(GetLevelByClass(CLASS_TYPE_DRUID, oPC)) nGiveGold = d4(2)*10;
else if(GetLevelByClass(CLASS_TYPE_FIGHTER, oPC)) nGiveGold = d4(6)*10;
else if(GetLevelByClass(CLASS_TYPE_MONK, oPC)) nGiveGold = d4(5);
else if(GetLevelByClass(CLASS_TYPE_PALADIN, oPC)) nGiveGold = d4(6)*10;
else if(GetLevelByClass(CLASS_TYPE_RANGER, oPC)) nGiveGold = d4(6)*10;
else if(GetLevelByClass(CLASS_TYPE_ROGUE, oPC)) nGiveGold = d4(5)*10;
else if(GetLevelByClass(CLASS_TYPE_SORCERER, oPC)) nGiveGold = d4(3)*10;
else if(GetLevelByClass(CLASS_TYPE_WIZARD, oPC)) nGiveGold = d4(3)*10;
else nGiveGold = d4(4)*10;
}
//Give Gold for Starting Characters Standard Amount
if(nPHBStrip == 0 && nGiveGold == 0)
{
//Change Gold for Level 2 and Up
if ((nXP >= 1000) && (nXP < 3000)) nGiveGold = 900;
else if ((nXP >= 3000) && (nXP < 6000)) nGiveGold = 2700;
else if ((nXP >= 6000) && (nXP < 10000)) nGiveGold = 5400;
else if ((nXP >= 10000) && (nXP < 15000)) nGiveGold = 9000;
else if ((nXP >= 15000) && (nXP < 21000)) nGiveGold = 13000;
else if ((nXP >= 21000) && (nXP < 28000)) nGiveGold = 19000;
else if ((nXP >= 28000) && (nXP < 36000)) nGiveGold = 27000;
else if ((nXP >= 36000) && (nXP < 45000)) nGiveGold = 36000;
else if ((nXP >= 45000) && (nXP < 55000)) nGiveGold = 49000;
else if ((nXP >= 55000) && (nXP < 66000)) nGiveGold = 66000;
else if ((nXP >= 66000) && (nXP < 78000)) nGiveGold = 88000;
else if ((nXP >= 78000) && (nXP < 91000)) nGiveGold = 110000;
else if ((nXP >= 91000) && (nXP < 105000)) nGiveGold = 150000;
else if ((nXP >= 105000) && (nXP < 120000)) nGiveGold = 200000;
else if ((nXP >= 120000) && (nXP < 136000)) nGiveGold = 260000;
else if ((nXP >= 136000) && (nXP < 153000)) nGiveGold = 340000;
else if ((nXP >= 153000) && (nXP < 171000)) nGiveGold = 440000;
else if ((nXP >= 171000) && (nXP < 190000)) nGiveGold = 580000;
else if (nXP >= 190000) nGiveGold = 760000;
}
//How much gold does the Player already have?
int nGold = GetGold(oPC);
//Too much Gold
if (nGold > nGiveGold)
{
AssignCommand(oPC, TakeGoldFromCreature(nGold - nGiveGold, oPC, TRUE));
}
//Not enough Gold
else if (nGold < nGiveGold)
{
GiveGoldToCreature(oPC, nGiveGold - nGold);
}
}
}