Não entendi :v
- Fórum
- OTServ
- Recursos
- Scripting
- Globalevents e Spells
- [TFS 1.2] Conditions: Resist, Absorv, Reflect, Deflect
AD
creatureevent
[TFS 1.2] Conditions: Resist, Absorv, Reflect, Deflect
Por Administrador, 16 de jun. de 2015 em Globalevents e Spells
script
7
3.5k
info
Grupo: Visconde
Registrado: 24/07/09
Posts: 356
Reputação: +28
Gênero: Masculino

16 de junho de 2015 às 23:23
info
Grupo: Banidos
Registrado: 07/04/13
Posts: 648
Reputação: +163

16 de junho de 2015 às 23:34
Não entendi :v
O que você não entendeu? A função do script?
17 de junho de 2015 às 11:34
nao entendo como usar..
info
Grupo: Visconde
Registrado: 24/07/09
Posts: 356
Reputação: +28
Gênero: Masculino

18 de junho de 2015 às 23:14
O que você não entendeu? A função do script?
Não entendi como funciona.. e como adiciona no server.
2 meses depois...
21 de agosto de 2015 às 10:44
Cara eu sei que tem mto tempo o topico mas eu quero mto usar isso no meu srv, eu queria saber nesse seu exemplo
Exemplo
local t = 60 * 1000
local v = 10
local resist = Condition(CONDITION_ATTRIBUTES)
resist:setParameter(CONDITION_PARAM_BUFF_SPELL, 1)
resist:setParameter(CONDITION_PARAM_SUBID, 108)
resist:setParameter(CONDITION_PARAM_TICKS, t)
player:addCondition(resist)
player:setStorageValue(5, v)
eu queria saber como eu escolho o valor da resistencia e o que seria o "v" no caso
Editado Agosto 21 por teakwondo
5 meses depois...






