bpm91
Advanced OT User
- Joined
- May 23, 2019
- Messages
- 1,046
- Solutions
- 7
- Reaction score
- 177
- Location
- Brazil
- YouTube
- caruniawikibr
I have a small problem, my SD is in revscript. The problem is that when you try to use creatures that walk very fast in battle, you can't hit them and I get the message "you can only attack creatures" as if the floor they passed was fast enough to not recognize the creature in battle.
I'm using a version 1.5 nekiro 7.72 with spells converted to TVP "real formulas from old tibia"
Basically I just need the SD to hit the creature in battle regardless of its position on the map, as this causes exhaustion in the player.
It seems like I need to stop for the rune to hit. If I keep shooting without stopping it says "you can only attack creatures"
I switched to original base spells, but the error continues, I believe it would be the character's movement while walking and he cannot use the rune
with GM for example where there is no cooldown when walking and using it works, the problem is that the player cannot walk and use it.
I'm using a version 1.5 nekiro 7.72 with spells converted to TVP "real formulas from old tibia"
Basically I just need the SD to hit the creature in battle regardless of its position on the map, as this causes exhaustion in the player.
XML:
local spell = Spell(SPELL_INSTANT)
spell:needLearn(true)
spell:mana(220)
spell:magicLevel(25)
spell:soul(0)
spell:isAggressive(false)
spell:name("Sudden Death")
spell:vocation("Sorcerer", "Master Sorcerer")
spell:words("ad,ori, vita, vis")
function spell.onCastSpell(creature, variant)
return creature:conjureItem(220, 2260, 2268, 1)
end
spell:register()
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, true)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, false)
combat:setArea(createCombatArea(AREA_SINGLE))
function onGetFormulaValues(player, level, magicLevel)
return player:computeDamage(150, 20)
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local rune = Spell(SPELL_RUNE)
function rune.onCastSpell(creature, variant)
return combat:execute(creature, variant)
end
rune:runeMagicLevel(15)
rune:runeId(2268)
rune:charges(1)
rune:allowFarUse(true)
rune:blockWalls(true)
rune:checkFloor(true)
rune:isBlocking(true)
rune:needTarget(true)
rune:isAggressive(true)
rune:register()
Post automatically merged:
LUA:
bool Spell::playerRuneSpellCheck(Player* player, const Position& toPos)
{
if (!playerSpellCheck(player)) {
return false;
}
if (toPos.x == 0xFFFF) {
return true;
}
const Position& playerPos = player->getPosition();
if (playerPos.z > toPos.z) {
player->sendCancelMessage(RETURNVALUE_FIRSTGOUPSTAIRS);
g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
return false;
} else if (playerPos.z < toPos.z) {
player->sendCancelMessage(RETURNVALUE_FIRSTGODOWNSTAIRS);
g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
return false;
}
Tile* tile = g_game.map.getTile(toPos);
if (!tile) {
player->sendCancelMessage(RETURNVALUE_NOTPOSSIBLE);
g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
return false;
}
if (range != -1 && !g_game.canThrowObjectTo(playerPos, toPos, true, true, range, range)) {
player->sendCancelMessage(RETURNVALUE_DESTINATIONOUTOFREACH);
g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
return false;
}
ReturnValue ret = Combat::canDoCombat(player, tile, aggressive);
if (ret != RETURNVALUE_NOERROR) {
player->sendCancelMessage(ret);
g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
return false;
}
const Creature* topVisibleCreature = tile->getBottomVisibleCreature(player);
if (blockingCreature && topVisibleCreature) {
player->sendCancelMessage(RETURNVALUE_NOTENOUGHROOM);
g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
return false;
} else if (blockingSolid && tile->hasFlag(TILESTATE_BLOCKSOLID)) {
player->sendCancelMessage(RETURNVALUE_NOTENOUGHROOM);
g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
return false;
}
if (needTarget && !topVisibleCreature) {
player->sendCancelMessage(RETURNVALUE_CANONLYUSETHISRUNEONCREATURES);
g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
return false;
}
if (aggressive && needTarget && topVisibleCreature && player->hasSecureMode()) {
const Player* targetPlayer = topVisibleCreature->getPlayer();
if (targetPlayer && targetPlayer != player && player->getSkullClient(targetPlayer) == SKULL_NONE && !Combat::isInPvpZone(player, targetPlayer)) {
player->sendCancelMessage(RETURNVALUE_TURNSECUREMODETOATTACKUNMARKEDPLAYERS);
g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
return false;
}
}
return true;
}
Post automatically merged:
It seems like I need to stop for the rune to hit. If I keep shooting without stopping it says "you can only attack creatures"
Post automatically merged:
I switched to original base spells, but the error continues, I believe it would be the character's movement while walking and he cannot use the rune
Post automatically merged:
with GM for example where there is no cooldown when walking and using it works, the problem is that the player cannot walk and use it.
Last edited: