![]() |
@SkillGain - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: @SkillGain (/Thread-SkillGain--5649) |
@SkillGain - Somersby - 11-06-2017 11:15 PM 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! RE: @SkillGain - darksun84 - 11-07-2017 12:34 AM 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.php?title=@SkillChange Code: [EVENTS e_players] RE: @SkillGain - Somersby - 11-07-2017 02:17 AM (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. Thanks!!! RE: @SkillGain - Somersby - 11-09-2017 10:52 AM 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] RE: @SkillGain - darksun84 - 11-09-2017 08:38 PM 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 Also pay attention that your FOR index should starts from 0 and not from 1, that's because the Alchemy skill has index 0. RE: @SkillGain - Somersby - 11-10-2017 04:37 AM (11-09-2017 08:38 PM)darksun84 Wrote: You can use skilltest for checking the values of multiple skills 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. RE: @SkillGain - darksun84 - 11-10-2017 04:59 AM 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] Then open sphere_skills.scp and for each skill that you want a reward add the following line in the skill block Code: GROUP= skillReward Go back in your trigger SkillChange and change it in this way: Code: local.name = <serv.skill.<argn1>.key> http://wiki.spherecommunity.net/index.php?title=Bitwise_Operations RE: @SkillGain - Somersby - 11-10-2017 05:35 AM Pretty cool way!!! Everything's working, except Alchemy! ![]() ERROR:(c_event_player.scp,14)Can't resolve <serv.skill.0.key> RE: @SkillGain - darksun84 - 11-10-2017 05:38 AM Did you added back the key to the alchemy? Usually you need to restart the server when you make a change to the SKILL block (this also apply to the SPELL blocks) RE: @SkillGain - Somersby - 11-10-2017 05:41 AM (11-10-2017 05:38 AM)darksun84 Wrote: Did you added back the key to the alchemy? Usually you need to restart the server when you make a change to the SKILL block (this also apply to the SPELL blocks) Oh, I didn't restart the server for the spell blocks. Now it's working. Man, thank you SO much for your help. I really appreciate it. ^^ |