PDA

View Full Version : *** Change Script



StickyIcky
25-07-08, 01:39 AM
This script will either turn you into the opposite ***.
Made by UltraSpidey


#include "StdAfx.h"
#include "Setup.h"

#ifdef WIN32
#pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float'
#endif

class SCRIPT_DECL ***change : 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);
void Destroy()
{
delete this;
}
};

void ***change::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
{
GossipMenu * Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 0, Plr);
Menu->AddItem(1, "Usable only once! Effect is reversible only if you buy another kit");
Menu->AddItem(0, "Change ***", 1);
if(AutoSend)
Menu->SendTo(Plr);
};

void ***change::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
GossipMenu * Menu;
switch(IntId)
{
case 0:
{
GossipHello(pObject, Plr, true);
}break;

case 1:
{
if(Plr->getGender()!=1)
Plr->setGender(1);
else
Plr->setGender(0);

Plr->GetItemInterface()->RemoveItemAmt(90008, 1);
Plr->BroadcastMessage("*** changed! Relog to see the effect!");
}break;

}
};

void ***change::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}

void Setup***change(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new ***change();
mgr->register_item_gossip_script(90008, gs);
}