PDA

View Full Version : [c++] Race Changer


lollardo
06-09-2009, 02:32 AM
I made an quite simple c++ script
The name explains it. :P
If your a Human Rogue for example You cant change race to Draenei Made some "If" functions for it otherwise when you relogged it would say Login failed. And your char would be locked untill you change it in the Database ^^

I updated the script so now when you choose a race you want to be.
Then the item will unlearn your current racial spells and add the new ones for that race you chosen, it will also Disconnect you so you dont have to wait for the 20 sec Logout Timer :)

Here is the script
>>> RaceChangerItem.cpp (http://www.mediafire.com/download.php?zwntitdxziz) <<<

Setup.cpp
Setupracechange(mgr);
Setup.h
void Setupracechange(ScriptMgr * mgr);

Tested and works to 100%
And make an item with the id 93008 And have the spell: 33208 On use (to lazy to upload the sql)

xoallen
06-09-2009, 02:38 AM
I am very new to this C++ could u show/tell me how to upload it to my server

lollardo
06-09-2009, 02:39 AM
You have msn or something? would go faster to talk on that xD

And btw have you compiled your own core?

xoallen
06-09-2009, 02:45 AM
Yes i have msn..xoallen@hotmail.com

well u more there

Sdyess
06-09-2009, 02:47 AM
There is a problem with this script. If the player for example is a warrior and he/she switches to the rogue class, he/she will be a rogue in warrior armor which = unfair.

lollardo
06-09-2009, 02:52 AM
ohh You read it wrong XD
Its the RACE you can change not the class :P

Sdyess
06-09-2009, 02:55 AM
oh QQ my bad. I was looking through the script really quickly and I saw the getclass event lulz

lollardo
06-09-2009, 02:57 AM
hehe ^^

Alvanaar
06-09-2009, 08:32 AM
You'll need to get them to unlearn their racial abilities and learn the new race's ones!

if (Plr->HasSpell(ID))
Plr->UnlearnSpell(ID);
Plr->BroadcastMessage("Enjoy being your new race!");
Plr->Gossip_Complete();

Something along the lines of that! :)

You could improve this script a lot, too.

lollardo
06-09-2009, 03:55 PM
Plr->UnlearnSpell aint a function that works

jammyjay
06-09-2009, 04:23 PM
Nice Script :] +rep

Double
06-09-2009, 06:27 PM
Plr->UnlearnSpell aint a function that works

aint aint a word and i aint gonna use it
(aint isnt a english function lol)

lollardo
06-09-2009, 06:32 PM
aint aint a word and i aint gonna use it
(aint isnt a english function lol)
Yea sure

Alvanaar
06-10-2009, 07:52 AM
My apologies, half stuck in the Lua world, half stuck in C++.

To unlearn spells:

Plr->removeSpell(SpellID,false,false,0);

lollardo
06-10-2009, 09:00 AM
My apologies, half stuck in the Lua world, half stuck in C++.

To unlearn spells:

Plr->removeSpell(SpellID,false,false,0);
I used Plr->removeSpell(SpellID,true,true,0);
and it worked fine so ^^

Alvanaar
06-10-2009, 09:08 AM
Awesome. :)

Good script, +rep.