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

OnKill noob char, teleport him and no frag.

pugamoline

uint32_t patch_mem(char *
Joined
Nov 15, 2011
Messages
189
Reaction score
19
Hi there, I have been thinking a lot on how about to solve noob chars in wars...

Protection system just sux, it doesnt work really well...

So I have an idea:

When you kill a player that has level X or less, he gets teleported to temple and also the killer doesn't get a frag, when dead this automaticaly add hp and mana.

Here is an idea for the part of the death for player:

my example:

creaturescripts.xml

PHP:
<event type="kill" name="Noobkill" script="noobkill.lua"/>

login.lua

PHP:
registerCreatureEvent(cid, "Noobkill")

noobkill.lua

LUA:
local lvl = 10 -- noob lvl
local corpse_ids = {
        [0] = 3065, -- female
        [1] = 3058 -- male
}
function onStatsChange(cid, attacker, type, combat, value)
        if combat == COMBAT_HEALING then
                return true
        end
 
        if getCreatureHealth(cid) > value then
                return true
        end
 if getPlayerLevel(cid) <= lvl then
 
         doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize "..getCreatureName(cid)..". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".\n[Noob caharcter killll]") 
         doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
        doSendMagicEffect(getCreaturePosition(cid), 10)
 
        doRemoveConditions(cid)
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
 
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You lost nothng as you are stilla  nub character")
        if isPlayer(attacker) then
                doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_BLUE, "You didnt got exp as you killed a noob character.")
        end
end
 
        return false
end
need work this script in tfs 0.4

Thanks to Mock.

Anyone can help?
I rep++++!
 
only asked for a little help to improve the script and publish it in the same community and that many of us helps
 
I use something similar, my tips:
Level 40- (so they wont be able to use SD)
Remove entire mana.
Just move them to temple and refill hp.
Dont do it onkill, do it on preparedeath.
 
-> PREPAREDEATH
LUA:
function onPrepareDeath(cid, deathList) 
	if getPlayerLevel(cid) < 40 then
		setPlayerStorageValue(cid, 834832, 1)
		doRemoveCreature(cid)
		return false
	end
	return true
end
-> LOGIN
LUA:
function onLogin(cid)
	if getPlayerStorageValue(cid, 834832) == 1 then
		doCreatureAddMana(cid, -getCreatureMaxMana(cid))
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		setPlayerStorageValue(cid, 834832, 0)
	end
return true
end
 
Back
Top