Log in
Most Viewed Topics
Latest topics
2000>
Test
C++ – Buy Level with Vote Tokens
Page 1 of 1
C++ – Buy Level with Vote Tokens
Things to edit:
#define DONE_TOKEN_ID 66015 // Put here id of your token
#define LEVELUP_NPC_ID 66000 // Put here your id of mob for it
#define VOTE_TOKEN_AMOUNT 5 // Put here amount for how much it needs to gain level 20
#define VOTE_TOKEN_AMOUNTE 10 // Put here amount for how much it needs to gain level 40
#define VOTE_TOKEN_AMOUNTEA 15 // Put here amount for how much it needs to gain level 60
#define VOTE_TOKEN_AMOUNTERA 20 // Put here amount for how much it needs to gain level 80
Where do you see GetItemCount(66015) change 66015 with your Token id
<blockquote>
#define DONE_TOKEN_ID 66015 // DONOR TOKEN
#define LEVELUP_NPC_ID 66000 // LEVEL UP NPC FOR TOKENS
#define VOTE_TOKEN_AMOUNT 5 // for 20 levels
#define VOTE_TOKEN_AMOUNTE 10 // FOR 40 LEVEL
#define VOTE_TOKEN_AMOUNTEA 15 // For 60 lvl
#define VOTE_TOKEN_AMOUNTERA 20 // For level 80
class SCRIPT_DECL LevelNPC : 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 LevelNPC::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
{
GossipMenu *Menu;
uint32 TextID = 820;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), TextID, Plr);
if (Plr->getLevel() == 1)
{
Menu->AddItem( 0, "I would like to Levelup to Level 80", 1 );
}
else
{
Menu->AddItem( 0, "I would like to Levelup 20 Level", 1 );
Menu->AddItem( 0, "I would like to Levelup 40 Levels", 2 );
Menu->AddItem( 0, "I would like to Levelup 60 Levels", 3 );
}
if(AutoSend)
{
Menu->SendTo(Plr);
}
}
void LevelNPC::GossipSelectOption(Object * pObject, Player* Plr,
uint32 Id, uint32 IntId, const char * Code)
{
Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?
((Creature*)pObject):NULL;
if(pCreature==NULL)
{
return;
}
switch(IntId)
{
case 1:
{
if (Plr->getLevel() == 1)
{
if (Plr->GetItemInterface()->GetItemCount(66015)
< VOTE_TOKEN_AMOUNTERA)
{
sChatHandler.SystemMessage(Plr->GetSession(),
"You do not have any <Level UP Tokens>. Please Donate for Level UP Tokens");
return;
}
Plr->GetItemInterface()->RemoveItemAmt
(DONE_TOKEN_ID, VOTE_TOKEN_AMOUNTERA);
Plr->BroadcastMessage("You are now level 80!" );
uint32 Level = 80;
LevelInfo * Info = objmgr.GetLevelInfo(Plr->getRace(),
Plr->getClass(), Level);
Plr->ApplyLevelInfo(Info, Level);
Plr->Gossip_Complete();
}
else
{
if (Plr->GetItemInterface()->GetItemCount(66015) < VOTE_TOKEN_AMOUNT)
{
sChatHandler.SystemMessage(Plr->GetSession(),
"You do not have any <Level UP Tokens>. Please Donate for Level UP Tokens");
return;
}
Plr->GetItemInterface()->
RemoveItemAmt(DONE_TOKEN_ID, VOTE_TOKEN_AMOUNT);
Plr->BroadcastMessage("You are now level 20!" );
uint32 Level = 20;
LevelInfo * Info = objmgr.GetLevelInfo(Plr->getRace(),
Plr->getClass(), Level);
Plr->ApplyLevelInfo(Info, Level);
Plr->Gossip_Complete();
}
}break;
case 2:
{
if (Plr->GetItemInterface()->GetItemCount(66015) < VOTE_TOKEN_AMOUNTE)
{
sChatHandler.SystemMessage(Plr->GetSession(),
"You do not have any <Level UP Tokens>. Please Donate for Level UP Tokens");
return;
}
Plr->GetItemInterface()->
RemoveItemAmt(DONE_TOKEN_ID, VOTE_TOKEN_AMOUNTE);
Plr->BroadcastMessage("You are now level 40!" );
uint32 Level =40;
LevelInfo * Info = objmgr.GetLevelInfo(Plr->getRace(),
Plr->getClass(), Level);
Plr->ApplyLevelInfo(Info, Level);
Plr->Gossip_Complete();
}break;
case 3:
{
if (Plr->GetItemInterface()->GetItemCount(66015) < VOTE_TOKEN_AMOUNTEA)
{
sChatHandler.SystemMessage(Plr->GetSession(),
"You do not have any <Level UP Tokens>. Please Donate for Level UP Tokens");
return;
}
Plr->GetItemInterface()->RemoveItemAmt
(DONE_TOKEN_ID, VOTE_TOKEN_AMOUNTEA);
Plr->BroadcastMessage("You are now level 60!" );
uint32 Level = 60;
LevelInfo * Info = objmgr.GetLevelInfo(Plr->getRace(),
Plr->getClass(), Level);
Plr->ApplyLevelInfo(Info, Level);
Plr->Gossip_Complete();
break;
}
}
}
void LevelNPC::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
void SetupLevelupNpc(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new LevelNPC();
mgr->register_gossip_script(LEVELUP_NPC_ID, gs);
}
</blockquote>
#define DONE_TOKEN_ID 66015 // Put here id of your token
#define LEVELUP_NPC_ID 66000 // Put here your id of mob for it
#define VOTE_TOKEN_AMOUNT 5 // Put here amount for how much it needs to gain level 20
#define VOTE_TOKEN_AMOUNTE 10 // Put here amount for how much it needs to gain level 40
#define VOTE_TOKEN_AMOUNTEA 15 // Put here amount for how much it needs to gain level 60
#define VOTE_TOKEN_AMOUNTERA 20 // Put here amount for how much it needs to gain level 80
Where do you see GetItemCount(66015) change 66015 with your Token id
<blockquote>
#define DONE_TOKEN_ID 66015 // DONOR TOKEN
#define LEVELUP_NPC_ID 66000 // LEVEL UP NPC FOR TOKENS
#define VOTE_TOKEN_AMOUNT 5 // for 20 levels
#define VOTE_TOKEN_AMOUNTE 10 // FOR 40 LEVEL
#define VOTE_TOKEN_AMOUNTEA 15 // For 60 lvl
#define VOTE_TOKEN_AMOUNTERA 20 // For level 80
class SCRIPT_DECL LevelNPC : 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 LevelNPC::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
{
GossipMenu *Menu;
uint32 TextID = 820;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), TextID, Plr);
if (Plr->getLevel() == 1)
{
Menu->AddItem( 0, "I would like to Levelup to Level 80", 1 );
}
else
{
Menu->AddItem( 0, "I would like to Levelup 20 Level", 1 );
Menu->AddItem( 0, "I would like to Levelup 40 Levels", 2 );
Menu->AddItem( 0, "I would like to Levelup 60 Levels", 3 );
}
if(AutoSend)
{
Menu->SendTo(Plr);
}
}
void LevelNPC::GossipSelectOption(Object * pObject, Player* Plr,
uint32 Id, uint32 IntId, const char * Code)
{
Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?
((Creature*)pObject):NULL;
if(pCreature==NULL)
{
return;
}
switch(IntId)
{
case 1:
{
if (Plr->getLevel() == 1)
{
if (Plr->GetItemInterface()->GetItemCount(66015)
< VOTE_TOKEN_AMOUNTERA)
{
sChatHandler.SystemMessage(Plr->GetSession(),
"You do not have any <Level UP Tokens>. Please Donate for Level UP Tokens");
return;
}
Plr->GetItemInterface()->RemoveItemAmt
(DONE_TOKEN_ID, VOTE_TOKEN_AMOUNTERA);
Plr->BroadcastMessage("You are now level 80!" );
uint32 Level = 80;
LevelInfo * Info = objmgr.GetLevelInfo(Plr->getRace(),
Plr->getClass(), Level);
Plr->ApplyLevelInfo(Info, Level);
Plr->Gossip_Complete();
}
else
{
if (Plr->GetItemInterface()->GetItemCount(66015) < VOTE_TOKEN_AMOUNT)
{
sChatHandler.SystemMessage(Plr->GetSession(),
"You do not have any <Level UP Tokens>. Please Donate for Level UP Tokens");
return;
}
Plr->GetItemInterface()->
RemoveItemAmt(DONE_TOKEN_ID, VOTE_TOKEN_AMOUNT);
Plr->BroadcastMessage("You are now level 20!" );
uint32 Level = 20;
LevelInfo * Info = objmgr.GetLevelInfo(Plr->getRace(),
Plr->getClass(), Level);
Plr->ApplyLevelInfo(Info, Level);
Plr->Gossip_Complete();
}
}break;
case 2:
{
if (Plr->GetItemInterface()->GetItemCount(66015) < VOTE_TOKEN_AMOUNTE)
{
sChatHandler.SystemMessage(Plr->GetSession(),
"You do not have any <Level UP Tokens>. Please Donate for Level UP Tokens");
return;
}
Plr->GetItemInterface()->
RemoveItemAmt(DONE_TOKEN_ID, VOTE_TOKEN_AMOUNTE);
Plr->BroadcastMessage("You are now level 40!" );
uint32 Level =40;
LevelInfo * Info = objmgr.GetLevelInfo(Plr->getRace(),
Plr->getClass(), Level);
Plr->ApplyLevelInfo(Info, Level);
Plr->Gossip_Complete();
}break;
case 3:
{
if (Plr->GetItemInterface()->GetItemCount(66015) < VOTE_TOKEN_AMOUNTEA)
{
sChatHandler.SystemMessage(Plr->GetSession(),
"You do not have any <Level UP Tokens>. Please Donate for Level UP Tokens");
return;
}
Plr->GetItemInterface()->RemoveItemAmt
(DONE_TOKEN_ID, VOTE_TOKEN_AMOUNTEA);
Plr->BroadcastMessage("You are now level 60!" );
uint32 Level = 60;
LevelInfo * Info = objmgr.GetLevelInfo(Plr->getRace(),
Plr->getClass(), Level);
Plr->ApplyLevelInfo(Info, Level);
Plr->Gossip_Complete();
break;
}
}
}
void LevelNPC::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
void SetupLevelupNpc(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new LevelNPC();
mgr->register_gossip_script(LEVELUP_NPC_ID, gs);
}
</blockquote>
- Join date : 1970-01-01
Similar topics
» Fun Repack Max Level 255
» How to create a custom GM rank (command level)
» World of warcraft AUTO-LEVEL hack
» How to create a custom GM rank (command level)
» World of warcraft AUTO-LEVEL hack
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Tue Jan 17, 2017 5:58 am by janpara
» SolidWoW BlizzLike 4.0.6-4.3.0 Repack stable UPDATED
Thu Apr 10, 2014 5:39 pm by ycabrerag
» JZY’s Trinity Blizzlike Repack 3.35a (updated)
Sun Dec 01, 2013 8:38 am by Bottscan
» Hello Everyone Well
Thu Jun 27, 2013 12:56 pm by
» ညီမေလး ဖတ္ဖို႔
Thu Jun 13, 2013 6:27 am by