PDA

View Full Version : Returning a value in skills?


Cutter
10-04-2004, 10:12 AM
Is t here a way to return a value in a skill.. ex. fletching

if player fletching => 2 then the npc the player is interacting with will give him an item.. and give him more fletching skill..

if player fletching < 2 then take an item he is giving the npc.. and say sorry your fletching is not high enough try again later.. thanks for the loot btw..

killspree
10-04-2004, 03:07 PM
You may have to make a custom variable, something like $getskill{"DUAL_WIELD"}...if that's even the proper syntax...I'm not a perl expert. Have that use the GetSkill() function to check the skill specified.

m0oni9
10-05-2004, 05:08 AM
I introduced C callback examples for perl a while back. I haven't been on the scene too much as of late (school, etc), but I think the initial changes (ie: backbone) were merged in. I think this is the thread, if you are feeling adventurous: http://www.eqemulator.net/forums/viewtopic.php?t=13920

At this point I think you would just need to make a C function that would be called from perl, and elsewhere register it with the quest module so that it would be recognized. In the link I provided, see the third post -- the two things you should draw most attention to are inside the cperl.cpp/.h file (creating a function), and then later registering it with the newXS() call.

The hardest part is probably getting the cryptic XS stuff to make sense. For that you might want to view the thread previous to the above: http://www.eqemulator.net/forums/viewtopic.php?t=12393

This hasn't gotten a lot of attention, I suspect largely because it does not come off as being the easiest thing to work with at first. The new variable idea that killspree suggested will probably work just fine. However, IMO a lot of this data will end up being fetched in the manner I described. It seems like a good idea to deal with it now rather than later.