Ir para conteúdo

Featured Replies

Postado

Pode dar uma testada nessa versão do script?

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

function onGetFormulaValues(cid, level, skill, attack, factor)
    local skillTotal, levelTotal = skill + attack, level / 5
    return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var, target)
	mninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
	fninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
	enemy_mninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
	enemy_fninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}

	target = getCreatureTarget(cid)
	if target == 0 then
		transformAroundPos (cid, nil, enemy_mninja, enemy_fninja)
	else
		transformAroundPos (cid, getCreaturePosition (target), enemy_mninja, enemy_fninja)
	end

	if getPlayerSex (cid) == 0 then
		doSetCreatureOutfit (cid, mninja, 500)
	else 
		doSetCreatureOutfit (cid, fninja, 500)
	end

	return doCombat (cid, combat, var) 
end

function transformAroundPos (cid, centerPos, male, female)
	for i = 0, 2 do
		for j = 0, 2 do
			initialPos = getCreaturePosition(getCreatureTarget(cid))
			if centerPos == nil then
				initialPos = getEpicenterPos (cid)
				doSendMagicEffect (initialPos, 35)
			end
			initialPos.x = initialPos.x - 1
			initialPos.y = initialPos.y - 1
			thingPos = initialPos
			thingPos.x = thingPos.x + i
			thingPos.y = thingPos.y + j
			thingPos.stackpos = 255
			thing = getThingfromPos(thingPos)	
			thing = thing.uid

			if isPlayer (thing) then
				if getPlayerSex (thing) == 0 then
					doSetCreatureOutfit (thing, male, 500)
				else
					doSetCreatureOutfit (thing, female, 500)
				end
			elseif isCreature (thing) then
				doSetCreatureOutfit (thing, male, 500)
			end

		end
	end
end

function getEpicenterPos (cid)
	playerDirection = getCreatureLookDirection(cid)
	skillPos = getCreaturePosition (cid)
	if playerDirection == NORTH then
		skillPos.y = skillPos.y - 1 
	elseif playerDirection == EAST then
		skillPos.x = skillPos.x + 1
	elseif playerDirection == SOUTH then
		skillPos.y = skillPos.y + 1
	elseif playerDirection == WEST then
		skillPos.x = skillPos.x - 1
	end
	return skillPos
end

 

  • Respostas 12
  • Visualizações 1.9k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Você pode pegar o target atual do player com: target = getCreatureTarget(cid) E depois setar uma outfit temporária pra esse target com: doSetCreatureOutfit (target, fninja, 500) Dentro d

  • @marcot É mais por curiosidade, mas vc pode usar o CALLBACK_PARAM_TARGETCREATURE ou CALLBACK_PARAM_TARGETTILE para pegar os targets ou os tiles que a spell atinge. Um exemplo rápido: function

  • Pode dar uma testada nessa versão do script? local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_

Postado
  • Autor
1 hora atrás, marcot disse:

Pode dar uma testada nessa versão do script?


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

function onGetFormulaValues(cid, level, skill, attack, factor)
    local skillTotal, levelTotal = skill + attack, level / 5
    return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var, target)
	mninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
	fninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
	enemy_mninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
	enemy_fninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}

	target = getCreatureTarget(cid)
	if target == 0 then
		transformAroundPos (cid, nil, enemy_mninja, enemy_fninja)
	else
		transformAroundPos (cid, getCreaturePosition (target), enemy_mninja, enemy_fninja)
	end

	if getPlayerSex (cid) == 0 then
		doSetCreatureOutfit (cid, mninja, 500)
	else 
		doSetCreatureOutfit (cid, fninja, 500)
	end

	return doCombat (cid, combat, var) 
end

function transformAroundPos (cid, centerPos, male, female)
	for i = 0, 2 do
		for j = 0, 2 do
			initialPos = getCreaturePosition(getCreatureTarget(cid))
			if centerPos == nil then
				initialPos = getEpicenterPos (cid)
				doSendMagicEffect (initialPos, 35)
			end
			initialPos.x = initialPos.x - 1
			initialPos.y = initialPos.y - 1
			thingPos = initialPos
			thingPos.x = thingPos.x + i
			thingPos.y = thingPos.y + j
			thingPos.stackpos = 255
			thing = getThingfromPos(thingPos)	
			thing = thing.uid

			if isPlayer (thing) then
				if getPlayerSex (thing) == 0 then
					doSetCreatureOutfit (thing, male, 500)
				else
					doSetCreatureOutfit (thing, female, 500)
				end
			elseif isCreature (thing) then
				doSetCreatureOutfit (thing, male, 500)
			end

		end
	end
end

function getEpicenterPos (cid)
	playerDirection = getCreatureLookDirection(cid)
	skillPos = getCreaturePosition (cid)
	if playerDirection == NORTH then
		skillPos.y = skillPos.y - 1 
	elseif playerDirection == EAST then
		skillPos.x = skillPos.x + 1
	elseif playerDirection == SOUTH then
		skillPos.y = skillPos.y + 1
	elseif playerDirection == WEST then
		skillPos.x = skillPos.x - 1
	end
	return skillPos
end

 

funcionou mt massa , só trava uns 2 seg dai dps da a magia 

Spoiler

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

function onGetFormulaValues(cid, level, skill, attack, factor)
    local skillTotal, levelTotal = skill + attack, level / 5
    return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var, target)
    mninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
    fninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
    enemy_mninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
    enemy_fninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}

        transformAroundPos (cid, nil, enemy_mninja, enemy_fninja)

    return doCombat (cid, combat, var) 
end

function transformAroundPos (cid, centerPos, male, female)
    for i = 0, 2 do
        for j = 0, 2 do
            if centerPos == nil then
                initialPos = getEpicenterPos (cid)
                doSendMagicEffect (initialPos, 35)
            end
            thingPos = initialPos
            thingPos.x = thingPos.x + i
            thingPos.y = thingPos.y + j
            thingPos.stackpos = 255
            thing = getThingfromPos(thingPos)    
            thing = thing.uid

            if isPlayer (thing) then
                if getPlayerSex (thing) == 0 then
                    doSetCreatureOutfit (thing, male, 500)
                else
                    doSetCreatureOutfit (thing, female, 500)
                end
            elseif isCreature (thing) then
                doSetCreatureOutfit (thing, male, 500)
            end

        end
    end
end

function getEpicenterPos (cid)
    playerDirection = getCreatureLookDirection(cid)
    skillPos = getCreaturePosition (cid)
    if playerDirection == NORTH then
        skillPos.y = skillPos.y - 1 
    elseif playerDirection == EAST then
        skillPos.x = skillPos.x + 1
    elseif playerDirection == SOUTH then
        skillPos.y = skillPos.y + 1
    elseif playerDirection == WEST then
        skillPos.x = skillPos.x - 1
    end
    return skillPos
end

tirei a parte do target da script e nao travou mais , ai agora ta em área troca a outfit do monster ou player na área ..  vc é o cara , obrigado mesmo de fé

  • 5 weeks later...
Postado
  • Autor

@marcot  desculpa reviver , mas tentei usar a script para criar outras magias com áreas diferentes mas a função transformAroundPos carrega a mesma para todos os scripts mesmo que eu mude ..

tem como ajudar ai?

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.3k

Informação Importante

Confirmação de Termo