Skrypty & Kody Pomoc transform

Status
Zamknięty.

sprytnaaaaa

Advanced User
Zarejestrowany
Dołączył
Kwiecień 20, 2011
Posty
342
Liczba reakcji
4
Witajcie a mianowicie mam taki skrypcik transform dzia?a i wgl tfs 8.6
[LUA]local tabela = {
------------Bardock--------------------
[7] = {outfit = {lookType=218}, level = 30, effectTrans = 226},
[8] = {outfit = {lookType=248}, level = 50, effectTrans = 224},
[9] = {outfit = {lookType=231}, level = 100, effectTrans = 227},
[10] = {outfit = {lookType=284}, level = 150, effectTrans = 225},
[11] = {outfit = {lookType=78}, level = 200, effectTrans = 223},


}

function onCastSpell(cid, var)
local arr = tabela[getPlayerVocation(cid)]

if(arr ~= NULL) then
if getPlayerLevel(cid) >= arr.level then
doPlayerSetVocation(cid, getPlayerVocation(cid)+1)
doSetCreatureOutfit(cid, arr.outfit, -1)
doSendMagicEffect(getPlayerPosition(cid), arr.effectTrans)
else
doPlayerSendCancel(cid, "You need " .. arr.level .. " level to transform.")
end
else
doPlayerSendCancel(cid, "Nie masz Reborn.")
end
return true
end[/LUA]

to wy?ej to z spells
to ni?ej z login

[LUA]local bardock = {lookType = 222, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}



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



----------------------Bardock--------------
if (getPlayerVocation(cid) == 8) then
doSetCreatureOutfit(cid, bardock, -1)
end
if (getPlayerVocation(cid) == 9) then
doSetCreatureOutfit(cid, bardock, -1)
end
if (getPlayerVocation(cid) == 10) then
doSetCreatureOutfit(cid, bardock, -1)
end
if (getPlayerVocation(cid) == 11) then
doSetCreatureOutfit(cid, bardock, -1)
end
if (getPlayerVocation(cid) == 12) then
doSetCreatureOutfit(cid, bardock, -1)
end
------------------------End Bardock----------------------

---------------Vocation------------

------------Bardock------------

if (getPlayerVocation(cid) == 8) then
doPlayerSetVocation(cid,7)
end
if (getPlayerVocation(cid) == 9) then
doPlayerSetVocation(cid,7)
end
if (getPlayerVocation(cid) == 10) then
doPlayerSetVocation(cid,7)
end
if (getPlayerVocation(cid) == 11) then
doPlayerSetVocation(cid,7)
end
if (getPlayerVocation(cid) == 12) then
doPlayerSetVocation(cid,7)
end

------------------------End Bardock----------------------
[/LUA]

a wi?c tak nie wiem jak lub czy wgl sie da ?e 1 trans daje np 500 manny/hp
2 daje 1000
3 daje 4000
itd...
i gdy np mamy ju? max transa lub nie, wylogujemy si? odejmuje nam to wszystko co nam doda?o za pomoc rep+ je?li co? nie jasne pisa? z g?ry thx

---------- Tre?? dodana o 02:54 ----------

http://tibia.net.pl/threads/524028-8-54-Transform
znalaz?em taki skrypt ale te? niema opcji na odejmowanie manny hp po logu przerobi kto? umiej?tny ?
 
Odp: Pomoc transform

[LUA]local ma = 4000
local he = 4000
------------------------
function onSay(cid,words,param)
if exhaustion.get(cid, 107) then
doPlayerSendCancel(cid, 'Slow down.')
return true
end
exhaustion.set(cid, 107, 1)
allbienbignoob = {lookType=168}
allienoob = {lookType=168}
------------------------------------------------------------------------------------------------------
if getPlayerVocation(cid) == 1 then
getPlayerLevel(cid) >= 1 then
doPlayerSetVocation(cid,2)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+he)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+ma)
doCreatureAddHealth(cid, 1)
doCreatureAddMana(cid, 1)
doCreatureChangeOutfit(cid, allienoob)
doSendMagicEffect(getPlayerPosition(cid), 106)
doSendAnimatedText(getCreaturePosition(cid), "Power UP !", 100)