info
Grupo: Administrador
Registrado: 08/07/05
Posts: 5.8k
Reputação: +1.4k
Gênero: Outro
local res = { {101, COMBAT_FIREDAMAGE}, {102, COMBAT_EARTHDAMAGE}, {103, COMBAT_ENERGYDAMAGE}, {104, COMBAT_ICEDAMAGE}, {105, COMBAT_HOLYDAMAGE}, {106, COMBAT_DEATHDAMAGE}, {107, COMBAT_PHYSICALDAMAGE}, {108, COMBAT_PHYSICALDAMAGE}, {109, COMBAT_FIREDAMAGE},{110, COMBAT_EARTHDAMAGE}, {111, COMBAT_ENERGYDAMAGE}, {112, COMBAT_ICEDAMAGE}, {113, COMBAT_HOLYDAMAGE}, {114, COMBAT_DEATHDAMAGE}, {115, COMBAT_PHYSICALDAMAGE}, {116, COMBAT_PHYSICALDAMAGE}, {117, COMBAT_FIREDAMAGE}, {118, COMBAT_EARTHDAMAGE}, {119, COMBAT_ENERGYDAMAGE}, {120, COMBAT_ICEDAMAGE}, {121, COMBAT_HOLYDAMAGE}, {122, COMBAT_DEATHDAMAGE}, {123, COMBAT_PHYSICALDAMAGE}, {124, COMBAT_PHYSICALDAMAGE}, {125, COMBAT_FIREDAMAGE}, {126, COMBAT_EARTHDAMAGE}, {127, COMBAT_ENERGYDAMAGE}, {128, COMBAT_ICEDAMAGE}, {129, COMBAT_HOLYDAMAGE}, {130, COMBAT_DEATHDAMAGE}, {131, COMBAT_PHYSICALDAMAGE}, {132, COMBAT_PHYSICALDAMAGE}, } local refs = { [COMBAT_PHYSICALDAMAGE] = CONST_ME_DRAWBLOOD, [COMBAT_ENERGYDAMAGE] = CONST_ME_ENERGYAREA, [COMBAT_EARTHDAMAGE] = CONST_ME_POISONAREA, [COMBAT_FIREDAMAGE] = CONST_ME_FIREAREA, [COMBAT_ICEDAMAGE] = CONST_ME_ICEAREA, [COMBAT_HOLYDAMAGE] = CONST_ME_HOLYAREA, [COMBAT_DEATHDAMAGE] = CONST_ME_MORTAREA } function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) if creature:isPlayer() then if primaryType == COMBAT_HEALING then return primaryDamage, primaryType, secondaryDamage, secondaryType end if creature:getCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, 11) then if primaryType == COMBAT_DROWNDAMAGE then primaryDamage = 0 end if secondaryType == COMBAT_DROWNDAMAGE then secondaryDamage = 0 end end for i = 1, 8 do -- resist if creature:getCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, res[i][1]) then if primaryType == res[i][2] or i == 8 then primaryDamage = (primaryDamage - (primaryDamage * (creature:getStorageValue(5) / 100))) end if secondaryType == res[i][2] or i == 8 then secondaryDamage = (secondaryDamage - (secondaryDamage * (creature:getStorageValue(5) / 100))) end end end for i = 9, 16 do -- reflect if creature:getCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, res[i][1]) then if not attacker then return primaryDamage, primaryType, secondaryDamage, secondaryType end if primaryType == res[i][2] or i == 16 then local a = math.floor(primaryDamage * (creature:getStorageValue(5) / 100)) if attacker:isMonster() then local m = MonsterType(attacker:getName()) local e = m:getElementList() local f = m:getCombatImmunities() if type(f) == "number" then if f == primaryType then a = 0 end else for i, j in pairs(f) do if i == primaryType then a = 0 end end end if type(e) == "number" then if e == primaryType then if e > 0 then a = (a - (a * (e / 100))) else a = (a + (a * ((e * -1) / 100))) end end else for i, j in pairs(e) do if i == primaryType then if j > 0 then a = (a - (a * (j / 100))) else a = (a + (a * ((j * -1) / 100))) end end end end end doTargetCombatHealth(creature, attacker, primaryType, a, a, refs[primaryType]) end end end for i = 17, 24 do -- deflect if creature:getCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, res[i][1]) then if not attacker then return primaryDamage, primaryType, secondaryDamage, secondaryType end if primaryType == res[i][2] or i == 24 then local a = math.floor(primaryDamage * (creature:getStorageValue(5) / 100)) if attacker:isMonster() then local m = MonsterType(attacker:getName()) local e = m:getElementList() local f = m:getCombatImmunities() if type(f) == "number" then if f == primaryType then a = 0 end else for i, j in pairs(f) do if i == primaryType then a = 0 end end end if type(e) == "number" then if e == primaryType then if e > 0 then a = (a - (a * (e / 100))) else a = (a + (a * ((e * -1) / 100))) end end else for i, j in pairs(e) do if i == primaryType then if j > 0 then a = (a - (a * (j / 100))) else a = (a + (a * ((j * -1) / 100))) end end end end end doTargetCombatHealth(creature, attacker, primaryType, a, a, refs[primaryType]) primaryDamage = (primaryDamage - (primaryDamage * (creature:getStorageValue(5) / 100))) secondaryDamage = (secondaryDamage - (secondaryDamage * (creature:getStorageValue(5) / 100))) end end end for i = 25, 32 do if creature:getCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, res[i][1]) then if primaryType == res[i][2] or i == 32 then local a = math.floor(primaryDamage * (creature:getStorageValue(5) / 100)) creature:addHealth(a) primaryDamage = (primaryDamage - (primaryDamage * (creature:getStorageValue(5) / 100))) secondaryDamage = (secondaryDamage - (secondaryDamage * (creature:getStorageValue(5) / 100))) end end end end if primaryDamage == 0 and secondaryDamage == 0 and creature:isPlayer() then creature:getPosition():sendMagicEffect(CONST_ME_POFF) end return primaryDamage, primaryType, secondaryDamage, secondaryType endExemplo
Créditos: RazorBlade