What's new

Transform (kilka problemow) tfs 0.3.5

Status
Not open for further replies.

Ingmarr

New User
Joined
Nov 24, 2010
Messages
2
Reaction score
0
Witam!
Silnik z kt?rego korzystam: tfs 0.3.5
Prosi?bym o pomoc:

skrypt:
Code:
function onCastSpell(cid, var)
if (getPlayerVocation(cid) == 1) and (getPlayerLevel(cid) >= 50) then
doPlayerSetVocation(cid,2)
doCreatureChangeOutfit(cid, {lookType=31})
doSendMagicEffect(getCreaturePosition(cid), 14)
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+200))
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+100))
doPlayerAddMana(cid,1)
elseif getPlayerLevel(cid) < 50 then
doSendMagicEffect(getCreaturePosition(cid), 3)
doPlayerSendCancel(cid, "You need 50 level to transform!")
else
if (getPlayerVocation(cid) == 2) and (getPlayerLevel(cid) >= 120) then
doPlayerSetVocation(cid,3)
doCreatureChangeOutfit(cid, {lookType=32})
doSendMagicEffect(getCreaturePosition(cid), 14)
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+300))
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+200))
doPlayerAddMana(cid,1)
elseif getPlayerLevel(cid) < 120 then
doSendMagicEffect(getCreaturePosition(cid), 3)
doPlayerSendCancel(cid, "You need 120 level to transform!")
else
if (getPlayerVocation(cid) == 3) and (getPlayerLevel(cid) >= 200) then
doPlayerSetVocation(cid,4)
doCreatureChangeOutfit(cid, {lookType=33})
doSendMagicEffect(getCreaturePosition(cid), 14)
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+1000))
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+500))
doPlayerAddMana(cid,1)
elseif getPlayerLevel(cid) < 200 then
doSendMagicEffect(getCreaturePosition(cid), 3)
doPlayerSendCancel(cid, "You need 200 level to transform!")
else
if (getPlayerVocation(cid) == 4) and (getPlayerLevel(cid) >= 270) then
doPlayerSetVocation(cid,5)
doCreatureChangeOutfit(cid, {lookType=36})
doSendMagicEffect(getCreaturePosition(cid), 14)
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+1500))
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+1000))
doPlayerAddMana(cid,1)
elseif getPlayerLevel(cid) < 270 then
doSendMagicEffect(getCreaturePosition(cid), 3)
doPlayerSendCancel(cid, "You need 270 level to transform!")
else
if (getPlayerVocation(cid) == 5) and (getPlayerLevel(cid) >= 350) then
doPlayerSetVocation(cid,6)
doCreatureChangeOutfit(cid, {lookType=40})
doSendMagicEffect(getCreaturePosition(cid), 14)
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+2000))
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+1500))
doPlayerAddMana(cid,1)
elseif getPlayerLevel(cid) < 350 then
doSendMagicEffect(getCreaturePosition(cid), 3)
doPlayerSendCancel(cid, "You need 350 level to transform!")
else
if (getPlayerVocation(cid) == 6) and (getPlayerLevel(cid) >= 350) then
doSendMagicEffect(getCreaturePosition(cid), 3)
doPlayerSendCancel(cid, "It is your last transform!")
end
end
end
end
end
end
return true
end

- 1. Problem -

Wszystko dzia?a tylko problem w tym ?e przy zmianie profesji jak wida? np. zmiana voc1 na voc2 dodatkowo daje graczowi 100 punkt?w hp i 200 punkt?w many i chodzi mi o to, ?e nie dodaje ich od razu tylko po transfie nadal jest taka sama liczba hp jak i many co na voc1 i dopiero jak np. u?yje czaru kt?ry regeneruje hp i mane to dopiero wida? prawid?ow? warto??. Wiem, ?e to troch? zagmatwa?em dlatego wstawiam ssy dla lepszego zrozumienia o co mi chodzi.
SSY:
1. Przed wpisaniem transform (6880 hp, 4380 many)

2. Po wpisaniu (6880hp, 4381 many - a chodzi mi o to ?e powinno by? 7080 hp i 4480 many)
(tu wzrost many o 1 poniewa? doda?em doPlayerAddMana(cid,1) po dodaniu hp bo my?la?em ?e to pomo?e)

3. Po u?yciu czaru kt?ry pod?adowa? mi na maxa hp i mane (7080 hp i 4480 many - tak jak powinno by?)

W skr?cie m?wi?c chcia?bym aby po wpisaniu transform na voc1 postac zamieni?a si? w voc2 (to dzia?a) lecz ?eby od razu ilo?? hp i many si? zaktualizowa?a do prawid?owej warto?ci.

- 2. Problem -

Chcia?bym aby po zamienieniu si? ju? w voc2 odejmowa?o 5 many i dodawa?o efekt np. 14 (co sekund? oba) dop?ki gracz ma wi?cej ni? 100 many lub dop?ki nie zmieni transform (w tym wypadku z voc2 na voc3) lub dop?ki si? nie wyloguje.
Pr?bowa?em to zrobi?...gdy przemieni?em si? z voc1 na voc2 to wszystko by?o ok (spala?o mane, pokazywa?o efekt co sekund?) lecz gdy u?y?em drugi raz transform to efekt si? podwaja? czyli spala?o 2x szybciej mane i pokazywa?o 2 efekty co sekund?. Najlepiej by by?o jakby by?o co? podobnego jak na dole z tym ?e jakbym m?g? stopowa? to kiedy chce.
Dodam funkcj? kt?ra to powodowa?a:
Code:
local function sendEffect(cid)
local user = cid
piorunki = addEvent(function()
if isPlayer(user) then
doPlayerAddMana(cid,-5)
doSendMagicEffect(getCreaturePosition(cid), 14)
return sendEffect(user)
end
end, 1000, {user = user})
if getPlayerMana (cid) <= 100 then
stopEvent(piorunki)
end
end

- 3. Problem -

Przy u?yciu tego czaru w??cza si? battle, a przy uzyciu np. doRemoveCondition(cid, 1024) w powy?szej funkcji co sekund? wy??cza? si? battle i znowu si? pokazywa? i tak ci?gle. Co zrobi? ?eby czar nie powodowa? w??czenia battle i nie robi? takich "anomalii" ?e co sekunde wy??cza i w??cza battle?

Z g?ry dzi?ki
 
Status
Not open for further replies.
Top