PDA

View Full Version : Item Upgrader and VIP System



Cronic
05-28-2014, 09:33 PM
like ive been asking how to make one idk if its a scripts or just in the sql but you click the item you want to upgrade blah blah then it pops up a quest then if you dont have the required item you cant upgrade it ok now the vip system idk if thats a script or not ether but im looking for is you have to be the rank like gm vip account access rank in trinity to beable to equip a item

ExO
05-29-2014, 09:19 AM
I'm not entirely sure about this, however I find it a bit hard to understand exactly what you want.

You want to do so when you click on an item a quest will pop up where you can obtain the new upgraded weapon? And if you don't have that item in your bag or equipped, the quest wont pop up?

But yet you mention something with gm vip accounts, maybe you could explain me futher?
I would happily try to help you out futher :)

Zenc
05-29-2014, 01:39 PM
Everything you are requesting requires scripting for it to be done the proper way. There are more efficient and clean ways to have an upgrade system, but its much more in depth. It would be more sufficient for this type of operating to be scripted in C++ rather than LUA as well. So you may want to venture out in searches for an experienced C++ scripter.

mWg
10-19-2014, 08:19 PM
This Idea+A Good Coder+WoW=Something That Has Potential

Xifios
11-18-2014, 09:42 PM
ty

karaflas
11-19-2014, 07:55 AM
So the player gets to choose the upgrade or it's hard-scripted?

cliffsmits
11-19-2014, 08:35 AM
like ive been asking how to make one idk if its a scripts or just in the sql but you click the item you want to upgrade blah blah then it pops up a quest then if you dont have the required item you cant upgrade it ok now the vip system idk if thats a script or not ether but im looking for is you have to be the rank like gm vip account access rank in trinity to beable to equip a item


i have worked n a vip system it was outdated but it works for me with my server now


The Prefix is .vip X
"island"
"changerace"
"changefaction"
"maxskills"
"customize"
"tele"
"morph"
"buffs"
"activate"
"getdrunk"
"soberup"
"respawn"



/*
* Error Fixed By Rochet2
* Released By Ghostcrawler
* Updated by Cliff Smits
*/


#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "MapManager.h"
#include "Chat.h"
#include "Common.h"
#include "Language.h"
#include "CellImpl.h"
#include "GridNotifiers.h"

