本文整理汇总了C++中LPCHARACTER::GetPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::GetPoint方法的具体用法?C++ LPCHARACTER::GetPoint怎么用?C++ LPCHARACTER::GetPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::GetPoint方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GET_ATTACK_SPEED
DWORD GET_ATTACK_SPEED(LPCHARACTER ch)
{
if (NULL == ch)
return 1000;
LPITEM item = ch->GetWear(WEAR_WEAPON);
DWORD default_bonus = SPEEDHACK_LIMIT_BONUS; // АЇµОё® °шјУ(±вє» 80)
DWORD riding_bonus = 0;
if (ch->IsRiding())
{
// №є°Ўё¦ ЕААёёй ГЯ°Ў°шјУ 50
riding_bonus = 50;
}
DWORD ani_speed = ani_attack_speed(ch);
DWORD real_speed = (ani_speed * 100) / (default_bonus + ch->GetPoint(POINT_ATT_SPEED) + riding_bonus);
// ґЬ°ЛАЗ °жїм °шјУ 2№и
if (item && item->GetSubType() == WEAPON_DAGGER)
real_speed /= 2;
return real_speed;
}
示例2: GET_ATTACK_SPEED
DWORD GET_ATTACK_SPEED(LPCHARACTER ch)
{
if (NULL == ch)
return 1000;
LPITEM item = ch->GetWear(WEAR_WEAPON);
DWORD default_bonus = SPEEDHACK_LIMIT_BONUS; // 유두리 공속(기본 80)
DWORD riding_bonus = 0;
if (ch->IsRiding())
{
// 뭔가를 탔으면 추가공속 50
riding_bonus = 50;
}
DWORD ani_speed = ani_attack_speed(ch);
DWORD real_speed = (ani_speed * 100) / (default_bonus + ch->GetPoint(POINT_ATT_SPEED) + riding_bonus);
// 단검의 경우 공속 2배
if (item && item->GetSubType() == WEAPON_DAGGER)
real_speed /= 2;
return real_speed;
}
示例3: NormalAttackAffect
void NormalAttackAffect(LPCHARACTER pkAttacker, LPCHARACTER pkVictim)
{
// 독 공격은 특이하므로 특수 처리
if (pkAttacker->GetPoint(POINT_POISON_PCT) && !pkVictim->IsAffectFlag(AFF_POISON))
{
if (number(1, 100) <= pkAttacker->GetPoint(POINT_POISON_PCT))
pkVictim->AttackedByPoison(pkAttacker);
}
int iStunDuration = 2;
if (pkAttacker->IsPC() && !pkVictim->IsPC())
iStunDuration = 4;
AttackAffect(pkAttacker, pkVictim, POINT_STUN_PCT, IMMUNE_STUN, AFFECT_STUN, POINT_NONE, 0, AFF_STUN, iStunDuration, "STUN");
AttackAffect(pkAttacker, pkVictim, POINT_SLOW_PCT, IMMUNE_SLOW, AFFECT_SLOW, POINT_MOV_SPEED, -30, AFF_SLOW, 20, "SLOW");
}
示例4: battle_hit
int battle_hit(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, int & iRetDam)
{
//PROF_UNIT puHit("Hit");
if (test_server)
sys_log(0, "battle_hit : [%s] attack to [%s] : dam :%d type :%d", pkAttacker->GetName(), pkVictim->GetName(), iRetDam);
int iDam = CalcMeleeDamage(pkAttacker, pkVictim);
if (iDam <= 0)
return (BATTLE_DAMAGE);
NormalAttackAffect(pkAttacker, pkVictim);
// 데미지 계산
//iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST)) / 100;
LPITEM pkWeapon = pkAttacker->GetWear(WEAR_WEAPON);
if (pkWeapon)
switch (pkWeapon->GetSubType())
{
case WEAPON_SWORD:
iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_SWORD)) / 100;
break;
case WEAPON_TWO_HANDED:
iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_TWOHAND)) / 100;
break;
case WEAPON_DAGGER:
iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_DAGGER)) / 100;
break;
case WEAPON_BELL:
iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_BELL)) / 100;
break;
case WEAPON_FAN:
iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_FAN)) / 100;
break;
case WEAPON_BOW:
iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_BOW)) / 100;
break;
}
//최종적인 데미지 보정. (2011년 2월 현재 대왕거미에게만 적용.)
float attMul = pkAttacker->GetAttMul();
float tempIDam = iDam;
iDam = attMul * tempIDam + 0.5f;
iRetDam = iDam;
//PROF_UNIT puDam("Dam");
if (pkVictim->Damage(pkAttacker, iDam, DAMAGE_TYPE_NORMAL))
return (BATTLE_DEAD);
return (BATTLE_DAMAGE);
}
示例5: CalcMagicDamage
int CalcMagicDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim)
{
int iDam = 0;
if (pkAttacker->IsNPC())
{
iDam = CalcMeleeDamage(pkAttacker, pkVictim, false, false);
}
iDam += pkAttacker->GetPoint(POINT_PARTY_ATTACKER_BONUS);
return CalcMagicDamageWithValue(iDam, pkAttacker, pkVictim);
}
示例6: GetPoisonDamageRate
int GetPoisonDamageRate(LPCHARACTER ch)
{
int iRate;
if (ch->IsPC())
{
if (LC_IsYMIR())
iRate = 40;
else
iRate = 50;
}
else
iRate = poison_damage_rate[ch->GetMobRank()];
iRate = MAX(0, iRate - ch->GetPoint(POINT_POISON_REDUCE));
return iRate;
}
示例7: ComputeRolePoint
void CParty::ComputeRolePoint(LPCHARACTER ch, BYTE bRole, bool bAdd)
{
if (!bAdd)
{
ch->PointChange(POINT_PARTY_ATTACKER_BONUS, -ch->GetPoint(POINT_PARTY_ATTACKER_BONUS));
ch->PointChange(POINT_PARTY_TANKER_BONUS, -ch->GetPoint(POINT_PARTY_TANKER_BONUS));
ch->PointChange(POINT_PARTY_BUFFER_BONUS, -ch->GetPoint(POINT_PARTY_BUFFER_BONUS));
ch->PointChange(POINT_PARTY_SKILL_MASTER_BONUS, -ch->GetPoint(POINT_PARTY_SKILL_MASTER_BONUS));
ch->PointChange(POINT_PARTY_DEFENDER_BONUS, -ch->GetPoint(POINT_PARTY_DEFENDER_BONUS));
ch->PointChange(POINT_PARTY_HASTE_BONUS, -ch->GetPoint(POINT_PARTY_HASTE_BONUS));
ch->ComputeBattlePoints();
return;
}
//SKILL_POWER_BY_LEVEL
float k = (float) ch->GetSkillPowerByLevel( MIN(SKILL_MAX_LEVEL, m_iLeadership ) )/ 100.0f;
//float k = (float) aiSkillPowerByLevel[MIN(SKILL_MAX_LEVEL, m_iLeadership)] / 100.0f;
//
//sys_log(0,"ComputeRolePoint %fi %d, %d ", k, SKILL_MAX_LEVEL, m_iLeadership );
//END_SKILL_POWER_BY_LEVEL
switch (bRole)
{
case PARTY_ROLE_ATTACKER:
{
//int iBonus = (int) (10 + 90 * k);
int iBonus = (int) (10 + 60 * k);
if (ch->GetPoint(POINT_PARTY_ATTACKER_BONUS) != iBonus)
{
ch->PointChange(POINT_PARTY_ATTACKER_BONUS, iBonus - ch->GetPoint(POINT_PARTY_ATTACKER_BONUS));
ch->ComputePoints();
}
}
break;
case PARTY_ROLE_TANKER:
{
int iBonus = (int) (50 + 1450 * k);
if (ch->GetPoint(POINT_PARTY_TANKER_BONUS) != iBonus)
{
ch->PointChange(POINT_PARTY_TANKER_BONUS, iBonus - ch->GetPoint(POINT_PARTY_TANKER_BONUS));
ch->ComputePoints();
}
}
break;
case PARTY_ROLE_BUFFER:
{
int iBonus = (int) (5 + 45 * k);
if (ch->GetPoint(POINT_PARTY_BUFFER_BONUS) != iBonus)
{
ch->PointChange(POINT_PARTY_BUFFER_BONUS, iBonus - ch->GetPoint(POINT_PARTY_BUFFER_BONUS));
}
}
break;
case PARTY_ROLE_SKILL_MASTER:
{
int iBonus = (int) (25 + 600 * k);
if (ch->GetPoint(POINT_PARTY_SKILL_MASTER_BONUS) != iBonus)
{
ch->PointChange(POINT_PARTY_SKILL_MASTER_BONUS, iBonus - ch->GetPoint(POINT_PARTY_SKILL_MASTER_BONUS));
ch->ComputePoints();
}
}
break;
case PARTY_ROLE_HASTE:
{
int iBonus = (int) (1+5*k);
if (ch->GetPoint(POINT_PARTY_HASTE_BONUS) != iBonus)
{
ch->PointChange(POINT_PARTY_HASTE_BONUS, iBonus - ch->GetPoint(POINT_PARTY_HASTE_BONUS));
ch->ComputePoints();
}
}
break;
case PARTY_ROLE_DEFENDER:
{
int iBonus = (int) (5+30*k);
if (ch->GetPoint(POINT_PARTY_DEFENDER_BONUS) != iBonus)
{
ch->PointChange(POINT_PARTY_DEFENDER_BONUS, iBonus - ch->GetPoint(POINT_PARTY_DEFENDER_BONUS));
ch->ComputePoints();
}
}
break;
}
}
示例8: CalcArrowDamage
int CalcArrowDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, LPITEM pkBow, LPITEM pkArrow, bool bIgnoreDefense)
{
if (!pkBow || pkBow->GetType() != ITEM_WEAPON || pkBow->GetSubType() != WEAPON_BOW)
return 0;
if (!pkArrow)
return 0;
// 타격치 계산부
int iDist = (int) (DISTANCE_SQRT(pkAttacker->GetX() - pkVictim->GetX(), pkAttacker->GetY() - pkVictim->GetY()));
//int iGap = (iDist / 100) - 5 - pkBow->GetValue(5) - pkAttacker->GetPoint(POINT_BOW_DISTANCE);
int iGap = (iDist / 100) - 5 - pkAttacker->GetPoint(POINT_BOW_DISTANCE);
int iPercent = 100 - (iGap * 5);
if (iPercent <= 0)
return 0;
else if (iPercent > 100)
iPercent = 100;
int iDam = 0;
float fAR = CalcAttackRating(pkAttacker, pkVictim, false);
iDam = number(pkBow->GetValue(3), pkBow->GetValue(4)) * 2 + pkArrow->GetValue(3);
int iAtk;
// level must be ignored when multiply by fAR, so subtract it before calculation.
iAtk = pkAttacker->GetPoint(POINT_ATT_GRADE) + iDam - (pkAttacker->GetLevel() * 2);
iAtk = (int) (iAtk * fAR);
iAtk += pkAttacker->GetLevel() * 2; // and add again
// Refine Grade
iAtk += pkBow->GetValue(5) * 2;
iAtk += pkAttacker->GetPoint(POINT_PARTY_ATTACKER_BONUS);
iAtk = (int) (iAtk * (100 + (pkAttacker->GetPoint(POINT_ATT_BONUS) + pkAttacker->GetPoint(POINT_MELEE_MAGIC_ATT_BONUS_PER))) / 100);
iAtk = CalcAttBonus(pkAttacker, pkVictim, iAtk);
int iDef = 0;
if (!bIgnoreDefense)
iDef = (pkVictim->GetPoint(POINT_DEF_GRADE) * (100 + pkAttacker->GetPoint(POINT_DEF_BONUS)) / 100);
if (pkAttacker->IsNPC())
iAtk = (int) (iAtk * pkAttacker->GetMobDamageMultiply());
iDam = MAX(0, iAtk - iDef);
int iPureDam = iDam;
iPureDam = (iPureDam * iPercent) / 100;
if (test_server)
{
pkAttacker->ChatPacket(CHAT_TYPE_INFO, "ARROW %s -> %s, DAM %d DIST %d GAP %d %% %d",
pkAttacker->GetName(),
pkVictim->GetName(),
iPureDam,
iDist, iGap, iPercent);
}
return iPureDam;
//return iDam;
}
示例9: CalcMeleeDamage
int CalcMeleeDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, bool bIgnoreDefense, bool bIgnoreTargetRating)
{
LPITEM pWeapon = pkAttacker->GetWear(WEAR_WEAPON);
bool bPolymorphed = pkAttacker->IsPolymorphed();
if (pWeapon && !(bPolymorphed && !pkAttacker->IsPolyMaintainStat()))
{
if (pWeapon->GetType() != ITEM_WEAPON)
return 0;
switch (pWeapon->GetSubType())
{
case WEAPON_SWORD:
case WEAPON_DAGGER:
case WEAPON_TWO_HANDED:
case WEAPON_BELL:
case WEAPON_FAN:
case WEAPON_MOUNT_SPEAR:
break;
case WEAPON_BOW:
sys_err("CalcMeleeDamage should not handle bows (name: %s)", pkAttacker->GetName());
return 0;
default:
return 0;
}
}
int iDam = 0;
float fAR = CalcAttackRating(pkAttacker, pkVictim, bIgnoreTargetRating);
int iDamMin = 0, iDamMax = 0;
// TESTSERVER_SHOW_ATTACKINFO
int DEBUG_iDamCur = 0;
int DEBUG_iDamBonus = 0;
// END_OF_TESTSERVER_SHOW_ATTACKINFO
if (bPolymorphed && !pkAttacker->IsPolyMaintainStat())
{
// MONKEY_ROD_ATTACK_BUG_FIX
Item_GetDamage(pWeapon, &iDamMin, &iDamMax);
// END_OF_MONKEY_ROD_ATTACK_BUG_FIX
DWORD dwMobVnum = pkAttacker->GetPolymorphVnum();
const CMob * pMob = CMobManager::instance().Get(dwMobVnum);
if (pMob)
{
int iPower = pkAttacker->GetPolymorphPower();
iDamMin += pMob->m_table.dwDamageRange[0] * iPower / 100;
iDamMax += pMob->m_table.dwDamageRange[1] * iPower / 100;
}
}
else if (pWeapon)
{
// MONKEY_ROD_ATTACK_BUG_FIX
Item_GetDamage(pWeapon, &iDamMin, &iDamMax);
// END_OF_MONKEY_ROD_ATTACK_BUG_FIX
}
else if (pkAttacker->IsNPC())
{
iDamMin = pkAttacker->GetMobDamageMin();
iDamMax = pkAttacker->GetMobDamageMax();
}
iDam = number(iDamMin, iDamMax) * 2;
// TESTSERVER_SHOW_ATTACKINFO
DEBUG_iDamCur = iDam;
// END_OF_TESTSERVER_SHOW_ATTACKINFO
//
int iAtk = 0;
// level must be ignored when multiply by fAR, so subtract it before calculation.
iAtk = pkAttacker->GetPoint(POINT_ATT_GRADE) + iDam - (pkAttacker->GetLevel() * 2);
iAtk = (int) (iAtk * fAR);
iAtk += pkAttacker->GetLevel() * 2; // and add again
if (pWeapon)
{
iAtk += pWeapon->GetValue(5) * 2;
// 2004.11.12.myevan.TESTSERVER_SHOW_ATTACKINFO
DEBUG_iDamBonus = pWeapon->GetValue(5) * 2;
///////////////////////////////////////////////
}
iAtk += pkAttacker->GetPoint(POINT_PARTY_ATTACKER_BONUS); // party attacker role bonus
iAtk = (int) (iAtk * (100 + (pkAttacker->GetPoint(POINT_ATT_BONUS) + pkAttacker->GetPoint(POINT_MELEE_MAGIC_ATT_BONUS_PER))) / 100);
iAtk = CalcAttBonus(pkAttacker, pkVictim, iAtk);
int iDef = 0;
if (!bIgnoreDefense)
{
iDef = (pkVictim->GetPoint(POINT_DEF_GRADE) * (100 + pkVictim->GetPoint(POINT_DEF_BONUS)) / 100);
if (!pkAttacker->IsPC())
//.........这里部分代码省略.........
示例10: CalcAttBonus
int CalcAttBonus(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, int iAtk)
{
// PvP에는 적용하지않음
if (!pkVictim->IsPC())
iAtk += pkAttacker->GetMarriageBonus(UNIQUE_ITEM_MARRIAGE_ATTACK_BONUS);
// PvP에는 적용하지않음
if (!pkAttacker->IsPC())
{
int iReduceDamagePct = pkVictim->GetMarriageBonus(UNIQUE_ITEM_MARRIAGE_TRANSFER_DAMAGE);
iAtk = iAtk * (100 + iReduceDamagePct) / 100;
}
if (pkAttacker->IsNPC() && pkVictim->IsPC())
{
iAtk = (iAtk * CHARACTER_MANAGER::instance().GetMobDamageRate(pkAttacker)) / 100;
}
if (pkVictim->IsNPC())
{
if (pkVictim->IsRaceFlag(RACE_FLAG_ANIMAL))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ANIMAL)) / 100;
else if (pkVictim->IsRaceFlag(RACE_FLAG_UNDEAD))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_UNDEAD)) / 100;
else if (pkVictim->IsRaceFlag(RACE_FLAG_DEVIL))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_DEVIL)) / 100;
else if (pkVictim->IsRaceFlag(RACE_FLAG_HUMAN))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_HUMAN)) / 100;
else if (pkVictim->IsRaceFlag(RACE_FLAG_ORC))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ORC)) / 100;
else if (pkVictim->IsRaceFlag(RACE_FLAG_MILGYO))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_MILGYO)) / 100;
else if (pkVictim->IsRaceFlag(RACE_FLAG_INSECT))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_INSECT)) / 100;
else if (pkVictim->IsRaceFlag(RACE_FLAG_FIRE))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_FIRE)) / 100;
else if (pkVictim->IsRaceFlag(RACE_FLAG_ICE))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ICE)) / 100;
else if (pkVictim->IsRaceFlag(RACE_FLAG_DESERT))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_DESERT)) / 100;
else if (pkVictim->IsRaceFlag(RACE_FLAG_TREE))
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_TREE)) / 100;
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_MONSTER)) / 100;
}
else if (pkVictim->IsPC())
{
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_HUMAN)) / 100;
switch (pkVictim->GetJob())
{
case JOB_WARRIOR:
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_WARRIOR)) / 100;
break;
case JOB_ASSASSIN:
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ASSASSIN)) / 100;
break;
case JOB_SURA:
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_SURA)) / 100;
break;
case JOB_SHAMAN:
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_SHAMAN)) / 100;
break;
}
}
if (pkAttacker->IsPC() == true)
{
switch (pkAttacker->GetJob())
{
case JOB_WARRIOR:
iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_WARRIOR)) / 100;
break;
case JOB_ASSASSIN:
iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_ASSASSIN)) / 100;
break;
case JOB_SURA:
iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_SURA)) / 100;
break;
case JOB_SHAMAN:
iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_SHAMAN)) / 100;
break;
}
}
//[ mob -> PC ] 원소 속성 방어 적용
//2013/01/17
//몬스터 속성공격 데미지의 30%에 해당하는 수치에만 저항이 적용됨.
if (pkAttacker->IsNPC() && pkVictim->IsPC())
{
if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_ELEC))
iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_ELEC)) / 10000;
else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_FIRE))
iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_FIRE)) / 10000;
//.........这里部分代码省略.........