kennyubuntu
Member
- Joined
- May 20, 2016
- Messages
- 150
- Reaction score
- 13
With the help of @heba i have the so wanted invisible spell (utana vid but invisible for other players, just like warlocks do)
source changes:
replace functions:
edit functions:
But there are a few problems i don't know how to fix...
I have to stop inv in 3 ways:
1- utamo ina is not working (a area spell to remove inv)
inv players don't recive area damage, can trap, do a lot things, i need a cauter play like this area spell that remove the utana vid, but it is not working (it was working before the modifications)
cancel invisibility.lua
2- players that attack still invisible
this is so OP, players can still invisible and attacking other players, i would like to when players do damage in other players, it stops the inv
3- players recive damage but still invisible
the monsters that are imune to inv can attack the inv players, but its strange because it still invisible, it should stop the invisibility
my source: Fir3element/3777 (https://github.com/Fir3element/3777/tree/master/src)
source changes:
replace functions:
Code:
void Player::sendCreatureChangeVisible(const Creature* creature, Visible_t visible)
{
if(!client)
return;
const Player* player = creature->getPlayer();
if(player == this || (player && (getGhostAccess() > player->getGhostAccess())))
sendCreatureChangeOutfit(creature, creature->getCurrentOutfit());
else if(visible == VISIBLE_DISAPPEAR)
sendCreatureDisappear(creature, creature->getTile()->getClientIndexOfThing(this, creature));
else
sendCreatureAppear(creature);
}
bool Player::canSeeCreature(const Creature* creature) const
{
if(creature == this)
return true;
if(const Player* player = creature->getPlayer())
return !player->isInvisible() || getGhostAccess() > player->getGhostAccess();
return !creature->isInvisible();
}
edit functions:
Code:
void Player::onEndCondition(ConditionType_t type)
after
g_game.updateCreatureSkull(this);
}
add
else if(type == CONDITION_INVISIBLE)
{
Position newPos = getPosition();
g_game.addDistanceEffect(Position(newPos.x + 1, newPos.y, newPos.z), newPos, SHOOT_EFFECT_ENERGY);
g_game.addDistanceEffect(Position(newPos.x - 1, newPos.y, newPos.z), newPos, SHOOT_EFFECT_ENERGY);
g_game.addDistanceEffect(Position(newPos.x, newPos.y + 1, newPos.z), newPos, SHOOT_EFFECT_ENERGY);
g_game.addDistanceEffect(Position(newPos.x, newPos.y - 1, newPos.z), newPos, SHOOT_EFFECT_ENERGY);
}
But there are a few problems i don't know how to fix...
I have to stop inv in 3 ways:
1- utamo ina is not working (a area spell to remove inv)
inv players don't recive area damage, can trap, do a lot things, i need a cauter play like this area spell that remove the utana vid, but it is not working (it was working before the modifications)
Code:
<instant name="Cancel Invisibility" words="utana ina" maglv="1" mana="210" prem="0" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/cancel invisibility.lua">
</instant>
cancel invisibility.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_INVISIBLE)
local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
2- players that attack still invisible
this is so OP, players can still invisible and attacking other players, i would like to when players do damage in other players, it stops the inv
3- players recive damage but still invisible
the monsters that are imune to inv can attack the inv players, but its strange because it still invisible, it should stop the invisibility
my source: Fir3element/3777 (https://github.com/Fir3element/3777/tree/master/src)