grassmaster 0 Postado Julho 8, 2011 Share Postado Julho 8, 2011 Quando estão em duel system, os pokemons nao tiram life um do outro. Gostaria de saber como arrumar isso. OBRIGADO Link para o comentário Compartilhar em outros sites More sharing options...
0 Kuro o Shiniga 87 Postado Julho 8, 2011 Share Postado Julho 8, 2011 Eles se attack pelo menos? provavelmente e pq o servidor esta no-pvp e o duel system esta errado '-' Link para o comentário Compartilhar em outros sites More sharing options...
0 batatasmile 8 Postado Julho 8, 2011 Share Postado Julho 8, 2011 aki é a msma coisa já tentei, colocar pvp, local pvp, mais só da pra dar traget pq os hits nao tiram dano Link para o comentário Compartilhar em outros sites More sharing options...
0 grassmaster 0 Postado Julho 8, 2011 Autor Share Postado Julho 8, 2011 Eles se attack pelo menos? provavelmente e pq o servidor esta no-pvp e o duel system esta errado '-' @pinpao Tentei no PVP e no PVP Enforced mas nada muda... Gostaria de saber como posso arrumar isso. REP+ por 1 semana. Grato! Se quiser me add no MSN ficarei agradecido. Link para o comentário Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Julho 8, 2011 Share Postado Julho 8, 2011 posta seu exp.lua (data/creaturescripts/scripts) aqui que eu arrumo pra você Link para o comentário Compartilhar em outros sites More sharing options...
0 batatasmile 8 Postado Julho 8, 2011 Share Postado Julho 8, 2011 (editado) local expcond = createConditionObject(CONDITION_INFIGHT)setConditionParam(expcond, CONDITION_PARAM_TICKS, 4500) -- MUDE AQUI O EFEITO QUE VOCÊ QUER QUE APAREÇA DE ACORDO COM O TIPO DE COMBATE local efeitos = { [COMBAT_PHYSICALDAMAGE] = 3, [ELECTRICDAMAGE] = 3, [WATERDAMAGE] = 3, [FIREDAMAGE] = 3, [GRASSDAMAGE] = 3, [iCEDAMAGE] = 3, [ROCKDAMAGE] = 3, [FLYDAMAGE] = 3, [FIGHTDAMAGE] = 3, [POISONDAMAGE] = 3, [DRAGONDAMAGE] = 3, [bUGDAMAGE] = 3, [NORMALDAMAGE] = 3, [GHOSTDAMAGE] = 3, [GROUNDDAMAGE] = 3, [PSYCHICDAMAGE] = 3, } function onStatsChange(cid, attacker, enps, combatee, value) if combatee == PSYCHICDAMAGE then cor = COLOR_PSYCHIC elseif combatee == GRASSDAMAGE then cor = COLOR_GRASS elseif combatee == FIREDAMAGE then cor = COLOR_FIRE2 elseif combatee == WATERDAMAGE then cor = COLOR_WATER elseif combatee == ICEDAMAGE then cor = COLOR_ICE elseif combatee == NORMALDAMAGE then cor = COLOR_NORMAL elseif combatee == FLYDAMAGE then cor = COLOR_FLYING elseif combatee == GHOSTDAMAGE then cor = COLOR_GHOST elseif combatee == GROUNDDAMAGE then cor = COLOR_GROUND elseif combatee == ELECTRICDAMAGE then cor = COLOR_ELECTRIC elseif combatee == ROCKDAMAGE then cor = COLOR_ROCK elseif combatee == BUGDAMAGE then cor = COLOR_BUG elseif combatee == FIGHTDAMAGE then cor = COLOR_FIGHTING elseif combatee == DRAGONDAMAGE then cor = COLOR_DRAGON elseif combatee == POISONDAMAGE then cor = COLOR_POISON elseif getCreatureName(cid) == "Kakuna" or getCreatureName(cid) == "Metapod" then cor = COLOR_BUG elseif getCreatureName(cid) == "Golem" or getCreatureName(cid) == "Graveler" or getCreatureName(cid) == "Geodude" then cor = COLOR_ROCK else cor = NONE end local cores = cor if getPlayerStorageValue(cid, 33) >= 1 then -- funcionamento do self destruction if isCreature(attacker) then return false end return true end if getPlayerStorageValue(cid, 34) >= 1 then -- REFLECT if combatee ~= COMBAT_PHYSICALDAMAGE then if isCreature(attacker) then doSendMagicEffect(getThingPos(cid), 135) doSendMagicEffect(getThingPos(attacker), 3) doSendAnimatedText(getThingPos(cid), "REFLECT", 215) doCreatureAddHealth(attacker, -value, 3, 191) -- 3 = efeito do reflect setPlayerStorageValue(cid, 34, 0) return false end end end if getPlayerStorageValue(cid, 35) >= 1 then -- MAGIAS DE MISS, STRING SHOT, MUD SHOT ETC if combatee ~= COMBAT_PHYSICALDAMAGE then if isCreature(attacker) then doSendAnimatedText(getThingPos(cid), "MISS", 215) setPlayerStorageValue(cid, 35, 0) return false end end end if not isCreature(attacker) then return true end if isPlayer(attacker) then return true end if enps == STATSCHANGE_HEALTHGAIN then return true end if enps == STATSCHANGE_HEALTHLOSS then if getCreatureHealth(cid) <= value then if isPlayer(cid) then if #getCreatureSummons(cid) == 0 then doCreatureAddHealth(cid, -getCreatureHealth(cid), 3, 180) -- 3 é o efeito que aparece no player quando ele é atacado e vai morrer return false end return false end if isPlayer(getCreatureMaster(attacker)) then doTargetCombatHealth(getCreatureMaster(attacker), cid, combatee, -(getCreatureHealth(cid)), -(getCreatureHealth(cid)), efeitos[combatee]) if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), value, cores) end return false end return true end if isPlayer(cid) then if #getCreatureSummons(cid) >= 1 then return false end doCreatureAddHealth(cid, -value, 3, 180) -- 3 é o efeito que aparece no player quando é atacado return false end if isPlayer(getCreatureMaster(cid)) then doAddCondition(getCreatureMaster(cid), expcond) end if combatee == ELECTRICDAMAGE then if isInArray(electric2, getCreatureName(cid)) then x = 2 elseif isInArray(electric1, getCreatureName(cid)) then x = 0.5 elseif isInArray(electric0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == WATERDAMAGE then if isInArray(water2, getCreatureName(cid)) then x = 2 elseif isInArray(water1, getCreatureName(cid)) then x = 0.5 elseif isInArray(water0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GRASSDAMAGE then if isInArray(grass2, getCreatureName(cid)) then x = 2 elseif isInArray(grass1, getCreatureName(cid)) then x = 0.5 elseif isInArray(grass0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FLYDAMAGE then if isInArray(flying2, getCreatureName(cid)) then x = 2 elseif isInArray(flying1, getCreatureName(cid)) then x = 0.5 elseif isInArray(flying0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FIREDAMAGE then if isInArray(fire2, getCreatureName(cid)) then x = 2 elseif isInArray(fire1, getCreatureName(cid)) then x = 0.5 elseif isInArray(fire0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == ROCKDAMAGE then if isInArray(rock2, getCreatureName(cid)) then x = 2 elseif isInArray(rock1, getCreatureName(cid)) then x = 0.5 elseif isInArray(rock0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GROUNDDAMAGE then if isInArray(ground2, getCreatureName(cid)) then x = 2 elseif isInArray(ground1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ground0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GHOSTDAMAGE then if isInArray(ghost2, getCreatureName(cid)) then x = 2 elseif isInArray(ghost1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ghost0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == BUGDAMAGE then if isInArray(bug2, getCreatureName(cid)) then x = 2 elseif isInArray(bug1, getCreatureName(cid)) then x = 0.5 elseif isInArray(bug0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == NORMALDAMAGE then if isInArray(normal2, getCreatureName(cid)) then x = 2 elseif isInArray(normal1, getCreatureName(cid)) then x = 0.5 elseif isInArray(normal0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FIGHTDAMAGE then if isInArray(fighting2, getCreatureName(cid)) then x = 2 elseif isInArray(fighting1, getCreatureName(cid)) then x = 0.5 elseif isInArray(fighting0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == POISONDAMAGE then if isInArray(poison2, getCreatureName(cid)) then x = 2 elseif isInArray(poison1, getCreatureName(cid)) then x = 0.5 elseif isInArray(poison0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == PSYCHICDAMAGE then if isInArray(psychic2, getCreatureName(cid)) then x = 2 elseif isInArray(psychic1, getCreatureName(cid)) then x = 0.5 elseif isInArray(psychic0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == ICEDAMAGE then if isInArray(ice2, getCreatureName(cid)) then x = 2 elseif isInArray(ice1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ice0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == DRAGONDAMAGE then if isInArray(dragon2, getCreatureName(cid)) then x = 2 elseif isInArray(dragon1, getCreatureName(cid)) then x = 0.5 elseif isInArray(dragon0, getCreatureName(cid)) then x = 0 else x = 1 end else x = 1 end local xx = x if not isSummon(attacker) then if not isPlayer(cid) and not isPlayer(getCreatureMaster(cid)) then return false end if isSummon(cid) and getCreatureHealth(cid) <= (getCreatureMaxHealth(cid)*0.15) and not exhaustion.get(getCreatureMaster(cid), 88726) then exhaustion.set(getCreatureMaster(cid), 88726, 6) doSendMagicEffect(getThingPos(cid), 178) end if getPlayerStorageValue(cid, 4) >= 1 then local damage = value doCreatureAddHealth(cid, -((math.ceil(damage/2))*xx), 2, cores) -- 2 é o efeito que aparece no pokemon quando tem harden e é atacado else local damage = value if cor == NONE then return true end doCreatureAddHealth(cid, -((math.ceil(damage/1))*xx), efeitos[combatee], cores) return false end return false end if isSummon(attacker) then if isSummon(cid) then if isInParty(getCreatureMaster(cid)) and isInParty(getCreatureMaster(attacker)) and getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then else return false end end local combatx = combatee local valor = value if getPlayerStorageValue(cid, 4) >= 1 then doTargetCombatHealth(getCreatureMaster(attacker), cid, combatx, -((valor / 2)*x), -(((valor / 2)+10)*x), 255) else doTargetCombatHealth(getCreatureMaster(attacker), cid, combatx, -((valor)*x), -((valor+10)*x), 255) end if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), value*xx, cores) end end end end o meu está assim Editado Julho 8, 2011 por Darkabra Link para o comentário Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Julho 8, 2011 Share Postado Julho 8, 2011 Use isso no lugar do seu exp.lua: local expcond = createConditionObject(CONDITION_INFIGHT) setConditionParam(expcond, CONDITION_PARAM_TICKS, 4500) local cores = { [PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC}, [GRASSDAMAGE] = {cor = COLOR_GRASS}, [FIREDAMAGE] = {cor = COLOR_FIRE2}, [WATERDAMAGE] = {cor = COLOR_WATER}, [iCEDAMAGE] = {cor = COLOR_ICE}, [NORMALDAMAGE] = {cor = COLOR_NORMAL}, [FLYDAMAGE] = {cor = COLOR_FLYING}, [GHOSTDAMAGE] = {cor = COLOR_GHOST}, [GROUNDDAMAGE] = {cor = COLOR_GROUND}, [ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC}, [ROCKDAMAGE] = {cor = COLOR_ROCK}, [bUGDAMAGE] = {cor = COLOR_BUG}, [FIGHTDAMAGE] = {cor = COLOR_FIGHTING}, [DRAGONDAMAGE] = {cor = COLOR_DRAGON}, [POISONDAMAGE] = {cor = COLOR_POISON}, [COMBAT_PHYSICALDAMAGE] = {cor = 0}, } function onStatsChange(cid, attacker, enps, combatee, value) if enps == STATSCHANGE_HEALTHGAIN then return true end if isPlayer(cid) and #getCreatureSummons(cid) >= 1 then return false end local cor = cores[combatee].cor if getPlayerStorageValue(cid, 33) >= 1 then -- funcionamento do self destruction if isCreature(attacker) then return false end return true end if getPlayerStorageValue(cid, 34) >= 1 then -- REFLECT if combatee ~= COMBAT_PHYSICALDAMAGE then if isCreature(attacker) then doSendMagicEffect(getThingPos(cid), 135) doSendMagicEffect(getThingPos(attacker), 3) doSendAnimatedText(getThingPos(cid), "REFLECT", 215) doCreatureAddHealth(attacker, -value, 3, 191) -- 3 = efeito do reflect setPlayerStorageValue(cid, 34, 0) return false end end end if getPlayerStorageValue(cid, 35) >= 1 then -- MAGIAS DE MISS, STRING SHOT, MUD SHOT ETC if combatee ~= COMBAT_PHYSICALDAMAGE then if isCreature(attacker) then doSendAnimatedText(getThingPos(cid), "MISS", 215) setPlayerStorageValue(cid, 35, 0) return false end end end if not isCreature(attacker) then return true end if isPlayer(attacker) then return true end if getCreatureHealth(cid) <= value then if isPlayer(cid) then doCreatureAddHealth(cid, -getCreatureHealth(cid), 3, 180) return false end if isPlayer(getCreatureMaster(attacker)) then doTargetCombatHealth(getCreatureMaster(attacker), cid, combatee, -(getCreatureHealth(cid)), -(getCreatureHealth(cid)), 3) if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), value, cores) end return false end return true end if isPlayer(cid) then doCreatureAddHealth(cid, -value, 3, 180) return false end if isPlayer(getCreatureMaster(cid)) then doAddCondition(getCreatureMaster(cid), expcond) end if combatee == ELECTRICDAMAGE then if isInArray(electric2, getCreatureName(cid)) then x = 2 elseif isInArray(electric1, getCreatureName(cid)) then x = 0.5 elseif isInArray(electric0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == WATERDAMAGE then if isInArray(water2, getCreatureName(cid)) then x = 2 elseif isInArray(water1, getCreatureName(cid)) then x = 0.5 elseif isInArray(water0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GRASSDAMAGE then if isInArray(grass2, getCreatureName(cid)) then x = 2 elseif isInArray(grass1, getCreatureName(cid)) then x = 0.5 elseif isInArray(grass0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FLYDAMAGE then if isInArray(flying2, getCreatureName(cid)) then x = 2 elseif isInArray(flying1, getCreatureName(cid)) then x = 0.5 elseif isInArray(flying0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FIREDAMAGE then if isInArray(fire2, getCreatureName(cid)) then x = 2 elseif isInArray(fire1, getCreatureName(cid)) then x = 0.5 elseif isInArray(fire0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == ROCKDAMAGE then if isInArray(rock2, getCreatureName(cid)) then x = 2 elseif isInArray(rock1, getCreatureName(cid)) then x = 0.5 elseif isInArray(rock0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GROUNDDAMAGE then if isInArray(ground2, getCreatureName(cid)) then x = 2 elseif isInArray(ground1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ground0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GHOSTDAMAGE then if isInArray(ghost2, getCreatureName(cid)) then x = 2 elseif isInArray(ghost1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ghost0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == BUGDAMAGE then if isInArray(bug2, getCreatureName(cid)) then x = 2 elseif isInArray(bug1, getCreatureName(cid)) then x = 0.5 elseif isInArray(bug0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == NORMALDAMAGE then if isInArray(normal2, getCreatureName(cid)) then x = 2 elseif isInArray(normal1, getCreatureName(cid)) then x = 0.5 elseif isInArray(normal0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FIGHTDAMAGE then if isInArray(fighting2, getCreatureName(cid)) then x = 2 elseif isInArray(fighting1, getCreatureName(cid)) then x = 0.5 elseif isInArray(fighting0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == POISONDAMAGE then if isInArray(poison2, getCreatureName(cid)) then x = 2 elseif isInArray(poison1, getCreatureName(cid)) then x = 0.5 elseif isInArray(poison0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == PSYCHICDAMAGE then if isInArray(psychic2, getCreatureName(cid)) then x = 2 elseif isInArray(psychic1, getCreatureName(cid)) then x = 0.5 elseif isInArray(psychic0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == ICEDAMAGE then if isInArray(ice2, getCreatureName(cid)) then x = 2 elseif isInArray(ice1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ice0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == DRAGONDAMAGE then if isInArray(dragon2, getCreatureName(cid)) then x = 2 elseif isInArray(dragon1, getCreatureName(cid)) then x = 0.5 elseif isInArray(dragon0, getCreatureName(cid)) then x = 0 else x = 1 end else x = 1 end local xx = x if not isSummon(attacker) then if not isPlayer(cid) and not isPlayer(getCreatureMaster(cid)) then return false end if isSummon(cid) and getCreatureHealth(cid) <= (getCreatureMaxHealth(cid)*0.15) and not exhaustion.get(getCreatureMaster(cid), 88726) then exhaustion.set(getCreatureMaster(cid), 88726, 6) doSendMagicEffect(getThingPos(cid), 178) end local damage = value if getPlayerStorageValue(cid, 4) >= 1 then doCreatureAddHealth(cid, -math.ceil(damage/2*xx), 2, cores) -- 2 é o efeito que aparece no pokemon quando tem harden e é atacado return false else doCreatureAddHealth(cid, -math.ceil(damage*xx), 3, cores) return false end return false end if isSummon(attacker) then if isSummon(cid) then if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then return false end if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then return false end end local combatx = combatee local valor = value local life = getCreatureHealth(cid) if getPlayerStorageValue(cid, 4) >= 1 then doTargetCombatHealth(getCreatureMaster(attacker), cid, combatx, -math.ceil(valor/2*xx), -math.ceil(valor/2*xx+10), 255) life = life - getCreatureHealth(cid) if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), life, cores) end else doTargetCombatHealth(getCreatureMaster(attacker), cid, combatx, -math.ceil(valor*xx), -math.ceil(valor*xx + 10), 255) life = life - getCreatureHealth(cid) if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), life, cores) end end return false end return true end Link para o comentário Compartilhar em outros sites More sharing options...
0 batatasmile 8 Postado Julho 8, 2011 Share Postado Julho 8, 2011 (editado) @brun123 DEU CERTO MAIS TA DANDO ESSE ERRO AKI [08/07/2011 15:35:51] [Error - CreatureScript Interface] [08/07/2011 15:35:51] data/creaturescripts/scripts/exp.lua:onStatsChange [08/07/2011 15:35:51] Description: [08/07/2011 15:35:51] data/creaturescripts/scripts/exp.lua:33: attempt to index field '?' (a nil value) [08/07/2011 15:35:51] stack traceback: [08/07/2011 15:35:51] data/creaturescripts/scripts/exp.lua:33: in function <data/creaturescripts/scripts/exp.lua:23> [08/07/2011 15:35:51] [C]: in function 'doCreatureAddHealth' [08/07/2011 15:35:51] data/creaturescripts/scripts/exp.lua:272: in function <data/creaturescripts/scripts/exp.lua:23> Editado Julho 8, 2011 por Darkabra Link para o comentário Compartilhar em outros sites More sharing options...
0 Demonbholder 420 Postado Julho 8, 2011 Share Postado Julho 8, 2011 Galera, não esqueçam de reportar quando o tópico estiver em seção incorreta. Movido, abraços. Link para o comentário Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Julho 8, 2011 Share Postado Julho 8, 2011 usa esse então: local expcond = createConditionObject(CONDITION_INFIGHT) setConditionParam(expcond, CONDITION_PARAM_TICKS, 4500) local cores = { [PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC}, [GRASSDAMAGE] = {cor = COLOR_GRASS}, [FIREDAMAGE] = {cor = COLOR_FIRE2}, [WATERDAMAGE] = {cor = COLOR_WATER}, [iCEDAMAGE] = {cor = COLOR_ICE}, [NORMALDAMAGE] = {cor = COLOR_NORMAL}, [FLYDAMAGE] = {cor = COLOR_FLYING}, [GHOSTDAMAGE] = {cor = COLOR_GHOST}, [GROUNDDAMAGE] = {cor = COLOR_GROUND}, [ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC}, [ROCKDAMAGE] = {cor = COLOR_ROCK}, [bUGDAMAGE] = {cor = COLOR_BUG}, [FIGHTDAMAGE] = {cor = COLOR_FIGHTING}, [DRAGONDAMAGE] = {cor = COLOR_DRAGON}, [POISONDAMAGE] = {cor = COLOR_POISON}, [COMBAT_PHYSICALDAMAGE] = {cor = 0}, } function onStatsChange(cid, attacker, enps, combatee, value) if enps == STATSCHANGE_HEALTHGAIN then return true end if isPlayer(cid) and #getCreatureSummons(cid) >= 1 then return false end local cor = 0 if cores[combatee].cor then cor = cores[combatee].cor end if getPlayerStorageValue(cid, 33) >= 1 then -- funcionamento do self destruction if isCreature(attacker) then return false end return true end if getPlayerStorageValue(cid, 34) >= 1 then -- REFLECT if combatee ~= COMBAT_PHYSICALDAMAGE then if isCreature(attacker) then doSendMagicEffect(getThingPos(cid), 135) doSendMagicEffect(getThingPos(attacker), 3) doSendAnimatedText(getThingPos(cid), "REFLECT", 215) doCreatureAddHealth(attacker, -value, 3, 191) -- 3 = efeito do reflect setPlayerStorageValue(cid, 34, 0) return false end end end if getPlayerStorageValue(cid, 35) >= 1 then -- MAGIAS DE MISS, STRING SHOT, MUD SHOT ETC if combatee ~= COMBAT_PHYSICALDAMAGE then if isCreature(attacker) then doSendAnimatedText(getThingPos(cid), "MISS", 215) setPlayerStorageValue(cid, 35, 0) return false end end end if not isCreature(attacker) then return true end if isPlayer(attacker) then return true end if getCreatureHealth(cid) <= value then if isPlayer(cid) then doCreatureAddHealth(cid, -getCreatureHealth(cid), 3, 180) return false end if isPlayer(getCreatureMaster(attacker)) then doTargetCombatHealth(getCreatureMaster(attacker), cid, combatee, -(getCreatureHealth(cid)), -(getCreatureHealth(cid)), 3) if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), value, cores) end return false end return true end if isPlayer(cid) then doCreatureAddHealth(cid, -value, 3, 180) return false end if isPlayer(getCreatureMaster(cid)) then doAddCondition(getCreatureMaster(cid), expcond) end if combatee == ELECTRICDAMAGE then if isInArray(electric2, getCreatureName(cid)) then x = 2 elseif isInArray(electric1, getCreatureName(cid)) then x = 0.5 elseif isInArray(electric0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == WATERDAMAGE then if isInArray(water2, getCreatureName(cid)) then x = 2 elseif isInArray(water1, getCreatureName(cid)) then x = 0.5 elseif isInArray(water0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GRASSDAMAGE then if isInArray(grass2, getCreatureName(cid)) then x = 2 elseif isInArray(grass1, getCreatureName(cid)) then x = 0.5 elseif isInArray(grass0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FLYDAMAGE then if isInArray(flying2, getCreatureName(cid)) then x = 2 elseif isInArray(flying1, getCreatureName(cid)) then x = 0.5 elseif isInArray(flying0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FIREDAMAGE then if isInArray(fire2, getCreatureName(cid)) then x = 2 elseif isInArray(fire1, getCreatureName(cid)) then x = 0.5 elseif isInArray(fire0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == ROCKDAMAGE then if isInArray(rock2, getCreatureName(cid)) then x = 2 elseif isInArray(rock1, getCreatureName(cid)) then x = 0.5 elseif isInArray(rock0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GROUNDDAMAGE then if isInArray(ground2, getCreatureName(cid)) then x = 2 elseif isInArray(ground1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ground0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GHOSTDAMAGE then if isInArray(ghost2, getCreatureName(cid)) then x = 2 elseif isInArray(ghost1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ghost0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == BUGDAMAGE then if isInArray(bug2, getCreatureName(cid)) then x = 2 elseif isInArray(bug1, getCreatureName(cid)) then x = 0.5 elseif isInArray(bug0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == NORMALDAMAGE then if isInArray(normal2, getCreatureName(cid)) then x = 2 elseif isInArray(normal1, getCreatureName(cid)) then x = 0.5 elseif isInArray(normal0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FIGHTDAMAGE then if isInArray(fighting2, getCreatureName(cid)) then x = 2 elseif isInArray(fighting1, getCreatureName(cid)) then x = 0.5 elseif isInArray(fighting0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == POISONDAMAGE then if isInArray(poison2, getCreatureName(cid)) then x = 2 elseif isInArray(poison1, getCreatureName(cid)) then x = 0.5 elseif isInArray(poison0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == PSYCHICDAMAGE then if isInArray(psychic2, getCreatureName(cid)) then x = 2 elseif isInArray(psychic1, getCreatureName(cid)) then x = 0.5 elseif isInArray(psychic0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == ICEDAMAGE then if isInArray(ice2, getCreatureName(cid)) then x = 2 elseif isInArray(ice1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ice0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == DRAGONDAMAGE then if isInArray(dragon2, getCreatureName(cid)) then x = 2 elseif isInArray(dragon1, getCreatureName(cid)) then x = 0.5 elseif isInArray(dragon0, getCreatureName(cid)) then x = 0 else x = 1 end else x = 1 end local xx = x if not isSummon(attacker) then if not isPlayer(cid) and not isPlayer(getCreatureMaster(cid)) then return false end if isSummon(cid) and getCreatureHealth(cid) <= (getCreatureMaxHealth(cid)*0.15) and not exhaustion.get(getCreatureMaster(cid), 88726) then exhaustion.set(getCreatureMaster(cid), 88726, 6) doSendMagicEffect(getThingPos(cid), 178) end local damage = value if getPlayerStorageValue(cid, 4) >= 1 then doCreatureAddHealth(cid, -math.ceil(damage/2*xx), 2, cores) -- 2 é o efeito que aparece no pokemon quando tem harden e é atacado return false else doCreatureAddHealth(cid, -math.ceil(damage*xx), 3, cores) return false end return false end if isSummon(attacker) then if isSummon(cid) then if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then return false end if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then return false end end local combatx = combatee local valor = value local life = getCreatureHealth(cid) if getPlayerStorageValue(cid, 4) >= 1 then doTargetCombatHealth(getCreatureMaster(attacker), cid, combatx, -math.ceil(valor/2*xx), -math.ceil(valor/2*xx+10), 255) life = life - getCreatureHealth(cid) if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), life, cores) end else doTargetCombatHealth(getCreatureMaster(attacker), cid, combatx, -math.ceil(valor*xx), -math.ceil(valor*xx + 10), 255) life = life - getCreatureHealth(cid) if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), life, cores) end end return false end return true end Link para o comentário Compartilhar em outros sites More sharing options...
0 vlist 0 Postado Julho 8, 2011 Share Postado Julho 8, 2011 (editado) Olá brun123 Por Favor Você Poderia Me Adicionar No Msn ( gabibiscegli@hotmail.com ) ? Fico Grato Editado Julho 8, 2011 por vlist Link para o comentário Compartilhar em outros sites More sharing options...
0 batatasmile 8 Postado Julho 9, 2011 Share Postado Julho 9, 2011 @brun123 continua a ter esse erro [09/07/2011 00:09:31] [Error - CreatureScript Interface] [09/07/2011 00:09:31] data/creaturescripts/scripts/exp.lua:onStatsChange [09/07/2011 00:09:31] Description: [09/07/2011 00:09:31] data/creaturescripts/scripts/exp.lua:34: attempt to index field '?' (a nil value) [09/07/2011 00:09:31] stack traceback: [09/07/2011 00:09:31] data/creaturescripts/scripts/exp.lua:34: in function <data/creaturescripts/scripts/exp.lua:23> [09/07/2011 00:09:31] [C]: in function 'doCreatureAddHealth' [09/07/2011 00:09:31] data/creaturescripts/scripts/exp.lua:275: in function <data/creaturescripts/scripts/exp.lua:23> pode me add no msn pra nois conversa tenho uma coisa para te perguntar, mais se vc quiser q seja pelo :XTibia_smile: tudo bem msn lukas157_@hotmail.com Link para o comentário Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Julho 9, 2011 Share Postado Julho 9, 2011 (editado) Então esse vai funcionar: local expcond = createConditionObject(CONDITION_INFIGHT) setConditionParam(expcond, CONDITION_PARAM_TICKS, 4500) local colors = { [PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC}, [GRASSDAMAGE] = {cor = COLOR_GRASS}, [FIREDAMAGE] = {cor = COLOR_FIRE2}, [WATERDAMAGE] = {cor = COLOR_WATER}, [iCEDAMAGE] = {cor = COLOR_ICE}, [NORMALDAMAGE] = {cor = COLOR_NORMAL}, [FLYDAMAGE] = {cor = COLOR_FLYING}, [GHOSTDAMAGE] = {cor = COLOR_GHOST}, [GROUNDDAMAGE] = {cor = COLOR_GROUND}, [ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC}, [ROCKDAMAGE] = {cor = COLOR_ROCK}, [bUGDAMAGE] = {cor = COLOR_BUG}, [FIGHTDAMAGE] = {cor = COLOR_FIGHTING}, [DRAGONDAMAGE] = {cor = COLOR_DRAGON}, [POISONDAMAGE] = {cor = COLOR_POISON}, [COMBAT_PHYSICALDAMAGE] = {cor = 0}, } function onStatsChange(cid, attacker, enps, combatee, value) if enps == STATSCHANGE_HEALTHGAIN then return true end if isPlayer(cid) then if #getCreatureSummons(cid) >= 1 then return false end if isPlayer(attacker) or isSummon(attacker) then return false end end local cores = 0 if colors[combatee] then cores = colors[combatee].cor end if getPlayerStorageValue(cid, 33) >= 1 then -- funcionamento do self destruction if isCreature(attacker) then return false end return true end if getPlayerStorageValue(cid, 34) >= 1 then -- REFLECT if combatee ~= COMBAT_PHYSICALDAMAGE then if isCreature(attacker) then doSendMagicEffect(getThingPos(cid), 135) doSendMagicEffect(getThingPos(attacker), 3) doSendAnimatedText(getThingPos(cid), "REFLECT", 215) doCreatureAddHealth(attacker, -value, 3, 191) -- 3 = efeito do reflect setPlayerStorageValue(cid, 34, 0) return false end end end if getPlayerStorageValue(cid, 35) >= 1 then -- MAGIAS DE MISS, STRING SHOT, MUD SHOT ETC if combatee ~= COMBAT_PHYSICALDAMAGE then if isCreature(attacker) then doSendAnimatedText(getThingPos(cid), "MISS", 215) setPlayerStorageValue(cid, 35, 0) return false end end end if not isCreature(attacker) then return true end if isPlayer(attacker) then return true end if getCreatureHealth(cid) <= value then if isPlayer(cid) then if isPlayer(attacker) or isSummon(attacker) then return false end doCreatureAddHealth(cid, -getCreatureHealth(cid), 3, 180) return false end if isSummon(cid) and (isPlayer(attacker) or isSummon(attacker)) then if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then return false end if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then return false end end if isPlayer(getCreatureMaster(attacker)) then doTargetCombatHealth(getCreatureMaster(attacker), cid, combatee, -(getCreatureHealth(cid)), -(getCreatureHealth(cid)), 3) if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), value, cores) end return false end return true end if isPlayer(cid) then doCreatureAddHealth(cid, -value, 3, 180) return false end if isPlayer(getCreatureMaster(cid)) then doAddCondition(getCreatureMaster(cid), expcond) end if combatee == ELECTRICDAMAGE then if isInArray(electric2, getCreatureName(cid)) then x = 2 elseif isInArray(electric1, getCreatureName(cid)) then x = 0.5 elseif isInArray(electric0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == WATERDAMAGE then if isInArray(water2, getCreatureName(cid)) then x = 2 elseif isInArray(water1, getCreatureName(cid)) then x = 0.5 elseif isInArray(water0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GRASSDAMAGE then if isInArray(grass2, getCreatureName(cid)) then x = 2 elseif isInArray(grass1, getCreatureName(cid)) then x = 0.5 elseif isInArray(grass0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FLYDAMAGE then if isInArray(flying2, getCreatureName(cid)) then x = 2 elseif isInArray(flying1, getCreatureName(cid)) then x = 0.5 elseif isInArray(flying0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FIREDAMAGE then if isInArray(fire2, getCreatureName(cid)) then x = 2 elseif isInArray(fire1, getCreatureName(cid)) then x = 0.5 elseif isInArray(fire0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == ROCKDAMAGE then if isInArray(rock2, getCreatureName(cid)) then x = 2 elseif isInArray(rock1, getCreatureName(cid)) then x = 0.5 elseif isInArray(rock0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GROUNDDAMAGE then if isInArray(ground2, getCreatureName(cid)) then x = 2 elseif isInArray(ground1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ground0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == GHOSTDAMAGE then if isInArray(ghost2, getCreatureName(cid)) then x = 2 elseif isInArray(ghost1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ghost0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == BUGDAMAGE then if isInArray(bug2, getCreatureName(cid)) then x = 2 elseif isInArray(bug1, getCreatureName(cid)) then x = 0.5 elseif isInArray(bug0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == NORMALDAMAGE then if isInArray(normal2, getCreatureName(cid)) then x = 2 elseif isInArray(normal1, getCreatureName(cid)) then x = 0.5 elseif isInArray(normal0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == FIGHTDAMAGE then if isInArray(fighting2, getCreatureName(cid)) then x = 2 elseif isInArray(fighting1, getCreatureName(cid)) then x = 0.5 elseif isInArray(fighting0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == POISONDAMAGE then if isInArray(poison2, getCreatureName(cid)) then x = 2 elseif isInArray(poison1, getCreatureName(cid)) then x = 0.5 elseif isInArray(poison0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == PSYCHICDAMAGE then if isInArray(psychic2, getCreatureName(cid)) then x = 2 elseif isInArray(psychic1, getCreatureName(cid)) then x = 0.5 elseif isInArray(psychic0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == ICEDAMAGE then if isInArray(ice2, getCreatureName(cid)) then x = 2 elseif isInArray(ice1, getCreatureName(cid)) then x = 0.5 elseif isInArray(ice0, getCreatureName(cid)) then x = 0 else x = 1 end elseif combatee == DRAGONDAMAGE then if isInArray(dragon2, getCreatureName(cid)) then x = 2 elseif isInArray(dragon1, getCreatureName(cid)) then x = 0.5 elseif isInArray(dragon0, getCreatureName(cid)) then x = 0 else x = 1 end else x = 1 end local xx = x if not isSummon(attacker) then if not isPlayer(cid) and not isPlayer(getCreatureMaster(cid)) then return false end if isSummon(cid) and getCreatureHealth(cid) <= (getCreatureMaxHealth(cid)*0.15) and not exhaustion.get(getCreatureMaster(cid), 88726) then exhaustion.set(getCreatureMaster(cid), 88726, 6) doSendMagicEffect(getThingPos(cid), 178) end local damage = value if getPlayerStorageValue(cid, 4) >= 1 then doCreatureAddHealth(cid, -math.ceil(damage/2*xx), 2, cores) -- 2 é o efeito que aparece no pokemon quando tem harden e é atacado return false else doCreatureAddHealth(cid, -math.ceil(damage*xx), 3, cores) return false end return false end if isSummon(attacker) then if isPlayer(cid) then return false end if isSummon(cid) then if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then return false end if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then return false end end local combatx = combatee local valor = value local life = getCreatureHealth(cid) if getPlayerStorageValue(cid, 4) >= 1 then doTargetCombatHealth(getCreatureMaster(attacker), cid, combatx, -math.ceil(valor/2*xx), -math.ceil(valor/2*xx+10), 255) life = life - getCreatureHealth(cid) if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), life, cores) end else doTargetCombatHealth(getCreatureMaster(attacker), cid, combatx, -math.ceil(valor*xx), -math.ceil(valor*xx + 10), 255) life = life - getCreatureHealth(cid) if isInArray({GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE}, combatee) then doSendAnimatedText(getThingPos(cid), life, cores) end end return false end return true end Editado Julho 19, 2011 por brun123 Link para o comentário Compartilhar em outros sites More sharing options...
0 batatasmile 8 Postado Julho 9, 2011 Share Postado Julho 9, 2011 (editado) por inquanto nao deu problema nenhum, só tem um detalhe o attack Melee ta hitando uma cor escura pode me add no msn pra nois conversa tenho uma coisa para te perguntar, msn lukas157_@hotmail.com Editado Julho 9, 2011 por Darkabra Link para o comentário Compartilhar em outros sites More sharing options...
0 coyotestark 24 Postado Julho 9, 2011 Share Postado Julho 9, 2011 ola man estou com o mesmo problema pvp ou enforced poques se atacam mas nao perdem life Link para o comentário Compartilhar em outros sites More sharing options...
0 vlist 0 Postado Julho 9, 2011 Share Postado Julho 9, 2011 Brun123 Aqui continua sem pegar os pokemons se atacam mais os mas os attack nao pega por favor me ajuda Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
grassmaster 0
Quando estão em duel system, os pokemons nao tiram life um do outro. Gostaria de saber como arrumar isso. OBRIGADO
Link para o comentário
Compartilhar em outros sites
18 respostass a esta questão
Posts Recomendados