Roguemaster | Дата: Четверг, 27.05.2010, 16:23 | Сообщение # 1 |
Группа: Модератор высокой группы
Сообщений: 989
Награды: 2
Репутация: 5
Статус:
| Code // CREATED BY LAAEVIE OF MMOWNED!
#include "StdAfx.h" #include "Setup.h"
#define CHANGE_CLASS_NPC 85004
#ifdef WIN32 #pragma warning(disable:4305)// warning C4305: 'argument' : truncation from 'double' to 'float' #endif
class SCRIPT_DECL ClassChangerNPC : 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 ClassChangerNPC::GossipHello(Object * pObject, Player* Plr, bool AutoSend) { GossipMenu *Menu; objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr); { if(Plr->getRace()== 1||Plr->getRace()== 2||Plr->getRace()== 3||Plr->getRace()== 4||Plr->getRace()== 5||Plr->getRace()== 6||Plr->getRace()== 7||Plr->getRace()== 8||Plr->getRace()== 11) {Menu->AddItem(0, "I want to be a Warrior!", 1);}
if(Plr->getRace()== 1||Plr->getRace()== 3||Plr->getRace()== 10||Plr->getRace()== 11) {Menu->AddItem(0, "I want to be a Paladin!", 2);}
if(Plr->getRace()== 2||Plr->getRace()== 3||Plr->getRace()== 4||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 11) {Menu->AddItem(0, "I want to be a Hunter!", 3);}
if(Plr->getRace()== 1||Plr->getRace()== 2||Plr->getRace()== 3||Plr->getRace()== 4||Plr->getRace()== 5||Plr->getRace()== 7||Plr->getRace()== 8||Plr->getRace()== 10) {Menu->AddItem(0, "I want to be a Rogue!", 4);}
if(Plr->getRace()== 1||Plr->getRace()== 3||Plr->getRace()== 4||Plr->getRace()== 5||Plr->getRace()== 8||Plr->getRace()== 10||Plr->getRace()== 11) {Menu->AddItem(0, "I want to be a Priest!", 5);}
if(Plr->getRace()== 1||Plr->getRace()== 2||Plr->getRace()== 3||Plr->getRace()== 4||Plr->getRace()== 5||Plr->getRace()== 6||Plr->getRace()== 7||Plr->getRace()== 8||Plr->getRace()== 10||Plr->getRace()== 11) {Menu->AddItem(0, "I want to be a Death Knight!", 6);}
if(Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 11) {Menu->AddItem(0, "I want to be a Shaman!", 7);}
if(Plr->getRace()== 1||Plr->getRace()== 5||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 10||Plr->getRace()== 11) {Menu->AddItem(0, "I want to be a Mage!", 8);}
if(Plr->getRace()== 1||Plr->getRace()== 2||Plr->getRace()== 5||Plr->getRace()== 7||Plr->getRace()== 10) {Menu->AddItem(0, "I want to be a Warlock!", 9);}
if(Plr->getRace()== 4||Plr->getRace()== 6) {Menu->AddItem(0, "I want to be a Druid!", 11);}
Menu->AddItem(0, "I Don't want to chage class!", 50); }
if(AutoSend) Menu->SendTo(Plr); };
void ClassChangerNPC::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code) { switch(IntId) { case 0: { GossipHello(pObject, Plr, true); }break; case 50: { Plr->Gossip_Complete(); }break;
default: { if (Plr->getClass() != IntId) { Plr->setClass((uint8)IntId); Plr->Reset_Spells(); Plr->_RemoveAllSkills(); Plr->BroadcastMessage("Class change complete. Relog to see the effect.");
if (Plr->_HasSkillLine(43)) {Plr->_ModifySkillMaximum(43, 400);}//Swords
if (Plr->_HasSkillLine(44)) {Plr->_ModifySkillMaximum(44, 400);}//Axes
if (Plr->_HasSkillLine(45)) {Plr->_ModifySkillMaximum(45, 400);}//Bows
if (Plr->_HasSkillLine(46)) {Plr->_ModifySkillMaximum(46, 400);}//Guns
if (Plr->_HasSkillLine(54)) {Plr->_ModifySkillMaximum(54, 400);}//Maces
if (Plr->_HasSkillLine(95)) {Plr->_ModifySkillMaximum(95, 400);}//Defense
if (Plr->_HasSkillLine(136)) {Plr->_ModifySkillMaximum(136, 400);}//Staves
if (Plr->_HasSkillLine(160)) {Plr->_ModifySkillMaximum(160, 400);}//Two-Handed Swords
if (Plr->_HasSkillLine(162)) {Plr->_ModifySkillMaximum(162, 400);}//Unarmed
if (Plr->_HasSkillLine(172)) {Plr->_ModifySkillMaximum(172, 400);}//Two-Handed Axes
if (Plr->_HasSkillLine(173)) {Plr->_ModifySkillMaximum(173, 400);}//Daggers
if (Plr->_HasSkillLine(176)) {Plr->_ModifySkillMaximum(176, 400);}//Thrown
if (Plr->_HasSkillLine(226)) {Plr->_ModifySkillMaximum(226, 400);}//Crossbows
if (Plr->_HasSkillLine(228)) {Plr->_ModifySkillMaximum(228, 400);}//Wands
if (Plr->_HasSkillLine(229)) {Plr->_ModifySkillMaximum(229, 400);}//Polearms
if (Plr->_HasSkillLine(473)) {Plr->_ModifySkillMaximum(473, 400);}//Fist Weapons if (Plr->_HasSkillLine(633)) {Plr->_ModifySkillMaximum(633, 400);}//Lockpicking Plr->Gossip_Complete(); }
else if (Plr->getClass() == IntId) { Plr->BroadcastMessage("ERROR: You are already that class, please choose other class!"); Plr->Gossip_Complete(); } }break;
} };
void ClassChangerNPC::GossipEnd(Object * pObject, Player* Plr) { GossipScript::GossipEnd(pObject, Plr); }
void SetupClassChangerNPC(ScriptMgr * mgr) { GossipScript * gs = (GossipScript*) new ClassChangerNPC(); mgr->register_gossip_script(CHANGE_CLASS_NPC, gs); }
|
|
| |
zaharovax | Дата: Среда, 28.12.2011, 13:35 | Сообщение # 2 |
| Неимоверно полезные обсуждения интересных для каждого тем. Добавлю ваш сайт в закладки и буду почаще серфить тут. Честно говоря не знал, млин настолько здесь засяду! С благодарнстью zaharovax
|
|
| |