else
doPlayerSendCancel(cid, "XYZ")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
elseif getPlayerVocation(cid) == 2 then
if getPlayerStorageValue(cid, 9999) >= 1 and getPlayerLevel(cid) >= 1 then
doPlayerSetVocation(cid,1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+he)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+ma)
doCreatureAddHealth(cid, 1)
doCreatureAddMana(cid, 1)
doCreatureChangeOutfit(cid, allienbignoob)
doSendMagicEffect(getPlayerPosition(cid), 106)
doSendAnimatedText(getCreaturePosition(cid), "Power UP !", 100)


else
doPlayerSendCancel(cid, "XYZ")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
end
return 0
end
[/LUA]

Na szybko masz co? co dzia?a potem Ci przerobi? t? tablice bo lec? do pracy.

Skrypt dzia?a w TalkActions.
 
Odp: Pomoc transform

TheAllien2 zapomnial napisac ze to skrypt z DBViolenta. ;)

Cd twojego skryptu;
Kod:
doPlayerSetVocation(cid, getPlayerVocation(cid)+1)
to moze ci sie z czasem wydac troche uciazliwe ze po wpisaniu transform zmienia ci aktualna profesje +1 /// mowie tu o sytuacji gdy bedziesz chcial dodac new transy :P

Masz :)
[lua] local tabela = {
------------Bardock--------------------
[7] = {newvoc = 8, outfit = {lookType=218}, level = 30, effectTrans = 226, hp = 500, ki = 500},
[8] = {newvoc = 9, outfit = {lookType=248}, level = 50, effectTrans = 224, hp = 1000, ki = 1000},
[9] = {newvoc = 10, outfit = {lookType=231}, level = 100, effectTrans = 227, hp = 2000, ki = 2000},
[10] = {newvoc = 11, outfit = {lookType=284}, level = 150, effectTrans = 225, hp = 3000, ki = 3000},
[11] = {newvoc = 12, outfit = {lookType=78}, level = 200, effectTrans = 223, hp = 4000, ki = 4000}
}

function onCastSpell(cid, var)
local arr = tabela[getPlayerVocation(cid)]

if(arr ~= NULL) then
if getPlayerLevel(cid) >= arr.level then
doPlayerSetVocation(cid, arr.newvoc)
doSetCreatureOutfit(cid, arr.outfit, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+arr.hp)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+arr.ki)
doCreatureAddHealth(cid, 1)
doCreatureAddMana(cid, 1)
doSendMagicEffect(getPlayerPosition(cid), arr.effectTrans)
else
doPlayerSendCancel(cid, "You need " .. arr.level .. " level to transform.")
end
else
doPlayerSendCancel(cid, "You don't have transformation.")
end
return true
end
[/lua]

Nie polecam uzywac violentowego skryptu.

//edit
Zapomnialem o twoim wyjebanym skrypcie z onLogin XD

[lua]local bardock = {lookType = 222}
local bardockvocprzedrb = {8, 9, 10, 11, 12}

if (getPlayerVocation(cid) == 8) then
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-500)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-500)
elseif (getPlayerVocation(cid) == 9) then
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-1000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-1000)
elseif (getPlayerVocation(cid) == 10) then
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-2000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-2000)
elseif (getPlayerVocation(cid) == 11) then
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-3000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-3000)
elseif (getPlayerVocation(cid) == 12) then
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-4000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-4000)
end[/lua]
 
Ostatnia edycja:
Odp: Pomoc transform

Swiruseq wszystko ?adnie dodaje hp manne nw dlaczego wbija pz i niemo?na u?y? np w depo gdzie masz no pvp :[
i po logu manna dalej jest jak i hp nic nie odejmuje b??d?w te? niema :]
 
