Postado Julho 3, 2013 11 anos Olá gostaria que alguem me ajudasse eu queria um script registerCreatureEvent que quando um monstro mata o cara ele n perde lv nem skill nada plis me ajudem ;/ Algo que funcione tipo assim: function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) local level = 49 if isPlayer(cid) and getPlayerLevel(cid) < level then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doRemoveConditions(cid, false) return false end return true end Alguem?
Postado Julho 3, 2013 11 anos Creaturescript crie = "levelprotection.lua" function onDeath(cid, corpse, deathList) local config = {onlypremium = true, -- se precisa ser premium para não perder nada exp = true, -- se ao morrer o jogador irá perder exp skills = false, -- se ao morrer vai perder skills magic = false, -- se vai perder magic level loot = false, -- se ao morrer o jogador irá perder o loot level = 50 -- até que level irá proteger o player}if isPlayer(cid) and getPlayerLevel(cid) <= config.level thenif config.onlypremium == true and not isPremium(cid) then return TRUE endif config.loot == false then doCreatureSetDropLoot(cid, false) endif config.magic == false then doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) endif config.skills == false then doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) endif config.exp == false then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) endreturn TRUE end return TRUE end Creaturescript.xml <event type="death" name="ProtectLevel" event="script" value="levelprotection.lua"/> Em creaturescript/script/login.lua adicione registerCreatureEvent(cid, "ProtectLevel") Creditos Speed Fire raell, me come
Postado Julho 4, 2013 11 anos Autor Obrigado amigo por tentar ajudar mas não é um script q o player n perde lv nem loot etc.. quando morre. explicando, quando um mosntro mata um player ele é teleportado para o templo e n perde nada mas tem q ser 1 nome de bixo só exemplo Event Boss quando mata 1 jogador o cara quando morre n perde nada só vai para o templo, mas vlw pela intenção
Postado Julho 5, 2013 11 anos Crie um arquivo chamado monster.lua na pasta data/creaturescripts/scripts local cfg = { areaPos = { {x=xxxx, y=yyyy, z=z}, -- Piso esquerdo superior da cave do monstro {x=xxxx, y=yyyy, z=z} -- Piso direito inferior da cave do monstro }, templePos = {x=xxxx, y=yyyy, z=z} -- Posição do templo } function onStatsChange(cid, attacker, type, combat, value) if isPlayer(cid) and isMonster(attacker) then if type == STATSCHANGE_HEALTHLOSS then if isInArea(getPlayerPosition(cid), cfg.areaPos[1], cfg.areaPos[2]) then local corpse = doCreateItem(3058, 1, getPlayerPosition(cid)) doItemSetAttribute(corpse, "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") ..".") doTeleportThing(cid, cfg.templePos) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) end end end return TRUE end Adicione a seguinte linha no arquivo creaturescripts.xml que se encontra na pasta data/creaturescripts <event type="statschange" name="monsterEvent" event="script" value="monster.lua"/> Adicione a seguinte linha no arquivo login.lua que se encontra na pasta data/creaturescripts/scripts registerCreatureEvent(cid, "monsterEvent") Não testado. Dúvidas? Me avise. Att. Giovani Rodrigo Spoiler local config = { delrey = getPlayerCarValue(cid, DELREY), cigarro = getPlayerCancer(cid, DERBY), prostituta = getPlayerAIDS(cid, cracuda), tresOitao = getPlayerRevorvi(cid, 38) } if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS") end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.