forked from insider42/scriptdev2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnpc_arena_honor.cpp
More file actions
99 lines (93 loc) · 3.43 KB
/
npc_arena_honor.cpp
File metadata and controls
99 lines (93 loc) · 3.43 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* Copyright (C) 2006 - 2011 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: npc_arena_honor
SD%Complete: 100%
SDComment: by tempura, corrected by /dev/rsa
SDCategory: custom
EndScriptData */
#include "precompiled.h"
#include "sc_creature.h"
#include "sc_gossip.h"
#define GOSSIP_ITEM_ARENA_TO_HONOR -3000770
#define GOSSIP_ITEM_ARENA_TO_HONOR1 -3000771
#define GOSSIP_ITEM_HONOR_TO_ARENA -3000772
#define GOSSIP_ITEM_HONOR_TO_ARENA1 -3000773
#define UNSUCCESSFUL_HONOR -1001007
#define UNSUCCESSFUL_ARENA -1001008
bool GossipHello_npc_arena_honor(Player* pPlayer, Creature *pCreature)
{
pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_HONOR_TO_ARENA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_HONOR_TO_ARENA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARENA_TO_HONOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARENA_TO_HONOR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
pPlayer->SEND_GOSSIP_MENU(3961,pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_arena_honor(Player *pPlayer, Creature *pCreature, uint32 sender, uint32 action)
{
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
if (pPlayer->GetHonorPoints() >= 1000)
{
pPlayer->ModifyHonorPoints(-1000);
pPlayer->ModifyArenaPoints(+50);
}
else
DoScriptText(UNSUCCESSFUL_HONOR, pCreature);
}
if (action == GOSSIP_ACTION_INFO_DEF + 2)
{
if (pPlayer->GetHonorPoints() >= 10000)
{
pPlayer->ModifyHonorPoints(-10000);
pPlayer->ModifyArenaPoints(+500);
}
else
DoScriptText(UNSUCCESSFUL_HONOR, pCreature);
}
if (action == GOSSIP_ACTION_INFO_DEF + 3)
{
if (pPlayer->GetArenaPoints() >= 100)
{
pPlayer->ModifyArenaPoints(-100);
pPlayer->ModifyHonorPoints(+2000);
}
else
DoScriptText(UNSUCCESSFUL_ARENA, pCreature);
}
if (action == GOSSIP_ACTION_INFO_DEF + 4)
{
if (pPlayer->GetArenaPoints() >= 1000)
{
pPlayer->ModifyArenaPoints(-1000);
pPlayer->ModifyHonorPoints(+20000);
}
else
DoScriptText(UNSUCCESSFUL_ARENA, pCreature);
}
pPlayer->CLOSE_GOSSIP_MENU();
return true;
}
void AddSC_npc_arena_honor()
{
Script *newscript;
newscript = new Script;
newscript->Name="npc_arena_honor";
newscript->pGossipHello = &GossipHello_npc_arena_honor;
newscript->pGossipSelect = &GossipSelect_npc_arena_honor;
newscript->RegisterSelf();
}