Jump to content

ayato96

Member
  • Content Count

    5
  • Joined

  • Last visited

About ayato96

  • Rank
    Noob

Profile Information

  • I am
    Scripter
    OT-Admin
    Spriter

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. bool Game::combatChangeHealth(CombatType_t combatType, Creature* attacker, Creature* target, int32_t healthChange, MagicEffect_t hitEffect/* = MAGIC_EFFECT_UNKNOWN*/, TextColor_t hitColor/* = TEXTCOLOR_UNKNOWN*/, bool force/* = false*/) { const Position& targetPos = target->getPosition(); if(healthChange > 0) { if(!force && target->getHealth() <= 0) return false; bool deny = false; CreatureEventList statsChangeEvents = target->getCreatureEvents(CREATURE_EVENT_STATSCHANGE); for(CreatureEventList::iterator it = statsChangeEvents.begin(); it != statsChangeEvents.end(); ++it) { if(!(*it)->executeStatsChange(target, attacker, STATSCHANGE_HEALTHGAIN, combatType, healthChange)) deny = true; } if(deny) return false; target->gainHealth(attacker, healthChange); if(g_config.getBool(ConfigManager::SHOW_HEALING_DAMAGE) && !target->isGhost() && (g_config.getBool(ConfigManager::SHOW_HEALING_DAMAGE_MONSTER) || !target->getMonster())) { char buffer[20]; sprintf(buffer, "+%d", healthChange); const SpectatorVec& list = getSpectators(targetPos); if(combatType != COMBAT_HEALING) addMagicEffect(list, targetPos, MAGIC_EFFECT_WRAPS_BLUE); addAnimatedText(list, targetPos, g_config.getNumber(ConfigManager::HEALTH_HEALING_COLOR), buffer); } } else { const SpectatorVec& list = getSpectators(targetPos); if(!target->isAttackable() || Combat::canDoCombat(attacker, target) != RET_NOERROR) { addMagicEffect(list, targetPos, MAGIC_EFFECT_POFF); return true; } int32_t damage = -healthChange; if(damage != 0) { if(!combatType == COMBAT_PHYSICALDAMAGE && target && target->getPlayer()) { double damageChange = 0; int32_t skillFish = target->getPlayer()->getSkill(SKILL_FISH, SKILL_LEVEL); if(skillFish >= 10) damageChange = std::ceil(skillFish * 0.1 * damage / 100); if((int32_t)damageChange != 0) { damage -= (int32_t)damageChange; char buffer[150]; sprintf(buffer, "%d hitpoint%s has been absorbed by your resistance.", (int32_t)damageChange, ((int32_t)damageChange == 1 ? "" : "s")); target->getPlayer()->addSkillAdvance(SKILL_FISH, 1, true); target->getPlayer()->sendTextMessage(MSG_EVENT_DEFAULT, buffer); } } if(target->hasCondition(CONDITION_MANASHIELD) && combatType != COMBAT_UNDEFINEDDAMAGE) { int32_t manaDamage = std::min(target->getMana(), damage); damage = std::max((int32_t)0, damage - manaDamage); if(manaDamage != 0) { bool deny = false; CreatureEventList statsChangeEvents = target->getCreatureEvents(CREATURE_EVENT_STATSCHANGE); for(CreatureEventList::iterator it = statsChangeEvents.begin(); it != statsChangeEvents.end(); ++it) { if(!(*it)->executeStatsChange(target, attacker, STATSCHANGE_MANALOSS, combatType, manaDamage)) deny = true; } if(deny) return false; target->drainMana(attacker, combatType, manaDamage); char buffer[20]; sprintf(buffer, "%d", manaDamage); addMagicEffect(list, targetPos, MAGIC_EFFECT_LOSE_ENERGY); addAnimatedText(list, targetPos, TEXTCOLOR_BLUE, buffer); } } damage = std::min(target->getHealth(), damage); if(damage > 0) { bool deny = false; CreatureEventList statsChangeEvents = target->getCreatureEvents(CREATURE_EVENT_STATSCHANGE); for(CreatureEventList::iterator it = statsChangeEvents.begin(); it != statsChangeEvents.end(); ++it) { if(!(*it)->executeStatsChange(target, attacker, STATSCHANGE_HEALTHLOSS, combatType, damage)) deny = true; } if(deny) return false; target->drainHealth(attacker, combatType, damage); addCreatureHealth(list, target); TextColor_t textColor = TEXTCOLOR_NONE; MagicEffect_t magicEffect = MAGIC_EFFECT_NONE; switch(combatType) { case COMBAT_PHYSICALDAMAGE: { Item* splash = NULL; switch(target->getRace()) { case RACE_VENOM: textColor = TEXTCOLOR_LIGHTGREEN; magicEffect = MAGIC_EFFECT_POISON; splash = Item::CreateItem(ITEM_SMALLSPLASH, FLUID_GREEN); break; case RACE_BLOOD: textColor = TEXTCOLOR_RED; magicEffect = MAGIC_EFFECT_DRAW_BLOOD; splash = Item::CreateItem(ITEM_SMALLSPLASH, FLUID_BLOOD); break; case RACE_UNDEAD: textColor = TEXTCOLOR_GREY; magicEffect = MAGIC_EFFECT_HIT_AREA; break; case RACE_FIRE: textColor = TEXTCOLOR_ORANGE; magicEffect = MAGIC_EFFECT_DRAW_BLOOD; break; case RACE_ENERGY: textColor = TEXTCOLOR_PURPLE; magicEffect = MAGIC_EFFECT_PURPLEENERGY; break; default: break; } if(splash) { internalAddItem(NULL, target->getTile(), splash, INDEX_WHEREEVER, FLAG_NOLIMIT); startDecay(splash); } break; } case COMBAT_ENERGYDAMAGE: { textColor = TEXTCOLOR_PURPLE; magicEffect = MAGIC_EFFECT_ENERGY_DAMAGE; break; } case COMBAT_EARTHDAMAGE: { textColor = TEXTCOLOR_LIGHTGREEN; magicEffect = MAGIC_EFFECT_POISON_RINGS; break; } case COMBAT_DROWNDAMAGE: { textColor = TEXTCOLOR_LIGHTBLUE; magicEffect = MAGIC_EFFECT_LOSE_ENERGY; break; } case COMBAT_FIREDAMAGE: { textColor = TEXTCOLOR_ORANGE; magicEffect = MAGIC_EFFECT_HITBY_FIRE; break; } case COMBAT_ICEDAMAGE: { textColor = TEXTCOLOR_TEAL; magicEffect = MAGIC_EFFECT_ICEATTACK; break; } case COMBAT_HOLYDAMAGE: { textColor = TEXTCOLOR_YELLOW; magicEffect = MAGIC_EFFECT_HOLYDAMAGE; break; } case COMBAT_DEATHDAMAGE: { textColor = TEXTCOLOR_DARKRED; magicEffect = MAGIC_EFFECT_SMALLCLOUDS; break; } case COMBAT_LIFEDRAIN: { textColor = TEXTCOLOR_RED; magicEffect = MAGIC_EFFECT_WRAPS_RED; break; } default: break; } if(hitEffect != MAGIC_EFFECT_UNKNOWN) magicEffect = hitEffect; if(hitColor != TEXTCOLOR_UNKNOWN) textColor = hitColor; if(textColor < TEXTCOLOR_NONE && magicEffect < MAGIC_EFFECT_NONE) { char buffer[20]; sprintf(buffer, "%d", damage); addMagicEffect(list, targetPos, magicEffect); addAnimatedText(list, targetPos, textColor, buffer); } } } } return true; } Try now how it is ! means that for all types of damage except
  2. Try this const SpectatorVec& list = getSpectators(targetPos); if(!target->isAttackable() || Combat::canDoCombat(attacker, target) != RET_NOERROR) { addMagicEffect(list, targetPos, MAGIC_EFFECT_POFF); return true; } int32_t damage = -healthChange; if(damage != 0) { if(!combatType == COMBAT_PHYSICALDAMAGE && target && target->getPlayer()) { double damageChange = 0; int32_t skillFish = target->getPlayer()->getSkill(SKILL_FISH, SKILL_LEVEL); if(skillFish >= 10) damageChange = std::ceil(skillFish * 0.1 * damage / 100); if((int32_t)damageChange != 0) { damage -= (int32_t)damageChange; char buffer[150]; sprintf(buffer, "%d hitpoint%s has been absorbed by your resistance.", (int32_t)damageChange, ((int32_t)damageChange == 1 ? "" : "s")); target->getPlayer()->addSkillAdvance(SKILL_FISH, 1, true); target->getPlayer()->sendTextMessage(MSG_EVENT_DEFAULT, buffer); } }
  3. Source edit on game.cpp in bool Game::combatChangeHealth if(params.combatType != COMBAT_PHYSICALDAMAGE && target && target->getPlayer()) { double damageChange = 0; int32_t skillFish = target->getPlayer()->getSkill(SKILL_FISH, SKILL_LEVEL); if(skillFish >= 10) damageChange = std::ceil(skillFish * 0.1 * damage / 100); if((int32_t)damageChange != 0) { damage -= (int32_t)damageChange; char buffer[150]; sprintf(buffer, "%d hitpoint%s has been absorbed by your resistance.", (int32_t)damageChange, ((int32_t)damageChange == 1 ? "" : "s")); target->getPlayer()->addSkillAdvance(SKILL_FISH, 1, true); target->getPlayer()->sendTextMessage(MSG_EVENT_DEFAULT, buffer); } }
  4. WELCOME!!! I would like to present You a custom Bleach ots. All of the classes,items,monsters,spawns and missions have are made on basis of anime Bleach . General Information: Website: https://blots.pl/index.php Client Download: https://blots.pl/downloads.php exp rate: Custom Stage Map: Custom Server type: PVP 20 Classes
  5. Progresso de um servidor completamente roubado, no final, embora algo adicionado de cada outro GZ;) Para a implementação de Otclienta Parabéns (uma vez eu digo que este post não é dirigido como um ataque):)

Open Tibia Server

Quer aprender a criar seu próprio servidor de Tibia? Então está no lugar certo, aqui você encontrará milhares de tutorias, scripts, códigos, mapas e utilitários para que você possa fazer o seu próprio servidor de Tibia começando do zero.

Redes Sociais

Anuncie no Tibia King

Precisa de mais visibilidade em seus projetos? Quer fazer um plano publicitário para o seu servidor? Anuncie no Tibia King e faça sua divulgação, possuímos centenas de acessos simultâneos e milhares diários, com certeza será a sua solução!

×
×
  • Create New...