• 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!

CreatureEvent AOE spells deals damage only to target

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
741
Solutions
5
Reaction score
193
Location
Pr0land
GitHub
Erexo
Hello guyz,
Fresh asked me about this script, i know its kinda stupid, but if someone need this, feel free to use.

Q: What this shit doin' Mrs Erexo?
Actually, you dont deal any damage to player who you dont have targeted. So, it deal damage to player, who u actually targeting (lul).
Monsters works as usual, u can hit them always, but if you wanna hit player, you must target him.

Here we go!

../creaturescripts/scripts/AntiAOE.lua
Lua:
function onStatsChange(cid, attacker, type, combat, value)
	if(attacker and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getCreatureName(getCreatureTarget(attacker)) ~= getCreatureName(cid)) then
		if combat ~= COMBAT_HEALING then
			return false
		end 
	end
return true
end
--By Erexo (hail OTLand)
function onCombat(cid, target) 
    if(target and isPlayer(target) and getCreatureName(getCreatureTarget(cid)) ~= getCreatureName(target)) then 
        return false 
    end 
return true 
end

../creaturescripts/scripts/login.lua {end of file before "return TRUE"}
Lua:
registerCreatureEvent(cid, "AntiAOE")
registerCreatureEvent(cid, "AntiAOE2")


../creaturescripts/creaturescripts.xml
XML:
 	<event type="statschange" name="AntiAOE" event="script" value="AntiAOE.lua"/>
	<event type="combat" name="AntiAOE2" event="script" value="AntiAOE.lua"/>


Have fun and enjoy,
Erexo.
 
Thy this one :)

Lua:
function onStatsChange(cid, attacker, type, combat, value)
	if(isPlayer(cid) and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getCreatureName(getCreatureTarget(attacker)) ~= getCreatureName(cid)) then
		if combat ~= COMBAT_HEALING then
			return false
		end 
	end
return true
end
--By Erexo (hail OTLand)
function onCombat(cid, target) 
	local zTarget = getCreatureTarget(cid)
	
    if(isPlayer(target) and target ~= zTarget) then 
        return false 
    end 
return true 
end
 
What do you mean?
U cannot mark player? Or just spells doesnt do damage to any player.
 
When I right click on a player it says sorry not possible. Nothing to do with protection lvl since I'm 10x higher lvl on both chars. I cannot attack another player at all.. even sudden death rune doesn't do damage.
 
Maybe profession ? I dont think that there is possibility to attack with/character without profession.
 
Uhm... No? xD thats irrelevant cause I don't have anything like a protected vocation. And I tried 4 chars agaist eachother.. none could attack eachother. (Knight-Sorc-Druid-Pally)
 
The problem that Xedite is having is "onCombat".
Obviously he is attempting to "target" a player, and getting the "Sorry not possible." cancle message.
I do not use 0.3.6, so I cannot be of much help other than that.
 
I'm not any good with Lua so I can't fix it self :( Would really love some help.
 
bump, could someone make it working on 0.3.6? got no idea how to do it
 
Back
Top