Login Status


ShareSource Site » Projects » sniffitzt » sniffitztWiki

Project: sniffitzt - a wow logging proxy [Wiki]

(*) Summary   [^] Files   [^] Screenshots   [_] Wiki   [!] Bug Tracker  
(») Mercurial Repository  
Project Wiki (Page: get_creatures_and_gameobjects)
Last Changed 2 months ago, by balrok

Extract Creatures and Gameobjects from dump

this guide is linux only, sorry :-/ also note, that this guide is written only by a user, arrai told me later, that i used the debug output of the javaprocessor^^ - but it works (:

First you need a processable dump, (for example xml)

then you can run the javaprocessor from the sniffitzt-src directory java processor.Processor /path/to/xml > /path/to/your/output

and the you can simply get all creatures and gameobjects through sed and grep or ack i post my scripts here, but please test them carefully, it's not my fault if they break something. feel free to use my code in closed source software and make money from it, but i'm also happy if you share your improvements :)

ack "^InstancedUnit\ " InstancedUnit | sed -r 's/.*entry=([0-9]*).*x=([0-9\.\-]*).*y=([0-9\.\-]*).*z=([0-9\.\-]*).*o=([0-9\.\-]*).*/\1 \2 \3 \4 \5/'

sed -r 's/.*entry=([0-9]*).*x=([0-9\.\-]*).*y=([0-9\.\-]*).*z=([0-9\.\-]*).*o=([0-9\.\-]*).*/INSERT INTO `creature`- (`guid`, `id`, `map`, `spawnMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`,`spawndist`,- `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (NULL, \1, 30, 1, 0, 0, \2, \3, \4, \5, 0, 0, 0, 100, 100, 0, 0);/'}

ack -v "\-\-" | ack -v "e\([0-2]" | sed -r 'N;s/.* m=30 x=([0-9\.\-]*).*y=([0-9\.\-]*).*z=([0-9\.\-]*) .*o=([0-9\.\-]*).*\n.*\(3,([0-9]*)\).*/ INSERT INTO `mangos`.`gameobject` (`guid` ,`id` ,`map` ,`spawnMask` ,`position_x` ,`position_y` ,`position_z` , `orientation` ,`rotation0` ,`rotation1` ,`rotation2` ,`rotation3` ,`spawntimesecs` ,`animprogress` ,`state`) VALUES (NULL , \5, 30, '1', \1, \2, \3, \4, '0', '0', '0', '0', '0', '0', '0');/'}

note: i used the scripts to extract alterac creatures, so i haven't extracted the mapid (i grepped first for the mapid)

also note, that you can't just extract them and think you're ready, you also extracted the hunter-pets and some waypoints of the creatures, so you have to cleanup many stuff