Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Darmowe skrypty LUA


P0ZAJM0WANE

Rekomendowane odpowiedzi

Opublikowano


function getPlayerManaMax(cid)

manaNow = getPlayerMana(cid)

doPlayerAddMana(cid,1000000)

manaMax = getPlayerMana(cid)

doPlayerAddMana(cid,manaNow-manaMax)

return manaMax

end

function onUse(cid, item, frompos, item2, topos)

local config = {

ended = true,

effect_enable = true,

effect = 13,

text_enable = true,

text_colour = 191,

exh =

{

exh_enable = true,

exh_time = 1.4,

storage = 12345, -- liczba przechowujaca exhausted

}

}

local voctab =

{

{minn=5, maxx=750, lvmul=2, mlmul=35},

{minn=150, maxx=550, lvmul=12, mlmul=1},

{minn=50, maxx=550, lvmul=5, mlmul=45},

{minn=150, maxx=1550, lvmul=3, mlmul=15}

}

topos.stackpos = 253

player = getThingfromPos(topos)

playerpos = getPlayerPosition(player.uid)

cidpos = getPlayerPosition(cid)

used = false

canUse = true

maglv = getPlayerMagLevel(cid)

voc = getPlayerVocation(cid)

lv=getPlayerLevel(cid)

vocc=voctab[voc]

addminn=vocc.minn +(vocc.lvmul*lv)+(vocc.mlmul*maglv)

addmaxx=vocc.maxx +(vocc.lvmul*lv)+(vocc.mlmul*maglv)

add=math.random(addminn,addmaxx)

if player.uid > 0 then

if getPlayerMana(player.uid) == getPlayerManaMax(player.uid) then

doPlayerSendCancel(cid, "Mana "..getPlayerName(player.uid).." is full!")

return 1

end

else

if getPlayerMana(cid) == getPlayerManaMax(cid) then

doPlayerSendCancel(cid, "Your mana is full.")

return 1

end

end

if(os.time() < getPlayerStorageValue(cid, config.exh.storage)) then

doPlayerSendCancel(cid,"You are exhausted.")

canUse = false

end

if (canUse) then

if player.itemid > 0 then

if (config.effect_enable) then

doSendMagicEffect(playerpos, config.effect)

end

if (config.text_enable) then

doSendAnimatedText(playerpos, add, config.text_colour) -- tutaj to masz wiec ustaw w configu dobry kolor

end

doPlayerAddMana(player.uid,add)

used = true

else

if config.effect_enable then

doSendMagicEffect(cidpos, config.effect)

end

if (config.text_enable) then

doSendAnimatedText(cidpos, add, config.text_colour) -- i tutaj

end

doPlayerAddMana(cid,add)

used = true

end

end

if (used) and (canUse) then

if (config.exh.exh_enable) then

setPlayerStorageValue(cid, config.exh.storage, os.time() + config.exh.exh_time)

end

if (config.ended) then

if item.type > 1 then

doChangeTypeItem(item.uid,item.type-1)

else

doRemoveItem(item.uid,1)

end

end

end

return 1

end

 

  • Odpowiedzi 97
  • Dodano
  • Ostatniej odpowiedzi
Opublikowano
function getPlayerManaMax(cid)
manaNow = getPlayerMana(cid)
doPlayerAddMana(cid,1000000)
manaMax = getPlayerMana(cid)
doPlayerAddMana(cid,manaNow-manaMax)
return manaMax
end
function onUse(cid, item, frompos, item2, topos)
   local config = {
   ended = true,
   effect_enable = true,
   effect = 13,
   text_enable = true,
   text_colour = 191,
   exh = 
   {
      exh_enable = true,
      exh_time = 1.4,
      storage = 12345, -- liczba przechowujaca exhausted
   }
}
local voctab =
{
{minn=5, maxx=750, lvmul=2, mlmul=35},
{minn=150, maxx=550, lvmul=12, mlmul=1},
{minn=50, maxx=550, lvmul=5, mlmul=45},
{minn=150, maxx=1550, lvmul=3, mlmul=15}
}
topos.stackpos = 253
player = getThingfromPos(topos)
playerpos = getPlayerPosition(player.uid)
cidpos = getPlayerPosition(cid)
used = false
canUse = true
maglv = getPlayerMagLevel(cid)
voc = getPlayerVocation(cid)
lv=getPlayerLevel(cid)
vocc=voctab[voc]
addminn=vocc.minn +(vocc.lvmul*lv)+(vocc.mlmul*maglv)
addmaxx=vocc.maxx +(vocc.lvmul*lv)+(vocc.mlmul*maglv)
add=math.random(addminn,addmaxx)
if player.uid > 0 then
if getPlayerMana(player.uid) == getPlayerManaMax(player.uid) then
doPlayerSendCancel(cid, "Mana "..getPlayerName(player.uid).." is full!")
return 1
end
else
if getPlayerMana(cid) == getPlayerManaMax(cid) then
doPlayerSendCancel(cid, "Your mana is full.")
return 1
end
end
if(os.time() < getPlayerStorageValue(cid, config.exh.storage)) then
   doPlayerSendCancel(cid,"You are exhausted.")
   canUse = false
