rlie
01-08-2015, 08:20 PM
When using the skill Disarm, it fails to even launch as you even used the skill as any class. you click it and it doenst say one way or another if you attempted to and failed or not.
Anyone know a fix for this?
Also as for the combat issue, From the attack.cpp, (should apply to NPCs only??)
Is there a way to apply the correct level(s) to these skills, Riposte for warrior lvl 25, dodge lvl 6, parry lvl 10, and for monks Block lvl 12? Currently mobs of all levels use all these skills starting at level 1...would like to adjust that...if possible.
Lines 351 - 535 Attack.cpp in ZONES folder.
bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
{
/* solar: called when a mob is attacked, does the checks to see if it's a hit
* and does other mitigation checks. 'this' is the mob being attacked.
*
* special return values:
* -1 - block
* -2 - parry
* -3 - riposte
* -4 - dodge
*
*/
float skill;
float bonus;
float RollTable[4] = {0,0,0,0};
float roll;
Mob *attacker=other;
Mob *defender=this;
//garunteed hit
bool ghit = false;
if((attacker->spellbonuses.MeleeSkillCheck + attacker->itembonuses.MeleeSkillCheck) > 500)
ghit = true;
//////////////////////////////////////////////////////////
// make enrage same as riposte
/////////////////////////////////////////////////////////
if (IsEnraged() && other->InFrontMob(this, other->GetX(), other->GetY())) {
damage = -3;
mlog(COMBAT__DAMAGE, "I am enraged, riposting frontal attack.");
}
/////////////////////////////////////////////////////////
// riposte
/////////////////////////////////////////////////////////
float riposte_chance = 0.0f;
if (CanRiposte && damage > 0 && CanThisClassRiposte() && other->InFrontMob(this, other->GetX(), other->GetY()))
{
riposte_chance = (100.0f + (float)defender->aabonuses.RiposteChance + (float)defender->spellbonuses.RiposteChance + (float)defender->itembonuses.RiposteChance) / 100.0f;
skill = GetSkill(SkillRiposte);
if (IsClient()) {
CastToClient()->CheckIncreaseSkill(SkillRiposte, other, -10);
}
if (!ghit) { //if they are not using a garunteed hit discipline
bonus = 2.0 + skill/60.0 + (GetDEX()/200);
bonus *= riposte_chance;
bonus = mod_riposte_chance(bonus, attacker);
RollTable[0] = bonus + (itembonuses.HeroicDEX / 25); // 25 heroic = 1%, applies to ripo, parry, block
}
}
///////////////////////////////////////////////////////
// block
///////////////////////////////////////////////////////
bool bBlockFromRear = false;
bool bShieldBlockFromRear = false;
if (this->IsClient()) {
int aaChance = 0;
// a successful roll on this does not mean a successful block is forthcoming. only that a chance to block
// from a direction other than the rear is granted.
//Live AA - HightenedAwareness
int BlockBehindChance = aabonuses.BlockBehind + spellbonuses.BlockBehind + itembonuses.BlockBehind;
if (BlockBehindChance && (BlockBehindChance > MakeRandomInt(1, 100))){
bBlockFromRear = true;
if (spellbonuses.BlockBehind || itembonuses.BlockBehind)
bShieldBlockFromRear = true; //This bonus should allow a chance to Shield Block from behind.
}
}
float block_chance = 0.0f;
if (damage > 0 && CanThisClassBlock() && (other->InFrontMob(this, other->GetX(), other->GetY()) || bBlockFromRear)) {
block_chance = (100.0f + (float)spellbonuses.IncreaseBlockChance + (float)itembonuses.IncreaseBlockChance) / 100.0f;
skill = CastToClient()->GetSkill(SkillBlock);
if (IsClient()) {
CastToClient()->CheckIncreaseSkill(SkillBlock, other, -10);
}
if (!ghit) { //if they are not using a garunteed hit discipline
bonus = 2.0 + skill/35.0 + (GetDEX()/200);
bonus = mod_block_chance(bonus, attacker);
RollTable[1] = RollTable[0] + (bonus * block_chance);
}
}
else{
RollTable[1] = RollTable[0];
}
if(damage > 0 && HasShieldEquiped() && (aabonuses.ShieldBlock || spellbonuses.ShieldBlock || itembonuses.ShieldBlock)
&& (other->InFrontMob(this, other->GetX(), other->GetY()) || bShieldBlockFromRear)) {
float bonusShieldBlock = 0.0f;
bonusShieldBlock = aabonuses.ShieldBlock + spellbonuses.ShieldBlock + itembonuses.ShieldBlock;
RollTable[1] += bonusShieldBlock;
}
if(damage > 0 && (aabonuses.TwoHandBluntBlock || spellbonuses.TwoHandBluntBlock || itembonuses.TwoHandBluntBlock)
&& (other->InFrontMob(this, other->GetX(), other->GetY()) || bShieldBlockFromRear)) {
bool equiped2 = CastToClient()->m_inv.GetItem(13);
if(equiped2) {
uint8 TwoHandBlunt = CastToClient()->m_inv.GetItem(13)->GetItem()->ItemType;
float bonusStaffBlock = 0.0f;
if(TwoHandBlunt == ItemType2HBlunt) {
bonusStaffBlock = aabonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock;
RollTable[1] += bonusStaffBlock;
}
}
}
//////////////////////////////////////////////////////
// parry
//////////////////////////////////////////////////////
float parry_chance = 0.0f;
if (damage > 0 && CanThisClassParry() && other->InFrontMob(this, other->GetX(), other->GetY()))
{
parry_chance = (100.0f + (float)defender->spellbonuses.ParryChance + (float)defender->itembonuses.ParryChance) / 100.0f;
skill = CastToClient()->GetSkill(SkillParry);
if (IsClient()) {
CastToClient()->CheckIncreaseSkill(SkillParry, other, -10);
}
if (!ghit) { //if they are not using a garunteed hit discipline
bonus = 2.0 + skill/60.0 + (GetDEX()/200);
bonus *= parry_chance;
bonus = mod_parry_chance(bonus, attacker);
RollTable[2] = RollTable[1] + bonus;
}
}
else{
RollTable[2] = RollTable[1];
}
////////////////////////////////////////////////////////
// dodge
////////////////////////////////////////////////////////
float dodge_chance = 0.0f;
if (damage > 0 && CanThisClassDodge() && other->InFrontMob(this, other->GetX(), other->GetY()))
{
dodge_chance = (100.0f + (float)defender->spellbonuses.DodgeChance + (float)defender->itembonuses.DodgeChance) / 100.0f;
skill = CastToClient()->GetSkill(SkillDodge);
if (IsClient()) {
CastToClient()->CheckIncreaseSkill(SkillDodge, other, -10);
}
if (!ghit) { //if they are not using a garunteed hit discipline
bonus = 2.0 + skill/60.0 + (GetAGI()/200);
bonus *= dodge_chance;
//DCBOOMKAR
bonus = mod_dodge_chance(bonus, attacker);
RollTable[3] = RollTable[2] + bonus - (itembonuses.HeroicDEX / 25) + (itembonuses.HeroicAGI / 25);
}
}
else{
RollTable[3] = RollTable[2];
}
if(damage > 0){
roll = MakeRandomFloat(0,100);
if(roll <= RollTable[0]){
damage = -3;
}
else if(roll <= RollTable[1]){
damage = -1;
}
else if(roll <= RollTable[2]){
damage = -2;
}
else if(roll <= RollTable[3]){
damage = -4;
}
}
mlog(COMBAT__DAMAGE, "Final damage after all avoidances: %d", damage);
if (damage < 0)
return true;
return false;
}
Anyone know a fix for this?
Also as for the combat issue, From the attack.cpp, (should apply to NPCs only??)
Is there a way to apply the correct level(s) to these skills, Riposte for warrior lvl 25, dodge lvl 6, parry lvl 10, and for monks Block lvl 12? Currently mobs of all levels use all these skills starting at level 1...would like to adjust that...if possible.
Lines 351 - 535 Attack.cpp in ZONES folder.
bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
{
/* solar: called when a mob is attacked, does the checks to see if it's a hit
* and does other mitigation checks. 'this' is the mob being attacked.
*
* special return values:
* -1 - block
* -2 - parry
* -3 - riposte
* -4 - dodge
*
*/
float skill;
float bonus;
float RollTable[4] = {0,0,0,0};
float roll;
Mob *attacker=other;
Mob *defender=this;
//garunteed hit
bool ghit = false;
if((attacker->spellbonuses.MeleeSkillCheck + attacker->itembonuses.MeleeSkillCheck) > 500)
ghit = true;
//////////////////////////////////////////////////////////
// make enrage same as riposte
/////////////////////////////////////////////////////////
if (IsEnraged() && other->InFrontMob(this, other->GetX(), other->GetY())) {
damage = -3;
mlog(COMBAT__DAMAGE, "I am enraged, riposting frontal attack.");
}
/////////////////////////////////////////////////////////
// riposte
/////////////////////////////////////////////////////////
float riposte_chance = 0.0f;
if (CanRiposte && damage > 0 && CanThisClassRiposte() && other->InFrontMob(this, other->GetX(), other->GetY()))
{
riposte_chance = (100.0f + (float)defender->aabonuses.RiposteChance + (float)defender->spellbonuses.RiposteChance + (float)defender->itembonuses.RiposteChance) / 100.0f;
skill = GetSkill(SkillRiposte);
if (IsClient()) {
CastToClient()->CheckIncreaseSkill(SkillRiposte, other, -10);
}
if (!ghit) { //if they are not using a garunteed hit discipline
bonus = 2.0 + skill/60.0 + (GetDEX()/200);
bonus *= riposte_chance;
bonus = mod_riposte_chance(bonus, attacker);
RollTable[0] = bonus + (itembonuses.HeroicDEX / 25); // 25 heroic = 1%, applies to ripo, parry, block
}
}
///////////////////////////////////////////////////////
// block
///////////////////////////////////////////////////////
bool bBlockFromRear = false;
bool bShieldBlockFromRear = false;
if (this->IsClient()) {
int aaChance = 0;
// a successful roll on this does not mean a successful block is forthcoming. only that a chance to block
// from a direction other than the rear is granted.
//Live AA - HightenedAwareness
int BlockBehindChance = aabonuses.BlockBehind + spellbonuses.BlockBehind + itembonuses.BlockBehind;
if (BlockBehindChance && (BlockBehindChance > MakeRandomInt(1, 100))){
bBlockFromRear = true;
if (spellbonuses.BlockBehind || itembonuses.BlockBehind)
bShieldBlockFromRear = true; //This bonus should allow a chance to Shield Block from behind.
}
}
float block_chance = 0.0f;
if (damage > 0 && CanThisClassBlock() && (other->InFrontMob(this, other->GetX(), other->GetY()) || bBlockFromRear)) {
block_chance = (100.0f + (float)spellbonuses.IncreaseBlockChance + (float)itembonuses.IncreaseBlockChance) / 100.0f;
skill = CastToClient()->GetSkill(SkillBlock);
if (IsClient()) {
CastToClient()->CheckIncreaseSkill(SkillBlock, other, -10);
}
if (!ghit) { //if they are not using a garunteed hit discipline
bonus = 2.0 + skill/35.0 + (GetDEX()/200);
bonus = mod_block_chance(bonus, attacker);
RollTable[1] = RollTable[0] + (bonus * block_chance);
}
}
else{
RollTable[1] = RollTable[0];
}
if(damage > 0 && HasShieldEquiped() && (aabonuses.ShieldBlock || spellbonuses.ShieldBlock || itembonuses.ShieldBlock)
&& (other->InFrontMob(this, other->GetX(), other->GetY()) || bShieldBlockFromRear)) {
float bonusShieldBlock = 0.0f;
bonusShieldBlock = aabonuses.ShieldBlock + spellbonuses.ShieldBlock + itembonuses.ShieldBlock;
RollTable[1] += bonusShieldBlock;
}
if(damage > 0 && (aabonuses.TwoHandBluntBlock || spellbonuses.TwoHandBluntBlock || itembonuses.TwoHandBluntBlock)
&& (other->InFrontMob(this, other->GetX(), other->GetY()) || bShieldBlockFromRear)) {
bool equiped2 = CastToClient()->m_inv.GetItem(13);
if(equiped2) {
uint8 TwoHandBlunt = CastToClient()->m_inv.GetItem(13)->GetItem()->ItemType;
float bonusStaffBlock = 0.0f;
if(TwoHandBlunt == ItemType2HBlunt) {
bonusStaffBlock = aabonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock;
RollTable[1] += bonusStaffBlock;
}
}
}
//////////////////////////////////////////////////////
// parry
//////////////////////////////////////////////////////
float parry_chance = 0.0f;
if (damage > 0 && CanThisClassParry() && other->InFrontMob(this, other->GetX(), other->GetY()))
{
parry_chance = (100.0f + (float)defender->spellbonuses.ParryChance + (float)defender->itembonuses.ParryChance) / 100.0f;
skill = CastToClient()->GetSkill(SkillParry);
if (IsClient()) {
CastToClient()->CheckIncreaseSkill(SkillParry, other, -10);
}
if (!ghit) { //if they are not using a garunteed hit discipline
bonus = 2.0 + skill/60.0 + (GetDEX()/200);
bonus *= parry_chance;
bonus = mod_parry_chance(bonus, attacker);
RollTable[2] = RollTable[1] + bonus;
}
}
else{
RollTable[2] = RollTable[1];
}
////////////////////////////////////////////////////////
// dodge
////////////////////////////////////////////////////////
float dodge_chance = 0.0f;
if (damage > 0 && CanThisClassDodge() && other->InFrontMob(this, other->GetX(), other->GetY()))
{
dodge_chance = (100.0f + (float)defender->spellbonuses.DodgeChance + (float)defender->itembonuses.DodgeChance) / 100.0f;
skill = CastToClient()->GetSkill(SkillDodge);
if (IsClient()) {
CastToClient()->CheckIncreaseSkill(SkillDodge, other, -10);
}
if (!ghit) { //if they are not using a garunteed hit discipline
bonus = 2.0 + skill/60.0 + (GetAGI()/200);
bonus *= dodge_chance;
//DCBOOMKAR
bonus = mod_dodge_chance(bonus, attacker);
RollTable[3] = RollTable[2] + bonus - (itembonuses.HeroicDEX / 25) + (itembonuses.HeroicAGI / 25);
}
}
else{
RollTable[3] = RollTable[2];
}
if(damage > 0){
roll = MakeRandomFloat(0,100);
if(roll <= RollTable[0]){
damage = -3;
}
else if(roll <= RollTable[1]){
damage = -1;
}
else if(roll <= RollTable[2]){
damage = -2;
}
else if(roll <= RollTable[3]){
damage = -4;
}
}
mlog(COMBAT__DAMAGE, "Final damage after all avoidances: %d", damage);
if (damage < 0)
return true;
return false;
}