[Eluna] Grumbo`z VIP System
Black Wolfs Den :: World of Warcraft :: Trinity Core :: My Releases :: Eluna
Page 1 of 1
[Eluna] Grumbo`z VIP System
Grumbo'z VIP System
VIP System:
=========
ok we only have a couple basic Vip/Premium systems so far that I have found on our site
so I figured I would release a complete version of my VIP System.
--Built Tested and Approved for TC2 3.3.5a Eluna ONLY--
--Tested and Approved for TC2 4.3.4 Eluna ONLY--
--Tested and Approved for TC2 4.3.4 Eluna ONLY--
For TrinityCore2 3.3.5a
add 1 column to your auth.account db:
- Code:
ALTER TABLE `account`
ADD COLUMN `vip` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1' AFTER `recruiter`;
then just create a VIP folder in your Lua_scripts folder and name the Core so it will allways load first i.e. "VIP_1_CORE.lua"
Add the scripts you choose, to the VIP folder also.
- Allows for VIP 1 to xx. max VIP level set in the core (VIPMAX) currently set to 5.
- A VIP Coin to give access to extra commands and perks.
- A VIP Stone that will level-up a player's VIP level.
- Stone is a one shot use. it will vanish after use.
"VIP_1_CORE.lua"
Core Script:
- Code:
-- this MUST be the first script of the VIP System to load --
print("\n----------------------------")
print("Grumbo'z VIP Engine starting:\n")
local VIPMAX = 5; -- you can set it to what ever your little heart desires.
local VIPCOIN = 63020; -- item id for the VIP Coin.
local VIPSTONE = 63021; -- item id for the VIP Stone.
local VIPTPBONUS = 14; -- how many extra talent points for each vip level.
ACCT = {}
print("VIP Table Allocated.")
ACCT["SERVER"] = {
Vip_max = VIPMAX,
Vip_coin = VIPCOIN,
Vip_stone = VIPSTONE,
Tp_mod = VIPTPBONUS
};
print("CORE settings loaded.")
function Player_Vip_Table(event, player)
local Q = WorldDBQuery("SELECT username, vip FROM auth.account WHERE `id` = '"..player:GetAccountId().."';");
ACCT[player:GetAccountId()] = {
Name = Q:GetString(0),
Vip = Q:GetUInt32(1),
Health = player:GetMaxHealth()
};
end
RegisterPlayerEvent(3, Player_Vip_Table)
print("Player VIP Table prepared.")
function SetVip(player, vip)
if((vip or 0)==0)then
return
end
ACCT[player:GetAccountId()].Vip = vip
WorldDBQuery("UPDATE auth.account SET `vip`='"..vip.."' WHERE `username`='"..player:GetAccountName().."';");
player:SendBroadcastMessage("|cff00cc00Your VIP is set to "..ACCT[player:GetAccountId()].Vip..".|r")
end
print("\nGrumbo'z VIP Engine running.")
print("----------------------------\n")
"VIP_coin.sql"
This needs to be added to your world.item_template table.
The Vip Coin will allow players to get extra perks and access to extra commands when a player has one in there inventory.:" may be required for some scripts to work properly."
- Code:
INSERT INTO `item_template` (`entry`, `class`, `subclass`, `SoundOverrideSubclass`, `name`, `displayid`, `Quality`, `Flags`, `FlagsExtra`, `BuyCount`, `InventoryType`, `AllowableClass`, `AllowableRace`, `ItemLevel`, `RequiredLevel`, `maxcount`, `stackable`, `spellid_1`, `spelltrigger_1`, `spellcharges_1`, `spellppmRate_1`, `spellcooldown_1`, `spellcategory_1`, `spellcategorycooldown_1`, `bonding`, `description`) VALUES
(63020, 15, 0, -1, 'VIP Coin', 32282, 1, 64, 0, 1, 0, -1, -1, 1, 1, 1, 1, 13567, 0, 0, 0, -1, 0, -1, 1, 'A MUST HAVE item for all your VIP needs.');
You can add the VIP Coin to a vendor or as a donation item.
"VIP_stone.sql"
The VIP stone will upgrade a players VIP level by 1 when used then vanishes.
the VIP Stone SQL file:
- Code:
INSERT INTO `item_template` (`entry`, `class`, `subclass`, `SoundOverrideSubclass`, `name`, `displayid`, `Quality`, `Flags`, `FlagsExtra`, `BuyCount`, `AllowableClass`, `AllowableRace`, `ItemLevel`, `RequiredLevel`, `maxcount`, `stackable`, `spellid_1`, `spelltrigger_1`, `spellcharges_1`, `spellppmRate_1`, `spellcooldown_1`, `spellcategory_1`, `spellcategorycooldown_1`, `bonding`, `description`) VALUES
(63021, 15, 0, -1, 'VIP Stone', 32282, 1, 64, 0, 1, -1, -1, 1, 1, 1, 1, 13567, 0, 0, 0, -1, 0, -1, 1, '!!Wooooohooooooo!!\r\n!!ClickMe!!!ClickMe!!\r\n!!VIP+1!!SuperFun!!');
"VIP_stone.lua"
the Vip Stone can be added to your site store for donors or add it as a drop from your major boss's:
- Code:
-- this will update a player's VIP +1 then delete the stone.
-- the timer is set to 1ms to avoid double tapping exploit.
local timer = 1
local itemid = ACCT["SERVER"].Vip_stone
local function RemoveVIPstone(event, _, _, player)
SetVip(player, ACCT[player:GetAccountId()].Vip+1)
player:RemoveItem(ACCT["SERVER"].Vip_stone, 1)
end
function VIPstone(event, player, spellID, effindex, item)
if(ACCT[player:GetAccountId()].Vip<=(ACCT["SERVER"].Vip_max-1))then
player:RegisterEvent(RemoveVIPstone, timer, 1, player)
else
player:SendBroadcastMessage("you are Max VIP "..ACCT[player:GetAccountId()].Vip..".")
return
end
end
RegisterItemEvent(itemid, 2, VIPstone)
"VIP_ResetTP.lua"
Just use local chat /say and type #resettp to reset talent points:
- Code:
[color=#808080]function VIPresetTP(event, player, message, type, language)
if(message:lower() == "#resettp") then
player:ResetTalents()
local Tp = (78+(ACCT[player:GetAccountId()].Vip*ACCT["SERVER"].Tp_mod))
player:SetFreeTalentPoints(Tp, 0)
player:SetFreeTalentPoints(Tp, 1)
player:SendBroadcastMessage("|cff00cc00All your talents are reset!|r")
else
end
end
RegisterPlayerEvent(18, VIPresetTP)
[/color]
"VIP_buff.lua"
Just use local chat /say and type #hp to buff your health:
- Code:
-- using local chat /say type #hp
-- adds 5%(0.05) of health max PER players vip level :: 0.10 = 10% :: 0.75 = 75% :: 1.25 = 125%
function VIPbuff(event, player, message, Type, lang)
if(message:lower() == "#hp") then
player:SetMaxHealth(ACCT[player:GetAccountId()].Health + ((ACCT[player:GetAccountId()].Health * 0.05) * ACCT[player:GetAccountId()].Vip))
end
end
RegisterPlayerEvent(18, VIPbuff)
"VIP_pvp_gold_reward.lua"
This is a PvP reward script. it will reward the killer 5% of the victims gold multiplied by the killers VIP level. :
- Code:
function Pvp_Gold_Reward(_, killer, killed)
killer:ModifyMoney(killed:GetCoinage()*(0.05 * ACCT[killer:GetAccountId()].Vip)) -- reward is 0.05 = 5% of victims gold multiplied by killers VIP level
end
RegisterPlayerEvent(6, Pvp_Gold_Reward)
print("Grumbo'z VIP Gold loot loaded.")
This is a dynamic system so you can use the global ACCT table in other scripts if you wish to use stored values for something or add new scripts using the table entries or expand with new table entries and scripts.
Pick and choose which scripts you wish to use, its dynamic, or write your own scripts. The value is stored in RAM so you can access the stored value in either Lua or C++.ooooh maybe a new community project?...
if you have your own scripts you have wrote to work with this and want to add them here in a post , just remember to be thorough with a very verbose 'how-to' whether it is Lua or C++ .. oh yea and it should work too.
>> The Complete System <<
Enjoy everyone and have fun makin kewl new addonz for your server.
Thanks to the following:
Lightning Blade for the Sticky I owe you a sticky
@Rochet2 and @FoeReaper for the tons of info that got me to this point.
3.3.5a, Eluna script, TrinityCore, Trinity Core, VIP System, VIP, wotlk, Grumbo
Black Wolfs Den :: World of Warcraft :: Trinity Core :: My Releases :: Eluna
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Fri Nov 15, 2019 8:00 pm by Grumbo
» TrinityCore 2 Gold Max Work-Around
Tue Mar 21, 2017 9:14 pm by Grumbo
» [CPP][Conv] Dedicated World Chat Channel
Tue Mar 21, 2017 8:56 pm by Grumbo
» Cool [CPP] Grumbo'z VIP System
Tue Mar 21, 2017 8:03 pm by Grumbo
» [CPP] EmuDevs Premium System
Tue Mar 21, 2017 7:18 pm by Grumbo
» [TC]255 server stats edit! By Frost - Thanx
Tue Mar 21, 2017 6:27 pm by Grumbo
» [Eluna] Grumbo`z VIP System
Tue Mar 21, 2017 6:20 pm by Grumbo
» [CPP] Grumbo'z Capture the Flag System
Tue Mar 21, 2017 5:14 pm by Grumbo
» Black Wolfs Den
Mon Mar 20, 2017 10:07 pm by Grumbo