This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Rochet2

Pages: 1 [2] 3 4
16
Miscellaneous / Re: [QUESTION] Unsheathe aura
« on: August 23, 2015, 01:43:48 am »
I found a spell visual kit that forces weapon in hand: 43
Modifying some aura to use this as the aura state visual could possibly achieve what you want.

17
Several people have reported having issues and in the end the compression has been at fault.
I have now disabled compression by default. Compression is/was only used for the sent addon code. More important is having the obfuscation setting on which removes whitespace and other bloat from the code to make it much smaller.

If someone knows some simple compression algorithm or knows some lua 5.1 and 5.2 compatible pure lua compression algorithm do share :)
For now it has been using TLibCompress that seems to not work properly, possibly depending on platform.
ps. need compress and decompress in pure lua.

18
Miscellaneous / Re: [TrinityCore] Max Level over 255?
« on: August 18, 2015, 07:21:42 pm »
having a little fun:


.debug Mod32Value 54 -160000

19
Miscellaneous / Re: [QUESTIONS] - A few questions I have.
« on: August 15, 2015, 01:49:12 pm »
See the usage of the DK portal to acherus.
Its only usable by the DK that spawned it I think .. or by DK.
Also you can make the code work only if the user is the owner of the object.
See GetOwner and similar functions.

dont know about the select thing ,.

You CAN code your own banking system. But that would require changing how the items are stored etc.
However atm the items are saved to the player inventory. Player has special slots in his inventory coded to fit the bank items so banking is actually a part of the normal character inventory slots - this is what you need changed.

20
Serverside Modding / Re: [Question] Adding a gobject scale command
« on: August 11, 2015, 06:34:30 pm »
I have updated the patch.
http://rochet2.github.io/Objscale.html

21
Serverside Modding / Re: [Question] Adding a gobject scale command
« on: August 11, 2015, 10:41:48 am »
It is possible to scale only one gameobject and only one NPC.
Neither is implemented so that you could save it. (you can scale NPCs but not save the scale)

This is some years old patch and not sure how it works these days:
http://community.trinitycore.org/topic/ ... ment-47056
The patch code might not be that great either.

22
Miscellaneous / Re: [Question] Items that spawn temporary objects.
« on: August 08, 2015, 04:34:55 pm »
Quote
Code: [Select]
local function logoff(plr, entry)
    guid = plr.GetGUIDLow()
    spawn[guid] = nil
end
Erm .. thats ..
The reason the code doesnt work is because your parameters are wrong logoff(plr, entry).
If you look here: http://eluna.emudevs.com/Global/Registe ... Event.html it says (event, player)

also make that guid variable local.
Also you call member functions with : not with a dot.

23
Serverside Modding / Re: GM Commands for users
« on: August 08, 2015, 02:21:43 am »
could be useful to know what core you are using.
on trinitycore you can use the rbac system in auth database to give the commands as permissions to the player GM level.
See the groupID in rbac_default_permissions for the gmlevel 0 and then use the rbac_linked_permission table to link permissions to that ID.
Each command has a permission ID set and you can see them in rbac_permissions table (I think that was the name ..) or in the world database commands table.

24
There are no edits to anything related since last update:
https://github.com/TrinityCore/TrinityC ... 1d...3.3.5

And the latest version works fine.
You are either not using TrinityCore 3.3.5 branch or you have somehow corrupted or invalid DBC files.

25
Serverside Modding / Re: [Question] Lua Teleporter errors
« on: August 01, 2015, 10:13:06 pm »
My recommendaion is to stay away from using variables starting with capital letter especially when handling things like Player and Creature etc.
These are global tables that are used to hold all the methods for those types - so similarly to C++ Player is the "class" of the player.

If you use Player in your code you might accidently screw up other user's code.
You can not mess up the actual metatables used for the userdata like this, but I do not recommend trying.

Krang Stonehoof is right about the case sensitivity, however the parameters are also mislocated.
All hooks in Eluna have event as the first argument.

You can .. uh .. almost .. see.. here:
http://eluna.emudevs.com/Global/Registe ... Event.html
How the argument order you should use is (event, player, creature) and for the select hook (event, player, creature, sender, intid, code).

