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
login.lua
noobkill.lua
need work this script in tfs 0.4
Thanks to Mock.
Anyone can help?
I rep++++!
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
Thanks to Mock.
Anyone can help?
I rep++++!