Advertisement
Guest User

MesoX - mail template quest patch

a guest
Oct 23rd, 2011
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.52 KB | None | 0 0
  1. Index: sql/world_updates/4636_quest_mail.sql
  2. ===================================================================
  3. --- sql/world_updates/4636_quest_mail.sql   (revision 0)
  4. +++ sql/world_updates/4636_quest_mail.sql   (revision 0)
  5. @@ -0,0 +1,3 @@
  6. +ALTER TABLE `quests` ADD `MailTemplateId` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `CastSpell`;
  7. +ALTER TABLE `quests` ADD `MailDelaySecs` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `MailTemplateId`;
  8. +ALTER TABLE `quests` ADD `MailSendItem` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `MailDelaySecs`;
  9. +UPDATE `arcemu_db_version` SET `LastUpdate` = '4655';
  10. Index: src/arcemu-world/DBC/DBCStores.cpp
  11. ===================================================================
  12. --- src/arcemu-world/DBC/DBCStores.cpp  (revision 4654)
  13. +++ src/arcemu-world/DBC/DBCStores.cpp  (working copy)
  14. @@ -84,6 +84,7 @@
  15.  SERVER_DECL DBCStorage<gtFloat> dbcSpellCritBase;
  16.  SERVER_DECL DBCStorage<SpellShapeshiftForm> dbcSpellShapeshiftForm;
  17.  SERVER_DECL DBCStorage<QuestXP> dbcQuestXP;
  18. +SERVER_DECL DBCStorage<MailTemplateEntry> dbcMailTemplateEntry;
  19.  SERVER_DECL DBCStorage<WMOAreaTableEntry> dbcWMOAreaTable;
  20.  SERVER_DECL DBCStorage< SummonPropertiesEntry > dbcSummonProperties;
  21.  SERVER_DECL DBCStorage< NameGenEntry > dbcNameGen;
  22. @@ -338,6 +339,7 @@
  23.  const char* itemlimitcategoryformat = "usxxxxxxxxxxxxxxxxuu";
  24.  const char* spellshapeshiftformformat = "uxxxxxxxxxxxxxxxxxxuuxuuuxxuuuuuuuu";
  25.  const char* questxpformat = "uxuuuuuuuux";
  26. +const char* mailTemplateEntryFormat="nsxxxxxxxxxxxxxxxxsxxxxxxxxxxxxxxxx";
  27.  const char* wmoareaformat = "uiiixxxxxuuxxxxxxxxxxxxxxxxx";
  28.  const char* summonpropertiesformat = "uuuuuu";
  29.  const char* namegenentryformat = "usuu";
  30. @@ -418,6 +420,7 @@
  31.     LOAD_DBC("DBC/ScalingStatValues.dbc", scalingstatvaluesformat, true, dbcScalingStatValues, false);
  32.     LOAD_DBC("DBC/ItemLimitCategory.dbc", itemlimitcategoryformat, true, dbcItemLimitCategory, true);
  33.     LOAD_DBC("DBC/QuestXP.dbc", questxpformat, true, dbcQuestXP, false);
  34. +   LOAD_DBC("DBC/MailTemplate.dbc", mailTemplateEntryFormat, true, dbcMailTemplateEntry, true);
  35.     LOAD_DBC("DBC/WMOAreaTable.dbc", wmoareaformat, true, dbcWMOAreaTable, false);
  36.     LOAD_DBC("DBC/SummonProperties.dbc", summonpropertiesformat, true, dbcSummonProperties, false);
  37.     LOAD_DBC("DBC/NameGen.dbc", namegenentryformat, true, dbcNameGen, true);
  38. Index: src/arcemu-world/DBC/DBCStores.h
  39. ===================================================================
  40. --- src/arcemu-world/DBC/DBCStores.h    (revision 4654)
  41. +++ src/arcemu-world/DBC/DBCStores.h    (working copy)
  42. @@ -1405,6 +1405,17 @@
  43.     //unk                                                   // 10
  44.  };
  45.  
  46. +struct MailTemplateEntry
  47. +{
  48. +   uint32      ID;             // 0
  49. +   char*       subject;        // 1
  50. +   //float     unused1[15]     // 2-16
  51. +   //uint32    flags1          // 17 name flags, unused
  52. +   char*       content;        // 18
  53. +   //float     unused2[15]     // 19-34
  54. +   //uint32    flags2          // 35 name flags, unused
  55. +};
  56. +
  57.  struct WMOAreaTableEntry
  58.  {
  59.     uint32 id; // 0
  60. @@ -2004,6 +2015,7 @@
  61.  extern SERVER_DECL DBCStorage<ScalingStatValuesEntry> dbcScalingStatValues;
  62.  extern SERVER_DECL DBCStorage<ItemLimitCategoryEntry> dbcItemLimitCategory;
  63.  extern SERVER_DECL DBCStorage< QuestXP > dbcQuestXP;
  64. +extern SERVER_DECL DBCStorage<MailTemplateEntry> dbcMailTemplateEntry;
  65.  extern SERVER_DECL DBCStorage<WMOAreaTableEntry> dbcWMOAreaTable;
  66.  extern SERVER_DECL DBCStorage< SummonPropertiesEntry > dbcSummonProperties;
  67.  extern SERVER_DECL DBCStorage< NameGenEntry > dbcNameGen;
  68. Index: src/arcemu-world/Master.h
  69. ===================================================================
  70. --- src/arcemu-world/Master.h   (revision 4654)
  71. +++ src/arcemu-world/Master.h   (working copy)
  72. @@ -43,8 +43,8 @@
  73.  #define BUILDTYPE "Release"
  74.  #endif
  75.  
  76. -#define REQUIRED_WORLD_DB_VERSION 4630
  77. -#define REQUIRED_CHAR_DB_VERSION 4641
  78. +#define REQUIRED_WORLD_DB_VERSION 4655
  79. +#define REQUIRED_CHAR_DB_VERSION 4641
  80.  
  81.  #define DEFAULT_LOOP_TIME 0 /* 0 milliseconds - instant */
  82.  #define DEFAULT_LOG_LEVEL 0
  83. Index: src/arcemu-world/ObjectStorage.cpp
  84. ===================================================================
  85. --- src/arcemu-world/ObjectStorage.cpp  (revision 4654)
  86. +++ src/arcemu-world/ObjectStorage.cpp  (working copy)
  87. @@ -32,7 +32,7 @@
  88.  const char * gAreaTriggerFormat                            = "ucuusffffuu";
  89.  const char * gItemPageFormat                           = "usu";
  90.  const char * gNpcTextFormat                                = "ufssuuuuuuufssuuuuuuufssuuuuuuufssuuuuuuufssuuuuuuufssuuuuuuufssuuuuuuufssuuuuuuu";
  91. -const char * gQuestFormat                              = "uuuuuuuuuuuuuuuuuuussssssssssuuuuuuuuuuuuiiiiuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuiiiiiiuiuuuuuuuuuuuusuuuusuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu";
  92. +const char * gQuestFormat                              = "uuuuuuuuuuuuuuuuuuussssssssssuuuuuuuuuuuuiiiiuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuiiiiiiuiuuuuuuuuuuuuuuusuuuusuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu";
  93.  //const char * gSpellExtraFormat                           = "uuuu";
  94.  const char* gGraveyardFormat                           = "uffffuuuux";
  95.  const char* gTeleportCoordFormat                       = "uxufffx";
  96. Index: src/arcemu-world/Quest.h
  97. ===================================================================
  98. --- src/arcemu-world/Quest.h    (revision 4654)
  99. +++ src/arcemu-world/Quest.h    (working copy)
  100. @@ -192,6 +192,10 @@
  101.     uint32 reward_spell;
  102.     uint32 effect_on_player;
  103.  
  104. +   uint32 MailTemplateId;
  105. +   uint32 MailDelaySecs;
  106. +   uint32 MailSendItem;
  107. +
  108.     uint32 point_mapid;
  109.     uint32 point_x;
  110.     uint32 point_y;
  111. Index: src/arcemu-world/QuestMgr.cpp
  112. ===================================================================
  113. --- src/arcemu-world/QuestMgr.cpp   (revision 4654)
  114. +++ src/arcemu-world/QuestMgr.cpp   (working copy)
  115. @@ -1370,6 +1370,35 @@
  116.                 plr->AddToFinishedQuests((*iter));
  117.         }
  118.     }
  119. +
  120. +   if( qst->MailTemplateId != 0 )
  121. +   {
  122. +       MailTemplateEntry * mail = dbcMailTemplateEntry.LookupEntryForced( qst->MailTemplateId );
  123. +       if( mail != NULL )
  124. +       {
  125. +           int mailType = NORMAL;
  126. +           uint64 itemGuid = 0;
  127. +           if(qst_giver->IsCreature())
  128. +               mailType = CREATURE;
  129. +           else if(qst_giver->IsGameObject())
  130. +               mailType = GAMEOBJECT;
  131. +
  132. +           if( qst->MailSendItem != 0 )
  133. +           {
  134. +               // the way it's done in World::PollMailboxInsertQueue
  135. +               Item * pItem = objmgr.CreateItem(qst->MailSendItem, NULL);
  136. +               if(pItem != NULL)
  137. +               {
  138. +                   pItem->SetStackCount(1);
  139. +                   pItem->SaveToDB(0, 0, true, NULL);
  140. +                   itemGuid = pItem->GetGUID();
  141. +                   pItem->DeleteMe();
  142. +               }
  143. +           }
  144. +
  145. +           sMailSystem.SendAutomatedMessage( mailType, qst_giver->GetGUID(), plr->GetGUID(), mail->subject, mail->content, 0, 0, itemGuid, MAIL_STATIONERY_TEST1, qst->MailDelaySecs );
  146. +       }
  147. +   }
  148.  }
  149.  
  150.  /////////////////////////////////////
  151.  
  152.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement