Hello there,
Ive put a normal, useable, stackable item into rune script.
Main idea is to create an mwall "rune" but in normal stackable item, and when you cast that "rune", 1 count from stack will be loss, not whole stack (runes based on item count, not charges).
Ive found out that:
there is that line:
But I dont really know how to change it that it will remove count, not charge.
Any ideas? Im using tfs0.3.6pl1
Greetings,
Erexo
Ive put a normal, useable, stackable item into rune script.
Main idea is to create an mwall "rune" but in normal stackable item, and when you cast that "rune", 1 count from stack will be loss, not whole stack (runes based on item count, not charges).
Ive found out that:
Code:
bool RuneSpell::executeUse(Player* player, Item* item, const PositionEx& posFrom,
const PositionEx& posTo, bool extendedUse, uint32_t creatureId)
{
if(!playerRuneSpellCheck(player, posTo))
return false;
bool result = false;
if(isScripted())
{
LuaVariant var;
if(creatureId && needTarget)
{
var.type = VARIANT_NUMBER;
var.number = creatureId;
}
else
{
var.type = VARIANT_POSITION;
var.pos = posTo;
}
result = internalCastSpell(player, var);
}
else if(function)
result = function(this, player, item, posFrom, posTo);
if(result)
{
Spell::postCastSpell(player);
if(hasCharges && item && g_config.getBool(ConfigManager::REMOVE_RUNE_CHARGES))
g_game.transformItem(item, item->getID(), std::max((int32_t)0, ((int32_t)item->getCharges()) - 1));
}
return result;
}
there is that line:
Code:
g_game.transformItem(item, item->getID(), std::max((int32_t)0, ((int32_t)item->getCharges()) - 1));
But I dont really know how to change it that it will remove count, not charge.
Any ideas? Im using tfs0.3.6pl1
Greetings,
Erexo