Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [SQL]Co to za zapytanie?
Forum PHP.pl > Forum > Przedszkole
assasin
Witam.. czy ktoś może mi objaśnić o co chodzi w tym zapytaniu:
Cytat
UPDATE `creature_template` SET
`mindmg` = 2,
`maxdmg` = 2,
`attackpower` = ROUND((`mindmg` + `maxdmg`) / 4 * 7),
`mindmg` = ROUND(`mindmg` - `attackpower` / 7),
`maxdmg` = ROUND(`maxdmg` - `attackpower` / 7)
WHERE `entry` = ...


? wiem że aktualizuje mindmg i maxdmg a w attackpower ? hmm 4 * 7 ? mnożenie?
Fifi209
Cytat(assasin @ 30.04.2010, 21:46:35 ) *
hmm 4 * 7 ? mnożenie?


No ja widać, mnożenie. ;p
assasin
Ale na jakiej zasadzie działa te zapytanie co mindmg * maxdmg?
Wicepsik
  1. `mindmg` = 2,
  2. `maxdmg` = 2,


blinksmiley.gif
piotrooo89
Cytat(assasin @ 30.04.2010, 22:07:58 ) *
Ale na jakiej zasadzie działa te zapytanie co mindmg * maxdmg?


no jak to na jakiej zasadzie? do podstawówki na mnożenie i dzielenie nie chodziłeś?
assasin
Właśnie chodziłem i mi się nic nie zgadza... man bazę no i jeśli te zapytanie działało by na takiej zasadzie to dlaczego dane są sprzeczne? w mindmg 12 w maxdmg 23 a w attackpower 121
Cytat
The attack power for the creature's melee attacks. This field along with mindmg and maxdmg dictate how much the creature will hit for. The formula in applying correct damages is as follows:

UPDATE `creature_template` SET
`mindmg` = <#1>,
`maxdmg` = <#2>,
`attackpower` = ROUND((`mindmg` + `maxdmg`) / 4 * 7),
`mindmg` = ROUND(`mindmg` - `attackpower` / 7),
`maxdmg` = ROUND(`maxdmg` - `attackpower` / 7)
WHERE `entry` = ...

In the query above, substitute '<#1>' with the minimum damage you want the creature to deal and '<#2>' with the maximum damage you want the creature to deal.

NOTE: You might also want to double check the values calculated after the query is run because if the difference between mindmg and maxdmg is too high, mindmg will end up being a negative value.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.