Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing a skill to a function
Author Message
Arcer
Apprentice
*

Posts: 20
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Mar 2013
Reputation: 0



Post: #1
Passing a skill to a function
Hi all,

I'm scripting a stone skill for custumazing the player skills.

The player can set his skill by usign +/- 1 +/-5 and +/- 10 buttons.

Is there a way to pass se skill object to a function??? like

on=1

f_upskill <src.archery>

[function f_upskill]

argo= <argo>+1.0
04-29-2013 10:44 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Passing a skill to a function
I think this can work
PHP Code:
ON=
f_upskill archery

[FUNCTION f_upskill]
args += 1.0 

Args contain the string Archery, so when the function is running the line :
args += 1.0
sphere will "evaluate" this line as
archery += 1.0
04-29-2013 10:52 PM
Find all posts by this user Like Post Quote this message in a reply
Arcer
Apprentice
*

Posts: 20
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Mar 2013
Reputation: 0



Post: #3
RE: Passing a skill to a function
(04-29-2013 10:52 PM)darksun84 Wrote:  I think this can work
PHP Code:
ON=
f_upskill archery

[FUNCTION f_upskill]
args += 1.0 

Args contain the string Archery, so when the function is running the line :
args += 1.0
sphere will "evaluate" this line as
archery += 1.0


nothing.....


but i've solved:

Code:
on = 2
f_upskill1 <src>, archery

[FUNCTION f_upskill1]
local.skillValue=<serv.uid.<argv[0]>.<argv[1]>>
if ( <local.skillValue> >= 1000)
    sysmessage Non puoi far salire la skill piu' di 100.0 con la stone!!
else
    serv.uid.<argv[0]>.<argv[1]> = <eval <local.skillValue> + 10>
endif
04-29-2013 11:17 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)