(script) xp lors d'un crochetage

Répondre
Partager Rechercher
Voilà deux scripts dont je me sers dans mon module "Tristram Nights" (un peu de pub n'a jamais fait de mal ^^).
Ils me permettent de récompenser les roublards dans leur art du crochetage / désamorçage.
Les scripts vérifient le niveau dans la compétence correspondante et allouent de l'expérience en fonction.

Code PHP:

////////////////////////////////////////////////////////////////////////////////
//:: script de recompense XP sur event OnDisarm
////////////////////////////////////////////////////////////////////////////////
void main()
{
object oThief GetLastDisarmed();
if(!
GetIsPC(oThief)) return;
int nThiefLevel GetLevelByClass(CLASS_TYPE_ROGUEoThief);
// Vérifier si l'objet a déjà été désamorcé
int nAlreadyDisarmed GetLocalInt(OBJECT_SELF"AlreadyDisarmed");
if (
nAlreadyDisarmed != 0) return;
// Niveau en désamorçage
int nDisarmSkill GetSkillRank(SKILL_DISABLE_TRAPoThief);
// DD du piège
int nTrapDC GetTrapDisarmDC(OBJECT_SELF);
float fXPMod 1.2;
int nXPAward FloatToInt((nTrapDC fXPMod) + (nThiefLevel nDisarmSkill));
int nPosition;
int nRogueTrue;
for (
nPosition 1nPosition <= 3nPosition ++)
{
nRogueTrue GetLocalInt(oThiefIntToString(GetClassByPosition(nPositionoThief)));
}
if (
nRogueTrue CLASS_TYPE_ROGUE)
{
GiveXPToCreature(oThiefnXPAward);
}
SetLocalInt(OBJECT_SELF"AlreadyDisarmed"1);

Code PHP:

////////////////////////////////////////////////////////////////////////////////
//:: script de recompense XP sur event OnUnlock coffres + portes
////////////////////////////////////////////////////////////////////////////////
void main()
{
object oThief GetLastUnlocked();
if(!
GetIsPC(oThief)) return;
int nThiefLevel GetLevelByClass(CLASS_TYPE_ROGUEoThief);
// Vérifier si l'objet a déjà été crocheté
int nAlreadyUnlocked GetLocalInt(OBJECT_SELF"AlreadyUnlocked");
if (
nAlreadyUnlocked != 0) return;
// Niveau en crochetage
int nUnlockSkill GetSkillRank(SKILL_OPEN_LOCKoThief);
// DD du crochetage porte/coffre
int nLockDC GetLockUnlockDC(OBJECT_SELF);
float fXPMod 1.2;
int nXPAward FloatToInt((nLockDC fXPMod) + (nThiefLevel nUnlockSkill));
int nPosition;
int nRogueTrue;
for (
nPosition 1nPosition <= 3nPosition ++)
{
nRogueTrue GetLocalInt(oThiefIntToString(GetClassByPosition(nPositionoThief)));
}
if (
nRogueTrue CLASS_TYPE_ROGUE)
{
GiveXPToCreature(oThiefnXPAward);
}
else
if (
nRogueTrue != CLASS_TYPE_ROGUE)
{
nXPAward FloatToInt((nLockDC fXPMod) + nUnlockSkill);
GiveXPToCreature(oThiefnXPAward);
}
SetLocalInt(OBJECT_SELF"AlreadyUnlocked"1);

Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés