Adding xp for unlocking doors and traps etc.
#1
Posté 04 mai 2011 - 09:41
bb_give_xp_onunlock
bb_give_xp_ondisarm
However, i don't have them in my list (when the little arrow is clicked to bring up a list of scripts to choose from in the properties)
1. Why are they not there?
2. Is it ok to just type them in instead?
THANKS for any help - M
#2
Posté 04 mai 2011 - 10:01
#3
Posté 04 mai 2011 - 10:10
I think they eventually added a couple of standard gp (I think) scripts that work similarly, although not exactly the same algorithm as mine. You could probably find those by using the Open Conversation/Script menu option and typing in lock. (I don't have access to the toolset at the moment).
Regards
Modifié par Kaldor Silverwand, 04 mai 2011 - 10:10 .
#4
Posté 04 mai 2011 - 10:50
Modifié par DannJ, 04 mai 2011 - 10:51 .
#5
Posté 04 mai 2011 - 10:57
Modifié par maglalosus, 04 mai 2011 - 11:01 .
#6
Posté 05 mai 2011 - 02:06
In contrast my scripts (the versions included with King's Festival) allow an option of using a module variable to specify that xp should be given only to the character doing the action rather than the whole party. By default the xp is given to the whole party. Also my scripts give far less xp: for unlocking the xp earned is equal to the Unlock DC; for disarming the xp earned is 3 * the DisarmDC.
Regards
#7
Posté 05 mai 2011 - 02:20
#8
Posté 05 mai 2011 - 07:48
Shaughn78 wrote...
I have another variation of the trap disarm xp, if you want it I can post. It assigns a CR to each of the base type traps and increases and decreases it based on trap detect and disarm DC. DC is set closely to the 3.5 Dungeon Master Guide. XP is rewarded using the experience 2da, it it is rewarded similar to creatures. A lower level party will gain more experience than a higher level party disarming the same trap.
Shaughn - I would like to see that script!
#9
Posté 05 mai 2011 - 11:21
The nTrap is the trap_base_type_*** from the traps.2da
A local variable "set_cr" can be placed on individual traps. It will override the base trap CR, it is also required for script based traps.
As I said it uses the Dungeon Master Guide, Tables 3-13 and 3-14. Essentially the CR increaes +1 for every 7 points of average damage. "2d8 = 9 points average damage rounded down +1 CR". For Spell traps spell level = CR.
/*
Written by Shaughn
For the Risen Hero Campaign
calculates trap CR and provides xp to party
*/
#include "ginc_2da"
int GetTrapXP(object oDisarm,int nTotalCR);
void GiveXP(int nXP);
void main()
{
object oDisarm = GetLastDisarmed();
int nLevel = GetTotalLevels(oDisarm,TRUE);
int nDC = GetTrapDisarmDC(OBJECT_SELF);
int nTrap = GetTrapBaseType(OBJECT_SELF);
int nDetect = GetTrapDetectDC(OBJECT_SELF);
int nSetCR = GetLocalInt(OBJECT_SELF,"set_cr");
int nCR;
int nInc1;
int nInc2;
int nTotalCR;
//based on trap base type sets CR, based on Dungeon Master's Guide 3.5
if(nTrap == 0)
{
nCR = 1;
}
else if(nTrap == 6 || nTrap == 5 || nTrap == 12 || nTrap == 4)
{
nCR = 2;
}
else if(nTrap == 8 || nTrap == 1 || nTrap == 24 || nTrap == 33
|| nTrap == 7 || nTrap == 32 || nTrap == 13)
{
nCR = 3;
}
else if(nTrap == 16 || nTrap == 2 || nTrap == 56)
{
nCR = 4;
}
else if(nTrap == 36 || nTrap == 37 || nTrap == 25 || nTrap == 17
|| nTrap == 34 || nTrap == 28 || nTrap == 29 || nTrap == 9)
{
nCR = 5;
}
else if(nTrap == 14 || nTrap == 57 || nTrap == 30)
{
nCR = 6;
}
else if(nTrap == 31 || nTrap == 38 || nTrap == 10 || nTrap == 40 || nTrap == 26)
{
nCR = 7;
}
else if(nTrap == 21 || nTrap == 35 || nTrap == 41 || nTrap == 11 || nTrap == 27)
{
nCR = 8;
}
else if(nTrap == 15 || nTrap == 20 || nTrap == 39 || nTrap == 18)
{
nCR = 9;
}
else if(nTrap == 42 || nTrap == 50)
{
nCR = 10;
}
else if(nTrap == 487 || nTrap == 3)
{
nCR = 11;
}
else if(nTrap == 22 || nTrap == 43)
{
nCR = 12;
}
else if(nTrap == 47 || nTrap == 49)
{
nCR = 13;
}
else if(nTrap == 19 || nTrap == 51)
{
nCR = 14;
}
else if(nTrap == 23)
{
nCR = 16;
}
else if(nTrap == 54)
{
nCR = 17;
}
else if(nTrap == 45 || nTrap == 55)
{
nCR = 19;
}
else if(nTrap == 52)
{
nCR = 21;
}
else if(nTrap == 53 || nTrap == 44)
{
nCR = 25;
}
else
{
nCR = 2;
}
//variable set on trap overrides CR, used on projectile traps
if(nSetCR != 0)
{
nCR = nSetCR;
}
//Modifies CR based on DC to disarm
if(nDC > 30)nInc1 = 2;
else if(nDC > 25)nInc1 = 1;
if(nDC < 15) nInc1 = -1;
//modifies CR based on DC to detect
if(nDetect > 30)nInc2 = 2;
else if(nDetect > 25)nInc1 = 1;
if(nDetect < 15) nInc1 = -1;
//total CR
nTotalCR = nCR + nInc1 + nInc2;
//Can't have trap with less than 1 CR
if(nTotalCR < 1)nTotalCR = 1;
//sets and gives xp
int nXP = GetTrapXP(oDisarm,nTotalCR);
GiveXP(nXP);
}
//Gets xp based on character level and trap CR using xptable 2da
int GetTrapXP(object oDisarm,int nTotalCR)
{
string sColumn = "C"+IntToString(nTotalCR)+"";
int nRow = GetTotalLevels(oDisarm,TRUE);
int nXP = Get2DAInt("xptable",sColumn,nRow);
//Debug
SendMessageToPC(oDisarm,"Character Level: "+IntToString(nRow)+". Trap CR: "+sColumn+". Experience Given "+IntToString(nXP)+".");
return nXP;
}
//gives xp to all party members
void GiveXP(int nXP)
{
object oPC = GetFirstPC();
object oMember = GetFirstFactionMember(oPC,FALSE);
while (GetIsObjectValid(oMember))
{
if(oPC != oMember)
{
GiveXPToCreature(oMember, nXP);
}
oMember = GetNextFactionMember(oPC,FALSE);
}
while (GetIsObjectValid(oPC))
{
if(oPC != oMember)
{
GiveXPToCreature(oPC, nXP);
}
oPC = GetNextPC();
}
}
Modifié par Shaughn78, 05 mai 2011 - 11:21 .
#10
Posté 05 mai 2011 - 06:51
#11
Posté 06 mai 2011 - 12:36
As for trap xp, I like the idea of having other sources of xp other than mostly relying on combat. While reloaded will ensure that a player gets all the xp and will exploit this type of xp rewards I still think it is a good thing.
Traps do offer a challange to a party, using consumables and spells to buff for disarming or healing after a failed attempt should offer some type of reward for traps.
I have a slightly different script for locks but it agains scales the xp based on the players unlock skill vs the lock dc. So a more expeirenced player will get less xp for the same door vs a lower level character. My unlock script only gives xp to the unlocking character and not the party and gives a bonus should a door be unlocked during combat since they actually have to roll instead of just getting 20.
Modifié par Shaughn78, 06 mai 2011 - 12:53 .
#12
Posté 06 mai 2011 - 07:05
Unlock:
const int DC_XP_MULTIPLIER = 10;
void main()
{
object oPC = GetLastUnlocked();
string sPC = "L" + GetName(oPC);
if (!GetLocalInt(OBJECT_SELF, sPC))
{
int iDC = GetLockUnlockDC(OBJECT_SELF);
int iXP = iDC * DC_XP_MULTIPLIER;
GiveXPToCreature(oPC, iXP);
SetLocalInt(OBJECT_SELF, sPC, 1);
}
}
Disarm:
const int DC_XP_MULTIPLIER = 10;
void main()
{
object oPC = GetLastDisarmed();
string sPC = "T" + GetName(oPC);
if (!GetLocalInt(OBJECT_SELF, sPC))
{
int iDC = GetTrapDisarmDC(OBJECT_SELF);
int iXP = iDC * DC_XP_MULTIPLIER;
GiveXPToCreature(oPC, iXP);
SetLocalInt(OBJECT_SELF, sPC, 1);
}
}
Modifié par GhostOfGod, 06 mai 2011 - 07:07 .
#13
Posté 06 mai 2011 - 07:39
GhostOfGod wrote...
Unlock:
const int DC_XP_MULTIPLIER = 10;
void main()
{
object oPC = GetLastUnlocked();
string sPC = "L" + GetName(oPC);
if (!GetLocalInt(OBJECT_SELF, sPC))
{
int iDC = GetLockUnlockDC(OBJECT_SELF);
int iXP = iDC * DC_XP_MULTIPLIER;
GiveXPToCreature(oPC, iXP);
SetLocalInt(OBJECT_SELF, sPC, 1);
}
}
Disarm:
const int DC_XP_MULTIPLIER = 10;
void main()
{
object oPC = GetLastDisarmed();
string sPC = "T" + GetName(oPC);
if (!GetLocalInt(OBJECT_SELF, sPC))
{
int iDC = GetTrapDisarmDC(OBJECT_SELF);
int iXP = iDC * DC_XP_MULTIPLIER;
GiveXPToCreature(oPC, iXP);
SetLocalInt(OBJECT_SELF, sPC, 1);
}
}
That looks nice and tidy GOG





Retour en haut






