Author Topic: Skill lvling up -<-- Solved -->-  (Read 634 times)

0 Members and 1 Guest are viewing this topic.

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Skill lvling up -<-- Solved -->-
« on: December 25, 2008, 09:57:56 pm »
I am working on a Zombie RPG script and have the accounts down but im having trouble lvling up your skills, i have records containing each skill and its mana and skillpoint cost. But I am trying to use this code
Code: [Select]
if Players[ID].logged then begin
if getpiece(text,' ',0) = '/learn' then

if not getpiece(text,' ',1) = nil then begin
if getpiece(text,' ',1) = 'heal' then begin
if players[ID].heal < 3 then begin
if players[ID].spts >= heal.lvl1cost then begin
dec(players[ID].spts,heal.lvl1cost);
inc(players[ID].heal,1)
end;
end;
end;
end;
end;
but with this I would have to make a new one for every lvl is there any way to make it universal like this?
Code: [Select]
if Players[ID].logged then begin
if getpiece(text,' ',0) = '/learn' then

if not getpiece(text,' ',1) = nil then begin
if getpiece(text,' ',1) = 'heal' then begin
if players[ID].heal < 3 then begin
if players[ID].spts >= heal.lvl+(Players[ID].heal+1)+cost then begin
dec(players[ID].spts,heal.lvl+(Players[ID].heal+1)+cost);
inc(players[ID].heal,1)
end;
end;
end;
end;
end;
Thank you
« Last Edit: December 26, 2008, 04:12:59 am by Hacktank »


Offline GSx_Major

  • Major
  • *
  • Posts: 97
Re: Skill lvling up
« Reply #1 on: December 25, 2008, 11:01:38 pm »
Make heal level cost an array...
...and headbutt the sucker through your banana suit!

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Skill lvling up
« Reply #2 on: December 26, 2008, 04:10:49 am »
Thanks GSx_Major, i cant beleive i didnt think of that. :p