Hello! About time to contribute!
This script is a npc who boosts the players reputation with the most common factions.
Funservers might find this usefull, where your players dont have to grind rep to use enchants etc.
RepBooster.cpp
Code:
#include "StdAfx.h"
#include "Setup.h"
#ifdef WIN32
#pragma warning(disable:4305)
#endif
//-----------------------Start-------------------------------//
class SCRIPT_DECL RepBooster: public GossipScript
{
public:
void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
void GossipEnd(Object * pObject, Player* Plr);
GossipMenu *Menu;
void Destroy()
{
delete this;
}
};
void RepBooster::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
if (Plr->GetTeam() == 1)
{
Menu->AddItem(0, "Horde Factions", 2);
}
if(Plr->GetTeam() == 0)
{
Menu->AddItem(0, "Alliance Factions", 3);
}
Menu->AddItem(0, "Other Factions", 4);
Menu->SendTo(Plr);
}
void RepBooster::GossipSelectOption(Object *pObject, Player *Plr, uint32 Id, uint32 IntId, const char *Code)
{
switch(IntId)
{
case 0:
{
}
break;
case 1:
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
if (Plr->GetTeam() == 3)
{
Menu->AddItem(0, "Horde Factions", 2);
}
if(Plr->GetTeam() == 2)
{
Menu->AddItem(0, "Alliance Factions", 3);
}
Menu->AddItem(0, "Other Factions", 4);
Menu->SendTo(Plr);
}
break;
case 2:
{
Plr->SetStanding(530, 5000000);
Plr->SetStanding(729, 5000000);
Plr->SetStanding(76, 5000000);
Plr->SetStanding(911, 5000000);
Plr->SetStanding(510, 5000000);
Plr->SetStanding(941, 5000000);
Plr->SetStanding(947, 5000000);
Plr->SetStanding(81, 5000000);
Plr->SetStanding(922, 5000000);
Plr->SetStanding(68, 5000000);
Plr->SetStanding(889, 5000000);
Plr->Gossip_Complete();
}
break;
case 3:
{
Plr->SetStanding(589, 5000000);
Plr->SetStanding(69, 5000000);
Plr->SetStanding(930, 5000000);
Plr->SetStanding(54, 5000000);
Plr->SetStanding(946, 5000000);
Plr->SetStanding(47, 5000000);
Plr->SetStanding(978, 5000000);
Plr->SetStanding(890, 5000000);
Plr->SetStanding(730, 5000000);
Plr->SetStanding(72, 5000000);
Plr->SetStanding(509, 5000000);
Plr->SetStanding(471, 5000000);
Plr->Gossip_Complete();
}
break;
case 4:
{
Plr->SetStanding(529, 5000000);
Plr->SetStanding(1012, 5000000);
Plr->SetStanding(21, 5000000);
Plr->SetStanding(910, 5000000);
Plr->SetStanding(609, 5000000);
Plr->SetStanding(942, 5000000);
Plr->SetStanding(909, 5000000);
Plr->SetStanding(577, 5000000);
Plr->SetStanding(369, 5000000);
Plr->SetStanding(92, 5000000);
Plr->SetStanding(749, 5000000);
Plr->SetStanding(989, 5000000);
Plr->SetStanding(1011, 5000000);
Plr->SetStanding(93, 5000000);
Plr->SetStanding(1015, 5000000);
Plr->SetStanding(1038, 5000000);
Plr->SetStanding(470, 5000000);
Plr->SetStanding(349, 5000000);
Plr->SetStanding(1031, 5000000);
Plr->SetStanding(1077, 5000000);
Plr->SetStanding(809, 5000000);
Plr->SetStanding(970, 5000000);
Plr->SetStanding(932, 5000000);
Plr->SetStanding(933, 5000000);
Plr->SetStanding(990, 5000000);
Plr->SetStanding(934, 5000000);
Plr->SetStanding(935, 5000000);
Plr->SetStanding(967, 5000000);
Plr->SetStanding(59, 5000000);
Plr->SetStanding(576, 5000000);
Plr->SetStanding(270, 5000000);
Plr->SetStanding(87, 5000000);
Plr->SetStanding(70, 5000000);
Plr->Gossip_Complete();
}
break;
}
};
void RepBooster::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
void SetupRepBooster(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new RepBooster();
mgr->register_gossip_script(112231,gs);
}
The number in red is the entry id of the booster npc.
Setup.cpp
Code:
#include "StdAfx.h"
#include "Setup.h"
#define SKIP_ALLOCATOR_SHARING 1
#include <ScriptSetup.h>
extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
{
return SCRIPT_TYPE_MISC;
}
extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
{
SetupRepBooster(mgr);
}
#ifdef WIN32
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}
#endif
Setup.h
Code:
#ifndef INSTANCE_SCRIPTS_SETUP_H
#define INSTANCE_SCRIPTS_SETUP_H
void SetupRepBooster(ScriptMgr * mgr);
#endif
Repbooster.sql
Im using WhyDB so the sql might not work for you if you are using something else, but just create a new npc if it dont.
Code:
INSERT INTO creature_names
(`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `unk4`, `spelldataid`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `civilian`, `leader`)
VALUES
(112231, 'Reputation Booster', '', '', 0, 0, 0, 3, 0, NULL, 2041, 0, 0, 0, 1, 1, 1, NULL);
INSERT INTO creature_proto
(`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `mountdisplayid`, `equipmodel1`, `equipinfo1`, `equipslot1`, `equipmodel2`, `equipinfo2`, `equipslot2`, `equipmodel3`, `equipinfo3`, `equipslot3`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`)
VALUES
(112231, 100, 100, 35, 100000, 100000, 100, 1, 1, 1500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 1, 0, '0', 0, 0, 0, 0, 2.5, 8, 14, 0);
Everything wrapped up in a rar file here:
Download