class vipcommands : public CommandScript
{
public:
vipcommands() : CommandScript("vipcommands") { }

ChatCommand* GetCommands() const
{
static ChatCommand vipCommandTable[] =

{
{ "island", SEC_PLAYER, true, &HandleVipMallCommand, "", NULL },
{ "changerace", SEC_PLAYER, false, &HandleChangeRaceCommand, "", NULL },
{ "changefaction", SEC_PLAYER, false, &HandleChangeFactionCommand, "", NULL },
{ "maxskills", SEC_PLAYER, false, &HandleMaxSkillsCommand, "", NULL },
{ "customize", SEC_PLAYER, false, &HandleCustomizeCommand, "", NULL },
{ "tele", SEC_PLAYER, false, &HandleTeleCommand, "", NULL },
{ "morph", SEC_PLAYER, false, &HandleMorphCommand, "", NULL },
{ "buffs", SEC_PLAYER, false, &HandleBuffCommand, "", NULL },
{ "activate", SEC_PLAYER, false, &HandleActivateCommand, "", NULL },
{ "getdrunk", SEC_PLAYER, false, &HandleGetDrunkCommand, "", NULL },
{ "soberup", SEC_PLAYER, false, &HandleSoberUpCommand, "", NULL },
{ "respawn", SEC_PLAYER, false, &HandleRespawnCommand, "", NULL },

{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
{ "vip", SEC_PLAYER, true, NULL, "", vipCommandTable},
{ NULL, 0, false, NULL, "", NULL }
};
return commandTable;
}

static bool HandleActivateCommand(ChatHandler * handler, const char * args)
{
Player* player = handler->GetSession()->GetPlayer();

if(player->GetSession()->GetSecurity() >= 1)
{
handler->PSendSysMessage("You already got VIP rank.");
handler->SetSentErrorMessage(true);
return false;
}

if(player->HasItemCount(313370, 1, false)) // Token ID, Count.
{
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOU NT_ACCESS);
stmt->setUInt32(0, player->GetSession()->GetAccountId());
stmt->setUInt8(1, 1);
stmt->setInt32(2, 1);
LoginDatabase.Execute(stmt);
player->DestroyItemCount(313370, 1, true, false); // Token ID, Count.
handler->PSendSysMessage("Your VIP rank has been updated.Login to get it active");
return true;
}
return true;
}

static bool HandleTeleCommand(ChatHandler* handler, const char* args)
{
if (!*args)
return false;

Player* me = handler->GetSession()->GetPlayer();

// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
GameTele const* tele = handler->extractGameTeleFromLink((char*)args);

if (!tele)
{
handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND);
handler->SetSentErrorMessage(true);
return false;
}

if (me->isInCombat())
{
handler->SendSysMessage(LANG_YOU_IN_COMBAT);
handler->SetSentErrorMessage(true);
return false;
}

MapEntry const* map = sMapStore.LookupEntry(tele->mapId);
if (!map || map->IsBattlegroundOrArena())
{
handler->SendSysMessage(LANG_CANNOT_TELE_TO_BG);
handler->SetSentErrorMessage(true);
return false;
}

// stop flight if need
if (me->isInFlight())
{
me->GetMotionMaster()->MovementExpired();
me->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
me->SaveRecallPosition();

me->TeleportTo(tele->mapId, tele->position_x, tele->position_y, tele->position_z, tele->orientation);
return true;
}


static bool HandleBuffCommand(ChatHandler * handler, const char * args)
{
Player * pl = handler->GetSession()->GetPlayer();
if(pl->isInCombat())
{
pl->GetSession()->SendNotification("You can't use this in combat!");
return false;
}
if(pl->InArena())
{
pl->GetSession()->SendNotification("You can't use that item in an arena match!");
return false;
}
else
pl->AddAura(48162, pl);
pl->AddAura(48074, pl);
pl->AddAura(48170, pl);
pl->AddAura(43223, pl);
pl->AddAura(36880, pl);
pl->AddAura(467, pl);
pl->AddAura(69994, pl);
pl->AddAura(48469, pl);
handler->PSendSysMessage("You have been buffed, enjoy!");
return true;

}


static bool HandlevipCommand(ChatHandler* handler, const char* args)
{

Player* me = handler->GetSession()->GetPlayer();

me->Say("vip command?", LANG_UNIVERSAL);
return true;
}

static bool HandleMorphCommand(ChatHandler* handler, const char* args)
{
handler->GetSession()->GetPlayer()->SetDisplayId((uint32)atol((char*)args));
return true;
}

static bool HandleChangeRaceCommand(ChatHandler* handler, const char* args)
{

Player* me = handler->GetSession()->GetPlayer();
me->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
handler->PSendSysMessage("Relog to change race of your character.");
return true;
}

static bool HandleChangeFactionCommand(ChatHandler* handler, const char* args)
{

Player* me = handler->GetSession()->GetPlayer();
me->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
handler->PSendSysMessage("Relog to change faction of your character.");
return true;
}

static bool HandleMaxSkillsCommand(ChatHandler* handler, const char* args)
{

Player* me = handler->GetSession()->GetPlayer();
me->UpdateSkillsForLevel();
handler->PSendSysMessage("Your weapon skills are now maximized.");
return true;
}

static bool HandleCustomizeCommand(ChatHandler* handler, const char* args)
{

Player* me = handler->GetSession()->GetPlayer();
me->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
handler->PSendSysMessage("Relog to customize your character.");
return true;
}

static bool HandleVipMallCommand(ChatHandler* handler, const char* args)
{

Player* me = handler->GetSession()->GetPlayer();

if (me->isInCombat())
{
handler->SendSysMessage(LANG_YOU_IN_COMBAT);
handler->SetSentErrorMessage(true);
return false;
}

// stop flight if need
if (me->isInFlight())
{
me->GetMotionMaster()->MovementExpired();
me->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
me->SaveRecallPosition();

me->TeleportTo(1, -11851.820313f, -4769.585449f, 22.753876f, 6.053061f); // MapId, X, Y, Z, O
return true;
}

static bool HandleRespawnCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();

Unit* target = handler->getSelectedUnit();
if (player->GetSelection() && target)
{
if (target->GetTypeId() != TYPEID_UNIT || target->isPet())
{
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
if(player->GetAreaId() == 4722)
return false;

if (target->isDead())
target->ToCreature()->Respawn();
return true;
}

CellCoord p(Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY()));
Cell cell(p);
cell.SetNoCreate();

Trinity::RespawnDo u_do;
Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(player, u_do);

TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
cell.Visit(p, obj_worker, *player->GetMap(), *player, player->GetGridActivationRange());

return true;
}

static bool HandleGetDrunkCommand(ChatHandler* handler, const char* args)
{

Player* me = handler->GetSession()->GetPlayer();
me->SetDrunkValue(100);
handler->PSendSysMessage("You're now drunk!");
return true;
}

static bool HandleSoberUpCommand(ChatHandler* handler, const char* args)
{

Player* me = handler->GetSession()->GetPlayer();
me->SetDrunkValue(1);
handler->PSendSysMessage("It's about time you sober up.");
return true;
}

};

void AddSC_vipcommands()
{
new vipcommands();
}