Somersby
Apprentice
Posts: 6
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Nov 2017
Reputation: 0
|
@SkillGain
Hello! I'm new at Sphere and I'm trying to figure some things out!
I want to make a reward item when a player reaches 100.0 in a specific skill. I'm using Sphere 56c.
[EVENTS e_players]
On=@SkillGain
if !<src.isplayer>
return 0
endif
if (<src.tinkering> == 1000)
if !<src.tag.reward_tinkering>
src.tag.reward_count = <eval ((<src.tag.reward_count>) + 1)>
src.tag.reward_tinkering = 1
src.sysmessage @,,1 Tinkering Complete!
src.dialog d_reward_gump
endif
endif
Ok. I have 99.9 Tinkering and I'm macroing... 100.0. Nothing happens. But if I keep macroing (one more time, to be exactly), it works.
What's wrong in there?
Thanks!
(This post was last modified: 11-06-2017 11:18 PM by Somersby.)
|
|
11-06-2017 11:15 PM |
|
|
Somersby
Apprentice
Posts: 6
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Nov 2017
Reputation: 0
|
RE: @SkillGain
(11-07-2017 12:34 AM)darksun84 Wrote: You have to use @SkillChange and the argn1 and argn2 value, @SkillGain is fired before the skill increase and is always fired whenever the skill will increase or not.
https://wiki.spherecommunity.net/index.p...killChange
Code:
[EVENTS e_players]
On=@SkillChange
if !<src.isplayer>
return 0
endif
if ( <argn1> == 37 ) && (<argn2> == 1000) //37 is the tinkering skill
if !<src.tag.reward_tinkering>
src.tag.reward_count = <eval ((<src.tag.reward_count>) + 1)>
src.tag.reward_tinkering = 1
src.sysmessage @,,1 Tinkering Complete!
src.dialog d_reward_gump
endif
endif
Thanks!!!
|
|
11-07-2017 02:17 AM |
|
|
Somersby
Apprentice
Posts: 6
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Nov 2017
Reputation: 0
|
RE: @SkillGain
So... I have a table (with skills I will use to give a reward). It works great. But, there's any way to combine skills in there? Example... Thief = Snooping+Stealing+Hiding+Stealth.
Code:
[DEFNAME reward_skills]
skillreward.Alchemy 58
skillreward.Musicianship 29
skillreward.Provocation 22
skillreward.Peacemaking 9
skillreward.Enticement 15
skillreward.Blacksmithing 7
skillreward.Carpentry 11
skillreward.Fishing 18
skillreward.Lumberjacking 44
skillreward.Magery 25
skillreward.Mining 45
skillreward.Tailoring 34
skillreward.Tinkering 37
skillreward.Snooping 28
skillreward.Lockpicking 24
skillreward.Stealth 47
skillreward.Hiding 21
skillreward.Stealing 33
skillreward.Taming 35
skillreward.Bowcraft 8
for r 1 58
local.name = <serv.skill.<local.r>.key>
if (<argn1> == <eval <def.skillreward.<local.name>>>) && (<argn2> == 1000)
if (<eval <def.skillreward.<local.name>>> == 0)
return 0
endif
if !<eval <src.tag0.reward_<local.name>>>
src.tag0.reward_<local.name> = 1
src.tag0.reward_count = <eval ((<src.tag0.reward_count>) + 1)>
src.dialog d_reward_gump
endif
endif
endfor
(This post was last modified: 11-09-2017 11:27 AM by Somersby.)
|
|
11-09-2017 10:52 AM |
|
|
Somersby
Apprentice
Posts: 6
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Nov 2017
Reputation: 0
|
RE: @SkillGain
(11-09-2017 08:38 PM)darksun84 Wrote: You can use skilltest for checking the values of multiple skills
Code:
//Skilltest returns 1 if you have all the skills in the list at the appropriate level, otherwise returns 0
if <src.skilltest snooping 1000,stealing 1000,hiding 1000, stealth 1000>
//your code...
endif
Also pay attention that your FOR index should starts from 0 and not from 1, that's because the Alchemy skill has index 0.
Yeah, I had a problem with it... Because my for returns all values to 0 (of the skills that I don't want it), if I put 0 in there, all skills will be triggered (even if I don't want them). I made a "new" Alchemy, just copying the KEY and put it on 58.
|
|
11-10-2017 04:37 AM |
|
|
darksun84
Sir Spamalot
Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35
|
RE: @SkillGain
I don't think it's safe to do that
A faster and safer alternative is this, create a new file and place the following code
Code:
[DEFNAME custom_skill_flags]
skillReward 01
Open spheretables.scp and add the new file before sphere_skills.scp.
Then open sphere_skills.scp and for each skill that you want a reward add the following line in the skill block
Go back in your trigger SkillChange and change it in this way:
Code:
local.name = <serv.skill.<argn1>.key>
if (<serv.skill.<argn1>.group>&<def0.skillReward>) && ( <argn2> == 1000 )
if !<eval <src.tag0.reward_<local.name>>>
src.tag0.reward_<local.name> = 1
src.tag0.reward_count = <eval ((<src.tag0.reward_count>) + 1)>
src.dialog d_reward_gump
endif
endif
http://wiki.spherecommunity.net/index.ph...Operations
(This post was last modified: 11-10-2017 05:06 AM by darksun84.)
|
|
11-10-2017 04:59 AM |
|
|