Odp: Pomoc transform

nw dlaczego wbija pz i niemo?na u?y? np w depo gdzie masz no pvp :[
PHP:
w spell.xml 
aggressive="0"



login
PHP:
   local bardock = {lookType = 226, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
 

  if (getPlayerVocation(cid) == 58) then
 doSetCreatureOutfit(cid, bardock, -1)
 	setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-500)
	setCreatureMaxMana(cid, getCreatureMaxMana(cid)-500)
 end
  if (getPlayerVocation(cid) == 59) then
 doSetCreatureOutfit(cid, bardock, -1)
 	setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-1000)
	setCreatureMaxMana(cid, getCreatureMaxMana(cid)-1000)
 end
  if (getPlayerVocation(cid) == 60) then
 doSetCreatureOutfit(cid, bardock, -1)
 setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-2000)
	setCreatureMaxMana(cid, getCreatureMaxMana(cid)-2000)
 end
  if (getPlayerVocation(cid) == 61) then
 doSetCreatureOutfit(cid, bardock, -1)
 	setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-3000)
	setCreatureMaxMana(cid, getCreatureMaxMana(cid)-3000)
 end
  if (getPlayerVocation(cid) == 62) then ----------end bardock
 doSetCreatureOutfit(cid, bardock, -1)
 setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-4000)
	setCreatureMaxMana(cid, getCreatureMaxMana(cid)-4000)
 end

Powinno dzia?ac
 
Odp: Pomoc transform

@UP Nwm po co to robiles skoro mozna 1if i reszta elseif... ;/

@Topic
vocations.xml przy kazdym id="X" prevoc="X" tj
<vocation id="69" name="None" description="a rookie" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="10" gainsoulticks="120" gainsoulamount="1" maxsoul="100" manamultiplier="4.0" attackspeed="1500" prevoc="69">

W prevoc wpisuj to samo co w voc ^^ a co do pz etc to aggressive="0" w spells.xml


A tu skrypt onLogin;
[lua]local bardock = {lookType = 222}

if (getPlayerVocation(cid) == 8) then
setPlayerVocation(cid, 7)
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-500)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-500)
elseif (getPlayerVocation(cid) == 9) then
setPlayerVocation(cid, 7)
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-1000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-1000)
elseif (getPlayerVocation(cid) == 10) then
setPlayerVocation(cid, 7)
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-2000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-2000)
elseif (getPlayerVocation(cid) == 11) then
setPlayerVocation(cid, 7)
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-3000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-3000)
elseif (getPlayerVocation(cid) == 12) then
setPlayerVocation(cid, 7)
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-4000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-4000)
end[/lua]
 
Ostatnia edycja:
Odp: Pomoc transform

Zrobi?em pod wz?r sprytnaaaaa by nie by?o nie jasno?ci. I tak przeoczy?em 1 linijk?. :
 
Ostatnia edycja:
Odp: Pomoc transform

Ju? testuje :D i m?wi? tak dalej dupa :[ 0 b??d?w dodaje nie ubiera i mog? mie? nie sko?czono?? do puki silnik si? nie zbuguje :]
Pomocy :[
 
Odp: Pomoc transform

testowa?em nie odejmuje manny ani hp :[

---------- Tre?? dodana o 00:43 ----------

Anakonta Dzi?ki za skrypta ale czy potrafisz do niego doda? gdy mam np 3 trans lub 2 to jak logne odejmie mi te hp/mane co do da?o przy transie bo jak kto? si? lognie to doda mu :[ a nikt przed logiem revert wpisywa? nie b?dzie :[ ale tak to skrypt 10/10 :] polecam
 
Odp: Pomoc transform

@UP Nwm po co to robiles skoro mozna 1if i reszta elseif... ;/

@Topic
vocations.xml przy kazdym id="X" prevoc="X" tj


W prevoc wpisuj to samo co w voc ^^ a co do pz etc to aggressive="0" w spells.xml


A tu skrypt onLogin;
[lua]local bardock = {lookType = 222}

if (getPlayerVocation(cid) == 8) then
setPlayerVocation(cid, 7)
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-500)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-500)
elseif (getPlayerVocation(cid) == 9) then
setPlayerVocation(cid, 7)
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-1000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-1000)
elseif (getPlayerVocation(cid) == 10) then
setPlayerVocation(cid, 7)
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-2000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-2000)
elseif (getPlayerVocation(cid) == 11) then
setPlayerVocation(cid, 7)
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-3000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-3000)
elseif (getPlayerVocation(cid) == 12) then
setPlayerVocation(cid, 7)
doSetCreatureOutfit(cid, bardock, -1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-4000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-4000)
end[/lua]

