• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent If free account, change from premium to free outfit

Godely

Member
Joined
Aug 19, 2007
Messages
233
Reaction score
16
JUST ADD THE BLUE CODES!
THE RED CODE IS ONLY FOR REFERENCE!
It's really simple. Go to your login.lua, in creaturescripts, and add it before the function onLogin:
Code:
local male =
	{
		lookType = 128,
		lookHead = 20,
		lookBody = 30,
		lookLegs = 40,
		lookFeet = 50,
		lookAddons = 0
	}

local female =
	{
		lookType = 136,
		lookHead = 20,
		lookBody = 30,
		lookLegs = 40,
		lookFeet = 50,
		lookAddons = 0
	}

Now add it -- inside the function --:
Code:
	if (not isPremium(cid)) then
		if (isInArray(premiumOutfits, getCreatureOutfit(cid).lookType) == TRUE) then
			if getPlayerSex(cid) == 1 then
				doCreatureChangeOutfit(cid, male)
			else
				doCreatureChangeOutfit(cid, female)
			end
		end
	end

Just after it:
Code:
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

Now go to constant.lua, in lib, and add:
Code:
premiumOutfits = {132,133,134,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,251,252,268,269,270,273,278,279,288,289,324,325,328,329}
anywhere you want, but I would recommend you to put it just after "femaleOutfits". Just Ctrl + F it.

See you guys :p
Hope you like it.
 
Last edited:
A little bit edited:
Code:
local outfits = {
	[0] =
	{
		lookType = 136,
		lookHead = 20,
		lookBody = 30,
		lookLegs = 40,
		lookFeet = 50,
		lookAddons = 0
	},
	[1] = {
		lookType = 128,
		lookHead = 20,
		lookBody = 30,
		lookLegs = 40,
		lookFeet = 50,
		lookAddons = 0
	}
}

	if (not isPremium(cid)) then
		if (isInArray(premiumOutfits, getCreatureOutfit(cid).lookType) == TRUE) then
			doCreatureChangeOutfit(cid, outfits[getPlayerSex(cid)])
		end
	end
 
Back
Top