PDA

View Full Version : Plastic Surgeon Kit



StickyIcky
25-07-08, 02:38 AM
Made by UltraSpidey

This script allows players to change their race(Depending on if other races allow the class you have)

//========================
// Plastic Surgeon Kit
// Made by Spidey
// Released under
// the Care License
//------------------------
// For more fun scripts
// visit CodeCraft.us
//========================
#include "StdAfx.h"
#include "Setup.h"

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

class SCRIPT_DECL Surgeon : 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 Surgeon::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
{
GossipMenu * Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 0, Plr);
uint8 pr = Plr->getRace();
uint8 pc = Plr->getClass();
uint32 pf = Plr->GetTeam();
if(pf == 1 && pr != RACE_BLOODELF && pc != WARRIOR && pc != SHAMAN && pc != DRUID)
Menu->AddItem(0, "Blood Elf", 10);
if(pf == 0 && pr != RACE_DRAENEI && pc != WARLOCK && pc != ROGUE && pc != DRUID)
Menu->AddItem(0, "Draenei", 11);
if(pf == 0 && pr != RACE_DWARF && pc != WARLOCK && pc != SHAMAN && pc != MAGE && pc != DRUID)
Menu->AddItem(0, "Dwarf", 3);
if(pf == 0 && pr != RACE_GNOME && (pc == WARRIOR || pc == ROGUE || pc == MAGE || pc == WARLOCK))
Menu->AddItem(0, "Gnome", 7);
if(pf == 0 && pr != RACE_HUMAN && pc != DRUID && pc != SHAMAN && pc != HUNTER)
Menu->AddItem(0, "Human", 1);
if(pf == 0 && pr != RACE_NIGHTELF && pc != MAGE && pc != PALADIN && pc != SHAMAN && pc != WARLOCK)
Menu->AddItem(0, "Night Elf", 4);
if(pf == 1 && pr != RACE_ORC && pc != MAGE && pc != PALADIN && pc != PRIEST && pc != DRUID)
Menu->AddItem(0, "Orc", 2);
if(pf == 1 && pr != RACE_TAUREN && (pc == WARRIOR || pc == SHAMAN || pc == HUNTER || pc == DRUID))
Menu->AddItem(0, "Tauren", 6);
if(pf == 1 && pr != RACE_TROLL && pc != WARLOCK && pc != PALADIN && pc != DRUID)
Menu->AddItem(0, "Troll", 8);
if(pf == 1 && pr != RACE_UNDEAD && pc != SHAMAN && pc != PALADIN && pc != HUNTER && pc != DRUID)
Menu->AddItem(0, "Undead", 5);
Menu->AddItem(1, "I've changed my mind", 100);
if(AutoSend)
Menu->SendTo(Plr);
};

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

default:
{
Plr->setRace((uint8)IntId);
Plr->GetItemInterface()->RemoveItemAmt(90010, 1);
Plr->Gossip_Complete();
Plr->BroadcastMessage("Race change complete. Relog to see the effect.");
}break;

}
};

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

void SetupSurgeon(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new Surgeon();
mgr->register_item_gossip_script(90010, gs);
}

Synthetic
02-09-08, 07:20 AM
Nice release, very usefull.

Chmun
02-09-08, 09:16 AM
Lol, Plastic Sugeon ... Nice

Knaur
02-09-08, 11:53 AM
hmm, so it does work now? i have tryed get that one to work in ages on the aspire cores.. no luck yet

StickyIcky
02-09-08, 01:25 PM
Haven't even tested it yet...but i will be putting this in my server...so i'll post back here later tonight

Knaur
02-09-08, 02:42 PM
i even contacted aspire devs, and did all 100% as they told me. dll loads and item is 100% as it should, but not a shit happens when i right-click on it

StickyIcky
02-09-08, 03:26 PM
i'll look into it

Coldmrn
04-09-08, 02:32 PM
Lol nice, don't get what this is exactly though, but looks like you've put alot of work in this ^_^