Changeset 113


Ignore:
Timestamp:
Oct 27, 2007, 10:23:13 PM (17 years ago)
Author:
hosiplan
Message:

+ Převedl jsem část scritpů na OOP
+ načal jsem poskládání proměnné $Database, která bude sloužit jako hlavní informační středisko
+ malá úprava ve výpisu Questů

Location:
db
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • db/check_database.php

    r109 r113  
    11<?php
    2 if($vlozeni_souboru == "OK"){
     2
     3$Database = array(
     4  'class' => array(
     5    1 => "Warrior",
     6    2 => "Paladin",
     7    3 => "Hunter",
     8    4 => "Rogue",
     9    5 => "Priest",
     10    6 => "",
     11    7 => "Shaman",
     12    8 => "Mage",
     13    9 => "Warlock",
     14    10 => "",
     15    11 => "Druid"
     16    ),
     17  'race' => array(
     18    1 => "Human",
     19    2 => "Orc",
     20    3 => "Dwarf",
     21    4 => "Night Elf",
     22    5 => "Undead",
     23    6 => "Tauren",
     24    7 => "Gnome",
     25    8 => "Troll",
     26    9 => "",
     27    10 => "Blood Elf",
     28    11 => "Dranei"
     29    ),
     30  'item' => array(
     31    'class' => array(
     32      0 => "Consumable",
     33      1 => "Container",
     34      2 => "Weapon",
     35      4 => "Armor",
     36      5 => "Reagent",
     37      6 => "Projectile",
     38      7 => "Trade Goods",
     39      9 => "Recipe",
     40      11 => "Quiver",
     41      12 => "Quest",
     42      13 => "Key",
     43      15 => "Miscellaneous"
     44      ),
     45    'subclass' => array(
     46      0 => array( // Consumable
     47        1 => "Food",
     48        2 => "Liquid",
     49        3 => "Potion (usable in combat)",
     50        4 => "Scroll (usable in combat)",
     51        5 => "Bandage (usable in combat)",
     52        6 => "Healthstone (usable in combat)",
     53        7 => "Combat Effect (usable in combat)"
     54        ),
     55      2 => array( // Weapon
     56        0 => "One Handed Axe",
     57        1 => "Two Handed Axe",
     58        2 => "Bow",
     59        3 => "Rifle",
     60        4 => "One Handed Mace",
     61        5 => "Two Handed Mace",
     62        6 => "Polearm",
     63        7 => "One Handed Sword",
     64        8 => "Two Handed Sword",
     65        10 => "Staff",
     66        11 => "One Handed Exotic",
     67        12 => "Two Handed Exotic",
     68        13 => "Fist Weapon",
     69        14 => "Miscellaneous Weapon",
     70        15 => "Dagger",
     71        16 => "Thrown",
     72        17 => "Spear",
     73        18 => "Crossbow",
     74        19 => "Wand",
     75        20 => "Fishing Pole"
     76        ),
     77      4 => array( // Armor
     78        0 => "Miscellaneous",
     79        1 => "Cloth",
     80        2 => "Leather",
     81        3 => "Mail",
     82        4 => "Plate",
     83        6 => "Shield"
     84        ),
     85      6 => array( // Projectile
     86        2 => "Arrows",
     87        3 => "Bullets"
     88        ),
     89      7 => array( // Trade Goods
     90        0 => "Trade Goods",
     91        1 => "Parts",
     92        2 => "Explosives",
     93        3 => "Devices"
     94        ),
     95      9 => array( // Recipe
     96        0 => array("Book"),
     97        1 => array("Pattern","Leatherworking"),
     98        2 => array("Pattern","Tailoring"),
     99        3 => array("Schematic","Engineering"),
     100        4 => array("Plans","Blacksmithing"),
     101        5 => array("Recipe","Cooking"),
     102        6 => array("Recipe","Alchemy"),
     103        7 => array("Manual","First Aid"),
     104        8 => array("Formula","Enchanting"),
     105        9 => array("Fishing","Manual")
     106        ),
     107      11 => array( // Quiver
     108        2 => array("Quiver","Arrows"),
     109        3 => array("Ammo Pouch","Bullets")
     110        ),
     111      13 => array( // Projectile
     112        2 => "Arrows",
     113        3 => "Bullets"
     114        )
     115      ),
     116    'quality' => array(
     117      0 => array("Grey","Poor"),
     118      1 => array("White","Common"),
     119      2 => array("Green","Uncommon"),
     120      3 => array("Blue","Rare"),
     121      4 => array("Purple","Epic"),
     122      5 => array("Orange","Legendary"),
     123      6 => array("Red","Artifact")
     124      ),
     125    'type' => array(
     126      1 => "binded",
     127      2 => "Conjured",
     128      4 => "Openable item",
     129      16 => "Shield",
     130      32 => "Totem",
     131      64 => "Mount",
     132      256 => "Wand",
     133      512 => "Ribboned Wrapping Paper",
     134      1024 => "Essence",
     135      8192 => "Guild Charter",
     136      32768 => "PvP Reward Item"
     137      ),
     138    'equip' => array(
     139      1 => "Head",
     140      2 => "Neck",
     141      3 => "Shoulder",
     142      4 => "Shirt",
     143      5 => "Chest",
     144      6 => "Waist", // Belt
     145      7 => "Legs", // Pants
     146      8 => "Feet", // Boots
     147      9 => "Wrists", // Bracers
     148      10 => "Hands", // Gloves
     149      11 => "Finger", // Ring
     150      12 => "Trinket",
     151      13 => "One Hand",
     152      14 => "Off Hand", // includes Shield
     153      15 => "Bow",
     154      16 => "Back",
     155      17 => "Two Hand",
     156      18 => "Bag", // include Quivers
     157      19 => "Tabard",
     158      20 => "Robe",
     159      21 => "Main Hand",
     160      22 => "Off Hand", // Misc Items
     161      23 => "Tome",
     162      24 => "Ammunition",
     163      25 => "Thrown",
     164      26 => "Gun"
     165      ),
     166    'AllowableClass' => array(
     167      1 => "Warrior",
     168      2 => "Paladin",
     169      4 => "Hunter",
     170      8 => "Rogue",
     171      16 => "Priest",
     172      64 => "Shaman",
     173      128 => "Mage",
     174      256 => "Warlock",
     175      1024 => "Druid"
     176      ),
     177    'AllowableRace' => array(
     178      1 => "Human",
     179      2 => "Orc",
     180      4 => "Dwarf",
     181      8 => "Night Elf",
     182      16 => "Undead",
     183      32 => "Tauren",
     184      64 => "Gnome",
     185      128 => "Troll",
     186      512 => "Blood elf",
     187      1024 => "Draenei"
     188      ),
     189    'RequiredReputationRank' => array(
     190      0 => "Hated",
     191      1 => "Hostile",
     192      2 => "Unfriendly",
     193      3 => "Neutral",
     194      4 => "Friendly",
     195      5 => "Honored",
     196      6 => "Reverted",
     197      7 => "Exalted",
     198      ),
     199    'stat_type' => array(
     200      0 => "Mana",
     201      1 => "Health",
     202      3 => "Agility",
     203      4 => "Strength",
     204      5 => "Intellect",
     205      6 => "Spirit",
     206      7 => "Stamina",
     207      ),
     208    'dmg_type' => array(
     209      0 => "Physical",
     210      1 => "Holy",
     211      2 => "Fire",
     212      3 => "Nature",
     213      4 => "Frost",
     214      5 => "Shadow",
     215      6 => "Arcane"
     216      ),
     217    'ammo_type' => array(
     218      2 => "Arrows",
     219      3 => "Bullets"
     220      ),
     221    'spell_charges' => array(
     222      0 => "Infinite charges",
     223      'negative' => "Item is expendable",
     224      'positive' => "Item is kept when all charges are spent"
     225      ),
     226    'bonding' => array(
     227      1 => "Binds when Picked Up",
     228      2 => "Binds when Equipped",
     229      3 => "Binds when Used",
     230      4 => "Quest Item"
     231      ),
     232    'bonding' => array(
     233      1 => "Binds when Picked Up",
     234      2 => "Binds when Equipped",
     235      3 => "Binds when Used",
     236      4 => "Quest Item"
     237      ),
     238    'LanguageID' => array(
     239      1 => "Orcish",
     240      2 => "Darnassian",
     241      3 => "Taurahe",
     242      6 => "Dwarvish",
     243      7 => "Common",
     244      8 => "Demonic",
     245      9 => "Titan",
     246      10 => "Thelassian",
     247      11 => "Draconic",
     248      12 => "Kalimag",
     249      13 => "Gnomish",
     250      14 => "Troll",
     251      33 => "Gutterspeak"
     252      ),
     253    'PageMaterial' => array(
     254      1 => "Parchment",
     255      2 => "Stone",
     256      3 => "Marble",
     257      4 => "Silver",
     258      5 => "Bronze"
     259      ),
     260    'Material' => array(
     261      1 => "Metal",
     262      2 => "Wood",
     263      3 => "Liquid",
     264      4 => "Jewelry",
     265      5 => "Chain",
     266      6 => "Plate",
     267      7 => "Cloth",
     268      8 => "Leather"
     269      ),
     270    'sheath' => array(
     271      1 => "Two Handed Sword (on the back; tip down)",
     272      2 => "Staff (on the back; tip up)",
     273      3 => "One Handed Sword (on the side)",
     274      4 => "Shield (on the back)",
     275      5 => "Enchanter's Rod",
     276      7 => "Off Hand",
     277      ),
     278    'BagFamily' => array(
     279      0 => "",
     280      1 => "Arrows",
     281      2 => "Bullets",
     282      3 => "Soul Shards",
     283      6 => "Herbs",
     284      7 => "Enchanting Supp",
     285      8 => "Engineering Supp",
     286      9 => "Keys",
     287      10 => "Gems",
     288      12 => "Mining Supp",
     289      )
     290    ),
     291  'quest' => array(
     292    'ZoneOrSort' => array(
     293      'negative' => array(
     294        1 => "Epic",
     295        21 => "REUSE - old wailing caverns",
     296        22 => "Seasonal",
     297        23 => "REUSE - old undercity one",
     298        24 => "Herbalism",
     299        25 => "REUSE - old scarlet monastery",
     300        41 => "REUSE - old uldaman",
     301        61 => "Warlock",
     302        81 => "Warrior",
     303        82 => "Shaman",
     304        101 => "Fishing",
     305        121 => "Blacksmithing",
     306        141 => "Paladin",
     307        161 => "Mage",
     308        162 => "Rogue",
     309        181 => "Alchemy",
     310        182 => "Leatherworking",
     311        201 => "Engineering",
     312        221 => "Treasure Map",
     313        241 => "REUSE - old sunken temple",
     314        261 => "Hunter",
     315        262 => "Priest",
     316        263 => "Druid",
     317        264 => "Tailoring",
     318        284 => "Special",
     319        304 => "Cooking",
     320        324 => "First Aid",
     321        344 => "Legendary",
     322        364 => "Darkmoon Faire",
     323        365 => "Ahn'Qiraj War",
     324        366 => "Lunar Festival",
     325        367 => "Reputation",
     326        ),
     327      'positive' => "SQL:area_table"
     328      ),
     329    'Type' => array(
     330      1 => "Elite",
     331      21 => "Life",
     332      41 => "PvP",
     333      62 => "Raid",
     334      81 => "Dungeon",
     335      82 => "World Event"
     336      ),
     337/* =====================================
     338
     339RequiredRaces ¶ ??????? need to complete !!!!
     340
     341Races required to get the quest. 0 means available for all races.
     342Field's value is a decimal value that must be transform to a 8 bits binary in order to be understandable.
     343In binary form, each different bit represent a different race. They're assigned as follow :
     344128     64      32      16      8       4       2       1
     345Troll   Gnome   Tauren  Undead  NightElf        Dwarf   Orc     Human
     346
     347Example :
     348Int field value : 77
     349Assigning bits from the left to the right :
     350128     64      32      16      8       4       2       1
     351Troll   Gnome   Tauren  Undead  NightElf        Dwarf   Orc     Human
     3520       1       0       0       1       1       0       1
     353
     354Then, quest is for races : Human, Dwarf, NightElf, Gnome. In other words, add the values in the above table together for the classes you want. Another example: To make a quest for Humans and Dwarves, add 1 and 4 together to get 5.
     355
     356===================================== */
     357    'SpecialFlags' => array(
     358      1 => "Elite",
     359      21 => "Life",
     360      41 => "PvP",
     361      62 => "Raid",
     362      81 => "Dungeon",
     363      82 => "World Event"
     364      )
     365/* =====================================
     366
     367    * QUEST_SPECIAL_FLAGS_NONE = 0
     368    * QUEST_SPECIAL_FLAGS_DELIVER = 1
     369    * QUEST_SPECIAL_FLAGS_EXPLORATION = 2
     370    * QUEST_SPECIAL_FLAGS_SPEAKTO = 4
     371    * QUEST_SPECIAL_FLAGS_KILL_OR_CAST = 8
     372    * QUEST_SPECIAL_FLAGS_TIMED = 16
     373    * Flag 32 unknown
     374    * QUEST_SPECIAL_FLAGS_REPUTATION = 64
     375
     376PrevQuestId ¶
     377
     378If value > 0: Contains the previous quest id, that must be completed before this quest can be started.
     379If value < 0: Contains the parent quest id, that must be active before this quest can be started.
     380If quest have many alternative previous quests (race specific quests lead to single not race specific quest) field NextQuestId in previous quests can used for setting this dependence.
     381Mangos check completing of PrevQuestId for this quest and completing of all quests that have NextQuestId == this quest id, one completion is enough to allow starting this quest.
     382NextQuestId ¶
     383
     384If value > 0: Contains the next quest id, if PrevQuestId of that quest is not sufficient.
     385If value < 0: Contains the sub quest id, if PrevQuestId of that quest is not sufficient.
     386If quest have many alternative next quests (class specific quests lead from single not class specific quest) field PrevQuestId in next quests can used for setting this dependence.
     387ExclusiveGroup ¶
     388
     389if ExclusiveGroup? > 0
     390
     391Allows to define a group of quests of which only one may be chosen and completed.
     392E.g. if from quests 1200, 1201 and 1202 only one should be allowed to be chosen, insert 1200 into ExclusiveGroup of all 3 quests.
     393
     394if ExclusiveGroup? < 0
     395
     396Allows to define a group of quests of which all must be completed and rewarded to start next quest.
     397E.g. if quest 1000 dependent from onw of quests 1200, 1201 and 1202 and all this quests have same negative exclusive group then all this quest mustbe completed and rewareded before quest 1000 can be started.
     398NextQuestInChain ¶
     399
     400Defines quest chains, the details of the entered quest will be automatically opened when this quest is completed.
     401Only works when the quest rewarder of this quest is the quest giver of the entered quest.
     402srcItem ¶
     403
     404Item's ID given by the quest giver at beginning of the quest.
     405Items will be deleted when quest is abandoned.
     406srcItemCount ¶
     407
     408Number of Item given at quest start.
     409SrcSpell ¶
     410
     411Spell casted on player when quest is started. Can be a buff or a learning spell.
     412Title ¶
     413
     414Title of the quest.
     415Details ¶
     416
     417Long quest's description.
     418Objectives ¶
     419
     420Objectives of the quest.
     421If empty, quest is an auto-complete quest that can be immediately finished without accepting it first.
     422OfferRewardText ¶
     423
     424First text send to the player by the NPC when completing the quest.
     425RequestItemsText ¶
     426
     427This text ist send to player, yet did not terminate the Quest and speak with NPC again!
     428EndText ¶
     429
     430This text is indicated to the player, if you open your Questlog and wars send to player ingame. No Change this!
     431ObjectiveText1-4 ¶
     432
     433Used to define non-standard objective texts.
     434ReqItemId1-4 ¶
     435
     436Item_template Id of the 1.-4. required item to complete the quest. (if any)
     437ReqItemCount1-4 ¶
     438
     439Amount of 1.-4. required items.
     440ReqSourceId1-4 ¶
     441
     442These fields are used in core quest-drop logic. They allow players to get quest drops which are not quest delivery items (ReqItem stand for this), but needed to create quest delivery by player or needed to cast ReqSpellCasts. ReqSourceId1 is the item_template id of a source item for creation of ReqItemX or casting of ReqSpellCastX. X is the value of ReqSourceRef1. Only items which have a quest drop chance (having QuestChance > 0 in *_loot_template) should be used as sources here.
     443
     444The same for ReqSourceId2-4
     445You may define 1, 2, 3 or even all 4 sources for the same ReqItem/ReqSpellCast or use 4 sources for 4 ReqItems/ReqSpellCasts.
     446ReqSourceCount1-4 ¶
     447
     448Amount of ReqSourceId items the player may gather per unfinished ReqItemId or ReqSpellCast.
     449So ReqSourceId1 items will drop up to a total amount of (ReqItemCount(ReqSourceRef1) - already owned ReqItemId(ReqSourceRef1)) * ReqSourceCount1. Same for ReqSpellCast objectives.
     450ReqSourceRef1-4 ¶
     451
     452Should be 0 or 1..4. See ReqSourceId description.
     453ReqCreatureOrGOId1-4 ¶
     454
     455Value > 0: 1.-4. required creature_template ID the player needs to kill/cast on in order to complete the quest.
     456Value < 0: 1.-4. required gameobject_template ID the player needs to cast on in order to complete the quest.
     457If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed.
     458ReqCreatureOrGOCount1-4 ¶
     459
     460Number of kills/casts needed on 1.-4. creature or gameobject.
     461ReqSpellCast1-4 ¶
     462
     463Spell ID of Spell that needs to be cast in order to fulfill a quest objective.
     464If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed.
     465RewChoiceItemId1-6 ¶
     466
     467Id of the 1.-6. Item available for reward choice.
     468RewChoiceItemCount1 ¶
     469
     470Number of Charges in the 1.-6. rewarded item available.
     471RewItemId1-4 ¶
     472
     4731.-4. item Id given for reward (no choice).
     474RewItemCount1-4 ¶
     475
     476Number of RewItem1-4.
     477RewRepFaction1-5 ¶
     478
     479Faction Id (from Faction.dbc in this case) for which the quest give reputation points.
     480RewRepValue1-5 ¶
     481
     482Number of gain or lost reputation points for Faction1-5 at quest completion.
     483This is special reputation rewarding. Normal reputation reward to quest rewarding creature faction calculated and added automatically.
     484RewOrReqMoney ¶
     485
     486Money earned by completing the quest (if value > 0). Money quest requirement (if value < 0).
     487RewXpOrMoney ¶
     488
     489Experience or money (when player's level = maxlevel) given when completing the quest. Only given once for repeatable quests.
     490RewSpell ¶
     491
     492Spell casted at player when completing the quest. This can be learn spell and player learned some spell in result, or buff spell, for example.
     493PointMapId ¶
     494
     495MapId of a quest point of interest (POI).
     496POI will be shown on the map when quest is active.
     497PointX ¶
     498
     499X coordinate of quest POI.
     500PointY ¶
     501
     502Y coordinate of quest POI.
     503PointOpt ¶
     504
     505!!! Need info here : Feel free to document if you know. !!!
     506OfferRewardEmote, RequestItemsEmote ¶
     507
     508Emote that creature show at request quest details, show incompleted quest and completing quest
     509CompleteScript ¶
     510
     511!!! Need info here : Feel free to document if you know. !!!
     512Repeatable ¶
     513
     514Is quest repeatable? 1 yes 0 no
     515
     516===================================== */
     517    ),
     518  'creep' => array(
     519    'type' => array(
     520      1 => "Beast",
     521      2 => "Dragonkin",
     522      3 => "Demon",
     523      4 => "Elemental",
     524      5 => "Giant",
     525      6 => "Undead",
     526      7 => "Humanoid",
     527      8 => "Critter",
     528      9 => "Mechanical",
     529      10 => "Not specified",
     530      11 => "Totem" ),
     531    ),
     532/* =====================================
     533
     534entry ¶
     535
     536Creature's id, related to field creature.guid
     537modelid ¶
     538
     539Graphical model that client must apply on this creature.
     540name ¶
     541
     542Base name of the creature.
     543subname ¶
     544
     545Subname of the creature (if any).
     546minlevel ¶
     547
     548Creature's minimum level. Spawned creature have level in range from minlevel to maxlevel
     549maxlevel ¶
     550
     551Creature's maximum level. Spawned creature have level in range from minlevel to maxlevel
     552minhealth ¶
     553
     554Maximum creature's health points for creature level equal minlevel. Spawned creature have health in linear proportion to level position in range minlevel .. maxlevel
     555maxhealth ¶
     556
     557Maximum creature's health points for creature level equal maxlevel. Spawned creature have health in linear proportion to level position in range minlevel .. maxlevel
     558minmana ¶
     559
     560Maximum creature's mana points for creature level equal minlevel. Spawned creature have mana in linear proportion to level position in range minlevel .. maxlevel
     561maxmana ¶
     562
     563Maximum creature's mana points for creature level equal maxlevel. Spawned creature have mana in linear proportion to level position in range minlevel .. maxlevel
     564armor ¶
     565
     566Creature's armor.
     567Faction ¶
     568
     569Creature's faction. See: CreatureFaction
     570npcflag ¶
     571
     572This is way to cliet know how info you see if you clic(RMB) on NPC if is vendor if is auction in fact is menu how you see
     573Is what type of NPC it is. Stored in npc_option.npcflag
     574
     575enum NPCFlags
     576Type    Value   Hex     Comment
     577UNIT_NPC_FLAG_NONE      0       0x00000         you can't speak with npc
     578UNIT_NPC_FLAG_GOSSIP    1       0x00001         you can only speak with npc
     579UNIT_NPC_FLAG_QUESTGIVER        2       0x00002         this npc can give you quest
     580UNIT_NPC_FLAG_VENDOR    4       0x00004         vendor..
     581UNIT_NPC_FLAG_TAXIVENDOR        8       0x00008         gryfon master and oder fly masters ....
     582UNIT_NPC_FLAG_TRAINER   16      0x00010         trainer this npc teatch you some spell
     583UNIT_NPC_FLAG_SPIRITHEALER      32      0x00020         ghost in graveyeard(visible only to dead)
     584UNIT_NPC_FLAG_SPIRITGUIDE       64      0x00040         ghost in battleground(visible only to dead)
     585UNIT_NPC_FLAG_INNKEEPER         128     0x00080         you can give to this npc your heartstone
     586UNIT_NPC_FLAG_BANKER    256     0x00100         bank in capital city
     587UNIT_NPC_FLAG_PETITIONER        512     0x00200         the guy you get the petitionpaper for signing a Guild
     588UNIT_NPC_FLAG_TABARDVENDOR      1024    0x00400         in this guy you can build tabart
     589UNIT_NPC_FLAG_BATTLEFIELDPERSON         2048    0x00800         battlemaster ... for Warsong and oder battlegrount this npc give you intro quorte
     590UNIT_NPC_FLAG_AUCTIONEER        4096    0x01000         auction house
     591UNIT_NPC_FLAG_STABLE    8192    0x02000         stable master for hunter you can keep your pet in stable
     592UNIT_NPC_FLAG_ARMORER   16384   0x04000         in this you you can repair your damaget items
     593        32768   0x08000         (unused)
     594UNIT_NPC_FLAG_GUARD     65536   0x10000         guard directions help (custom flag used at sever side only
     595
     596
     597To see flag combinations, just use this tool: http://www.mangosproject.org/~wrs/tools/flags.php ;)
     598
     599NPCs with one than one function get their flag by adding the flag values. A trainer that gives quest and sells stuff would have the NPCFLAG 16+2+4=22. It's really that easy ;)
     600speed ¶
     601
     602Creature's speed.
     603rank ¶
     604
     605Creature's honnor rank.
     6060 - Normal
     6071 - Elite
     6082 - RareElite?
     6093 - WorldBoss?
     6104 - Rare
     611
     612mindmg ¶
     613
     614Creature's minimum melee damage.
     615maxdmg ¶
     616
     617Creature's maximum melee damage.
     618dmgschool ¶
     619
     620Creature's melee damage spell school (by default 0/SPELL_SCHOOL_NORMAL/physical damage).
     621attackpower ¶
     622
     623Creature's melee attack power.
     624baseattacktime ¶
     625
     626Time between each creature's melee attacks.
     627rangeattacktime ¶
     628
     629Time between each creature's range attacks.
     630flags ¶
     631
     632!!! Need info here : Feel free to describe if you know !!!
     633mount ¶
     634
     635Creature's mount model ID ... if the value is equal to zero then creature doesn't have any mount.
     636dynamicflags ¶
     637
     638!!! Need info here : Feel free to describe if you know !!!
     639size ¶
     640
     641Creature model size 1 = 100%
     642family ¶
     643Id      Family
     6441       Wolf
     6452       Cat
     6463       Spider
     6474       Bear
     6485       Boar
     6496       Crocolisk
     6507       Carrion Bird
     6518       Crab
     6529       Gorilla
     65310      [UNUSED]
     65411      Raptor
     65512      Tallstrider
     65613      [UNUSED]
     65714      [UNUSED]
     65815      Felhunter
     65916      Voidwalker
     66017      Succubus
     66118      [UNUSED]
     66219      Doomguard
     66320      Scorpid
     66421      Turtle
     66522      [UNUSED]
     66623      Imp
     66724      Bat
     66825      Hyena
     66926      Owl
     67027      Wind Serpent
     67128      Remote Control
     67229      Felguard
     67330      Dragonhawk
     67431      Ravager
     67532      Warp Stalker
     67633      Sporebat
     67734      Nether Ray
     67835      Serpent
     679bounding_radius ¶
     680
     681Radius from what u can be attacked !
     682trainer_type ¶
     683
     684
     685    TRAINER_TYPE_CLASS = 0 //Train Spell your class. Must be creature_template.class == player class for training
     686    TRAINER_TYPE_MOUNTS = 1 //Train Spell your race (mounts). Must be creature_template.race == player race for training
     687    TRAINER_TYPE_TRADESKILLS = 2 //Train Trade skills Mining,Herb, first aid .... Pдayer must known creature_template.trainer_spell for training
     688    TRAINER_TYPE_PETS = 3 //Train Pet only for hunter(train hunter train pet) creature_template.class == HUNTER == player class for training
     689
     690
     691trainer_spell ¶
     692
     693Spell ID. Used for check in case npcflag include trainer flag (16) and trainer_type == TRAINER_TYPE_TRADESKILLS. Player must known trainer_spell to start training
     694See : character.class.
     695class ¶
     696
     697Creature's class, like 'character.class' field. Used for check in case npcflag include trainer flag (16) and trainer_type == TRAINER_TYPE_CLASS or TRAINER_TYPE_PETS
     698See : character.class.
     699race ¶
     700
     701Creature's race, like 'character.race' field. Used for check in case npcflag include trainer flag (16) and trainer_type == TRAINER_TYPE_MOUNTS
     702See : character.race.
     703minrangedmg ¶
     704
     705Minimum creature's range damage.
     706maxrangedmg ¶
     707
     708Maximum creature's range damage.
     709rangedattackpower ¶
     710
     711Creature's ranged attack power.
     712combat_reach ¶
     713
     714The distance from the creature can hit you.
     715type ¶
     716Id      Type
     7171       Beast
     7182       Dragonkin
     7193       Demon
     7204       Elemental
     7215       Giant
     7226       Undead
     7237       Humanoid
     7248       Critter
     7259       Mechanical
     72610      Not specified
     72711      Totem
     728civilian ¶
     729
     730If is this NPC civilian or not.
     731
     732If this is a boolean value (Civilian or not), why is it a int(4) ?
     733flag1 ¶
     734
     735!!! Need info here : Feel free to describe if you know !!!
     736equipmodel1 ¶
     737
     738Equipement's model of the first item weared by the creature.
     739equipmodel2 ¶
     740
     741Equipement's model of the second item weared by the creature.
     742equipmodel3 ¶
     743
     744Equipement's model of the third item weared by the creature.
     745equipinfo1 ¶
     746
     747!!! Need info here : Feel free to describe if you know !!!
     748equipinfo2 ¶
     749
     750!!! Need info here : Feel free to describe if you know !!!
     751equipinfo3 ¶
     752
     753!!! Need info here : Feel free to describe if you know !!!
     754equipslot1 ¶
     755
     756!!! Need info here : Feel free to describe if you know !!!
     757equipslot2 ¶
     758
     759!!! Need info here : Feel free to describe if you know !!!
     760equipslot3 ¶
     761
     762!!! Need info here : Feel free to describe if you know !!!
     763lootid ¶
     764
     765Refered to field loot_template.entry
     766skinloot ¶
     767
     768Type of loot if creature is skinned.
     769resistance1 ¶
     770
     771holy resitance
     772resistance2 ¶
     773
     774fire resistance
     775resistance3 ¶
     776
     777nature resistance
     778resistance4 ¶
     779
     780frost resistance
     781resistance5 ¶
     782
     783shadow resistance
     784resistance6 ¶
     785
     786arcane resistance
     787spell1 ¶
     788
     789Creature's first spell. ??? refer to game_spell.id ???
     790spell2 ¶
     791
     792Creature's second spell. ??? refer to game_spell.id ???
     793spell3 ¶
     794
     795Creature's third spell. ??? refer to game_spell.id ???
     796spell4 ¶
     797
     798Creature fourth spell. ??? refer to game_spell.id ???
     799mingold ¶
     800
     801Minimum gold drop.
     802maxgold ¶
     803
     804Maximum gold drop. 0 = creature don't drop any gold.
     805AIName ¶
     806
     807Name of the AI function creature uses.
     808MovementType? ¶
     809
     810Type of default creature movment.
     811Id      Type
     8120       Idle (not move)
     8131       Random
     8142       Waypoint
     815InhabitType? ¶
     816
     817Where creature cat move and attack (bit mask).
     818Id      Type
     8191       Ground
     8202       Water
     8213       Ground+Water
     822ScriptName? ¶
     823
     824Script's name creature uses.
     825
     826===================================== */
     827  'gameobject' => array(
     828    'type' => array(
     829      1 => "Beast",
     830      2 => "Dragonkin",
     831      3 => "Demon",
     832      4 => "Elemental",
     833      5 => "Giant",
     834      6 => "Undead",
     835      7 => "Humanoid",
     836      8 => "Critter",
     837      9 => "Mechanical",
     838      10 => "Not specified",
     839      11 => "Totem" ),
     840    )
     841/* =====================================
     842
     843entry
     844ID of your choice ex : 5914 and in game : .addgo 5914
     845
     846type:
     847Value   Name    Note
     8480       DOOR   
     8491       BUTTON 
     8502       QUESTGIVER     
     8513       CHEST   
     8524       ?       
     8535       GENERIC         
     8546       TRAP   
     8557       CHAIR   
     8568       SPELL_FOCUS     
     8579       TEXT   
     85810      GOOBER 
     85911      TRANSPORT       
     86012      ?       
     86113      ?       "Battlement Large"
     86214      ?       do not possess the parameter?
     86315      MO_TRANSPORT   
     86416      DUEL_FLAG       
     86517      FISHING_BOBBER 
     86618      RITUAL 
     86719      MAILBOX         
     86820      ?       
     86921      ?       
     87022      SPELLCASTER     
     87123      MEETING_STONE   
     87224      FLAGSTAND       (BG_Flag)
     87325      FISHING_HOLE   
     87426      ?       
     87527      CUSTOM_TELEPORTER       Not supported but sended to client, can create problems in client work.
     87628      ?       
     87729      BANNER?         
     878
     879displayId:
     880Graphic model's id sent to the client.
     881
     882name:
     883Object's name.
     884
     885faction:
     886Object's faction, if any.
     887
     888flags:
     889!!! Need info here : Feel free to document if you know !!!
     890
     891size:
     892Object's size must be set because graphic models can be resample.
     893
     894sound0 - sound11:
     895Data fields specific for different type field values. Each type has unique fields.
     896
     897ScriptName?
     898Script's name this object uses, if needed.
     899
     900Gameobject type 0 ( DOOR ):
     901sound0 = State
     902sound1 = LockID ( ID from Lock.dbc )
     903sound2 = flags ?
     904sound3 = flags ?
     905sound4 = 0
     906sound5 = 0
     907sound6 = 0
     908sound7 = 0
     909sound8 = 0
     910sound9 = 0
     911sound10 = 0
     912sound11 = 0
     913
     914Gameobject type 1 ( BUTTON ):
     915sound0 = State
     916sound1 = LockID ( ID from Lock.dbc )
     917sound2 = flags ?
     918sound3 = ID gameobject ( Spawned GO type 6 )
     919sound4 = State Battleground ?
     920sound5 = 0
     921sound6 = 0
     922sound7 = 0
     923sound8 = 0
     924sound9 = 0
     925sound10 = 0
     926sound11 = 0
     927
     928Gameobject type 2 ( QUESTGIVER ):
     929sound0 = LockID ( ID from Lock.dbc )
     930sound1 = QuestLoot? ID (Quest Id to be given)
     931sound2 = 0
     932sound3 = QuestLoot? ID
     933sound4 = 0
     934sound5 = 0
     935sound6 = 0
     936sound7 = 0
     937sound8 = 0
     938sound9 = 0
     939sound10 = 0
     940sound11 = 0
     941
     942Gameobject type 3 ( CHEST ):
     943sound0 = LockID ( ID from Lock.dbc )
     944sound1 = LootID
     945sound2 = Time
     946sound3 = State
     947sound4 = MinLoot? ( Min successful loot attempts for Mining Gerbalism etc )
     948sound5 = MaxLoot? ( Max successful loot attempts for Mining Gerbalism etc )
     949sound6 = QuestLoot? ID
     950sound7 = ID gameobject ( Spawned GO type 6 )
     951sound8 = QuestID ( Quest complete )
     952sound9 = ?
     953sound10 = ?
     954sound11 = 0
     955
     956Gameobject type 5 ( GENERIC ):
     957sound0 = State
     958sound1 = State
     959sound2 = 0
     960sound3 = 0
     961sound4 = 0
     962sound5 = 0
     963sound6 = 0
     964sound7 = 0
     965sound8 = 0
     966sound9 = 0
     967sound10 = 0
     968sound11 = 0
     969
     970Gameobject type 6 ( TRAP ):
     971sound0 = LockID ( ID from Lock.dbc )
     972sound1 = Time
     973sound2 = Distance
     974sound3 = Spell ID
     975sound4 = State ?
     976sound5 = Time/Distance ?
     977sound6 = Chain Effect
     978sound7 = Time/Distance for Chain Effect
     979sound8 = 0
     980sound9 = 0
     981sound10 = 0
     982sound11 = 0
     983
     984Gameobject type 7 ( CHAIR ):
     985sound0 = State
     986sound1 = Distance/ State ?
     987sound2 = 0
     988sound3 = 0
     989sound4 = 0
     990sound5 = 0
     991sound6 = 0
     992sound7 = 0
     993sound8 = 0
     994sound9 = 0
     995sound10 = 0
     996sound11 = 0
     997
     998Gameobject type 8 ( SPELL_FOCUS ):
     999sound0 = ID SpellFocusObject.dbc. See SpellFocusObjectID
     1000sound1 = Distance
     1001sound2 = ID gameobject ( Spawned GO type 6 )
     1002sound3 = State ?
     1003sound4 = 0
     1004sound5 = 0
     1005sound6 = 0
     1006sound7 = 0
     1007sound8 = 0
     1008sound9 = 0
     1009sound10 = 0
     1010sound11 = 0
     1011
     1012Gameobject type 9 ( TEXT ):
     1013sound0 = Page ID
     1014sound1 = 0
     1015sound2 = ID from PageTextMaterial?.dbc
     1016sound3 = 0
     1017sound4 = 0
     1018sound5 = 0
     1019sound6 = 0
     1020sound7 = 0
     1021sound8 = 0
     1022sound9 = 0
     1023sound10 = 0
     1024sound11 = 0
     1025
     1026Gameobject type 10 ( GOOBER ):
     1027sound0 = LockID ( ID from Lock.dbc )
     1028sound1 = flags ?
     1029sound2 = QuestLoot? ID ?
     1030sound3 = flags ?
     1031sound4 = State ?
     1032sound5 = State ?
     1033sound6 = 0
     1034sound7 = 0
     1035sound8 = 0
     1036sound9 = 0
     1037sound10 = Spell ID
     1038sound11 = 0
     1039
     1040Gameobject type 18 ( RITUAL ):
     1041sound0 = Time ?
     1042sound1 = Spell ID
     1043sound2 = Spell ID
     1044sound3 = 0
     1045sound4 = ?
     1046sound5 = ?
     1047sound6 = 0
     1048sound7 = 0
     1049sound8 = 0
     1050sound9 = 0
     1051sound10 = 0
     1052sound11 = 0
     1053
     1054Gameobject type 22 ( SPELLCASTER ):
     1055sound0 = Spell ID
     1056sound1 = 0
     1057sound2 = State ?
     1058sound3 = 0
     1059sound4 = 0
     1060sound5 = 0
     1061sound6 = 0
     1062sound7 = 0
     1063sound8 = 0
     1064sound9 = 0
     1065sound10 = 0
     1066sound11 = 0
     1067
     1068Gameobject type 24 ( FLAGSTAND ):
     1069sound0 = 0
     1070sound1 = Spell ID
     1071sound2 = ?
     1072sound3 = Spell ID
     1073sound4 = Spell ID
     1074sound5 = ?
     1075sound6 = 0
     1076sound7 = 0
     1077sound8 = 0
     1078sound9 = 0
     1079sound10 = 0
     1080sound11 = 0
     1081
     1082Gameobject type 27 ( CUSTOM_TELEPORTER ):
     1083sound0 = areatrigger_template.id
     1084sound1 = 0
     1085sound2 = 0
     1086sound3 = 0
     1087sound4 = 0
     1088sound5 = 0
     1089sound6 = 0
     1090sound7 = 0
     1091sound8 = 0
     1092sound9 = 0
     1093sound10 = 0
     1094sound11 = 0
     1095
     1096===================================== */
     1097);
     1098
    31099?>
    4 
    5 
    6 
    7 <?php
    8   };
    9 ?>
  • db/config.sample.php

    r109 r113  
    3030);
    3131
    32 $Database = array(
    33   'class' => array(
    34     1 => "Warrior",
    35     2 => "Paladin",
    36     3 => "Hunter",
    37     4 => "Rogue",
    38     5 => "Priest",
    39     6 => "",
    40     7 => "Shaman",
    41     8 => "Mage",
    42     9 => "Warlock",
    43     10 => "",
    44     11 => "Druid"
    45     ),
    46   'race' => array(
    47     1 => "Human",
    48     2 => "Orc",
    49     3 => "Dwarf",
    50     4 => "Night Elf",
    51     5 => "Undead",
    52     6 => "Tauren",
    53     7 => "Gnome",
    54     8 => "Troll",
    55     9 => "",
    56     10 => "Blood Elf",
    57     11 => "Dranei"
    58     ),
    59   'item' => array(
    60     1 => "",
    61     2 => ""
    62     ),
    63   'quest' => array(
    64     1 => "",
    65     2 => ""
    66     ),
    67   'creep' => array(
    68     'type' => array(
    69       1 => "Beast",
    70       2 => "Dragonkin",
    71       3 => "Demon",
    72       4 => "Elemental",
    73       5 => "Giant",
    74       6 => "Undead",
    75       7 => "Humanoid",
    76       8 => "Critter",
    77       9 => "Mechanical",
    78       10 => "Not specified",
    79       11 => "Totem" ),
    80     )
    81 );
    82 
    8332?>
  • db/include/bug_report.php

    r109 r113  
    11<?php
    22if($vlozeni_souboru == "OK"){
     3
     4
     5  if( $id == "bugreport" AND !empty($bug) ){
     6    $sql_select = $BasicWiewer->bug($bug);
     7  ## ================== Výpis bugu ================== ##
     8 
     9  if( !empty($sql_select['error']) ){
     10    echo $sql_select['error'];  ?>
     11  <br><p><a href="./index.php?id=sendbug">Pokud chcete nějaké chyby nahlásit pokračujte zde.</a></p>
     12  <?php
     13    }
     14  else{  ?>
     15    <table border="0" id="sendbug" cellspacing="0" cellpadding="2">
     16      <col width="120px;"><col width="160px;">
     17      <tr><td><b>Vlozil:</b></td><td><?php echo preg_replace(array("(\<)","(\>)"), array("&#60;","&#62;"), $sql_select['bug']['nick']); ?></td></tr>
     18      <tr><td><b>Vlozeno:</b></td><td><?php echo @date("H:i d.m.Y", $sql_select['bug']['vlozeno']); ?></td></tr>
     19      <tr><td><b>Status:</b></td><td><?php echo $sql_select['bug']['opraveno']; ?></td></tr>
     20      <tr><td><b>Opravil:</b></td><td><?php echo $sql_select['bug']['opravil_nick']; ?></td></tr>
     21      <tr><td><b>Popis Chyby:</b></td><td></td><td></td></tr>
     22      <tr><td colspan='3' class="text"><?php echo nl2br(preg_replace(array("(\<)","(\>)"), array("&#60;","&#62;"), $sql_select['bug']['popis'])); ?></td></tr>
     23      <?php if( !empty($sql_select['bug']['popis_opravy']) ){ ?>
     24      <tr><td><b>Popis Opravy:</b></td><td></td><td></td></tr>
     25      <tr><td colspan='3' class="text"><?php echo nl2br(preg_replace(array("(\<)","(\>)"), array("&#60;","&#62;"), $sql_select['bug']['popis_opravy'])); ?></td></tr>
     26      <?php }; ?>
     27    </table>
     28   
     29  <br><p><a href="./index.php?id=sendbug">Pokud chcete nějaké chyby nahlásit pokračujte zde.</a></p>
     30      <?php
     31      };
     32  ## ================== Výpis bugu ================== ##
     33    }
     34  elseif( $id == "bugreport" AND empty($bug) ){
     35    $sql_select = $BasicWiewer->bugs($bug,$limit,20);
     36  ## ================== Výpis bugů ================== ##
     37  if( !empty($sql_select['error']) ){
     38    echo $sql_select['error'];  ?>
     39  <br><p><a href="./index.php?id=sendbug">Pokud chcete nějaké chyby nahlásit pokračujte zde.</a></p>
     40  <?php
     41    }
     42  else{
     43    echo $sql_select['result'];  ?>
     44    <br><p><a href="./index.php?id=sendbug">Pokud chcete nějaké chyby nahlásit pokračujte zde.</a></p>
     45    <?php
     46      };
     47  ## ================== Výpis bugů ================== ##
     48    }
     49  elseif( $id == "sendbug" ){
     50    $sql_insert = $BasicWiewer->bugSend();
     51  ## ================== Vložení bugu ================== ##
     52  ?>
     53    <?php echo $sql_insert['result']; ?>
     54    <p>Příspěvky, které se netýkají chyb v databázi, budou nemilosrdně mazány.</p>
     55    <form action="./index.php?id=sendbug" method="post" accept-charset="utf-8">
     56      <table id="sendbug" border="0" cellspacing="0" cellpadding="2">
     57        <tr><td>
     58          <label for="game_nick">Váš nick ve hře:</label></td><td>
     59          <input type="text" name="game_nick" id="game_nick" maxlength="50" style="width:300px;">
     60        </td></tr><tr><td>
     61          <label for="err_type">Typ chyby:</label></td><td>
     62          <select name="err_type" id="err_type" style="width:300px;">
     63            <option value="q">Buglý Úkol (Quest)</option>
     64            <option value="i">Buglá Věc (Item)</option>
     65            <option value="c">Buglý Creep (NPC)</option>
     66            <option value="g">Buglý Objekt ve hře (Gameobject)</option>
     67            <option value="p">Buglá Profese (Profesion)</option>
     68            <option value="s">Buglé Kouzlo (Spell)</option>
     69            <option value="t">Buglý Talent</option>
     70            <option value="o">Jiný</option>
     71          </select>
     72        </td></tr><tr><td colspan='2'>
     73          <label for="typ">Popis chyby:</label></td></tr><tr><td colspan='2'>
     74          <textarea name="popis" id="popis" rows="5" cols="50" style="width:474px;height:100px;"></textarea>
     75        </td></tr><tr><td align='left' valign='top'>
     76          <input type="submit" value="Nahlásit Chybu" name="send"></td><td>
     77        </td></tr>
     78    </table></form>
     79  <?php
     80  ## ================== Vložení bugu ================== ##
     81    };
     82
     83
     84};
    385?>
    4 
    5 <?php if( !empty($sql_select['bug']) AND $id="bugreport" AND !empty($bug) ){ ?>
    6  
    7   <table border="0" id="sendbug" cellspacing="0" cellpadding="2">
    8     <col width="120px;"><col width="160px;">
    9     <tr><td><b>Vlozil:</b></td><td><?php echo preg_replace(array("(\<)","(\>)"), array("&#60;","&#62;"), $sql_select['bug']['nick']); ?></td></tr>
    10     <tr><td><b>Vlozeno:</b></td><td><?php echo @date("H:i d.m.Y", $sql_select['bug']['vlozeno']); ?></td></tr>
    11     <tr><td><b>Status:</b></td><td><?php echo $sql_select['bug']['opraveno']; ?></td></tr>
    12     <tr><td><b>Opravil:</b></td><td><?php echo $sql_select['bug']['opravil_nick']; ?></td></tr>
    13     <tr><td><b>Popis Chyby:</b></td><td></td><td></td></tr>
    14     <tr><td colspan='3' class="text"><?php echo nl2br(preg_replace(array("(\<)","(\>)"), array("&#60;","&#62;"), $sql_select['bug']['popis'])); ?></td></tr>
    15 <?php if( !empty($sql_select['bug']['popis_opravy']) ){ ?>
    16     <tr><td><b>Popis Opravy:</b></td><td></td><td></td></tr>
    17     <tr><td colspan='3' class="text"><?php echo nl2br(preg_replace(array("(\<)","(\>)"), array("&#60;","&#62;"), $sql_select['bug']['popis_opravy'])); ?></td></tr>
    18 <?php }; ?>
    19   </table>
    20  
    21 <br><p><a href="./index.php?id=sendbug">Pokud chcete nějaké chyby nahlásit pokračujte zde.</a></p>
    22 <?php } elseif( !empty($sql_select['result']) AND $id="bugreport" AND empty($bug) ){ ?>
    23   <?php echo $sql_select['result']; ?>
    24 <br><p><a href="./index.php?id=sendbug">Pokud chcete nějaké chyby nahlásit pokračujte zde.</a></p>
    25 <?php } elseif( $id=="sendbug" ){ ?>
    26   <?php echo $sql_insert['result']; ?>
    27   <p>Příspěvky, které se netýkají chyb v databázi, budou nemilosrdně mazány.</p>
    28   <form action="./index.php?id=sendbug" method="post" accept-charset="utf-8">
    29     <table id="sendbug" border="0" cellspacing="0" cellpadding="2">
    30       <tr><td>
    31         <label for="game_nick">Váš nick ve hře:</label></td><td>
    32         <input type="text" name="game_nick" id="game_nick" maxlength="50" style="width:300px;">
    33       </td></tr><tr><td>
    34         <label for="err_type">Typ chyby:</label></td><td>
    35         <select name="err_type" id="err_type" style="width:300px;">
    36           <option value="q">Buglý Úkol (Quest)</option>
    37           <option value="i">Buglá Věc (Item)</option>
    38           <option value="c">Buglý Creep (NPC)</option>
    39           <option value="g">Buglý Objekt ve hře (Gameobject)</option>
    40           <option value="p">Buglá Profese (Profesion)</option>
    41           <option value="s">Buglé Kouzlo (Spell)</option>
    42           <option value="t">Buglý Talent</option>
    43           <option value="o">Jiný</option>
    44         </select>
    45       </td></tr><tr><td colspan='2'>
    46         <label for="typ">Popis chyby:</label></td></tr><tr><td colspan='2'>
    47         <textarea name="popis" id="popis" rows="5" cols="50" style="width:474px;height:100px;"></textarea>
    48       </td></tr><tr><td align='left' valign='top'>
    49         <input type="submit" value="Nahlásit Chybu" name="send"></td><td>
    50       </td></tr>
    51   </table></form>
    52 <?php } elseif( !empty($sql_select['error']) ){ ?>
    53   <?php echo $sql_select['error']; ?>
    54 <br><p><a href="./index.php?id=sendbug">Pokud chcete nějaké chyby nahlásit pokračujte zde.</a></p>
    55 <?php }; ?>
    56 
    57 <?php
    58   };
    59 ?>
  • db/include/creep.php

    r110 r113  
    2323      };
    2424  </script>
     25
     26<?php
     27  $sql_select = $BasicWiewer->creature($creature);
     28?>
    2529
    2630<?php if( empty($sql_select['error']) ){ ?>
  • db/include/creeps.php

    r109 r113  
    11<?php
    22if($vlozeni_souboru == "OK"){
     3?>
     4
     5<?php
     6  $sql_select = $BasicWiewer->searchCreep($q,$limit,20);
    37?>
    48
  • db/include/quest.php

    r82 r113  
    11<?php
    22if($vlozeni_souboru == "OK"){
     3
     4  $nevyresene=0;
     5  $sql_select = $BasicWiewer->quest($quest);
    36?>
    47
     
    710    <tr><td width="30%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    811      <tr><td>ID Questu: <?php echo $sql_select['quest']['entry']; ?></td></tr>
    9       <tr><td>Začíná u:</td></tr>
    10       <tr><td style="padding-left:20px;"><?php echo $sql_select['other']['StartNPC']; ?></td></tr>
     12      <tr><td>Začíná u: <?php echo $sql_select['other']['StartNPC']; ?></td></tr>
     13      <tr><td>Končí u: <?php echo $sql_select['other']['EndNPC']; ?></td></tr>
     14<?php if($nevyresene==1){ //nevyřešeno !!!   ?>
    1115      <tr><td>Oblast:</td></tr>
    1216      <tr><td style="padding-left:20px;"><?php echo "???"; ?></td></tr>
     17<?php }; ?>
    1318      <tr><td>Level: <?php echo $sql_select['quest']['QuestLevel']; ?></td></tr>
    1419      <tr><td>Počet XP: <?php echo $sql_select['quest']['RewXpOrMoney']; ?></td></tr>
     
    1823<?php }; ?>
    1924
    20 <?php $zobrazit=0; if($zobrazit =1){ //nevyřešeno !!!   ?>
     25<?php if($nevyresene==1){ //nevyřešeno !!!   ?>
    2126<?php if( $sql_select['quest']['PrevQuestId']!=0 OR $sql_select['quest']['NextQuestId']!=0 ){ ?>
    2227      <tr><td><b>Návaznost:</b></td></tr>
  • db/include/questy.php

    r92 r113  
    11<?php
    22if($vlozeni_souboru == "OK"){
     3
     4
     5  $sql_select = $BasicWiewer->searchQuest($q,$lvl_d,$lvl_h,$limit,20);
    36?>
    47
  • db/include/uvod.php

    r92 r113  
    1515klidně pište na ICQ 327671143 nebo na E-mail: HosipLan<!-- spam ochrana -->&#64;<!-- spam ochrana -->seznam.cz</p>
    1616
    17 <?php /*
    18 // Tohel tady zatím může strašit..
    19 <h4>Na projektu se podílejí:</h4>
     17<?php // test !!!
    2018
    21 <ul id="ucast">
    22 <li>HosipLan <ul>
    23       <li>Základní struktura stránky</li>
    24       <li>Základní grafika</li>
    25       <li>Hledání questů</li>
    26       <li>Základní výpis Questů</li>
    27       <li>Základní výpis Creepů</li>
    28     </ul></li>
    29 <li>Bbtrash <ul>
    30       <li>Konzultace v nesnázích a psychycká podpora :)</li>
    31       <li>Nějaká ta rada ohledně databáze.</li>
    32     </ul></li>
    33 <li>Chronos <ul>
    34       <li>Konzultace v nesnázích a psychycká podpora :)</li>
    35       <li>Nějaká ta rada ohledně databáze.</li>
    36     </ul></li>
    37 <li>Perihelion <ul>
    38       <li>Konzultace v nesnázích a psychycká podpora :)</li>
    39       <li>Nějaká ta rada ohledně databáze.</li>
    40     </ul></li>
    41 <li>Borci <ul>
    42       <li>Úprava titulního obrázku</li>
    43     </ul></li>
    44 </ul>
     19  //$databaseR->resetSelection('class','2','item');
     20  //print($databaseR->returnResult()."<br>\n");
    4521
    46 <p>Tímto děkuji všem co se jakkoliv zapojili.</p> */
    4722?>
    4823
  • db/index.php

    r109 r113  
    44  if( !empty($session_id) ){ $session = $session_id; };
    55
     6/* =========== Security =========== */
     7  if( isset($_GET['Database']) OR isset($_POST['Database']) ){ unset($_GET['Database']); unset($_POST['Database']); };
     8  if( isset($_GET['DB_read']) OR isset($_POST['DB_read']) ){ unset($_GET['DB_read']); unset($_POST['DB_read']); };
     9  if( isset($_GET['Menu']) OR isset($_POST['Menu']) ){ unset($_GET['Menu']); unset($_POST['Menu']); };
     10  if( isset($_GET['text']) OR isset($_POST['text']) ){ unset($_GET['text']); unset($_POST['text']); };
     11  $klic=array_keys($_POST);
     12  for ($i=0;$i<=count($klic)-1;$i++) {
     13    $_POST[$klic[$i]]=addslashes($_POST[$klic[$i]]);
     14  };
     15  $klic=array_keys($_GET);
     16  for ($i=0;$i<=count($klic)-1;$i++) {
     17    $_GET[$klic[$i]]=addslashes($_GET[$klic[$i]]);
     18  };
     19
    620/* =========== Config aj. =========== */
    721  require_once "./config.php";
    822  require_once "./check_database.php";
     23  require_once "./functions.php";
     24  $databaseR = new CheckDatabaseArray();
    925
    1026/* =========== Připojení k Databázi =========== */
     
    1329
    1430/* =========== Login / Logout =========== */
    15   @mysql_select_db($Config['DB_read']['DB_read']['Database_realmd'])
    16     OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_realmd']."!</p>");
    17   @mysql_query("SET CHARACTER SET utf8");
     31  SwitchDB(2); // nastavení databáze na realmd
    1832
    1933  if( !empty($_POST['username']) AND !empty($_POST['pass']) ){
     
    2741        $login_info = @MySQL_Fetch_Array($sql_user);
    2842
    29       @mysql_select_db($Config['DB_read']['DB_read']['Database_web'])
    30         OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_web']."!</p>");
    31       @mysql_query("SET CHARACTER SET utf8");
     43      SwitchDB(3); // nastavení databáze na web
    3244     
    3345          $sql_active_id_dotaz = @mysql_query("SELECT * FROM `acc_online` WHERE `nick`='".$login_info['username']."' LIMIT 1");
     
    5466      };
    5567
    56   @mysql_select_db($Config['DB_read']['DB_read']['Database_web'])
    57     OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_web']."!</p>");
    58   @mysql_query("SET CHARACTER SET utf8");
     68  SwitchDB(3); // nastavení databáze na web
    5969 
    6070  if( $_GET['id'] == "logout" ){
     
    147157  $Menu = array_merge($Menu, $Menu_add);
    148158
    149 /* =========== Speciální FCE =========== */
    150   function DelNl($str){
    151     $str = @str_replace("\n","",$str);
    152     $str = @str_replace("\r","",$str);
    153     return $str;
    154     };
    155 
    156   function AbsCheck($int){ return (abs($int)==$int)? true : false; };
    157  
    158   function CheckQuestRace(){
    159    
    160     return true;
    161     };
    162 
    163   function StranovaniVypisu($sql, $limit, $nastranu, $adresa, $SID){
    164     global $text;
    165     $pocet_radku = @mysql_num_rows(mysql_query($sql));
    166     if( $pocet_radku > 0 ) {
    167       $listovani = $pocet_radku/10;
    168       $listovani = ceil($listovani);
    169       $listovani = $listovani/($nastranu/10);
    170       $listovani = ceil($listovani);
    171 
    172       if( $listovani == 1 ){
    173         $navigace = "&lt;&lt; &nbsp; &lt; <b>1</b> &gt; &nbsp; &gt;&gt;";
    174         }
    175       elseif( $listovani > 1 ){
    176         $predchozi = $limit-1;
    177         $dalsi = $limit+1;
    178         $posledni = $listovani;
    179         if( $predchozi < 1 ){ $predchozi = 1; };
    180 
    181         if( $listovani <= 10 ){
    182           for( $i=1; ($i<=10)AND($i<=$listovani) ;$i++ ){
    183             if($i==$limit){$navigace['cisla'] .= " <b title=\"".$text['navigation']['onpage'].$text['navigation']['number']." $i\">".$i."</b>\n";}
    184             else{$navigace['cisla'] .= " <a href=\"index.php".$adresa."&amp;list=".$i.$SID."\" title=\"".$text['navigation']['page'].$text['navigation']['number']." $i\">".$i."</a>\n";};
    185             };
    186 
    187           $navigace['zacatek'] = "<a href=\"index.php".$adresa."&amp;list=1".$SID."\" title=\"".$text['navigation']['start']."\">&lt;&lt;</a>"." &nbsp; ";
    188           $navigace['zacatek'] .= "<a href=\"index.php".$adresa."&amp;list=".$predchozi.$SID."\" title=\"".$text['navigation']['previous']."\">&lt;</a> ";
    189           $navigace['konec'] = " <a href=\"index.php".$adresa."&amp;list=".$dalsi.$SID."\" title=\"".$text['navigation']['next']."\">&gt;</a>"." &nbsp; ";
    190           $navigace['konec'] .= "<a href=\"index.php".$adresa."&amp;list=".$posledni.$SID."\" title=\"".$text['navigation']['end']."\">&gt;&gt;</a>";
    191 
    192           if( $limit == 1 ){ $navigace['zacatek'] = "&lt;&lt;"." &nbsp; &lt; "; };
    193           if( $limit == $listovani ){ $navigace['konec'] = " &gt; &nbsp; &gt;&gt;"; };
    194           }
    195         else{
    196           if( $limit <= 6 ){
    197             for( $i=1; ($i<=10) ;$i++ ){
    198               if($i==$limit){$navigace['cisla'] .= " <b title=\"".$text['navigation']['onpage'].$text['navigation']['number']." $i\">".$i."</b>\n";}
    199               else{$navigace['cisla'] .= " <a href=\"index.php".$adresa."&amp;list=".$i.$SID."\" title=\"".$text['navigation']['page'].$text['navigation']['number']." $i\">".$i."</a>\n";};
    200               }; $navigace['cisla'] .= " ... ";
    201             }
    202           elseif( $limit >= 6 AND (($limit+6) <= $listovani) ){
    203             $navigace['cisla'] .= " ... ";
    204            
    205             for( $i=$limit-5; ($i<=$limit+5) ;$i++ ){
    206  
    207               if($i==$limit){$navigace['cisla'] .= " <b title=\"".$text['navigation']['onpage'].$text['navigation']['number']." $i\">".$i."</b>\n";}
    208               else{$navigace['cisla'] .= " <a href=\"index.php".$adresa."&amp;list=".$i.$SID."\" title=\"".$text['navigation']['page'].$text['navigation']['number']." $i\">".$i."</a>\n";};
    209  
    210               }; $navigace['cisla'] .= " ... ";
    211             }
    212           elseif( ($limit+6) >= $listovani ){
    213             $navigace['cisla'] .= " ... ";
    214             for( $i=$listovani-10; ($i<=$listovani) ;$i++ ){
    215               if($i==$limit){$navigace['cisla'] .= " <b title=\"".$text['navigation']['onpage'].$text['navigation']['number']." $i\">".$i."</b>\n";}
    216               else{$navigace['cisla'] .= " <a href=\"index.php".$adresa."&amp;list=".$i.$SID."\" title=\"".$text['navigation']['page'].$text['navigation']['number']." $i\">".$i."</a>\n";};
    217               };
    218             };
    219 
    220           $navigace['zacatek'] = "<a href=\"index.php".$adresa."&amp;list=1".$SID."\" title=\"".$text['navigation']['start']."\">&lt;&lt;</a>"." &nbsp; ";
    221           $navigace['zacatek'] .= "<a href=\"index.php".$adresa."&amp;list=".$predchozi.$SID."\" title=\"".$text['navigation']['previous']."\">&lt;</a> ";
    222           $navigace['konec'] = " <a href=\"index.php".$adresa."&amp;list=".$dalsi.$SID."\" title=\"".$text['navigation']['next']."\">&gt;</a>"." &nbsp; ";
    223           $navigace['konec'] .= "<a href=\"index.php".$adresa."&amp;list=".$posledni.$SID."\" title=\"".$text['navigation']['end']."\">&gt;&gt;</a>";
    224 
    225 
    226           if( $limit == 1 ){ $navigace['zacatek'] = "&lt;&lt;"." &nbsp; &lt; "; };
    227           if( $limit == $listovani ){ $navigace['konec'] = " &gt; &nbsp; &gt;&gt;"; };
    228           };
    229         $navigace = $navigace['zacatek'].$navigace['cisla'].$navigace['konec'];
    230         };
    231      
    232       return $navigace;
    233       }
    234     else{ return FALSE; };
    235     };
    236 
    237   function SQLselect_Strankovani($dotaz, $limit, $nastranu, $adresa, $SID){
    238     $navigace = StranovaniVypisu($dotaz, $limit, $nastranu, $adresa, $SID);
    239     $dotaz =  @mysql_query($dotaz." LIMIT ".(--$limit*10*($nastranu/10)).", $nastranu ");
    240     $vysledek = array( '1'           => $dotaz,
    241                        'strankovani' => $navigace );
    242     return $vysledek;
    243     };
    244 
    245   function GenerateMenu(){
    246     global $Menu;
    247 
    248     $klice = array_keys($Menu);
    249     $klice_count = count($klice);
    250 
    251     for($i=0; $i <= $klice_count ;$i++){
    252         if($Menu[$klice[$i]][0] == 1){ 
    253         if( $inside_submenu == 1 ){ $Generated_Menu .= "          </ul></li>\n"; }
    254         elseif( !empty($Generated_Menu) ){ $Generated_Menu .= "</li>\n"; } unset($inside_submenu);
    255           $Generated_Menu .= "          <li><a href=\"".$Menu[$klice[$i]][1]."\">".$Menu[$klice[$i]][2]."</a>";
    256         $submenu = 1;
    257         }
    258       elseif($Menu[$klice[$i]][0] == 2){
    259         if( $submenu == 1 ){ $Generated_Menu .= "<ul>\n"; }; unset($submenu);
    260           $Generated_Menu .= "            <li><a href=\"".$Menu[$klice[$i]][1]."\">".$Menu[$klice[$i]][2]."</a></li>\n";
    261         $inside_submenu = 1;
    262         }
    263       elseif($Menu[$klice[$i]][0] == 3){
    264         if( $submenu == 1 ){ $Generated_Menu .= "<ul>"; }; unset($submenu);
    265           $Generated_Menu .= "          <li>".$Menu[$klice[$i]][1]."</li>\n";
    266         $inside_submenu = 1;
    267         }
    268       elseif( !empty($Menu[$klice[$i]][0]) AND !empty($Menu[$klice[$i]][1]) AND !empty($Menu[$klice[$i]][2]) ){
    269         $Generated_Menu .= "          <li><a href=\"#\">Chyba !!</a>"; }
    270       else{ $Generated_Menu .= "          </ul></li>\n"; };
    271       };
    272 
    273     return $Generated_Menu;
    274     };
    275 
    276159/* =========== END_TOP =========== */
    277160  $vlozeni_souboru = "OK";
     
    300183
    301184    /* =========== Výchozí databáze =========== */
    302     @mysql_select_db($Config['DB_read']['DB_read']['Database_mangos'])
    303       OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_mangos']."!</p>");
    304     @mysql_query("SET CHARACTER SET utf8");
     185    SwitchDB(1); // nastavení databáze na mangos
     186   
     187    switch($id){
     188      case 'character': $general_include = "./character.php"; break;
     189      default: $general_include = "./hlavni.php"; break;
     190      };
    305191   
    306192    /* =========== Vložení základního souboru =========== */
     
    308194
    309195    require_once "./post_read.php";
    310     require_once "./hlavni.php";
    311          
     196    $BasicWiewer = new BasicWiewer();
     197    $BasicWiewer->setPage($id,$SID);
     198
     199    require_once $general_include;
    312200
    313201  mysql_close(); // odpojíme se od databáze
  • db/post_read.php

    r109 r113  
    22if($vlozeni_souboru == "OK"){
    33
    4 if( !empty($q) AND !empty($id) ){
    5   if( $id == "questy" ){
    6     if( !empty($lvl_d) AND !empty($lvl_h) ){ $where = "(`MinLevel`>='$lvl_d' AND `MinLevel`<='$lvl_h') AND "; };
    7     $sql_select = SQLselect_Strankovani("SELECT * FROM `quest_template` WHERE ( $where`Title` LIKE '%$q%' ) ORDER BY `entry` ASC", $limit, 20, "?id=questy&amp;q=".$q."&amp;lvl_d=".$lvl_d."&amp;lvl_h=".$lvl_h, $SID);
    8     if( @mysql_num_rows($sql_select[1]) > 0 ){ $i = 0;
    9       $sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
    10       $sql_select['result'] .= "<thead><tr><td>Název úkolu</td><td>Min level</td><td>Úkol zadává</td><td>Úkol</td></tr></thead>\n<col width=\"180px\"><col width=\"70px\">";
     4  class BasicWiewer{
     5    var $q; // dotaz na vyhledávání
     6    var $id; // současná stránka
     7    var $limit; // současná stránka
     8    var $nastranu = 20; // počet výsledků hledání které budou vypsány
     9    var $sql_select; // proměnná obsahující všechny výsledky pro výpis
     10    var $SID; // proměnná obsahující imformaci o přihlášení pro předání na konec každého odkazu
     11
     12    // konkrétní proměnné podle toho s čím pracujme
     13    var $quest; // GUID Questu
     14    var $lvl_d; // min. lvl u Questu
     15    var $lvl_h; // max. lvl u Questu
     16    var $bug; // GUID Bugu
     17    var $creature; // GUID Creepa
     18    var $item; // GUID Itemu
     19
     20    // nastavuje vstupní hodnoty
     21    public function setPage($id,$SID){
     22      $this->id = $id;
     23      $this->sid = $SID;
     24      }
     25
     26    public function searchQuest($q,$lvl_d,$lvl_h,$limit,$nastranu){
     27      $this->q = $q;
     28      $this->lvl_d = $lvl_d;
     29      $this->lvl_h = $lvl_h;
     30      $this->limit = $limit;
     31      $this->nastranu = $nastranu;
     32      $this->searchQuests(); // vykonáme hledání
     33      return $this->sql_select;
     34      }
     35
     36    public function searchCreep($q,$limit,$nastranu){
     37      $this->q = $q;
     38      $this->limit = $limit;
     39      $this->nastranu = $nastranu;
     40      $this->searchCreeps(); // vykonáme hledání
     41      return $this->sql_select;
     42      }
     43
     44    public function quest($quest){
     45      $this->quest = $quest;
     46      $this->showQuest(); // získání dat o Questu
     47      return $this->sql_select;
     48      }
     49
     50    public function bugs($bug,$limit,$nastranu){
     51      $this->bug = $bug;
     52      $this->limit = $limit;
     53      $this->nastranu = $nastranu;
     54      $this->showBugs(); // vrací všechny chyby i s navigací pro listování
     55      return $this->sql_select;
     56      }
     57    public function bug($bug){
     58      $this->bug = $bug;
     59      $this->showBug(); // získání dat o konkrétním bugu
     60      return $this->sql_select;
     61      }
     62    public function bugSend(){
     63      $this->sendBug();
     64      return $this->sql_select;
     65      }
     66
     67    public function creature($creature){
     68      $this->creature = $creature;
     69      $this->showCreature(); // získání dat o Creepovy
     70      return $this->sql_select;
     71      }
     72
     73    public function item($item){
     74      $this->item = $item;
     75      # need to complete !!!
     76      return $this->sql_select;
     77      }
     78
     79    public function myAcc(){
     80      $this->showMyAcc(); // získání dat o užvatelově účtu
     81      return $this->sql_select;
     82      }
     83
     84  /* ==================================================
     85   * searchQuests()
     86   *
     87   * Tato funkce vyhledává
     88   * v databázi questy
     89   *
     90  ================================================== */
     91
     92    function searchQuests(){
     93
     94      if( !empty($this->q) AND $this->id == "questy" ){
     95
     96        if( !empty($this->lvl_d) AND !empty($this->lvl_h) ){
     97          $where = "(`MinLevel`>='".$this->lvl_d."' AND `MinLevel`<='".$this->lvl_h."') AND ";
     98          };
     99
     100        $this->sql_select = SQLselect_Strankovani("SELECT * FROM `quest_template` WHERE ( $where`Title` LIKE '%$q%' ) ORDER BY `entry` ASC", $this->limit, $this->nastranu, "?id=questy&amp;q=".$this->q."&amp;lvl_d=".$this->lvl_d."&amp;lvl_h=".$this->lvl_h, $this->sid);
     101        if( @mysql_num_rows($this->sql_select[1]) > 0 ){
     102          $this->sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" cellspacing=\"0\" cellpadding=\"0\">\n";
     103          $this->sql_select['result'] .= "<thead><tr><td>Název úkolu</td><td>Min level</td><td>Úkol zadává</td><td>Úkol</td></tr></thead>\n<col width=\"180px\"><col width=\"70px\">";
     104
     105          while( $result = MySQL_Fetch_Array($this->sql_select[1]) ){
     106            $this->sql_select['result'] .= "  <tr valign='top'>";
     107            $this->sql_select['result'] .= "<td><a href=\"index.php?quest=".$result['entry']."\">".$result['Title']."</a></td>";
     108            $this->sql_select['result'] .= "<td>".$result['MinLevel']."</td>";
     109            $this->sql_select['result'] .= "<td>";
     110
     111              $startovni_creature_dotaz = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$result['entry']." ");
     112              while( $start_creature = @MySQL_Fetch_Array($startovni_creature_dotaz) ){
     113                $this->sql_select['result'] .= "<a href=\"index.php?creature=".$start_creature['entry']."\">".$start_creature['name']."</a><br>";
     114                };
     115              $startovni_gameobject_dotaz = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$result['entry']." ");
     116              while( $start_gameobject = @MySQL_Fetch_Array($startovni_gameobject_dotaz) ){
     117                $this->sql_select['result'] .= "<a href=\"index.php?gameobject=".$start_gameobject['entry']."\">".$start_gameobject['name']."</a><br>";
     118                };
     119
     120            $this->sql_select['result'] .= "</td>";
     121            $this->sql_select['result'] .= "<td>".$result['Objectives']."</td>";
     122            $this->sql_select['result'] .= "</tr>\n";
     123            };
     124
     125          $this->sql_select['result'] .= "</table>\n";
     126          }
     127        else{
     128          $this->sql_select['error'] = "<p>Nebyly nalezeny žádné questy.</p>";
     129          };
     130        return true;
     131        };
     132
     133      return false;
     134      }
     135
     136  /* ==================================================
     137   * searchCreeps()
     138   *
     139   * Tato funkce vyhledává
     140   * v databázi creepy
     141   *
     142  ================================================== */
     143
     144    function searchCreeps(){
     145
     146      if( !empty($this->q) AND $this->id == "creeps" ){
     147
     148          $this->sql_select = SQLselect_Strankovani("SELECT * FROM `creature_template` WHERE ( `name` LIKE '%".$this->q."%' OR `subname` LIKE '%".$this->q."%' ) ORDER BY `entry` ASC", $this->limit, $this->nastranu, "?id=creeps&amp;q=".$this->q, $this->sid);
     149          if( @mysql_num_rows($this->sql_select[1]) > 0 ){
     150            $this->sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" cellspacing=\"0\" cellpadding=\"0\">\n";
     151            $this->sql_select['result'] .= "<thead><tr><td>Název creepa</td><td>Level</td></tr></thead>\n<col><col width=\"70px\">";
     152       
     153            while( $result = MySQL_Fetch_Array($this->sql_select[1]) ){
     154              $this->sql_select['result'] .= "  <tr valign='top'>";
     155              $this->sql_select['result'] .= "<td><a href=\"index.php?creature=".$result['entry']."\">".$result['name']."</a></td>";
     156              if( $result['rank'] != 3 ){
     157                $this->sql_select['result'] .= "<td align='center'>".$result['minlevel']." - ".$result['maxlevel']."</td>";
     158                }
     159              else{
     160                $this->sql_select['result'] .= "<td align='center'>Boss</td>";
     161                };
     162              $this->sql_select['result'] .= "</tr>\n";
     163              };
     164           
     165            $this->sql_select['result'] .= "</table>\n";
     166            }  else{ $this->sql_select['error'] = "<p>Nebyly nalezeny žádní creepové.</p>"; };
     167        return true;
     168        };
     169
     170      return false;
     171      }
     172
     173  /* ==================================================
     174   * showQuest()
     175   *
     176   * Tato funkce vrací konkrétní Quest
     177   * + provádí pár dalších operací s jeho daty
     178   *
     179  ================================================== */
     180
     181    function showQuest(){
     182
     183      if( is_numeric($this->quest) AND empty($this->id) ){
     184
     185        $sql_select['sql'] = mysql_query("SELECT * FROM quest_template WHERE `entry`='".$this->quest."' LIMIT 1");
     186        if( @mysql_num_rows($sql_select['sql']) > 0 ){
     187          $this->sql_select['quest'] = MySQL_Fetch_Array($sql_select['sql']);
     188
     189          // Zjištění creatur a gameobjectů kde se Quest dá vzít
     190          $startovni_NPC_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$this->sql_select['quest']['entry']." ");
     191            if( @mysql_num_rows($startovni_NPC_dotaz_creature) > 0 ){
     192              while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_creature)){
     193              $this->sql_select['other']['StartNPC'] .= "<a href=\"index.php?creature=".$start_NPC['entry']."\">".$start_NPC['name']."</a><br>\n";
     194              }; };
     195          $startovni_NPC_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$this->sql_select['quest']['entry']." ");
     196            if( @mysql_num_rows($startovni_NPC_dotaz_gameobject) > 0 ){
     197              while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_gameobject)){
     198              $this->sql_select['other']['StartNPC'] .= "<a href=\"index.php?gameobject=".$start_NPC['entry']."\">".$start_NPC['name']."</a><br>\n";
     199              }; };
     200          $startovni_dotaz_item = mysql_query("SELECT * FROM item_template WHERE startquest='".$this->sql_select['quest']['entry']."' ");
     201            if( @mysql_num_rows($startovni_dotaz_item) > 0 ){
     202              while($start_NPC = @MySQL_Fetch_Array($startovni_dotaz_item)){
     203              switch($start_NPC['Quality']){
     204                case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break;
     205                case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break;
     206                case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break;
     207                case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break;
     208                case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break;
     209                case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break;
     210                case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break;
     211                };
     212              $this->sql_select['other']['StartNPC'] .= "<a href=\"index.php?item=".$start_NPC['entry']."\"".$sql_select['other']['item_color'].">".$start_NPC['name']."</a><br>\n";
     213              }; };
     214          if( empty($this->sql_select['other']['StartNPC']) ){
     215            $this->sql_select['other']['EndNPC'] = "<b>Úkol není kde začít!</b>"; };
     216
     217          $ukoncovaci_NPC_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_involvedrelation ON creature_involvedrelation.id = creature_template.entry WHERE creature_involvedrelation.quest =".$this->sql_select['quest']['entry']." ");
     218            if( @mysql_num_rows($ukoncovaci_NPC_dotaz_creature) > 0 ){
     219              while($end_NPC = @MySQL_Fetch_Array($ukoncovaci_NPC_dotaz_creature)){
     220              $this->sql_select['other']['EndNPC'] .= "<a href=\"index.php?creature=".$end_NPC['entry']."\">".$end_NPC['name']."</a><br>\n";
     221              }; };
     222          $ukoncovaci_NPC_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_involvedrelation ON gameobject_involvedrelation.id = gameobject_template.entry WHERE gameobject_involvedrelation.quest =".$this->sql_select['quest']['entry']." ");
     223            if( @mysql_num_rows($ukoncovaci_NPC_dotaz_gameobject) > 0 ){
     224              while($end_NPC = @MySQL_Fetch_Array($ukoncovaci_NPC_dotaz_gameobject)){
     225              $this->sql_select['other']['EndNPC'] .= "<a href=\"index.php?gameobject=".$end_NPC['entry']."\">".$end_NPC['name']."</a><br>\n";
     226              }; };
     227          if( empty($this->sql_select['other']['EndNPC']) ){
     228            $this->sql_select['other']['EndNPC'] = "<b>Úkol není kde skončit!</b>"; };
     229
     230          // Zjištění Oblasti
     231          if( AbsCheck($this->sql_select['quest']['ZoneOrSort']) ){  }
     232          else{  };
     233
     234          // Důležitá věc
     235          $SrcItemId_dotaz = mysql_query("SELECT * FROM item_template WHERE entry =".$this->sql_select['quest']['SrcItemId']." LIMIT 1;");
     236          if( @mysql_num_rows($SrcItemId_dotaz) > 0 ){
     237              $SrcItemId = @MySQL_Fetch_Array($SrcItemId_dotaz);
     238              $this->sql_select['other']['SrcItemId'] .= "<a href=\"index.php?item=".$SrcItemId['entry']."\">".$SrcItemId['name']."</a><br>\n";
     239              };
     240
     241            $this->sql_select['quest']['PrevQuestId'];
     242            $this->sql_select['quest']['NextQuestId'];
     243     
     244            $this->sql_select['other']['ReqItems']; // ReqItemId1-4.ReqItemCount1-4
     245     
     246            $this->sql_select['other']['ReqSource']; // ??
     247      /*        ReqSourceId1-4
     248            These fields are used in core quest-drop logic. They allow players to get quest drops which are not quest delivery items (ReqItem stand for this), but needed to create quest delivery by player or needed to cast ReqSpellCasts. ReqSourceId1 is the item_template id of a source item for creation of ReqItemX or casting of ReqSpellCastX. X is the value of ReqSourceRef1. Only items which have a quest drop chance (having QuestChance > 0 in *_loot_template) should be used as sources here.
     249            The same for ReqSourceId2-4
     250            You may define 1, 2, 3 or even all 4 sources for the same ReqItem/ReqSpellCast or use 4 sources for 4 ReqItems/ReqSpellCasts.
     251                ReqSourceCount1-4
     252            Amount of ReqSourceId items the player may gather per unfinished ReqItemId or ReqSpellCast.
     253            So ReqSourceId1 items will drop up to a total amount of (ReqItemCount(ReqSourceRef1) - already owned ReqItemId(ReqSourceRef1)) * ReqSourceCount1. Same for ReqSpellCast objectives.
     254                ReqSourceRef1-4
     255            Should be 0 or 1..4. See ReqSourceId description. */
     256     
     257            $this->sql_select['other']['ReqCreatureOrGOId']; // need to kill/cast
     258      /*    Value > 0: 1.-4. required creature_template ID the player needs to kill/cast on in order to complete the quest.
     259            Value < 0: 1.-4. required gameobject_template ID the player needs to cast on in order to complete the quest.
     260            If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */
     261     
     262            $this->sql_select['other']['ReqSpellCast'];
     263      /*    Spell ID of Spell that needs to be cast in order to fulfill a quest objective.
     264            If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */
     265     
     266            $this->sql_select['other']['ReqSpellCast'];
     267      /*    Spell ID of Spell that needs to be cast in order to fulfill a quest objective.
     268            If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */
     269     
     270            $this->sql_select['other']['RewChoiceItemId']; // !!! RewChoiceItemCount
     271      /*    Id of the 1.-6. Item available for reward choice.  */
     272           
     273            $this->sql_select['other']['RewItemId']; // !!! RewItemCount
     274      /*    1.-4. item Id given for reward (no choice).   */
     275           
    11276 
    12       while( $result = MySQL_Fetch_Array($sql_select[1]) ){
    13         $sql_select['result'] .= "  <tr valign='top'>";
    14         $sql_select['result'] .= "<td><a href=\"index.php?quest=".$result['entry']."\">".$result['Title']."</a></td>";
    15         $sql_select['result'] .= "<td>".$result['MinLevel']."</td>";
    16         $sql_select['result'] .= "<td>";
     277          }
     278        else{
     279          $this->sql_select['error'] = "<p>Quest nebyl nalezen.</p>";
     280          };
     281        return true;
     282        };
     283
     284      return false;
     285      }
     286
     287  /* ==================================================
     288   * showCreature()
     289   *
     290   * Tato funkce vrací konkrétního Creepa
     291   * + provádí pár dalších operací s jeho daty
     292   *
     293  ================================================== */
     294
     295    function showCreature(){
     296
     297      if( is_numeric($this->creature) AND empty($this->id) ){
     298        $this->sql_select['sql'] = mysql_query("SELECT * FROM creature_template WHERE `entry`='".$this->creature."' LIMIT 1");
     299        if( @mysql_num_rows($this->sql_select['sql']) > 0 ){
     300          $this->sql_select['creature'] = MySQL_Fetch_Array($this->sql_select['sql']);
    17301 
    18           $startovni_creature_dotaz = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$result['entry']." ");
    19           while( $start_creature = @MySQL_Fetch_Array($startovni_creature_dotaz) ){
    20             $sql_select['result'] .= "<a href=\"index.php?creature=".$start_creature['entry']."\">".$start_creature['name']."</a><br>";
     302          switch($sql_select['creature']['rank']){
     303            case 0: $sql_select['other']['creature_type'] = "Normal"; break;
     304            case 1: $sql_select['other']['creature_type'] = "Elite"; break;
     305            case 2: $sql_select['other']['creature_type'] = "Rare Elite"; break;
     306            case 3: $sql_select['other']['creature_type'] = "World Boss"; break;
     307            case 4: $sql_select['other']['creature_type'] = "Rare"; break;
    21308            };
    22           $startovni_gameobject_dotaz = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$result['entry']." ");
    23           while( $start_gameobject = @MySQL_Fetch_Array($startovni_gameobject_dotaz) ){
    24             $sql_select['result'] .= "<a href=\"index.php?gameobject=".$start_gameobject['entry']."\">".$start_gameobject['name']."</a><br>";
     309     
     310          $questy_dotaz_creature = mysql_query("SELECT * FROM `creature_questrelation` LEFT JOIN `quest_template` ON `creature_questrelation`.`quest` = `quest_template`.`entry` WHERE (`creature_questrelation`.`id` =".$this->sql_select['creature']['entry']." AND `quest_template`.`PrevQuestId`=0 ) ");
     311            if( @mysql_num_rows($questy_dotaz_creature) > 0 ){
     312              while($quest_NPC = @MySQL_Fetch_Array($questy_dotaz_creature)){
     313                $this->sql_select['other']['creature_quests'] .= "<a href=\"index.php?quest=".$quest_NPC['entry']."\">".$quest_NPC['Title']."</a><br>\n";
     314              }; };
     315     
     316          $drop_creature = mysql_query("SELECT * FROM `creature_loot_template` LEFT JOIN `item_template` ON `creature_loot_template`.`item` = `item_template`.`entry` WHERE `creature_loot_template`.`entry`='".$this->sql_select['creature']['lootid']."' ORDER BY `Quality` DESC, `ChanceOrRef` DESC ");
     317            if( @mysql_num_rows($drop_creature) > 0 ){
     318              while($drop_NPC = @MySQL_Fetch_Array($drop_creature)){
     319                switch($drop_NPC['Quality']){
     320                  case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break;
     321                  case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break;
     322                  case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break;
     323                  case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break;
     324                  case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break;
     325                  case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break;
     326                  case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break;
     327                  };
     328                $this->sql_select['other']['creature_drop'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>";
     329                $this->sql_select['other']['creature_drop'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n";
     330              }; } else{ $this->sql_select['other']['creature_drop'] = "<tr><td colspan='2'>Tento creep nemá žádný drop !</td></tr>"; };
     331     
     332          $pickpocket_creature = mysql_query("SELECT * FROM `pickpocketing_loot_template` LEFT JOIN `item_template` ON `pickpocketing_loot_template`.`item` = `item_template`.`entry` WHERE `pickpocketing_loot_template`.`entry`='".$this->sql_select['creature']['pickpocketloot']."' ORDER BY `Quality` DESC, `ChanceOrRef` DESC ");
     333            if( @mysql_num_rows($pickpocket_creature) > 0 ){
     334              while($drop_NPC = @MySQL_Fetch_Array($pickpocket_creature)){
     335                switch($drop_NPC['Quality']){
     336                  case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break;
     337                  case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break;
     338                  case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break;
     339                  case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break;
     340                  case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break;
     341                  case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break;
     342                  case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break;
     343                  };
     344                $this->sql_select['other']['creature_pickpocket'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>";
     345                $this->sql_select['other']['creature_pickpocket'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n";
     346              }; } else{ $this->sql_select['other']['creature_pickpocket'] = "<tr><td colspan='2'>Tento creep nemá žádný Pickpocket !</td></tr>"; };
     347     
     348          $skin_creature = mysql_query("SELECT * FROM `skinning_loot_template` LEFT JOIN `item_template` ON `skinning_loot_template`.`item` = `item_template`.`entry` WHERE `skinning_loot_template`.`entry`='".$sql_select['creature']['skinloot']."' ORDER BY `Quality` DESC, `ChanceOrRef` DESC ");
     349            if( @mysql_num_rows($skin_creature) > 0 ){
     350              while($drop_NPC = @MySQL_Fetch_Array($skin_creature)){
     351                switch($drop_NPC['Quality']){
     352                  case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break;
     353                  case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break;
     354                  case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break;
     355                  case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break;
     356                  case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break;
     357                  case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break;
     358                  case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break;
     359                  };
     360                $this->sql_select['other']['creature_skin'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>";
     361                $this->sql_select['other']['creature_skin'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n";
     362              }; } else{ $this->sql_select['other']['creature_skin'] = "<tr><td colspan='2'>Tento creep nemá žádný Skin !</td></tr>"; };
     363     
     364            }
     365          else{
     366            $this->sql_select['error'] = "<p>Creep nebyl nalezen.</p>";
    25367            };
    26  
    27         $sql_select['result'] .= "</td>";
    28         $sql_select['result'] .= "<td>".$result['Objectives']."</td>";
    29         $sql_select['result'] .= "</tr>\n";
    30         };
    31      
    32       $sql_select['result'] .= "</table>\n";
    33       }  else{ $sql_select['error'] = "<p>Nebyly nalezeny žádné questy.</p>"; };
    34    
    35     }
    36   elseif( $id == "creeps" ){
    37     $sql_select = SQLselect_Strankovani("SELECT * FROM `creature_template` WHERE ( `name` LIKE '%$q%' OR `subname` LIKE '%$q%' ) ORDER BY `entry` ASC", $limit, 20, "?id=creeps&amp;q=".$q, $SID);
    38     if( @mysql_num_rows($sql_select[1]) > 0 ){ $i = 0;
    39       $sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
    40       $sql_select['result'] .= "<thead><tr><td>Název creepa</td><td>Level</td></tr></thead>\n<col><col width=\"70px\">";
    41  
    42       while( $result = MySQL_Fetch_Array($sql_select[1]) ){
    43         $sql_select['result'] .= "  <tr valign='top'>";
    44         $sql_select['result'] .= "<td><a href=\"index.php?creature=".$result['entry']."\">".$result['name']."</a></td>";
    45         if( $result['rank'] != 3 ){
    46           $sql_select['result'] .= "<td align='center'>".$result['minlevel']." - ".$result['maxlevel']."</td>";
    47           }
    48         else{
    49           $sql_select['result'] .= "<td align='center'>Boss</td>";
    50           };
    51         $sql_select['result'] .= "</tr>\n";
    52         };
    53      
    54       $sql_select['result'] .= "</table>\n";
    55       }  else{ $sql_select['error'] = "<p>Nebyly nalezeny žádní creepové.</p>"; };
    56 
    57     };
    58   }
    59 elseif( !empty($quest) AND empty($id) ){
    60   $sql_select['sql'] = mysql_query("SELECT * FROM quest_template WHERE `entry`='$quest' LIMIT 1;");
    61   if( @mysql_num_rows($sql_select['sql']) > 0 ){ $i = 0;
    62     $result = MySQL_Fetch_Array($sql_select['sql']);
    63     $sql_select['quest'] = $result;
    64 
    65     // Zjištění creatur a gameobjectů kde se Quest dá vzít
    66     $startovni_NPC_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$sql_select['quest']['entry']." ");
    67       if( @mysql_num_rows($startovni_NPC_dotaz_creature) > 0 ){
    68         while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_creature)){
    69         $sql_select['other']['StartNPC'] .= "<a href=\"index.php?creature=".$start_NPC['entry']."\">".$start_NPC['name']."</a><br>\n";
    70         }; };
    71     $startovni_NPC_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$sql_select['quest']['entry']." ");
    72       if( @mysql_num_rows($startovni_NPC_dotaz_gameobject) > 0 ){
    73         while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_gameobject)){
    74         $sql_select['other']['StartNPC'] .= "<a href=\"index.php?gameobject=".$start_NPC['entry']."\">".$start_NPC['name']."</a><br>\n";
    75         }; };
    76     if( empty($sql_select['other']['StartNPC']) ){
    77       $sql_select['other']['StartNPC'] = "<b>Úkol není kde začít!</b>"; }
    78 
    79     // Zjištění Oblasti
    80     if( AbsCheck($sql_select['quest']['ZoneOrSort']) ){ }
    81     else{  };
    82 
    83     // Důležitá věc
    84     $SrcItemId_dotaz = mysql_query("SELECT * FROM item_template WHERE entry =".$sql_select['quest']['SrcItemId']." LIMIT 1;");
    85     if( @mysql_num_rows($SrcItemId_dotaz) > 0 ){
    86         $SrcItemId = @MySQL_Fetch_Array($SrcItemId_dotaz);
    87         $sql_select['other']['SrcItemId'] .= "<a href=\"index.php?item=".$SrcItemId['entry']."\">".$SrcItemId['name']."</a><br>\n";
    88         };
    89 
    90       $sql_select['quest']['PrevQuestId'];
    91       $sql_select['quest']['NextQuestId'];
    92 
    93       $sql_select['other']['ReqItems']; // ReqItemId1-4.ReqItemCount1-4
    94 
    95       $sql_select['other']['ReqSource']; // ??
    96 /*        ReqSourceId1-4
    97       These fields are used in core quest-drop logic. They allow players to get quest drops which are not quest delivery items (ReqItem stand for this), but needed to create quest delivery by player or needed to cast ReqSpellCasts. ReqSourceId1 is the item_template id of a source item for creation of ReqItemX or casting of ReqSpellCastX. X is the value of ReqSourceRef1. Only items which have a quest drop chance (having QuestChance > 0 in *_loot_template) should be used as sources here.
    98       The same for ReqSourceId2-4
    99       You may define 1, 2, 3 or even all 4 sources for the same ReqItem/ReqSpellCast or use 4 sources for 4 ReqItems/ReqSpellCasts.
    100           ReqSourceCount1-4
    101       Amount of ReqSourceId items the player may gather per unfinished ReqItemId or ReqSpellCast.
    102       So ReqSourceId1 items will drop up to a total amount of (ReqItemCount(ReqSourceRef1) - already owned ReqItemId(ReqSourceRef1)) * ReqSourceCount1. Same for ReqSpellCast objectives.
    103           ReqSourceRef1-4
    104       Should be 0 or 1..4. See ReqSourceId description. */
    105 
    106       $sql_select['other']['ReqCreatureOrGOId']; // need to kill/cast
    107 /*    Value > 0: 1.-4. required creature_template ID the player needs to kill/cast on in order to complete the quest.
    108       Value < 0: 1.-4. required gameobject_template ID the player needs to cast on in order to complete the quest.
    109       If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */
    110 
    111       $sql_select['other']['ReqSpellCast'];
    112 /*    Spell ID of Spell that needs to be cast in order to fulfill a quest objective.
    113       If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */
    114 
    115       $sql_select['other']['ReqSpellCast'];
    116 /*    Spell ID of Spell that needs to be cast in order to fulfill a quest objective.
    117       If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */
    118 
    119       $sql_select['other']['RewChoiceItemId']; // !!! RewChoiceItemCount
    120 /*    Id of the 1.-6. Item available for reward choice.  */
    121      
    122       $sql_select['other']['RewItemId']; // !!! RewItemCount
    123 /*    1.-4. item Id given for reward (no choice).   */
    124      
    125 
    126     } else{ $sql_select['error'] = "<p>Quest nebyl nalezen.</p>"; };
    127  
    128   }
    129 elseif( !empty($creature) AND empty($id) ){
    130   $sql_select['sql'] = mysql_query("SELECT * FROM creature_template WHERE `entry`='$creature' LIMIT 1;");
    131   if( @mysql_num_rows($sql_select['sql']) > 0 ){ $i = 0;
    132     $result = MySQL_Fetch_Array($sql_select['sql']);
    133     $sql_select['creature'] = $result;
    134    
    135     switch($sql_select['creature']['rank']){
    136       case 0: $sql_select['other']['creature_type'] = "Normal"; break;
    137       case 1: $sql_select['other']['creature_type'] = "Elite"; break;
    138       case 2: $sql_select['other']['creature_type'] = "Rare Elite"; break;
    139       case 3: $sql_select['other']['creature_type'] = "World Boss"; break;
    140       case 4: $sql_select['other']['creature_type'] = "Rare"; break;
    141       };
    142 
    143     $questy_dotaz_creature = mysql_query("SELECT * FROM `creature_questrelation` LEFT JOIN `quest_template` ON `creature_questrelation`.`quest` = `quest_template`.`entry` WHERE (`creature_questrelation`.`id` =".$sql_select['creature']['entry']." AND `quest_template`.`PrevQuestId`=0 ) ");
    144       if( @mysql_num_rows($questy_dotaz_creature) > 0 ){
    145         while($quest_NPC = @MySQL_Fetch_Array($questy_dotaz_creature)){
    146           $sql_select['other']['creature_quests'] .= "<a href=\"index.php?quest=".$quest_NPC['entry']."\">".$quest_NPC['Title']."</a><br>\n";
    147         }; };
    148 
    149     $drop_creature = mysql_query("SELECT * FROM `creature_loot_template` LEFT JOIN `item_template` ON `creature_loot_template`.`item` = `item_template`.`entry` WHERE `creature_loot_template`.`entry`='".$sql_select['creature']['lootid']."' ORDER BY `Quality` DESC, `ChanceOrRef` DESC ");
    150       if( @mysql_num_rows($drop_creature) > 0 ){
    151         while($drop_NPC = @MySQL_Fetch_Array($drop_creature)){
    152           switch($drop_NPC['Quality']){
    153             case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break;
    154             case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break;
    155             case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break;
    156             case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break;
    157             case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break;
    158             case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break;
    159             case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break;
    160             };
    161           $sql_select['other']['creature_drop'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>";
    162           $sql_select['other']['creature_drop'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n";
    163         }; } else{ $sql_select['other']['creature_drop'] = "<tr><td colspan='2'>Tento creep nemá žádný drop !</td></tr>"; };
    164 
    165     $pickpocket_creature = mysql_query("SELECT * FROM `pickpocketing_loot_template` LEFT JOIN `item_template` ON `pickpocketing_loot_template`.`item` = `item_template`.`entry` WHERE `pickpocketing_loot_template`.`entry`='".$sql_select['creature']['pickpocketloot']."' ORDER BY `Quality` DESC, `ChanceOrRef` DESC ");
    166       if( @mysql_num_rows($pickpocket_creature) > 0 ){
    167         while($drop_NPC = @MySQL_Fetch_Array($pickpocket_creature)){
    168           switch($drop_NPC['Quality']){
    169             case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break;
    170             case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break;
    171             case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break;
    172             case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break;
    173             case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break;
    174             case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break;
    175             case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break;
    176             };
    177           $sql_select['other']['creature_pickpocket'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>";
    178           $sql_select['other']['creature_pickpocket'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n";
    179         }; } else{ $sql_select['other']['creature_pickpocket'] = "<tr><td colspan='2'>Tento creep nemá žádný Pickpocket !</td></tr>"; };
    180 
    181     $skin_creature = mysql_query("SELECT * FROM `skinning_loot_template` LEFT JOIN `item_template` ON `skinning_loot_template`.`item` = `item_template`.`entry` WHERE `skinning_loot_template`.`entry`='".$sql_select['creature']['skinloot']."' ORDER BY `Quality` DESC, `ChanceOrRef` DESC ");
    182       if( @mysql_num_rows($skin_creature) > 0 ){
    183         while($drop_NPC = @MySQL_Fetch_Array($skin_creature)){
    184           switch($drop_NPC['Quality']){
    185             case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break;
    186             case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break;
    187             case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break;
    188             case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break;
    189             case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break;
    190             case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break;
    191             case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break;
    192             };
    193           $sql_select['other']['creature_skin'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>";
    194           $sql_select['other']['creature_skin'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n";
    195         }; } else{ $sql_select['other']['creature_skin'] = "<tr><td colspan='2'>Tento creep nemá žádný Skin !</td></tr>"; };
    196 
    197     } else{ $sql_select['error'] = "<p>Creep nebyl nalezen.</p>"; };
    198  
    199   }
    200 elseif( $id == "bugreport" AND empty($bug) ){
    201   mysql_select_db($Config['DB_read']['DB_read']['Database_web'])
    202     OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_web']."!</p>");
    203     @mysql_query("SET CHARACTER SET utf8"); 
    204 
    205   $sql_select = SQLselect_Strankovani("SELECT * FROM `bug_report` ORDER BY `opraveno` ASC, `vlozeno` DESC", $limit, 20, "?id=bugreport", $SID);
    206   if( @mysql_num_rows($sql_select[1]) > 0 ){ $i = 0;
    207     $sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
    208     $sql_select['result'] .= "<thead><tr><td>Vloženo</td><td>Chyba</td><td align='right'>Status</td></tr></thead>\n<col width=\"120px\"><col><col width=\"60px\">";
    209 
    210     while( $result = MySQL_Fetch_Array($sql_select[1]) ){
    211       $sql_select['result'] .= "<tr><td valign='top'>";
    212       $sql_select['result'] .= "<a href=\"./index.php?id=bugreport&amp;bug=".$result['id']."\">".@date("d.m.Y H:i", $result['vlozeno'])."</a>";
    213       $sql_select['result'] .= "</td><td valign='top'>";
    214       $sql_select['result'] .= nl2br(preg_replace(array("(\<)","(\>)"), array("&#60;","&#62;"), $result['popis']));
    215       $sql_select['result'] .= "</td><td valign='top' align='right'>";
    216       if( $result['opraveno'] == 0 ){
    217         $sql_select['result'] .= "<img src=\"img/aff_cross.gif\" alt=\"ne\" height=\"16\" width=\"16\">"; }
    218       elseif( $result['opraveno'] == 1 ){
    219         $sql_select['result'] .= "<img src=\"img/aff_tick.gif\" alt=\"ne\" height=\"16\" width=\"16\">"; }
    220       $sql_select['result'] .= "</td></tr>\n";
    221       };
    222  
    223     $sql_select['result'] .= "</table>\n";
    224 
    225     } else{ $sql_select['error'] .= "<p>V databázi nejsou záznamy o chybách.</p>"; };
    226 
    227   }
    228 elseif( $id == "bugreport" AND !empty($bug) ){
    229   mysql_select_db($Config['DB_read']['DB_read']['Database_web'])
    230     OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_web']."!</p>");
    231     @mysql_query("SET CHARACTER SET utf8"); 
    232 
    233   $sql_select['sql'] = mysql_query("SELECT * FROM `bug_report` WHERE id=$bug LIMIT 1");
    234   if( @mysql_num_rows($sql_select['sql']) > 0 ){
    235     $result = MySQL_Fetch_Array($sql_select['sql']);
    236       $sql_select['bug'] = $result;
    237       if( empty($sql_select['bug']['opravil_nick']) ){
    238         $sql_select['bug']['opravil_nick'] = "Zatím nikdo"; };
    239       if( $sql_select['bug']['opraveno'] == 0 ){
    240         $sql_select['bug']['opraveno'] = "<img src=\"img/aff_cross.gif\" alt=\"ne\" height=\"16\" width=\"16\"> Čeká na vyřízení"; }
    241       elseif( $sql_select['bug']['opraveno'] == 1 ){
    242         $sql_select['bug']['opraveno'] = "<img src=\"img/aff_tick.gif\" alt=\"ne\" height=\"16\" width=\"16\"> Opraveno"; }
    243     } else{ $sql_select['error'] = "<p>V databázi není záznam s touto chybou.</p>"; };
    244 
    245   }
    246 elseif( $id == "sendbug" AND isset($_POST['send']) ){
    247   mysql_select_db($Config['DB_read']['DB_read']['Database_web'])
    248     OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_web']."!</p>");
    249     @mysql_query("SET CHARACTER SET utf8"); 
    250 
    251   $sql_insert['sql'] = "INSERT INTO `bug_report` (`nick`,`typ`,`vlozeno`,`popis`) VALUES('".$_POST['game_nick']."','".$_POST['err_type']."','".time()."','".$_POST['popis']."')";
    252   if( mysql_query($sql_insert['sql']) ){
    253     $sql_insert['result'] = "<p>Bug byl uložen do databáze.</p>";
    254     }
    255   else{ $sql_insert['result'] = "<p>Bug se nepodařilo uložit do databáze.<br>Zkuste to později znovu prosím.</p>"; };
    256  
    257   }
    258 elseif( $id == "myacc" ){
    259   mysql_select_db($Config['DB_read']['DB_read']['Database_realmd'])
    260     OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_realmd']."!</p>");
    261     @mysql_query("SET CHARACTER SET utf8"); 
    262 
    263   $sql_select['sql'] = mysql_query("SELECT * FROM `account` WHERE `username`='".$user['nick']."' LIMIT 1");
    264   $sql_select['result']['acc'] = @mysql_fetch_array($sql_select['sql']);
    265 
    266   mysql_select_db($Config['DB_read']['DB_read']['Database_mangos'])
    267     OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_mangos']."!</p>");
    268     @mysql_query("SET CHARACTER SET utf8"); 
    269 
    270   $sql_select['sql'] = mysql_query("SELECT * FROM `character` WHERE `account`='".$sql_select['result']['acc']['id']."' ");
    271   $sql_select['result']['char_count'] = @mysql_num_rows($sql_select['sql']);
    272   for($i=0;$sql_select['result']['char'][$i] = @mysql_fetch_array($sql_select['sql']) ;$i++){
    273     $sql_select['result']['char'][$i]['data'] = explode(" ", $sql_select['result']['char'][$i]['data']);
    274     };
    275 
    276   switch($sql_select['result']['acc']['gmlevel']){
    277     case 0: $sql_select['result']['other']['opravneni'] = "Player"; break;
    278     case 1: $sql_select['result']['other']['opravneni'] = "Moderator"; break;
    279     case 2: $sql_select['result']['other']['opravneni'] = "GameMaster"; break;
    280     case 3: $sql_select['result']['other']['opravneni'] = "Administrator"; break;
    281     default: $sql_select['result']['other']['opravneni'] = "unknown";
    282     };
    283 
    284   switch($sql_select['result']['acc']['tbc']){
    285     case 0: $sql_select['result']['other']['version'] = "Normal"; break;
    286     case 1: $sql_select['result']['other']['version'] = "Burning Crusade"; break;
    287     };
    288 
    289   $sql_select['result']['other']['chars'] .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n";
    290   for($i=0; $i < $sql_select['result']['char_count'] ;$i++){
    291     $sql_select['result']['other']['chars'] .= "<tr><td>".$sql_select['result']['char'][$i]['name']."</td>";
    292     $sql_select['result']['other']['chars'] .= "<td title=\"Level\">".$sql_select['result']['char'][$i]['data'][34]."</td>";
    293     $sql_select['result']['other']['chars'] .= "<td title=\"Rasa\">".$Database['race'][$sql_select['result']['char'][$i]['race']]."</td>";
    294     $sql_select['result']['other']['chars'] .= "<td title=\"Povolání\">".$Database['class'][$sql_select['result']['char'][$i]['class']]."</td>\n";
    295     $sql_select['result']['other']['chars'] .= "<td> - <a href=\"./character.php?char=".$sql_select['result']['char'][$i]['guid']."\">Exportovat</a></td></tr>\n";
    296     }; $sql_select['result']['other']['chars'] .= "</table>";
    297 
    298 
    299   };
    300 
    301 
    302 
     368        return true;
     369        };
     370
     371      return false;
     372      }
     373
     374  /* ==================================================
     375   * showBugs()
     376   * showBug()
     377   * sendBug()
     378   *
     379   * Tyto funkce jsou určeny pro práci s Bugreporterem
     380   * showBugs() - vypisuje všechny bugy
     381   * showBug() - vrátí konkrétní bug
     382   * sendBug() - odesílá nový bug do databáze   
     383   *
     384  ================================================== */
     385
     386    function showBugs(){
     387
     388      if( $this->id == "bugreport" AND empty($this->bug) ){
     389        SwitchDB(3); // nastavení databáze na web
     390
     391        $this->sql_select = SQLselect_Strankovani("SELECT * FROM `bug_report` ORDER BY `opraveno` ASC, `vlozeno` DESC", $this->limit, $this->nastranu, "?id=bugreport", $this->sid);
     392        if( @mysql_num_rows($this->sql_select[1]) > 0 ){
     393          $this->sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
     394          $this->sql_select['result'] .= "<thead><tr><td>Vloženo</td><td>Chyba</td><td align='right'>Status</td></tr></thead>\n<col width=\"120px\"><col><col width=\"60px\">\n";
     395     
     396          while( $result = MySQL_Fetch_Array($this->sql_select[1]) ){
     397            $this->sql_select['result'] .= "<tr><td valign='top'>";
     398            $this->sql_select['result'] .= "<a href=\"./index.php?id=bugreport&amp;bug=".$result['id']."\">".@date("d.m.Y H:i", $result['vlozeno'])."</a>";
     399            $this->sql_select['result'] .= "</td><td valign='top'>";
     400            $this->sql_select['result'] .= nl2br(preg_replace(array("(\<)","(\>)"), array("&#60;","&#62;"), $result['popis']));
     401            $this->sql_select['result'] .= "</td><td valign='top' align='right'>";
     402            if( $result['opraveno'] == 0 ){
     403              $this->sql_select['result'] .= "<img src=\"img/aff_cross.gif\" alt=\"ne\" height=\"16\" width=\"16\">"; }
     404            elseif( $result['opraveno'] == 1 ){
     405              $this->sql_select['result'] .= "<img src=\"img/aff_tick.gif\" alt=\"ne\" height=\"16\" width=\"16\">"; }
     406            $this->sql_select['result'] .= "</td></tr>\n";
     407            };
     408       
     409          $this->sql_select['result'] .= "</table>\n";
     410     
     411          }
     412        else{
     413          $this->sql_select['error'] .= "<p>V databázi nejsou záznamy o chybách.</p>";
     414          };
     415        return true;
     416        };
     417
     418      return false;
     419      }
     420
     421    function showBug(){
     422
     423      if( $this->id == "bugreport" AND !empty($this->bug) ){
     424        SwitchDB(3); // nastavení databáze na web
     425     
     426        $this->sql_select['sql'] = mysql_query("SELECT * FROM `bug_report` WHERE id=".$this->bug." LIMIT 1");
     427        if( @mysql_num_rows($this->sql_select['sql']) > 0 ){
     428          $this->sql_select['bug'] = MySQL_Fetch_Array($this->sql_select['sql']);
     429            if( empty($this->sql_select['bug']['opravil_nick']) ){
     430              $this->sql_select['bug']['opravil_nick'] = "Zatím nikdo"; };
     431            if( $this->sql_select['bug']['opraveno'] == 0 ){
     432              $this->sql_select['bug']['opraveno'] = "<img src=\"img/aff_cross.gif\" alt=\"ne\" height=\"16\" width=\"16\"> Čeká na vyřízení"; }
     433            elseif( $this->sql_select['bug']['opraveno'] == 1 ){
     434              $this->sql_select['bug']['opraveno'] = "<img src=\"img/aff_tick.gif\" alt=\"ne\" height=\"16\" width=\"16\"> Opraveno"; }
     435          }
     436        else{
     437          $this->sql_select['error'] = "<p>V databázi není záznam s touto chybou.</p>";
     438          };
     439        return true;
     440        };
     441
     442      return false;
     443      }
     444
     445    function sendBug(){
     446      global $_POST;
     447
     448      if( $this->id == "sendbug" AND isset($_POST['send']) ){
     449        SwitchDB(3); // nastavení databáze na web
     450
     451        $sql_insert['sql'] = "INSERT INTO `bug_report` (`nick`,`typ`,`vlozeno`,`popis`) VALUES('".$_POST['game_nick']."','".$_POST['err_type']."','".time()."','".$_POST['popis']."')";
     452        if( mysql_query($sql_insert['sql']) ){
     453          $this->sql_select['result'] = "<p>Bug byl uložen do databáze.</p>";
     454          }
     455        else{
     456          $this->sql_select['result'] = "<p>Bug se nepodařilo uložit do databáze.<br>Zkuste to později znovu prosím.</p>";
     457          };
     458        return true;
     459        };
     460
     461      return false;
     462      }
     463
     464  /* ==================================================
     465   * showMyAcc()
     466   *
     467   * Tato funkce vrací informace o uživatelově účtu
     468   *
     469  ================================================== */
     470
     471    function showMyAcc(){
     472      global $user, $Database;
     473
     474      if( $this->id == "myacc" ){
     475        SwitchDB(2); // nastavení databáze na realmd
     476
     477        $sql_select['sql'] = mysql_query("SELECT * FROM `account` WHERE `username`='".$user['nick']."' LIMIT 1");
     478        $this->sql_select['result']['acc'] = @mysql_fetch_array($sql_select['sql']);
     479
     480        SwitchDB(1); // nastavení databáze na mangos
     481
     482        $sql_select['sql'] = mysql_query("SELECT * FROM `character` WHERE `account`='".$this->sql_select['result']['acc']['id']."' ");
     483        $this->sql_select['result']['char_count'] = @mysql_num_rows($sql_select['sql']);
     484        for($i=0;$this->sql_select['result']['char'][$i] = @mysql_fetch_array($sql_select['sql']) ;$i++){
     485          $this->sql_select['result']['char'][$i]['data'] = explode(" ", $this->sql_select['result']['char'][$i]['data']);
     486          };
     487
     488        switch($this->sql_select['result']['acc']['gmlevel']){
     489          case 0: $this->sql_select['result']['other']['opravneni'] = "Player"; break;
     490          case 1: $this->sql_select['result']['other']['opravneni'] = "Moderator"; break;
     491          case 2: $this->sql_select['result']['other']['opravneni'] = "GameMaster"; break;
     492          case 3: $this->sql_select['result']['other']['opravneni'] = "Administrator"; break;
     493          default: $this->sql_select['result']['other']['opravneni'] = "unknown";
     494          };
     495
     496        switch($this->sql_select['result']['acc']['tbc']){
     497          case 0: $this->sql_select['result']['other']['version'] = "Normal"; break;
     498          case 1: $this->sql_select['result']['other']['version'] = "Burning Crusade"; break;
     499          };
     500
     501        $this->sql_select['result']['other']['chars'] .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n";
     502        for($i=0; $i < $this->sql_select['result']['char_count'] ;$i++){
     503          $this->sql_select['result']['other']['chars'] .= "<tr><td>".$this->sql_select['result']['char'][$i]['name']."</td>";
     504          $this->sql_select['result']['other']['chars'] .= "<td title=\"Level\">".$this->sql_select['result']['char'][$i]['data'][34]."</td>";
     505          $this->sql_select['result']['other']['chars'] .= "<td title=\"Rasa\">".$Database['race'][$this->sql_select['result']['char'][$i]['race']]."</td>";
     506          $this->sql_select['result']['other']['chars'] .= "<td title=\"Povolání\">".$Database['class'][$this->sql_select['result']['char'][$i]['class']]."</td>\n";
     507          $this->sql_select['result']['other']['chars'] .= "<td> - <a href=\"./character.php?char=".$this->sql_select['result']['char'][$i]['guid']."\">Exportovat</a></td></tr>\n";
     508          };
     509        $this->sql_select['result']['other']['chars'] .= "</table>";
     510
     511        return true;
     512        };
     513
     514      return false;
     515      }
     516
     517
     518    }; // konec třídy
    303519
    304520  }; // vložení souboru
Note: See TracChangeset for help on using the changeset viewer.