viewing paste Unknown #1551 | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
Index: atcommand.c
===================================================================
--- atcommand.c (revision 16920)
+++ atcommand.c (working copy)
@@ -8786,6 +8786,41 @@
    #undef MC_CART_MDFY
 }
 
+/*==========================================
+ * ported from Xantara's homunculus_mutate
+ * scriptcommand [clydelion]
+ *------------------------------------------*/
+ACMD_FUNC(hommutate)
+{
+   int homun_id, m_class = 0, m_id;
+   int homun_array[5] = {6048,6049,6050,6051,6052};
+   nullpo_retr(-1, sd);
+
+   if ( !merc_is_hom_active(sd->hd) ) {
+       clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
+       return -1;
+   }
+   
+   if( sd == NULL )
+       return -1;
+   if (!message || !*message)
+       homun_id = homun_array[rnd() % 5];
+   else
+       homun_id = atoi(message);
+
+   m_class = hom_class2mapid(sd->hd->homunculus.class_);
+   m_id    = hom_class2mapid(homun_id);
+       
+   if ( m_class != -1 && m_id != -1 && m_class&HOM_EVO && m_id&HOM_S && sd->hd->homunculus.level >= 99 )
+       hom_mutate(sd->hd, homun_id);
+   else
+   {
+       clif_displaymessage(fd, "Your homunculus must be level 99 to mutate.");
+       clif_emotion(&sd->hd->bl, E_SWT);
+   }
+   return 0;
+}
+
 /**
  * Fills the reference of available commands in atcommand DBMap
  **/
@@ -8796,6 +8831,7 @@
     * Command reference list, place the base of your commands here
     **/
    AtCommandInfo atcommand_base[] = {
+       ACMD_DEF(hommutate),
        ACMD_DEF2("warp", mapmove),
        ACMD_DEF(where),
        ACMD_DEF(jumpto),
Viewed 695 times, submitted by clydelion.