Nie wiem po co elseif jak mo?na u?y? tablic :P
 
Odp: Pomoc transform

sprytnaaaa zr?b sobie sta?y system transformacji i po problemie "doCreatureChangeOutfit".
 
Odp: Pomoc transform

The Godfather [Anakonta] moze pochwal sie swoja znajomoscia zastosowania tablic etc ;]

@topic
A ustawiles w vocations.xml tak jak napisalem?
 
Odp: Pomoc transform

testowa?em nie odejmuje manny ani hp :[

---------- Tre?? dodana o 00:43 ----------

Anakonta Dzi?ki za skrypta ale czy potrafisz do niego doda? gdy mam np 3 trans lub 2 to jak logne odejmie mi te hp/mane co do da?o przy transie bo jak kto? si? lognie to doda mu :[ a nikt przed logiem revert wpisywa? nie b?dzie :[ ale tak to skrypt 10/10 :] polecam
[LUA] config = {-- 2 trans zmienia na 1 trans, ile odejmuje many, ile odejmuje hp
[2] = {toVoc = 1, mana = 600, hp = 600},
[3] = {toVoc = 2, mana = 700, hp = 700}
}

function onLogout(cid)
local mvoc = config[getPlayerVocation(cid)]
if mvoc then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-mvoc.hp)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-mvoc.mana)
doCreatureAddHealth(cid, -mvoc.hp)
doCreatureAddMana(cid, -mvoc.mana)
doPlayerSetVocation(cid, mvoc.toVoc)
end
return true
end[/LUA]
 
Odp: Pomoc transform

hmmm nw czy ja co? ?le robi? czy ja nw wytestuje go kto? i powie czy dzia?a bo testowa?em i dupa ale to niemo?liwe testnij go kto? czy odejmuje

---------- Tre?? dodana o 15:42 ----------

nw mi nie dzia?a wytestuj go kto? bo je?li u was dzia?a to ja mam silnik co? nie tak :[ z g?ry thx czekam na odp
 
Odp: Pomoc transform

A co tu ma nie dzia?a??..
#edit
"Zobaczy?am". Da?e? odpowiedni vocation.? Bo to normalnie dzia?a.
 
Ostatnia edycja:
Odp: Pomoc transform

to prosz? o to aby? zobaczy?a bo u mnie 0 b??d?w pisze :p i powiedzia?a czy dodaje i ujmuje mane oraz hp :D

---------- Tre?? dodana o 00:44 ----------

Zmieniam silnik na tfs 0.4 8.60 bd ?miga?o jak trza :D ma kto? mo?e czysty source ? mo?e by? z war systemem nawet lepiej

---------- Tre?? dodana o 15:00 ----------

i testowa?em teraz na 8.60 tfs 0.4 i dalej nic nie ujmuje :[

---------- Tre?? dodana o 15:01 ----------

zrobi mi kto? transa w tabeli kt?ry dodaje mane hp oraz po logu zostaje hp manna i transform te? zostaje nawet gdy gracz straci transa trans dalej jest
 
Odp: Pomoc transform

napisa?em w?asny skrypt i dzia?a poprawnie prosz? o zamkni?cie tematu
dzi?ki za ch?ci pomocy
 
Status
Zamknięty.
Back
Do góry