Is there a way to get the defname of the ore that is being mined - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Is there a way to get the defname of the ore that is being mined (/Thread-Is-there-a-way-to-get-the-defname-of-the-ore-that-is-being-mined) |
Is there a way to get the defname of the ore that is being mined - fabiohvp - 07-20-2018 05:07 PM I'll try to explain.. I am using ON=@SkillMakeItem to create a system to upgrade the skill tool (bs - sledge hammer, bc - dagger, tailor - sewing kit, etc..). I blocked the use of other tools, each skill can use only one kind of tool. The system is fairly simple, each time the event is triggered, I check which skill is being used with <act.SKILLMAKE.1.KEY> and depend on the skill amount needed to craft the item I increment X until my counter reach the value I want and then the tool will give +10 for that skill. My main issue is that when mining (or lumberjacking) I can't get the type (iron, gold, silver, valorite, etc..) that was mined. Another issue is that for skills like tailor, tinker, I don't have reference for the tool that is being used, so for now I am using findid, but if anyone knows another way, let me know. The main part of the script is below. Code: ON=@SkillMakeItem RE: Is there a way to get the defname of the ore that is being mined - darksun84 - 07-20-2018 06:42 PM you can use the @RegionResourceFound trigger https://wiki.spherecommunity.net/index.php?title=@RegionResourceFound Also you can improve the if statement in this way: Code: ON=@SkillMakeItem No need to use eval in if, they are automatically evaluated, and skill_* definition are just number so no need to string compare them, also no need to do src.weapon.uid or <findid.i_tinker_tools.uid> because <src.weapon> or <findid.i_tinker_tools> return the uid by default RE: Is there a way to get the defname of the ore that is being mined - fabiohvp - 07-22-2018 03:15 AM Thank you, I manage to make mining and lumber working using @RegionResourceFound |