• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

secureMode, getPlayerSpell (?) problem.... CyberM take a look please!

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello
I made working piece of code secureMode (popular hand in Tibia)
PHP:
function onCombat(cid, target)
    if isPlayer(cid) and secureMode == 0 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You cannot attack player when secure mode is off.")
        return false
        elseif isPlayer(cid) and secureMode == 1 then
                return true
    end  
    return true
end

But i dont know how to add function with ignoring spell, if i dont have selected hand.
Anyone can help me ?

If i try:
onCastSpell(cid) the script totally ruins, i totally cannot attack player (like non-pvp server)
 
secure mode means that you CANNOT attackl players, thats why its secure -.-
im not sure, ut targetting part should be already done in source(thats why you get false in both cases: your script disables pvp with secure mode off and source when its on)
and aoe thing, well, easy patch to source, in lua bigger thing imo
 
So how i can add it to tfs 0.3.5pl1 ? Tibia 8.5 . You have any piece of code to source with aoe spells ??
 
Here is piece of code:

combat.cpp:
LUA:
	if(target->getPlayer() && !Combat::isInPvpZone(player, target) && player->getSkullClient(target->getPlayer()) == SKULL_NONE)
	{
		if(player->getSecureMode() == SECUREMODE_ON)
			return RET_TURNSECUREMODETOATTACKUNMARKEDPLAYERS;

and

spells.cpp
LUA:
	if(player->getSecureMode() == SECUREMODE_ON)
	{
		player->sendCancelMessage(RET_TURNSECUREMODETOATTACKUNMARKEDPLAYERS);
		g_game.addMagicEffect(player->getPosition(), NM_ME_POFF);
		return false;
	}


Now if i spell an AoE spells it dont ignore players if i have securemode on (hand off):
aaaaaaaa11111.png


I want if i spell AoE spell and i have secure mode on, the spells tiles ignoring players like this:
withouta.png



ANYONE CAN HELP ME ?
 
Back
Top