Skip to content

Commit 42ddc01

Browse files
authored
Merge pull request #31 from azerothcore/sudlud-pach-42-5
2 parents 4320ea5 + 12b3ee4 commit 42ddc01

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

src/instance_reset.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,39 +111,27 @@ bool InstanceReset::OnGossipHello(Player* player, Creature* creature)
111111
case 1:
112112
{
113113
if (player->HasItemCount(token, count, true))
114-
{
115114
AddGossipItemFor(player, GOSSIP_ICON_CHAT, gossipText, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
116-
}
117115
else
118-
{
119116
creature->Whisper("You do not have the required items or token.", LANG_UNIVERSAL, player);
120-
}
121117
break;
122118
}
123119

124120
case 2:
125121
{
126122
if (player->GetMoney() >= money)
127-
{
128123
AddGossipItemFor(player, GOSSIP_ICON_CHAT, gossipText, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
129-
}
130124
else
131-
{
132125
creature->Whisper("You don't have enough money.", LANG_UNIVERSAL, player);
133-
}
134126
break;
135127
}
136128

137129
case 3:
138130
{
139131
if ((player->HasItemCount(token, count, true)) && ((player->GetMoney() >= money)))
140-
{
141132
AddGossipItemFor(player, GOSSIP_ICON_CHAT, gossipText, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
142-
}
143133
else
144-
{
145134
creature->Whisper("The reset requires a token and money.", LANG_UNIVERSAL, player);
146-
}
147135
break;
148136
}
149137

src/instance_reset.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#include "ScriptMgr.h"
2-
#include "Player.h"
1+
#include "Chat.h"
32
#include "Configuration/Config.h"
43
#include "GossipDef.h"
5-
#include "ScriptedGossip.h"
64
#include "Language.h"
7-
#include "Chat.h"
5+
#include "Opcodes.h"
6+
#include "Player.h"
7+
#include "ScriptedGossip.h"
8+
#include "ScriptMgr.h"
89
#include "WorldPacket.h"
910
#include "WorldSession.h"
10-
#include "Opcodes.h"
1111

1212
void GossipSetText(Player* player, std::string message, uint32 textID);
1313

@@ -20,7 +20,9 @@ uint32 money = 10000000;
2020
class InstanceResetAnnouncer : public PlayerScript
2121
{
2222
public:
23-
InstanceResetAnnouncer() : PlayerScript("InstanceResetAnnouncer") {}
23+
InstanceResetAnnouncer() : PlayerScript("InstanceResetAnnouncer", {
24+
PLAYERHOOK_ON_LOGIN
25+
}) {}
2426

2527
void OnPlayerLogin(Player* player) override;
2628
};
@@ -37,7 +39,9 @@ class InstanceReset : public CreatureScript
3739
class InstanceResetWorldConfig : public WorldScript
3840
{
3941
public:
40-
InstanceResetWorldConfig() : WorldScript("InstanceResetWorldConfig") { }
42+
InstanceResetWorldConfig() : WorldScript("InstanceResetWorldConfig", {
43+
WORLDHOOK_ON_BEFORE_CONFIG_LOAD
44+
}) { }
4145

4246
void OnBeforeConfigLoad(bool /*reload*/) override;
4347
};

0 commit comments

Comments
 (0)