Bienvenue sur JeuxOnLine - MMO, MMORPG et MOBA !
Les sites de JeuxOnLine...
 

Panneau de contrôle

Recherche | Retour aux forums

JOL Archives

[Script] Attribution d'expérience variant selon la difficulté à désarmer un piège

Par Daynos le 14/10/2002 à 11:29:39 (#2332335)

Sujet posté par Tonton


void main()
{
// declare variables being used
// nExp as integer for value of XP being assigned
int nExp;
// oPC is the creature object who disarmed the trap
object oPC = GetLastDisarmed();
// nTrapDC is the trap DC integer
int nTrapDC = GetTrapDisarmDC (GetObjectByTag ("TRAP_TAG_HERE"));
// declare value of nExp based on the trap's DC
if (nTrapDC 25) && (nTrapDC 30) && (nTrapDC < 36))
{
nExp = 300;
}
else
{
nExp = 400;
}
// once nExp is set, give that amount in XP to the PC
GiveXPToCreature (oPC, nExp);
}



A mettre dans l'evenement "OnDisarm" du piege
(c) dagid gaider



et un autre : pour les traps sur le "ondisarm"


// Disarm Trap XP award for Thieves
// Operates on this math: (TrapDC * XPMultiplier) - (ThiefLevel x Skill) = XP Award
// Created by Todmaerin 6/22/02
// Modified 6/30/02

object oThief = GetLastDisarmed();
void main()
{
string sThiefLevel;
int nPosition;
int nRogueTrue;
for (nPosition= 1; nPosition <= 3; nPosition ++)
{
nRogueTrue = GetLocalInt (oThief, IntToString (GetClassByPosition (nPosition, oThief) ));
};
if (nRogueTrue = CLASS_TYPE_ROGUE)
{
sThiefLevel = IntToString (GetLevelByClass (CLASS_TYPE_ROGUE, oThief));
int nDisarmSkill = GetSkillRank (SKILL_DISABLE_TRAP, oThief);
int nTrapDC = GetTrapDisarmDC(OBJECT_SELF);
float fXPMod = 1.2;
//the math
int nXPAward = FloatToInt ((nTrapDC * fXPMod) - (StringToInt(sThiefLevel) * nDisarmSkill));
GiveXPToCreature (oThief, nXPAward);
}
}


et pour les locks sur le onlock

//Unlock XP award for Thieves
//Operates on this math: (UnlockDC * XPMultiplier) - (ThiefLevel x Skill) = XP Award
//
// Created by Todmaerin 6/22/02
// Modified 6/30/02

object oThief = GetLastUnlocked();
void main()
{
string sThiefLevel;
int nPosition;
int nRogueTrue;
for (nPosition = 1; nPosition <= 3; nPosition ++)
{
nRogueTrue = GetLocalInt(oThief, IntToString (GetClassByPosition (nPosition, oThief) ));
};
if (nRogueTrue = CLASS_TYPE_ROGUE)
{
sThiefLevel = IntToString(GetLevelByClass (CLASS_TYPE_ROGUE, oThief) );
int nUnlockSkill = GetSkillRank (SKILL_OPEN_LOCK, oThief);
int nLockDC = GetLockUnlockDC (OBJECT_SELF);
float fXPMod = 1.2;
//the math
int nXPAward = FloatToInt ((nLockDC * fXPMod) - (StringToInt (sThiefLevel) * nUnlockSkill) );
GiveXPToCreature (oThief, nXPAward);
}
}

JOL Archives 1.0.1
@ JOL / JeuxOnLine