Postado Fevereiro 19, 2017 8 anos Olá, gostaria da ajuda de vocês para criar um script CREATUREEVENTS. Ele funcionaria de tal forma : Player completa a quest e ganha uma storage XXXXX (não preciso do script da Quest, so o script do creatureevents com o reflect) Assim que ganha a storage ele começa automaticamente a refletir todo tipo de dano, não 100%, mais uma porcentagem de 15% (Parte editável.) Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.
Postado Fevereiro 19, 2017 8 anos <event type="statschange" name="reflect" event="script" value="reflect.lua"/> login.lua: registerCreatureEvent(cid, "reflect") reflect.lua: local config = { chance = 100, -- chance de sair o reflect (1 = 1% de chance) valor_reflect = 15, -- % do dano do reflect storage = 45455 -- storage do reflect } function onStatsChange(cid, attacker, type, combat, value) if getPlayerStorageValue(cid, config.storage) > 0 then if type == STATSCHANGE_HEALTHLOSS and isPlayer(cid) and isCreature(attacker) then if math.random (1,100) <= config.chance then doCreatureSay(cid, "Reflect!", TALKTYPE_MONSTER_SAY) local danoReflect = value * (config.valor_reflect/100) doTargetCombatHealth(cid, attacker, COMBAT_PHYSICALDAMAGE, -danoReflect, -danoReflect, CONST_ME_EXPLOSIONAREA) return true end end end return true end
Postado Fevereiro 20, 2017 8 anos Autor 1 hora atrás, Zanrix disse: <event type="statschange" name="reflect" event="script" value="reflect.lua"/> login.lua: registerCreatureEvent(cid, "reflect") reflect.lua: 1 hora atrás, Zanrix disse: <event type="statschange" name="reflect" event="script" value="reflect.lua"/> login.lua: registerCreatureEvent(cid, "reflect") reflect.lua: local config = { chance = 100, -- chance de sair o reflect (1 = 1% de chance) valor_reflect = 15, -- % do dano do reflect storage = 45455 -- storage do reflect } function onStatsChange(cid, attacker, type, combat, value) if getPlayerStorageValue(cid, config.storage) > 0 then if type == STATSCHANGE_HEALTHLOSS and isPlayer(cid) and isCreature(attacker) then if math.random (1,100) <= config.chance then doCreatureSay(cid, "Reflect!", TALKTYPE_MONSTER_SAY) local danoReflect = value * (config.valor_reflect/100) doTargetCombatHealth(cid, attacker, COMBAT_PHYSICALDAMAGE, -danoReflect, -danoReflect, CONST_ME_EXPLOSIONAREA) return true end end end return true end Ai ele esta so refletindo quando o player perde vida e não mana. Mais eu mesmo alterei e consegue colocar pra refletir quando ta com utamo vita tbm. Valeu Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.
Postado Fevereiro 20, 2017 8 anos Como vc alterou @tetheuscunha ? GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
Postado Fevereiro 20, 2017 8 anos 5 minutos atrás, Sekk disse: Como vc alterou @tetheuscunha ? Troca if type == STATSCHANGE_HEALTHLOSS and isPlayer(cid) and isCreature(attacker) then Por essa if type == STATSCHANGE_HEALTHLOSS or STATSCHANGE_MANALOSS and isPlayer(cid) and isCreature(attacker) then
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.