end
if (canUse) then
if player.itemid > 0 then
  if (config.effect_enable) then
    doSendMagicEffect(playerpos, config.effect)
    end
if (config.text_enable) then
   doSendAnimatedText(playerpos, add, config.text_colour) -- tutaj to masz wiec ustaw w configu dobry kolor
   end
   doPlayerAddMana(player.uid,add)
   used = true
    else
      if config.effect_enable then
         doSendMagicEffect(cidpos, config.effect)
      end
      if (config.text_enable) then
         doSendAnimatedText(cidpos, add, config.text_colour) -- i tutaj
      end
      doPlayerAddMana(cid,add)
      used = true
   end
end
if (used) and (canUse) then
   if (config.exh.exh_enable) then
      setPlayerStorageValue(cid, config.exh.storage, os.time() + config.exh.exh_time)
   end
   if (config.ended) then
      if item.type > 1 then
         doChangeTypeItem(item.uid,item.type-1)
      else
         doRemoveItem(item.uid,1)
      end
   end
end
return 1
end

tak ale na tfs 1.0 dosendanimatedtext nie dziala 

Opublikowano

czyli mam dać DoCreatureSay(getCreaturePosition(cid), add, 191)?

bo  dosendanimatedtext nie działa 

nie bo doCreatureSay dziala tylko na pomaranczowo (chyba)

 

sprawdz to:

doSendAnimatedText(getCreaturePosition(cid), add, 191)

czekaj przegladam spis funkcji pod tfs 1.0 i racja nie ma doSendAnimatedText

 

dowiedzialem sie ze ta funkcja została usunieta i jest tylko doCreatureSay

-------------------------------------------------------------------------------

dobra sprawdz tak: doCreatureSay(cid,add, 5)

 

z7ldq1.jpg

Opublikowano

nie bo doCreatureSay dziala tylko na pomaranczowo (chyba)

 

sprawdz to:

doSendAnimatedText(getCreaturePosition(cid), add, 191)

czekaj przegladam spis funkcji pod tfs 1.0 i racja nie ma doSendAnimatedText

Screen_Shot_10_15_15_at_07_19_PM.png

 

w spellu mam zrobiona leczącą rune i u niej pokazuje tak samo przy exura itp to ile uleczylo idze w gore i znika 

Opublikowano

bo to jest w source wbudowane raczej

 

w config masz ustawione żeby pokazywało, chyba zeby nie robic na actionach tylko w spellsach jako rune i wtedy powinno pokazac

tylko jak ja to teraz przerobie pod spela

hmm...

 

w spelu niema funkcji COMBAT_HEALING

COMBAT_HEALING_MANA

czy czegos takiego tylko jest pod zycie

Opublikowano
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 1, 0, 1, 0)

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

poprzestawiaj sobie Formule pod taki dmg i powinno dzialac

Opublikowano
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 1, 0, 1, 0)

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

poprzestawiaj sobie Formule pod taki dmg i powinno dzialac

 

wrzuciłem do actiona i wywala to

Screen_Shot_10_16_15_at_03_35_PM.png

Opublikowano

a wklej te cyfry z jakiegos spella, powinno dzialac

spell to wyglada tak zmienilem tylko koniec na useweapon ale dalej po 1 co jakiś czas od ognia bije

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ANI_BOLT)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)

function onGetFormulaValues(cid, level, maglevel)
	min = -(level * 2 + maglevel * 3) * 4.0
	max = -(level * 2 + maglevel * 3) * 6.2 
	return min, max
end



setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...