Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

quest mail

By: jackpoz on Oct 8th, 2011  |  syntax: Diff  |  size: 5.80 KB  |  hits: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Index: sql/world_updates/4632_quest_mail.sql
  2. ===================================================================
  3. --- sql/world_updates/4632_quest_mail.sql       (revision 0)
  4. +++ sql/world_updates/4632_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. +UPDATE `arcemu_db_version` SET `LastUpdate` = '4632';
  9. \ No newline at end of file
  10. Index: src/arcemu-world/DBC/DBCStores.cpp
  11. ===================================================================
  12. --- src/arcemu-world/DBC/DBCStores.cpp  (revision 4629)
  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 4629)
  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 4630)
  71. +++ src/arcemu-world/Master.h   (working copy)
  72. @@ -43,7 +43,7 @@
  73.  #define BUILDTYPE "Release"
  74.  #endif
  75.  
  76. -#define REQUIRED_WORLD_DB_VERSION 4630
  77. +#define REQUIRED_WORLD_DB_VERSION 4632
  78.  #define REQUIRED_CHAR_DB_VERSION 4479
  79.  
  80.  #define DEFAULT_LOOP_TIME 0 /* 0 milliseconds - instant */
  81. Index: src/arcemu-world/ObjectStorage.cpp
  82. ===================================================================
  83. --- src/arcemu-world/ObjectStorage.cpp  (revision 4630)
  84. +++ src/arcemu-world/ObjectStorage.cpp  (working copy)
  85. @@ -32,7 +32,7 @@
  86.  const char * gAreaTriggerFormat                                                        = "ucuusffffuu";
  87.  const char * gItemPageFormat                                                   = "usu";
  88.  const char * gNpcTextFormat                                                            = "ufssuuuuuuufssuuuuuuufssuuuuuuufssuuuuuuufssuuuuuuufssuuuuuuufssuuuuuuufssuuuuuuu";
  89. -const char * gQuestFormat                                                              = "uuuuuuuuuuuuuuuuuuussssssssssuuuuuuuuuuuuiiiiuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuiiiiiiuiuuuuuuuuuuuusuuuusuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu";
  90. +const char * gQuestFormat                                                              = "uuuuuuuuuuuuuuuuuuussssssssssuuuuuuuuuuuuiiiiuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuiiiiiiuiuuuuuuuuuuuuuusuuuusuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu";
  91.  //const char * gSpellExtraFormat                                                       = "uuuu";
  92.  const char* gGraveyardFormat                                                   = "uffffuuuux";
  93.  const char* gTeleportCoordFormat                                               = "uxufffx";
  94. Index: src/arcemu-world/Quest.h
  95. ===================================================================
  96. --- src/arcemu-world/Quest.h    (revision 4630)
  97. +++ src/arcemu-world/Quest.h    (working copy)
  98. @@ -192,6 +192,9 @@
  99.         uint32 reward_spell;
  100.         uint32 effect_on_player;
  101.  
  102. +       uint32 MailTemplateId;
  103. +       uint32 MailDelaySecs;
  104. +
  105.         uint32 point_mapid;
  106.         uint32 point_x;
  107.         uint32 point_y;
  108. Index: src/arcemu-world/QuestMgr.cpp
  109. ===================================================================
  110. --- src/arcemu-world/QuestMgr.cpp       (revision 4630)
  111. +++ src/arcemu-world/QuestMgr.cpp       (working copy)
  112. @@ -1370,6 +1370,13 @@
  113.                                 plr->AddToFinishedQuests((*iter));
  114.                 }
  115.         }
  116. +
  117. +       if( qst->MailTemplateId )
  118. +       {
  119. +               MailTemplateEntry * mail = dbcMailTemplateEntry.LookupEntryForced( qst->MailTemplateId );
  120. +               if( mail != NULL )
  121. +                       sMailSystem.SendAutomatedMessage( NORMAL, qst_giver->GetGUID(), plr->GetGUID(), mail->subject, mail->content, 0, 0, 0, MAIL_STATIONERY_TEST1, qst->MailDelaySecs );
  122. +       }
  123.  }
  124.  
  125.  /////////////////////////////////////
  126.  
  127.