View Single Post
  #1  
Old 12-03-2010, 01:38 PM
Leere
Sarnak
 
Join Date: Sep 2008
Location: Home
Posts: 31
Default COMMITTED: quest::LearnRecipe

Makes LearnRecipe accessible for the initiating $client via quest::LearnRecipe.

Code:
Index: zone/perlparser.cpp
===================================================================
--- zone/perlparser.cpp    (revision 1754)
+++ zone/perlparser.cpp    (working copy)
@@ -3072,7 +3072,21 @@
     XSRETURN_EMPTY;
 }
 
+XS(XS__LearnRecipe);
+XS(XS__LearnRecipe)
+{
+    dXSARGS;
+    if (items != 1)
+        Perl_croak(aTHX_ "Usage: LearnRecipe(recipe_id)");
 
+    uint32 recipe_id = (uint32)SvIV(ST(0));
+
+    quest_manager.LearnRecipe(recipe_id);
+
+    XSRETURN_EMPTY;
+}
+
+
 /*
 This is the callback perl will look for to setup the
 quest package's XSUBs
@@ -3272,6 +3286,7 @@
         newXS(strcpy(buf, "removetitle"), XS__removetitle, file);
         newXS(strcpy(buf, "wearchange"), XS__wearchange, file);
         newXS(strcpy(buf, "voicetell"), XS__voicetell, file);
+        newXS(strcpy(buf, "LearnRecipe"), XS__LearnRecipe, file);
     XSRETURN_YES;
 }
Code:
Index: zone/questmgr.cpp
===================================================================
--- zone/questmgr.cpp    (revision 1754)
+++ zone/questmgr.cpp    (working copy)
@@ -2428,6 +2428,12 @@
    initiator->RemoveTitle(titleset);
 }
 
+void QuestManager::LearnRecipe(uint32 recipe_id) {
+    if(!initiator)
+        return;
+    initiator->LearnRecipe(recipe_id);
+}
+
 void QuestManager::wearchange(int8 slot, int16 texture)
 {
     if(owner){
Code:
Index: zone/questmgr.h
===================================================================
--- zone/questmgr.h    (revision 1754)
+++ zone/questmgr.h    (working copy)
@@ -190,6 +190,7 @@
     void enabletitle(int titleset);
        bool checktitle(int titlecheck);
        void removetitle(int titlecheck);
+    void LearnRecipe(uint32 recipe_id);
 
     int16 CreateGroundObject(int32 itemid, float x, float y, float z, float heading, int32 decay_time = 300000);
     int16 CreateGroundObjectFromModel(const char* model, float x, float y, float z, float heading, int8 type = 0x00, int32 decay_time = 0);
Reply With Quote