Also for future posting.. there are several lua engines (luabridge, LHA, Eluna...) it would be nice to know at least which core you are using to know which lua engine is being talked about.


I wrote a little something recently in the doc folder. Could be good for a beginner to check out:
https://github.com/ElunaLuaEngine/Eluna ... s/USAGE.md
https://github.com/ElunaLuaEngine/Eluna ... DETAILS.md

26
Miscellaneous / Re: [Question] Items that spawn temporary objects.
« on: August 01, 2015, 12:51:25 am »
Alright, I see the error now.
Change
local guid = plr:GetGUID()
to
local guid = plr:GetGUIDLow()

The difference here is that GetGUID returns an uint64 number which is represented as an object.
Each GetGUID returns a different object causing the lua table to map them to different locations.
GetGUIDLow returns a normal number.
To properly make the uint64 work as table key it might need to be converted to strings, but using lowguid is easier for this and might be faster.

27
Miscellaneous / Re: [Question] Items that spawn temporary objects.
« on: August 01, 2015, 12:39:42 am »
Quote from: "jar0fair"
Nope, It doesn't remove the objects, and I am not sure why, because, it really seems like would, reading the code.
Are you getting any errors?
The script does nothing after spawning one gameobject? No more spawns or any messages?

28
Miscellaneous / Re: [Question] Items that spawn temporary objects.
« on: August 01, 2015, 12:08:47 am »
Try this. I basically just added back in the GetWorldObject you removed.

Code: [Select]
-- Cauldron
local CauldronItem = 200001
local CauldronObj = 186472
-- Chair
local ChairItem = 200002
local ChairObj = 186732
-- bed
local BedItem = 200003
local BedObj = 13948
-- vendor tent
local VendortentItem = 200004
local VendortentObj = 4000668

local spawn = {}

local function SpawnObj(plr, entry, despawn_time)
    local guid = plr:GetGUID()
    if spawn[guid] then
        local spawnedGobject = plr:GetMap():GetWorldObject(spawn[guid])
        if spawnedGobject then
            spawnedGobject:RemoveFromWorld(true)
            spawn[guid] = nil
        else
            plr:SendNotification("You need to be closer to the existing object to despawn it")
        end
    else
        local x, y, z, o = plr:GetLocation()
        local gobject = plr:SummonGameObject(entry, x, y, z, o, despawn_time)
        if gobject then
            spawn[guid] = gobject:GetGUID()
        end
    end
end

local function Cauldron(event, plr, item, target)
    SpawnObj(plr, CauldronObj, 0)
end

local function Chair(event, plr, item, target)
    SpawnObj(plr, ChairObj, 0)
end

local function Bed(event, plr, item, target)
    SpawnObj(plr, BedObj, 5)
end

local function VendorTent(event, plr, item, target)
    SpawnObj(plr, VendortentObj, 0)
end

RegisterItemEvent(CauldronItem, 2, Cauldron)
RegisterItemEvent(ChairItem, 2, Chair)
RegisterItemEvent(BedItem, 2, Bed)
RegisterItemEvent(VendortentItem, 2, VendorTent)

29
Miscellaneous / Re: [Question] Items that spawn temporary objects.
« on: July 31, 2015, 04:38:34 pm »
This is because in your code you check
Code: [Select]
if spawn thenBut spawn is always defined. The check is useless.
The code inside the IF statement is run and it errors because the value for the key plr:GetGUID() is nil in the spawn table.

What you should check instead is
Code: [Select]
if spawn[plr:GetGUID()] then

30
Miscellaneous / Re: [Question] Items that spawn temporary objects.
« on: July 30, 2015, 02:49:41 pm »
Like Kaev said you should look into using a lua table.

Getting this stuff to work is not so stright forward though. You need to think about special cases.

For example if you try to fetch an object that is on another map it will return nil
If you try to fetch an object that is in an unloaded grid of the map you are on it will return nil

So that said, you can make it so that spawning an object on a map will block you from spawning on other maps or on same map until you successfully delete the already spawned object.
Or you block spawning from same map but allow spawning on other maps.
Or you allow spawning as long as the already spawned object is not within set distance of the player or similar.

Pages: 1 [2] 3 4