added things

added a crafting tool merchant,
added a training hall (not quite working yet)
fixed crafting issues,
exchanged the small cave area
This commit is contained in:
2024-09-01 14:11:15 -04:00
parent 65af23f08d
commit 7030eb2235
335 changed files with 55956 additions and 3946 deletions

View File

@@ -11,17 +11,12 @@
//:: Created On: Oct 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
object CreatePlaceable(string sObject, location lPlace, float fDuration);
void RewardCombatXP(object oKiller, object oVictim = OBJECT_SELF);
void main()
{
object oKiller = GetLastKiller();
SetIsDestroyable(FALSE,FALSE,FALSE);
ExecuteScript("sf_xp", OBJECT_SELF);
SetIsDestroyable(FALSE,FALSE,FALSE);
DelayCommand(120.0,SetIsDestroyable(TRUE,FALSE,FALSE));
DelayCommand(121.0,DestroyObject(OBJECT_SELF));
object oTemp = CreatePlaceable("corpse",GetLocation(OBJECT_SELF),120.0);
@@ -53,6 +48,13 @@ void main()
SetLocalObject(oTemp,"oCorpse",OBJECT_SELF);
SetLocalInt(oTemp,"iPenalty",200);
}
if (sResSelf == "bearblck002")
{
SetLocalString(oTemp,"sPelt","pelt002");
SetLocalString(oTemp,"sMeat","meat002");
SetLocalObject(oTemp,"oCorpse",OBJECT_SELF);
SetLocalInt(oTemp,"iPenalty",200);
}
if (sResSelf == "bearbrwn001")
{
SetLocalString(oTemp,"sPelt","pelt001");
@@ -109,6 +111,21 @@ void main()
SetLocalObject(oTemp,"oCorpse",OBJECT_SELF);
SetLocalInt(oTemp,"iPenalty",50);
}
if (sResSelf == "wolf002")
{
SetLocalString(oTemp,"sPelt","pelt008");
SetLocalString(oTemp,"sMeat","meat008");
SetLocalObject(oTemp,"oCorpse",OBJECT_SELF);
SetLocalInt(oTemp,"iPenalty",50);
}
if (sResSelf == "direwolf002")
{
SetLocalString(oTemp,"sPelt","pelt010");
SetLocalString(oTemp,"sMeat","meat010");
SetLocalObject(oTemp,"oCorpse",OBJECT_SELF);
SetLocalInt(oTemp,"iPenalty",500);
}
if (sResSelf == "worg001")
{
SetLocalString(oTemp,"sPelt","pelt009");
@@ -234,120 +251,12 @@ void main()
{
SignalEvent(GetAreaFromLocation(GetLocation(OBJECT_SELF)), EventUserDefined(1007));
}
RewardCombatXP(oKiller);
ExecuteScript("prc_npc_death", OBJECT_SELF);
}
object CreatePlaceable(string sObject, location lPlace, float fDuration)
{
object oPlaceable = CreateObject(OBJECT_TYPE_PLACEABLE,sObject,lPlace,FALSE);
if (fDuration != 0.0)
DestroyObject(oPlaceable,fDuration);
return oPlaceable;
}
void RewardCombatXP(object oKiller, object oVictim = OBJECT_SELF)
{
int noleech = 0;
float BaseEXP = ((GetChallengeRating(oVictim)*5.0)+2);
float BonusEXP = ((GetChallengeRating(oVictim)*2.0)+5);
float BaseMonEXP = BaseEXP;
int NumOfParty = 0;
float PartyLevelSum = 0.0;
object oPartyMember = GetFirstFactionMember(oKiller, TRUE);
while(GetIsObjectValid(oPartyMember)) {
if (GetArea(oVictim) == GetArea(oPartyMember))
{
int leech = GetHitDice(oPartyMember);
if (leech >= noleech){
noleech = leech;
}
NumOfParty++;
PartyLevelSum += GetCharacterLevel(oPartyMember);
}
oPartyMember = GetNextFactionMember(oKiller, TRUE);
}
if (PartyLevelSum <= 1.0)
{
PartyLevelSum = 1.0;
}
if (NumOfParty <= 1)
{
NumOfParty = 1;
}
float PartyAvgLvl = PartyLevelSum / NumOfParty;
//Calculate Adjustment Value
if (PartyAvgLvl <= 1.0)
{
PartyAvgLvl = 1.0;
}
float x = GetChallengeRating(oVictim);
if (x <= 1.0)
{
x = 1.0;
}
float z = (x / PartyAvgLvl);
float AdjustValue = ((z+2)/3);
float FinalMonValue;
//Determine Final Experience Value
if (AdjustValue == 0.0) {
FinalMonValue = BaseMonEXP;
} else {
if (AdjustValue < 1.0) {
FinalMonValue = BaseMonEXP * AdjustValue;
} else {
FinalMonValue = BaseMonEXP + (BonusEXP * (AdjustValue * (1.10)));
}
}
//Determine the value of the Split EXP
if (NumOfParty >= 8)
{
NumOfParty = 8;
}
if (NumOfParty <= 1)
{
NumOfParty = 1;
}
if (FinalMonValue <= 1.0)
{
FinalMonValue = 1.0;
}
float SplitFinalEXP = FinalMonValue / NumOfParty;
if (SplitFinalEXP <= 1.0)
{
SplitFinalEXP = 1.0;
}
float y = (FinalMonValue - SplitFinalEXP);
if (y <= 1.0)
{
y = 1.0;
}
if (PartyAvgLvl >= 15.0)
{
FinalMonValue = FinalMonValue - ( PartyAvgLvl);
}
float PartyBonus = ((y +1)/ 1.75) + (FinalMonValue + ((21-PartyAvgLvl)/3));
int SFEint = FloatToInt(PartyBonus);
//Distribute EXP to all PCs in the Party
oPartyMember = GetFirstFactionMember(oKiller, TRUE);
while (GetIsObjectValid(oPartyMember))
{
if (GetArea(OBJECT_SELF) == GetArea(oPartyMember)) {
int nHD = GetHitDice(oPartyMember) + 1;
int nMax = (((nHD * (nHD - 1)) / 2) * 1000)+1;
if (nMax <= GetXP(oPartyMember) && nHD <= 40) {
SendMessageToPC(oPartyMember, "You cannot gain experience until you have leveled.");
} else if (GetIsDead(oPartyMember)) {
SendMessageToPC(oPartyMember, "You cannot gain experience while dead. Your XP has been reset.");
} else if ((GetHitDice(oPartyMember)) <= (noleech - 7) || (GetHitDice(oPartyMember)) >= FloatToInt(PartyAvgLvl) + 7) {
SendMessageToPC(oPartyMember, "All party members must be within 6 levels of each other.");
} else {
GiveXPToCreature(oPartyMember, SFEint);
}
}
oPartyMember = GetNextFactionMember(oKiller, TRUE);
}
}