• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[Eluna] Grumbo`z VIP System

slp13at420

Mad Scientist
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--

For TrinityCore2 3.3.5a

add 1 column to your auth.account db:
Code:
[COLOR="#A9A9A9"]
ALTER TABLE `account`
 ADD COLUMN `vip` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1' AFTER `recruiter`;
[/COLOR]
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.
  • A '#resetTP' command for players to reset there own talent points.
    • The command will add extra points based on VIP level also.
  • A '#hp' command to buff a players health points based on there VIP level.

"VIP_1_CORE.lua"
Core Script:
Code:
-- [B][U][COLOR="#FFD700"]this MUST be the first script of the VIP System to load[/COLOR][/U][/B] --
[COLOR="#808080"] 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")
[/COLOR]

"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.:" [SUB]may be required for some scripts to work properly.[/SUB]"
Code:
[COLOR="#808080"] 
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.');
[/COLOR]
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:
[COLOR="#808080"]
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!!');


[/COLOR]

"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:
[COLOR="#808080"]
-- 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)[/COLOR]

"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:
[COLOR="#808080"]
-- 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)
[/COLOR]

"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:
[COLOR="#808080"]
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.")
[/COLOR]

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++.[SUP]ooooh maybe a new community project?...[/SUP]

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 :RpS_flapper:


Enjoy everyone :rock: and have fun makin kewl new addonz for your server.

Thanks to the following:
Lightning Blade for the Sticky :bump2: I owe you a sticky :D
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
 
Last edited:

slp13at420

Mad Scientist

"VIP_repair_command.lua"
Here is another kewl command I added.
The "#repair" command will repair ALL players gear IF they possess A VIP Coin in there inventory.:
Code:
[COLOR="#A9A9A9"]
-- use local chat /say #repair
function VIP_repair(event, player, message, type, language)

  	if(message == "#repair") then
        if(player:HasItem(ACCT["SERVER"].Vip_coin)==true) then
        		player:DurabilityRepairAll(100,100)
        		player:SendBroadcastMessage("|cff00cc00All your items have been repaired!|r")
        else
        		player:SendBroadcastMessage("You must have a VIP Coin to use this command.")
      	return false;
    	end
    end
end    

RegisterPlayerEvent(18, VIP_repair)

print("Grumbo'z VIP Repair command loaded.")

[/COLOR]

This will require you to update the VIP_1_Core.lua Engine to the latest version in the first post and install the VIP Coin sql file.

 
Last edited:

slp13at420

Mad Scientist
Great! But please correct that typo "You're VIP is set to..."

I Don't understand what the typo is.
Code:
player:SendBroadcastMessage("|cff00cc00You\'re VIP is set to "..ACCT[player:GetAccountId()].Vip..".|r")

but you can also change it to say what-ever you want.
Code:
player:SendBroadcastMessage("|cff00cc00Congratulations "..player:GetName()..". You are now VIP "..ACCT[player:GetAccountId()].Vip..".|r")

-- update --
changed .Vip from a GetString() to GetUInt32()
 
Last edited:

mariow

Enthusiast
Can anyone please fix this script. There is an error in VIP_stone.lua. Worldserver says "Couldn't find a item with <ID: 63021>!" and that is from the VIP_stone.lua script... I have imported both item 63020 and 63021 to item_template in world DB. Help me to fix this please

Also none of the commands except "#resettp" is working. so this script really needs to be fixed. And yes i did add a "VIP" folder in lua_scripts folder and added all scripts there with the names that you recommended. So please fix it
 
Last edited:

Foereaper

Founder
The script works fine, make sure the item is actually in your database, or change the stones entry in the script to whatever is correct :)
 

Tok124

Respected Member
The script works fine, make sure the item is actually in your database, or change the stones entry in the script to whatever is correct :)
Hello Foereaper, I'm a friend to Mariow and i can confirm that the item is in the database. Both items is there. And we also restarted the server and both the item appear ingame and we did not change the entry of the items. So we use the Default Entry. I did "reload eluna" in worldserver.exe and also restarted but the script wont work... I also added the "vip" column to account table in auth but it just wont work...
 

Tok124

Respected Member
"VIP_coin.lua"
The Vip Coin will allow players to get extra perks and access to extra commands when a player has one in there inventory.:" [SUB]may be required for some scripts to work properly.[/SUB]"
Code:
[COLOR="#A9A9A9"]
REPLACE INTO `item_template` (`entry`, `class`, `subclass`, `SoundOverrideSubclass`, `name`, `displayid`, `Quality`, `Flags`, `FlagsExtra`, `BuyCount`, `BuyPrice`, `SellPrice`, `InventoryType`, `AllowableClass`, `AllowableRace`, `ItemLevel`, `RequiredLevel`, `RequiredSkill`, `RequiredSkillRank`, `requiredspell`, `requiredhonorrank`, `RequiredCityRank`, `RequiredReputationFaction`, `RequiredReputationRank`, `maxcount`, `stackable`, `ContainerSlots`, `StatsCount`, `stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`, `stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`, `stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`, `ScalingStatDistribution`, `ScalingStatValue`, `dmg_min1`, `dmg_max1`, `dmg_type1`, `dmg_min2`, `dmg_max2`, `dmg_type2`, `armor`, `holy_res`, `fire_res`, `nature_res`, `frost_res`, `shadow_res`, `arcane_res`, `delay`, `ammo_type`, `RangedModRange`, `spellid_1`, `spelltrigger_1`, `spellcharges_1`, `spellppmRate_1`, `spellcooldown_1`, `spellcategory_1`, `spellcategorycooldown_1`, `spellid_2`, `spelltrigger_2`, `spellcharges_2`, `spellppmRate_2`, `spellcooldown_2`, `spellcategory_2`, `spellcategorycooldown_2`, `spellid_3`, `spelltrigger_3`, `spellcharges_3`, `spellppmRate_3`, `spellcooldown_3`, `spellcategory_3`, `spellcategorycooldown_3`, `spellid_4`, `spelltrigger_4`, `spellcharges_4`, `spellppmRate_4`, `spellcooldown_4`, `spellcategory_4`, `spellcategorycooldown_4`, `spellid_5`, `spelltrigger_5`, `spellcharges_5`, `spellppmRate_5`, `spellcooldown_5`, `spellcategory_5`, `spellcategorycooldown_5`, `bonding`, `description`, `PageText`, `LanguageID`, `PageMaterial`, `startquest`, `lockid`, `Material`, `sheath`, `RandomProperty`, `RandomSuffix`, `block`, `itemset`, `MaxDurability`, `area`, `Map`, `BagFamily`, `TotemCategory`, `socketColor_1`, `socketContent_1`, `socketColor_2`, `socketContent_2`, `socketColor_3`, `socketContent_3`, `socketBonus`, `GemProperties`, `RequiredDisenchantSkill`, `ArmorDamageModifier`, `duration`, `ItemLimitCategory`, `HolidayId`, `ScriptName`, `DisenchantID`, `FoodType`, `minMoneyLoot`, `maxMoneyLoot`, `flagsCustom`, `WDBVerified`) VALUES 
(63020, 15, 0, -1, 'VIP Coin', 32282, 1, 64, 0, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13567, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 1, 'Click me to view your stats.\r\nA MUST HAVE item.\r\nFor all your VIP needs.\r\n', 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 'Vipcoin_Trigger', 0, 0, 0, 0, 0, 12340);
[/COLOR]

And also. It says vip_coin.lua but this is not a lua script. It's a SQL Script... However we did import this item. The only thing i changed was WDBVerified to VerifiedBuild
 

slp13at420

Mad Scientist
And also. It says vip_coin.lua but this is not a lua script. It's a SQL Script... However we did import this item. The only thing i changed was WDBVerified to VerifiedBuild

thanx good catch. :top:
-fixed-
this is an sql file and needs to be added to your sql world.item_template DB.
yea if you were placing it in the lua_scripts folder rather than grinding it into your SQL db then it would cause the problems your having.
sorry my fault .

 
Last edited:

Tok124

Respected Member

thanx good catch. :top:
-fixed-
this is an sql file and needs to be added to your sql world.item_template DB.
yea if you were placing it in the lua_scripts folder rather than grinding it into your SQL db then it would cause the problems your having.
sorry my fault .

Np, However first i just tried to insert the items into DB and then i got that error and then i was thinking that maybe there is a function in the lua script that includes that SQL so then i added that SQL File in lua_scripts folder. And it reported same error. So the error was there before i added that to the folder. Anyway i will try again.

Btw, You can also edit the query to support latest DB Version, Just change WDBVerified to VerifiedBuild. Most people know how to edit this but before someone ask about it i would atleast recommend that you change it :p
 

slp13at420

Mad Scientist
tnx and updated.
I may shorten it down to just the basic needed data so it wont need to be edited after every TC update lol
 
Last edited:

slp13at420

Mad Scientist
ok -updated-
stripped it down the just the needed data so it should be better for both newer/older cores.
this was one of those back-burnur things I been meaning to get to rofl shortening up all the sql files to short needed data. K.I.S.S.
 
Last edited:

mariow

Enthusiast
ok -updated-
stripped it down the just the needed data so it should be better for both newer/older cores
Thanks for all help slp, However i did remove the sql now from scripts folder and the error is gone. Now i have a error with the buff command. I think you forgot and "end" and i tried to add that and then i got another error about a nil message value or something like that. Here is an image to show you the error
ojji3o.png


And also the items still doesn't work. Atleast the VIP Cooin does not work. When i click it i just see some red aura around my char. Butt i guess a menu should pop up. But that doesnt work. There is no window that pops up when i click that item
 
Last edited:

slp13at420

Mad Scientist
consider it an item that gives extra bonus's. this is a stripped down version of a larger VIP System in the donator section.
if a player has this coin then they can use extra commands like the '#repair' command.
In the full version it will display VIP Stats when a player clicks it hence the spell visual.
 
Last edited:

slp13at420

Mad Scientist
Added ".VIP mall" command.

Now a player that has a VIP Coin in there inventory can now teleport to a location you have setup as a VIP mall.
Just type ".VIP mall" ingame and poof :D

This requires the VIP Coin from the first post.

Code:
[COLOR="#808080"]
-- command ".VIP mall"
local command = "VIP mall";

local VIPCoin = ACCT["SERVER"].Vip_coin;
local VIPCoinName = GetItemLink(VIPCoin);

-- GPS coord's . current  coord's  is Shattrath.
local map_id = 530;
local x = -1863.6059;
local y = 5430.4414;
local z = -7.7509;
local o = 5.1025;

function VIP_Mall(event, player, message)

  	if(message == command) then

       if(player:HasItem(VIPCoin)==true) then
			player:Teleport(map_id, x, y, z, o)
        else
		 	player:SendBroadcastMessage("|cffFF0000[SYSTEM] |cff00cc00"..Pname.." you need to have a "..VIPCoinName.." to use the mall command.|r")
		 	player:SendBroadcastMessage("|cffFF0000[SYSTEM] |cff00cc00"..Pname.." you can purchase a "..VIPCoinName.." from the Custom VIP vendor, misc items for xx "..mg_name..".|r")
      	return false;
    	end
    end
end    

RegisterPlayerEvent(42, VIP_Mall)

function VIP_reset_comm(event, player, message, type, language)

    if(message:lower() == "vcommands") then
    
    	player:SendBroadcastMessage("/say ."..command.." |cff00cc00To teleport to the VIP mall when you own a "..VIPCoinName..".|r")
	end
return;
end

RegisterPlayerEvent(18, VIP_reset_comm)

print("Grumbo'z VIP Mall command loaded.")
[/COLOR]
 
Last edited:
Top