mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 17:38:26 +00:00
Converted SkillType typedef enumeration to SkillUseTypes enumeration
This commit is contained in:
+51
-51
@@ -1232,7 +1232,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
|
||||
if(IsTracking() && ((x_pos!=ppu->x_pos) || (y_pos!=ppu->y_pos))){
|
||||
if(MakeRandomFloat(0, 100) < 70)//should be good
|
||||
CheckIncreaseSkill(TRACKING, nullptr, -20);
|
||||
CheckIncreaseSkill(SkillTracking, nullptr, -20);
|
||||
}
|
||||
|
||||
// Break Hide if moving without sneaking and set rewind timer if moved
|
||||
@@ -1275,7 +1275,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
{
|
||||
if(zone->watermap->InLiquid(x_pos, y_pos, z_pos))
|
||||
{
|
||||
CheckIncreaseSkill(SWIMMING, nullptr, -17);
|
||||
CheckIncreaseSkill(SkillSwimming, nullptr, -17);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2591,7 +2591,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
if(!HasSkill(BEGGING) || !GetTarget())
|
||||
if(!HasSkill(SkillBegging) || !GetTarget())
|
||||
return;
|
||||
|
||||
if(GetTarget()->GetClass() == LDON_TREASURE)
|
||||
@@ -2629,7 +2629,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
uint16 CurrentSkill = GetSkill(BEGGING);
|
||||
uint16 CurrentSkill = GetSkill(SkillBegging);
|
||||
|
||||
float ChanceToBeg=((float)(CurrentSkill/700.0f) + 0.15f) * 100;
|
||||
|
||||
@@ -2651,7 +2651,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app)
|
||||
}
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
CheckIncreaseSkill(BEGGING, nullptr, -10);
|
||||
CheckIncreaseSkill(SkillBegging, nullptr, -10);
|
||||
}
|
||||
|
||||
void Client::Handle_OP_TestBuff(const EQApplicationPacket *app)
|
||||
@@ -2914,7 +2914,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
|
||||
if (sa->type == AT_Invis) {
|
||||
if(sa->parameter != 0)
|
||||
{
|
||||
if(!HasSkill(HIDE) && GetSkill(HIDE) == 0)
|
||||
if(!HasSkill(SkillHide) && GetSkill(SkillHide) == 0)
|
||||
{
|
||||
if(GetClientVersion() < EQClientSoF)
|
||||
{
|
||||
@@ -3015,7 +3015,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
|
||||
else if (sa->type == AT_Sneak) {
|
||||
if(sa->parameter != 0)
|
||||
{
|
||||
if(!HasSkill(SNEAK))
|
||||
if(!HasSkill(SkillSneak))
|
||||
{
|
||||
char *hack_str = nullptr;
|
||||
MakeAnyLenString(&hack_str, "Player sent OP_SpawnAppearance with AT_Sneak: %i", sa->parameter);
|
||||
@@ -3099,7 +3099,7 @@ void Client::Handle_OP_Death(const EQApplicationPacket *app)
|
||||
return;
|
||||
|
||||
Mob* killer = entity_list.GetMob(ds->killer_id);
|
||||
Death(killer, ds->damage, ds->spell_id, (SkillType)ds->attack_skill);
|
||||
Death(killer, ds->damage, ds->spell_id, (SkillUseTypes)ds->attack_skill);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3354,8 +3354,8 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app)
|
||||
|
||||
//BreakInvis();
|
||||
|
||||
uint16 primfeign = GetSkill(FEIGN_DEATH);
|
||||
uint16 secfeign = GetSkill(FEIGN_DEATH);
|
||||
uint16 primfeign = GetSkill(SkillFeignDeath);
|
||||
uint16 secfeign = GetSkill(SkillFeignDeath);
|
||||
if (primfeign > 100) {
|
||||
primfeign = 100;
|
||||
secfeign = secfeign - 100;
|
||||
@@ -3373,13 +3373,13 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app)
|
||||
SetFeigned(true);
|
||||
}
|
||||
|
||||
CheckIncreaseSkill(FEIGN_DEATH, nullptr, 5);
|
||||
CheckIncreaseSkill(SkillFeignDeath, nullptr, 5);
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_Sneak(const EQApplicationPacket *app)
|
||||
{
|
||||
if(!HasSkill(SNEAK) && GetSkill(SNEAK) == 0) {
|
||||
if(!HasSkill(SkillSneak) && GetSkill(SkillSneak) == 0) {
|
||||
return; //You cannot sneak if you do not have sneak
|
||||
}
|
||||
|
||||
@@ -3403,9 +3403,9 @@ void Client::Handle_OP_Sneak(const EQApplicationPacket *app)
|
||||
safe_delete(outapp);
|
||||
}
|
||||
else {
|
||||
CheckIncreaseSkill(SNEAK, nullptr, 5);
|
||||
CheckIncreaseSkill(SkillSneak, nullptr, 5);
|
||||
}
|
||||
float hidechance = ((GetSkill(SNEAK)/300.0f) + .25) * 100;
|
||||
float hidechance = ((GetSkill(SkillSneak)/300.0f) + .25) * 100;
|
||||
float random = MakeRandomFloat(0, 99);
|
||||
if(!was && random < hidechance) {
|
||||
sneaking = true;
|
||||
@@ -3434,7 +3434,7 @@ void Client::Handle_OP_Sneak(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_Hide(const EQApplicationPacket *app)
|
||||
{
|
||||
if(!HasSkill(HIDE) && GetSkill(HIDE) == 0)
|
||||
if(!HasSkill(SkillHide) && GetSkill(SkillHide) == 0)
|
||||
{
|
||||
//Can not be able to train hide but still have it from racial though
|
||||
return; //You cannot hide if you do not have hide
|
||||
@@ -3447,9 +3447,9 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
|
||||
int reuse = HideReuseTime - GetAA(209);
|
||||
p_timers.Start(pTimerHide, reuse-1);
|
||||
|
||||
float hidechance = ((GetSkill(HIDE)/250.0f) + .25) * 100;
|
||||
float hidechance = ((GetSkill(SkillHide)/250.0f) + .25) * 100;
|
||||
float random = MakeRandomFloat(0, 100);
|
||||
CheckIncreaseSkill(HIDE, nullptr, 5);
|
||||
CheckIncreaseSkill(SkillHide, nullptr, 5);
|
||||
if (random < hidechance) {
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
||||
SpawnAppearance_Struct* sa_out = (SpawnAppearance_Struct*)outapp->pBuffer;
|
||||
@@ -3470,7 +3470,7 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
|
||||
SimpleMessage_Struct *msg=(SimpleMessage_Struct *)outapp->pBuffer;
|
||||
msg->color=0x010E;
|
||||
if (!auto_attack && entity_list.Fighting(this)) {
|
||||
if (MakeRandomInt(0, 260) < (int)GetSkill(HIDE)) {
|
||||
if (MakeRandomInt(0, 260) < (int)GetSkill(SkillHide)) {
|
||||
msg->string_id=343;
|
||||
entity_list.Evade(this);
|
||||
} else {
|
||||
@@ -3753,14 +3753,14 @@ void Client::Handle_OP_LDoNSenseTraps(const EQApplicationPacket *app)
|
||||
Mob * target = GetTarget();
|
||||
if(target->IsNPC())
|
||||
{
|
||||
if(HasSkill(SENSE_TRAPS))
|
||||
if(HasSkill(SkillSenseTraps))
|
||||
{
|
||||
if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
{
|
||||
Message(13, "%s is too far away.", target->GetCleanName());
|
||||
return;
|
||||
}
|
||||
HandleLDoNSenseTraps(target->CastToNPC(), GetSkill(SENSE_TRAPS), LDoNTypeMechanical);
|
||||
HandleLDoNSenseTraps(target->CastToNPC(), GetSkill(SkillSenseTraps), LDoNTypeMechanical);
|
||||
}
|
||||
else
|
||||
Message(13, "You do not have the sense traps skill.");
|
||||
@@ -3772,14 +3772,14 @@ void Client::Handle_OP_LDoNDisarmTraps(const EQApplicationPacket *app)
|
||||
Mob * target = GetTarget();
|
||||
if(target->IsNPC())
|
||||
{
|
||||
if(HasSkill(DISARM_TRAPS))
|
||||
if(HasSkill(SkillDisarmTraps))
|
||||
{
|
||||
if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
{
|
||||
Message(13, "%s is too far away.", target->GetCleanName());
|
||||
return;
|
||||
}
|
||||
HandleLDoNDisarm(target->CastToNPC(), GetSkill(DISARM_TRAPS), LDoNTypeMechanical);
|
||||
HandleLDoNDisarm(target->CastToNPC(), GetSkill(SkillDisarmTraps), LDoNTypeMechanical);
|
||||
}
|
||||
else
|
||||
Message(13, "You do not have the disarm trap skill.");
|
||||
@@ -3791,14 +3791,14 @@ void Client::Handle_OP_LDoNPickLock(const EQApplicationPacket *app)
|
||||
Mob * target = GetTarget();
|
||||
if(target->IsNPC())
|
||||
{
|
||||
if(HasSkill(PICK_LOCK))
|
||||
if(HasSkill(SkillPickLock))
|
||||
{
|
||||
if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
{
|
||||
Message(13, "%s is too far away.", target->GetCleanName());
|
||||
return;
|
||||
}
|
||||
HandleLDoNPickLock(target->CastToNPC(), GetSkill(PICK_LOCK), LDoNTypeMechanical);
|
||||
HandleLDoNPickLock(target->CastToNPC(), GetSkill(SkillPickLock), LDoNTypeMechanical);
|
||||
}
|
||||
else
|
||||
Message(13, "You do not have the pick locks skill.");
|
||||
@@ -4643,9 +4643,9 @@ void Client::Handle_OP_DeleteItem(const EQApplicationPacket *app)
|
||||
const ItemInst *inst = GetInv().GetItem(alc->from_slot);
|
||||
if (inst && inst->GetItem()->ItemType == ItemTypeAlcohol) {
|
||||
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), inst->GetItem()->Name);
|
||||
CheckIncreaseSkill(ALCOHOL_TOLERANCE, nullptr, 25);
|
||||
CheckIncreaseSkill(SkillAlcoholTolerance, nullptr, 25);
|
||||
|
||||
int16 AlcoholTolerance = GetSkill(ALCOHOL_TOLERANCE);
|
||||
int16 AlcoholTolerance = GetSkill(SkillAlcoholTolerance);
|
||||
int16 IntoxicationIncrease;
|
||||
|
||||
if(GetClientVersion() < EQClientSoD)
|
||||
@@ -7574,7 +7574,7 @@ void Client::Handle_OP_Forage(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
||||
{
|
||||
if(!HasSkill(MEND))
|
||||
if(!HasSkill(SkillMend))
|
||||
return;
|
||||
|
||||
if(!p_timers.Expired(&database, pTimerMend, false)) {
|
||||
@@ -7585,7 +7585,7 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
||||
|
||||
int mendhp = GetMaxHP() / 4;
|
||||
int currenthp = GetHP();
|
||||
if (MakeRandomInt(0, 199) < (int)GetSkill(MEND)) {
|
||||
if (MakeRandomInt(0, 199) < (int)GetSkill(SkillMend)) {
|
||||
int criticalchance = 0;
|
||||
switch(GetAA(aaCriticalMend)){
|
||||
case 1:
|
||||
@@ -7614,7 +7614,7 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
||||
0 skill - 25% chance to worsen
|
||||
20 skill - 23% chance to worsen
|
||||
50 skill - 16% chance to worsen */
|
||||
if ((GetSkill(MEND) <= 75) && (MakeRandomInt(GetSkill(MEND),100) < 75) && (MakeRandomInt(1, 3) == 1))
|
||||
if ((GetSkill(SkillMend) <= 75) && (MakeRandomInt(GetSkill(SkillMend),100) < 75) && (MakeRandomInt(1, 3) == 1))
|
||||
{
|
||||
SetHP(currenthp > mendhp ? (GetHP() - mendhp) : 1);
|
||||
SendHPUpdate();
|
||||
@@ -7624,7 +7624,7 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
||||
Message_StringID(4,MEND_FAIL);
|
||||
}
|
||||
|
||||
CheckIncreaseSkill(MEND, nullptr, 10);
|
||||
CheckIncreaseSkill(SkillMend, nullptr, 10);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7682,7 +7682,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
|
||||
{
|
||||
mod_client_death_env();
|
||||
|
||||
Death(0, 32000, SPELL_UNKNOWN, HAND_TO_HAND);
|
||||
Death(0, 32000, SPELL_UNKNOWN, SkillHandtoHand);
|
||||
}
|
||||
SendHPUpdate();
|
||||
return;
|
||||
@@ -7700,7 +7700,7 @@ void Client::Handle_OP_Damage(const EQApplicationPacket *app)
|
||||
// Broadcast to other clients
|
||||
CombatDamage_Struct* damage = (CombatDamage_Struct*)app->pBuffer;
|
||||
//dont send to originator of falling damage packets
|
||||
entity_list.QueueClients(this, app, (damage->type==FallingDamageType));
|
||||
entity_list.QueueClients(this, app, (damage->type==DamageTypeFalling));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7958,7 +7958,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
|
||||
DumpPacket(app);
|
||||
}
|
||||
|
||||
if(!HasSkill(PICK_POCKETS))
|
||||
if(!HasSkill(SkillPickPockets))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -7983,7 +7983,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
|
||||
pick_out->coin = 0;
|
||||
pick_out->from = victim->GetID();
|
||||
pick_out->to = GetID();
|
||||
pick_out->myskill = GetSkill(PICK_POCKETS);
|
||||
pick_out->myskill = GetSkill(SkillPickPockets);
|
||||
pick_out->type = 0;
|
||||
//if we do not send this packet the client will lock up and require the player to relog.
|
||||
QueuePacket(outapp);
|
||||
@@ -7996,7 +7996,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
|
||||
pick_out->coin = 0;
|
||||
pick_out->from = victim->GetID();
|
||||
pick_out->to = GetID();
|
||||
pick_out->myskill = GetSkill(PICK_POCKETS);
|
||||
pick_out->myskill = GetSkill(SkillPickPockets);
|
||||
pick_out->type = 0;
|
||||
//if we do not send this packet the client will lock up and require the player to relog.
|
||||
QueuePacket(outapp);
|
||||
@@ -8012,7 +8012,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
|
||||
pick_out->coin = 0;
|
||||
pick_out->from = victim->GetID();
|
||||
pick_out->to = GetID();
|
||||
pick_out->myskill = GetSkill(PICK_POCKETS);
|
||||
pick_out->myskill = GetSkill(SkillPickPockets);
|
||||
pick_out->type = 0;
|
||||
//if we do not send this packet the client will lock up and require the player to relog.
|
||||
QueuePacket(outapp);
|
||||
@@ -8062,10 +8062,10 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app)
|
||||
if(GetClass() != RANGER && GetClass() != DRUID && GetClass() != BARD)
|
||||
return;
|
||||
|
||||
if( GetSkill(TRACKING)==0 )
|
||||
SetSkill(TRACKING,1);
|
||||
if( GetSkill(SkillTracking)==0 )
|
||||
SetSkill(SkillTracking,1);
|
||||
else
|
||||
CheckIncreaseSkill(TRACKING, nullptr, 15);
|
||||
CheckIncreaseSkill(SkillTracking, nullptr, 15);
|
||||
|
||||
if(!entity_list.MakeTrackPacket(this))
|
||||
LogFile->write(EQEMuLog::Error, "Unable to generate OP_Track packet requested by client.");
|
||||
@@ -8145,7 +8145,7 @@ void Client::Handle_OP_Split(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
|
||||
{
|
||||
if (!HasSkill(SENSE_TRAPS))
|
||||
if (!HasSkill(SkillSenseTraps))
|
||||
return;
|
||||
|
||||
if(!p_timers.Expired(&database, pTimerSenseTraps, false)) {
|
||||
@@ -8168,10 +8168,10 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
|
||||
|
||||
Trap* trap = entity_list.FindNearbyTrap(this,800);
|
||||
|
||||
CheckIncreaseSkill(SENSE_TRAPS, nullptr);
|
||||
CheckIncreaseSkill(SkillSenseTraps, nullptr);
|
||||
|
||||
if (trap && trap->skill > 0) {
|
||||
int uskill = GetSkill(SENSE_TRAPS);
|
||||
int uskill = GetSkill(SkillSenseTraps);
|
||||
if ((MakeRandomInt(0,99) + uskill) >= (MakeRandomInt(0,99) + trap->skill*0.75))
|
||||
{
|
||||
float xdif = trap->x - GetX();
|
||||
@@ -8212,7 +8212,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
|
||||
{
|
||||
if (!HasSkill(DISARM_TRAPS))
|
||||
if (!HasSkill(SkillDisarmTraps))
|
||||
return;
|
||||
|
||||
if(!p_timers.Expired(&database, pTimerDisarmTraps, false)) {
|
||||
@@ -8236,7 +8236,7 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
|
||||
Trap* trap = entity_list.FindNearbyTrap(this,60);
|
||||
if (trap && trap->detected)
|
||||
{
|
||||
int uskill = GetSkill(DISARM_TRAPS);
|
||||
int uskill = GetSkill(SkillDisarmTraps);
|
||||
if ((MakeRandomInt(0, 49) + uskill) >= (MakeRandomInt(0, 49) + trap->skill))
|
||||
{
|
||||
Message(MT_Skills,"You disarm a trap.");
|
||||
@@ -8254,7 +8254,7 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
|
||||
Message(MT_Skills,"You failed to disarm a trap.");
|
||||
}
|
||||
}
|
||||
CheckIncreaseSkill(DISARM_TRAPS, nullptr);
|
||||
CheckIncreaseSkill(SkillDisarmTraps, nullptr);
|
||||
return;
|
||||
}
|
||||
Message(MT_Skills,"You did not find any traps close enough to disarm.");
|
||||
@@ -8476,8 +8476,8 @@ void Client::Handle_OP_SetRunMode(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_SafeFallSuccess(const EQApplicationPacket *app) // bit of a misnomer, sent whenever safe fall is used (success of fail)
|
||||
{
|
||||
if(HasSkill(SAFE_FALL)) //this should only get called if the client has safe fall, but just in case...
|
||||
CheckIncreaseSkill(SAFE_FALL, nullptr); //check for skill up
|
||||
if(HasSkill(SkillSafeFall)) //this should only get called if the client has safe fall, but just in case...
|
||||
CheckIncreaseSkill(SkillSafeFall, nullptr); //check for skill up
|
||||
}
|
||||
|
||||
void Client::Handle_OP_Heartbeat(const EQApplicationPacket *app)
|
||||
@@ -8910,8 +8910,8 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) {
|
||||
if(m_pp.ldon_points_available > 0x77359400)
|
||||
m_pp.ldon_points_available = 0x77359400;
|
||||
|
||||
if(GetSkill(SWIMMING) < 100)
|
||||
SetSkill(SWIMMING,100);
|
||||
if(GetSkill(SkillSwimming) < 100)
|
||||
SetSkill(SkillSwimming,100);
|
||||
|
||||
//pull AAs from the PP
|
||||
for(uint32 a=0; a < MAX_PP_AA_ARRAY; a++){
|
||||
@@ -11031,10 +11031,10 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) {
|
||||
{
|
||||
if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == ItemType1HPiercing) ||
|
||||
(SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == ItemType1HPiercing)) {
|
||||
float SuccessChance = (GetSkill(APPLY_POISON) + GetLevel()) / 400.0f;
|
||||
float SuccessChance = (GetSkill(SkillApplyPoison) + GetLevel()) / 400.0f;
|
||||
double ChanceRoll = MakeRandomFloat(0, 1);
|
||||
|
||||
CheckIncreaseSkill(APPLY_POISON, nullptr, 10);
|
||||
CheckIncreaseSkill(SkillApplyPoison, nullptr, 10);
|
||||
|
||||
if(ChanceRoll < SuccessChance) {
|
||||
ApplyPoisonSuccessResult = 1;
|
||||
|
||||
Reference in New Issue
Block a user