Scripts/Commands: Fix guid usage and enhance commands
- Fix targeting gameobjects and creatures for .dist and .gps. The old code used DB guid to search from core generated guid lists. - Fix some error messages saying 'no player found' even if creatures and gameobjects and players were searched - Change atoi to atoul when receiving lowguids as string or other uint32 values - Use ObjectGuid::LowType instead of uint32 for lowguid type - Allow .gob info to take in gameobject guid link as well as entry link in addition to gameobject entry and update the documentation of the command - Change .gob delete to post the spawnid (dbguid) instead of the ingame generated guid (which is basically never seen or used by the player in any other commands that I see) - Allow spawntimesecs to be negative when spawning a gameobject - Disable searching by ingame spawn id in commands. (it makes little sense for a user to provide a number which is then attempted to be used as DB guid and non DB guid when both could have a match) - Update .gob turn documentation to tell about possibility to provide orientation in command - Correct the types in .gob add command result trinity_string - Correct the creature search for .npc del - Change .event to .event info - Add .go offset command - Remove the .go command for empty string (no subcommand given) because it just used .go xyz - Extend .gob info to show size, faction, flags and model dimensions - Remove some unnecessary casts - Document .wp show better (first and last were not documented) - Insert spawnid to .wp show info error message - Fix spawntime printing for .gobject target - Fix guid targetting for .npc set movetype - Fix query by spawnid for .wp show info - Fix deleting of existing waypoints when twice doing the command .wp show on - Fix deleting of existing waypoints when doing the command .wp show off - Change wpguid column in DB and in core to uint32, which is what the spawnid type is in core and db.
This commit is contained in:
1 parent
e24178406d
commit
2d54defdf0
14 files changed
+301
-174
No files matched your search
@@ -536,7 +536,7 @@ CREATE TABLE `rbac_linked_permissions` (
|
||||
|
||||
LOCK TABLES `rbac_linked_permissions` WRITE;
|
||||
/*!40000 ALTER TABLE `rbac_linked_permissions` DISABLE KEYS */;
|
||||
INSERT INTO `rbac_linked_permissions` VALUES (192,21),(192,42),(192,43),(192,193),(192,196),(192,778),(192,779),(192,780),(192,781),(192,782),(192,783),(192,784),(192,785),(192,786),(192,787),(192,788),(192,789),(192,790),(192,791),(192,792),(192,793),(192,794),(192,835),(193,48),(193,194),(193,197),(194,1),(194,2),(194,11),(194,13),(194,14),(194,15),(194,16),(194,17),(194,18),(194,19),(194,20),(194,22),(194,23),(194,25),(194,26),(194,27),(194,28),(194,29),(194,30),(194,31),(194,32),(194,33),(194,34),(194,35),(194,36),(194,37),(194,38),(194,39),(194,40),(194,41),(194,44),(194,46),(194,47),(194,195),(194,198),(195,3),(195,4),(195,5),(195,6),(195,24),(195,49),(195,199),(196,200),(196,201),(196,208),(196,212),(196,213),(196,226),(196,227),(196,230),(196,231),(196,233),(196,234),(196,235),(196,238),(196,239),(196,240),(196,241),(196,242),(196,243),(196,244),(196,245),(196,246),(196,247),(196,248),(196,249),(196,250),(196,251),(196,252),(196,253),(196,254),(196,255),(196,256),(196,257),(196,258),(196,259),(196,260),(196,261),(196,262),(196,264),(196,265),(196,266),(196,267),(196,268),(196,269),(196,270),(196,271),(196,272),(196,279),(196,280),(196,283),(196,287),(196,288),(196,289),(196,290),(196,291),(196,292),(196,293),(196,294),(196,295),(196,296),(196,297),(196,298),(196,299),(196,302),(196,303),(196,304),(196,305),(196,306),(196,307),(196,308),(196,309),(196,310),(196,313),(196,314),(196,319),(196,320),(196,321),(196,322),(196,323),(196,324),(196,325),(196,326),(196,327),(196,328),(196,329),(196,330),(196,331),(196,332),(196,333),(196,334),(196,335),(196,336),(196,337),(196,338),(196,339),(196,340),(196,341),(196,342),(196,343),(196,344),(196,345),(196,346),(196,347),(196,348),(196,349),(196,350),(196,351),(196,352),(196,353),(196,354),(196,355),(196,356),(196,357),(196,358),(196,359),(196,360),(196,361),(196,362),(196,363),(196,364),(196,365),(196,366),(196,373),(196,375),(196,400),(196,401),(196,402),(196,403),(196,404),(196,405),(196,406),(196,407),(196,417),(196,418),(196,419),(196,420),(196,421),(196,422),(196,423),(196,424),(196,425),(196,426),(196,427),(196,428),(196,429),(196,434),(196,435),(196,436),(196,437),(196,438),(196,439),(196,440),(196,441),(196,442),(196,443),(196,444),(196,445),(196,446),(196,447),(196,448),(196,449),(196,450),(196,451),(196,452),(196,453),(196,454),(196,455),(196,456),(196,457),(196,458),(196,459),(196,461),(196,463),(196,464),(196,465),(196,472),(196,473),(196,474),(196,475),(196,476),(196,477),(196,478),(196,488),(196,489),(196,491),(196,492),(196,493),(196,495),(196,497),(196,498),(196,499),(196,500),(196,502),(196,503),(196,505),(196,508),(196,511),(196,513),(196,514),(196,516),(196,519),(196,522),(196,523),(196,526),(196,527),(196,529),(196,530),(196,533),(196,535),(196,536),(196,537),(196,538),(196,539),(196,540),(196,541),(196,556),(196,581),(196,582),(196,592),(196,593),(196,596),(196,602),(196,603),(196,604),(196,605),(196,606),(196,607),(196,608),(196,609),(196,610),(196,611),(196,612),(196,613),(196,614),(196,615),(196,616),(196,617),(196,618),(196,619),(196,620),(196,621),(196,622),(196,623),(196,624),(196,625),(196,626),(196,627),(196,628),(196,629),(196,630),(196,631),(194,632),(196,633),(196,634),(196,635),(196,636),(196,637),(196,638),(196,639),(196,640),(196,641),(196,642),(196,643),(196,644),(196,645),(196,646),(196,647),(196,648),(196,649),(196,650),(196,651),(196,652),(196,653),(196,654),(196,655),(196,656),(196,657),(196,658),(196,659),(196,660),(196,661),(196,662),(196,663),(196,664),(196,665),(196,666),(196,667),(196,668),(196,669),(196,670),(196,671),(196,672),(196,673),(196,674),(196,675),(196,676),(196,677),(196,678),(196,679),(196,680),(196,681),(196,682),(196,683),(196,684),(196,685),(196,686),(196,687),(196,688),(196,689),(196,690),(196,691),(196,692),(196,693),(196,694),(196,695),(196,696),(196,697),(196,698),(196,699),(196,700),(196,701),(196,702),(196,703),(196,704),(196,705),(196,706),(196,707),(196,708),(196,709),(196,710),(196,711),(196,712),(196,713),(196,714),(196,715),(196,716),(196,717),(196,718),(196,719),(196,721),(196,722),(196,723),(196,724),(196,725),(196,726),(196,727),(196,728),(196,729),(196,730),(196,733),(196,734),(196,735),(196,736),(196,738),(196,739),(196,748),(196,753),(196,757),(196,773),(196,777),(196,836),(196,837),(196,838),(196,839),(196,840),(196,841),(197,232),(197,236),(197,237),(197,273),(197,274),(197,275),(197,276),(197,277),(197,284),(197,285),(197,286),(197,301),(197,311),(197,387),(197,388),(197,389),(197,390),(197,391),(197,392),(197,393),(197,394),(197,395),(197,396),(197,397),(197,398),(197,399),(197,479),(197,480),(197,481),(197,482),(197,485),(197,486),(197,487),(197,494),(197,506),(197,509),(197,510),(197,517),(197,518),(197,521),(197,542),(197,543),(197,550),(197,558),(197,568),(197,571),(197,572),(197,573),(197,574),(197,575),(197,576),(197,577),(197,578),(197,579),(197,580),(197,583),(197,584),(197,585),(197,586),(197,587),(197,588),(197,589),(197,590),(197,591),(197,594),(197,595),(197,601),(19Line truncated
|
||||
INSERT INTO `rbac_linked_permissions` VALUES (192,21),(192,42),(192,43),(192,193),(192,196),(192,778),(192,779),(192,780),(192,781),(192,782),(192,783),(192,784),(192,785),(192,786),(192,787),(192,788),(192,789),(192,790),(192,791),(192,792),(192,793),(192,794),(192,835),(193,48),(193,194),(193,197),(194,1),(194,2),(194,11),(194,13),(194,14),(194,15),(194,16),(194,17),(194,18),(194,19),(194,20),(194,22),(194,23),(194,25),(194,26),(194,27),(194,28),(194,29),(194,30),(194,31),(194,32),(194,33),(194,34),(194,35),(194,36),(194,37),(194,38),(194,39),(194,40),(194,41),(194,44),(194,46),(194,47),(194,195),(194,198),(195,3),(195,4),(195,5),(195,6),(195,24),(195,49),(195,199),(196,200),(196,201),(196,208),(196,212),(196,213),(196,226),(196,227),(196,230),(196,231),(196,233),(196,234),(196,235),(196,238),(196,239),(196,240),(196,241),(196,242),(196,243),(196,244),(196,245),(196,246),(196,247),(196,248),(196,249),(196,250),(196,251),(196,252),(196,253),(196,254),(196,255),(196,256),(196,257),(196,258),(196,259),(196,260),(196,261),(196,262),(196,264),(196,265),(196,266),(196,267),(196,268),(196,269),(196,270),(196,271),(196,272),(196,279),(196,280),(196,283),(196,287),(196,288),(196,289),(196,290),(196,291),(196,292),(196,293),(196,294),(196,295),(196,296),(196,297),(196,298),(196,299),(196,302),(196,303),(196,304),(196,305),(196,306),(196,307),(196,308),(196,309),(196,310),(196,313),(196,314),(196,319),(196,320),(196,321),(196,322),(196,323),(196,324),(196,325),(196,326),(196,327),(196,328),(196,329),(196,330),(196,331),(196,332),(196,333),(196,334),(196,335),(196,336),(196,337),(196,338),(196,339),(196,340),(196,341),(196,342),(196,343),(196,344),(196,345),(196,346),(196,347),(196,348),(196,349),(196,350),(196,351),(196,352),(196,353),(196,354),(196,355),(196,356),(196,357),(196,358),(196,359),(196,360),(196,361),(196,362),(196,363),(196,364),(196,365),(196,366),(196,373),(196,375),(196,400),(196,401),(196,402),(196,403),(196,404),(196,405),(196,406),(196,407),(196,417),(196,418),(196,419),(196,420),(196,421),(196,422),(196,423),(196,424),(196,425),(196,426),(196,427),(196,428),(196,429),(196,434),(196,435),(196,436),(196,437),(196,438),(196,439),(196,440),(196,441),(196,442),(196,443),(196,444),(196,445),(196,446),(196,447),(196,448),(196,449),(196,450),(196,451),(196,452),(196,453),(196,454),(196,455),(196,456),(196,457),(196,458),(196,459),(196,461),(196,463),(196,464),(196,465),(196,472),(196,473),(196,474),(196,475),(196,476),(196,477),(196,478),(196,488),(196,489),(196,491),(196,492),(196,493),(196,495),(196,497),(196,498),(196,499),(196,500),(196,502),(196,503),(196,505),(196,508),(196,511),(196,513),(196,514),(196,516),(196,519),(196,522),(196,523),(196,526),(196,527),(196,529),(196,530),(196,533),(196,535),(196,536),(196,537),(196,538),(196,539),(196,540),(196,541),(196,556),(196,581),(196,582),(196,592),(196,593),(196,596),(196,602),(196,603),(196,604),(196,605),(196,606),(196,607),(196,608),(196,609),(196,610),(196,611),(196,612),(196,613),(196,614),(196,615),(196,616),(196,617),(196,618),(196,619),(196,620),(196,621),(196,622),(196,623),(196,624),(196,625),(196,626),(196,627),(196,628),(196,629),(196,630),(196,631),(194,632),(196,633),(196,634),(196,635),(196,636),(196,637),(196,638),(196,639),(196,640),(196,641),(196,642),(196,643),(196,644),(196,645),(196,646),(196,647),(196,648),(196,649),(196,650),(196,651),(196,652),(196,653),(196,654),(196,655),(196,656),(196,657),(196,658),(196,659),(196,660),(196,661),(196,662),(196,663),(196,664),(196,665),(196,666),(196,667),(196,668),(196,669),(196,670),(196,671),(196,672),(196,673),(196,674),(196,675),(196,676),(196,677),(196,678),(196,679),(196,680),(196,681),(196,682),(196,683),(196,684),(196,685),(196,686),(196,687),(196,688),(196,689),(196,690),(196,691),(196,692),(196,693),(196,694),(196,695),(196,696),(196,697),(196,698),(196,699),(196,700),(196,701),(196,702),(196,703),(196,704),(196,705),(196,706),(196,707),(196,708),(196,709),(196,710),(196,711),(196,712),(196,713),(196,714),(196,715),(196,716),(196,717),(196,718),(196,719),(196,721),(196,722),(196,723),(196,724),(196,725),(196,726),(196,727),(196,728),(196,729),(196,730),(196,733),(196,734),(196,735),(196,736),(196,738),(196,739),(196,748),(196,753),(196,757),(196,773),(196,777),(196,836),(196,837),(196,838),(196,839),(196,840),(196,841),(197,232),(197,236),(197,237),(197,273),(197,274),(197,275),(197,276),(197,277),(197,284),(197,285),(197,286),(197,301),(197,311),(197,387),(197,388),(197,389),(197,390),(197,391),(197,392),(197,393),(197,394),(197,395),(197,396),(197,397),(197,398),(197,399),(197,479),(197,480),(197,481),(197,482),(197,485),(197,486),(197,487),(197,494),(197,506),(197,509),(197,510),(197,517),(197,518),(197,521),(197,542),(197,543),(197,550),(197,558),(197,568),(197,571),(197,572),(197,573),(197,574),(197,575),(197,576),(197,577),(197,578),(197,579),(197,580),(197,583),(197,584),(197,585),(197,586),(197,587),(197,588),(197,589),(197,590),(197,591),(197,594),(197,595),(197,601),(19Line truncated
|
||||
/*!40000 ALTER TABLE `rbac_linked_permissions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
@@ -560,7 +560,7 @@ CREATE TABLE `rbac_permissions` (
|
||||
|
||||
LOCK TABLES `rbac_permissions` WRITE;
|
||||
/*!40000 ALTER TABLE `rbac_permissions` DISABLE KEYS */;
|
||||
INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(11,'Log GM trades'),(13,'Skip Instance required bosses check'),(14,'Skip character creation team mask check'),(15,'Skip character creation class mask check'),(16,'Skip character creation race mask check'),(17,'Skip character creation reserved name check'),(18,'Skip character creation heroic min level check'),(19,'Skip needed requirements to use channel check'),(20,'Skip disable map check'),(21,'Skip reset talents when used more than allowed check'),(22,'Skip spam chat check'),(23,'Skip over-speed ping check'),(24,'Two side faction characters on the same account'),(25,'Allow say chat between factions'),(26,'Allow channel chat between factions'),(27,'Two side mail interaction'),(28,'See two side who list'),(29,'Add friends of other faction'),(30,'Save character without delay with .save command'),(31,'Use params with .unstuck command'),(32,'Can be assigned tickets with .assign ticket command'),(33,'Notify if a command was not found'),(34,'Check if should appear in list using .gm ingame command'),(35,'See all security levels with who command'),(36,'Filter whispers'),(37,'Use staff badge in chat'),(38,'Resurrect with full Health Points'),(39,'Restore saved gm setting states'),(40,'Allows to add a gm to friend list'),(41,'Use Config option START_GM_LEVEL to assign new character level'),(42,'Allows to use CMSG_WORLD_TELEPORT opcode'),(43,'Allows to use CMSG_WHOIS opcode'),(44,'Receive global GM messages/texts'),(45,'Join channels without announce'),(46,'Change channel settings without being channel moderator'),(47,'Enables lower security than target check'),(48,'Enable IP, Last Login and EMail output in pinfo'),(49,'Forces to enter the email for confirmation on password change'),(50,'Allow user to check his own email with .account'),(192,'Role: Sec Level Administrator'),(193,'Role: Sec Level Gamemaster'),(194,'Role: Sec Level Moderator'),(195,'Role: Sec Level Player'),(196,'Role: Administrator Commands'),(197,'Role: Gamemaster Commands'),(198,'Role: Moderator Commands'),(199,'Role: Player Commands'),(200,'Command: rbac'),(201,'Command: rbac account'),(202,'Command: rbac account list'),(203,'Command: rbac account grant'),(204,'Command: rbac account deny'),(205,'Command: rbac account revoke'),(206,'Command: rbac list'),(207,'Command: battlenetaccount'),(208,'Command: battlenetaccount create'),(209,'Command: battlenetaccount lock country'),(210,'Command: battlenetaccount lock ip'),(211,'Command: battlenetaccount password'),(212,'Command: battlenetaccount set'),(213,'Command: battlenetaccount set password'),(217,'Command: account'),(218,'Command: account addon'),(219,'Command: account create'),(220,'Command: account delete'),(221,'Command: account lock'),(222,'Command: account lock country'),(223,'Command: account lock ip'),(224,'Command: account onlinelist'),(225,'Command: account password'),(226,'Command: account set'),(227,'Command: account set addon'),(228,'Command: account set gmlevel'),(229,'Command: account set password'),(230,'Command: achievement'),(231,'Command: achievement add'),(232,'Command: arena'),(233,'Command: arena captain'),(234,'Command: arena create'),(235,'Command: arena disband'),(236,'Command: arena info'),(237,'Command: arena lookup'),(238,'Command: arena rename'),(239,'Command: ban'),(240,'Command: ban account'),(241,'Command: ban character'),(242,'Command: ban ip'),(243,'Command: ban playeraccount'),(244,'Command: baninfo'),(245,'Command: baninfo account'),(246,'Command: baninfo character'),(247,'Command: baninfo ip'),(248,'Command: banlist'),(249,'Command: banlist account'),(250,'Command: banlist character'),(251,'Command: banlist ip'),(252,'Command: unban'),(253,'Command: unban account'),(254,'Command: unban character'),(255,'Command: unban ip'),(256,'Command: unban playeraccount'),(257,'Command: bf'),(258,'Command: bf start'),(259,'Command: bf stop'),(260,'Command: bf switch'),(261,'Command: bf timer'),(262,'Command: bf enable'),(263,'Command: account email'),(264,'Command: account set sec'),(265,'Command: account set sec email'),(266,'Command: account set sec regmail'),(267,'Command: cast'),(268,'Command: cast back'),(269,'Command: cast dist'),(270,'Command: cast self'),(271,'Command: cast target'),(272,'Command: cast dest'),(273,'Command: character'),(274,'Command: character customize'),(275,'Command: character changefaction'),(276,'Command: character changerace'),(277,'Command: character deleted'),(279,'Command: character deleted list'),(280,'Command: character deleted restore'),(283,'Command: character level'),(284,'Command: character rename'),(285,'Command: character reputation'),(286,'Command: character titles'),(287,'Command: levelup'),(288,'Command: pdump'),(289,'Command: pdump load'),(290,'Command: pdump write'),(291,'Command: cheat'),(292,'Command: cheat casttime'),(293,'Command: cheat cooldown'),(Line truncated
|
||||
INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(11,'Log GM trades'),(13,'Skip Instance required bosses check'),(14,'Skip character creation team mask check'),(15,'Skip character creation class mask check'),(16,'Skip character creation race mask check'),(17,'Skip character creation reserved name check'),(18,'Skip character creation heroic min level check'),(19,'Skip needed requirements to use channel check'),(20,'Skip disable map check'),(21,'Skip reset talents when used more than allowed check'),(22,'Skip spam chat check'),(23,'Skip over-speed ping check'),(24,'Two side faction characters on the same account'),(25,'Allow say chat between factions'),(26,'Allow channel chat between factions'),(27,'Two side mail interaction'),(28,'See two side who list'),(29,'Add friends of other faction'),(30,'Save character without delay with .save command'),(31,'Use params with .unstuck command'),(32,'Can be assigned tickets with .assign ticket command'),(33,'Notify if a command was not found'),(34,'Check if should appear in list using .gm ingame command'),(35,'See all security levels with who command'),(36,'Filter whispers'),(37,'Use staff badge in chat'),(38,'Resurrect with full Health Points'),(39,'Restore saved gm setting states'),(40,'Allows to add a gm to friend list'),(41,'Use Config option START_GM_LEVEL to assign new character level'),(42,'Allows to use CMSG_WORLD_TELEPORT opcode'),(43,'Allows to use CMSG_WHOIS opcode'),(44,'Receive global GM messages/texts'),(45,'Join channels without announce'),(46,'Change channel settings without being channel moderator'),(47,'Enables lower security than target check'),(48,'Enable IP, Last Login and EMail output in pinfo'),(49,'Forces to enter the email for confirmation on password change'),(50,'Allow user to check his own email with .account'),(192,'Role: Sec Level Administrator'),(193,'Role: Sec Level Gamemaster'),(194,'Role: Sec Level Moderator'),(195,'Role: Sec Level Player'),(196,'Role: Administrator Commands'),(197,'Role: Gamemaster Commands'),(198,'Role: Moderator Commands'),(199,'Role: Player Commands'),(200,'Command: rbac'),(201,'Command: rbac account'),(202,'Command: rbac account list'),(203,'Command: rbac account grant'),(204,'Command: rbac account deny'),(205,'Command: rbac account revoke'),(206,'Command: rbac list'),(207,'Command: battlenetaccount'),(208,'Command: battlenetaccount create'),(209,'Command: battlenetaccount lock country'),(210,'Command: battlenetaccount lock ip'),(211,'Command: battlenetaccount password'),(212,'Command: battlenetaccount set'),(213,'Command: battlenetaccount set password'),(217,'Command: account'),(218,'Command: account addon'),(219,'Command: account create'),(220,'Command: account delete'),(221,'Command: account lock'),(222,'Command: account lock country'),(223,'Command: account lock ip'),(224,'Command: account onlinelist'),(225,'Command: account password'),(226,'Command: account set'),(227,'Command: account set addon'),(228,'Command: account set gmlevel'),(229,'Command: account set password'),(230,'Command: achievement'),(231,'Command: achievement add'),(232,'Command: arena'),(233,'Command: arena captain'),(234,'Command: arena create'),(235,'Command: arena disband'),(236,'Command: arena info'),(237,'Command: arena lookup'),(238,'Command: arena rename'),(239,'Command: ban'),(240,'Command: ban account'),(241,'Command: ban character'),(242,'Command: ban ip'),(243,'Command: ban playeraccount'),(244,'Command: baninfo'),(245,'Command: baninfo account'),(246,'Command: baninfo character'),(247,'Command: baninfo ip'),(248,'Command: banlist'),(249,'Command: banlist account'),(250,'Command: banlist character'),(251,'Command: banlist ip'),(252,'Command: unban'),(253,'Command: unban account'),(254,'Command: unban character'),(255,'Command: unban ip'),(256,'Command: unban playeraccount'),(257,'Command: bf'),(258,'Command: bf start'),(259,'Command: bf stop'),(260,'Command: bf switch'),(261,'Command: bf timer'),(262,'Command: bf enable'),(263,'Command: account email'),(264,'Command: account set sec'),(265,'Command: account set sec email'),(266,'Command: account set sec regmail'),(267,'Command: cast'),(268,'Command: cast back'),(269,'Command: cast dist'),(270,'Command: cast self'),(271,'Command: cast target'),(272,'Command: cast dest'),(273,'Command: character'),(274,'Command: character customize'),(275,'Command: character changefaction'),(276,'Command: character changerace'),(277,'Command: character deleted'),(279,'Command: character deleted list'),(280,'Command: character deleted restore'),(283,'Command: character level'),(284,'Command: character rename'),(285,'Command: character reputation'),(286,'Command: character titles'),(287,'Command: levelup'),(288,'Command: pdump'),(289,'Command: pdump load'),(290,'Command: pdump write'),(291,'Command: cheat'),(292,'Command: cheat casttime'),(293,'Command: cheat cooldown'),(Line truncated
|
||||
/*!40000 ALTER TABLE `rbac_permissions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
@@ -650,7 +650,7 @@ CREATE TABLE `updates` (
|
||||
LOCK TABLES `updates` WRITE;
|
||||
/*!40000 ALTER TABLE `updates` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `updates` VALUES ('2014_11_10_00_auth.sql','0E3CB119442D09DD88E967015319BBC8DAFBBFE0','ARCHIVED','2015-03-21 21:44:12',0),('2014_11_10_01_auth.sql','327E77A1DA3546D5275AB249915DD57EDD6FDD3D','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_10_00_auth.sql','821703A96D80F9080074852B5A46E2909C9562EA','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_21_00_auth.sql','CE2E5D2CD82E79C25294539ADED27A1429105B43','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_00_auth.sql','E8C5B74BB45F0F35DEC182C72BACF435C7066FB0','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_01_auth.sql','862961815354DA2746F5F71FBC8155F57CBE75AB','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_02_auth.sql','33E4F94086590768EF5D4855DD43D7DE7C06ADA4','ARCHIVED','2015-03-21 21:44:51',0),('2016_01_13_00_auth.sql','24615CC69B3CD7BB4699874647C35BA86E8A93FD','ARCHIVED','2016-01-14 23:27:07',0),('2016_01_13_00_auth_434.sql','3E88183E1A85D11BFD74CF9A32A725C44AE02EEC','ARCHIVED','2016-01-13 01:19:16',0),('2016_03_12_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-03-12 01:19:16',0),('2016_05_15_00_auth_from_335_was_2016_05_11_00_auth.sql','C593DA4423F344FB10AAA86C20D1E87B','ARCHIVED','',0),('2016_08_28_00_auth.sql','30A76055F50A79629DB82B7BF17CE9B7','ARCHIVED','',0),('2016_09_03_02_auth_from_335_was_2016_06_06_00_auth.sql','8E1989D33A2A6CCC60B3AFAEFCBFD735','ARCHIVED','',0),('2016_09_28_00_auth.sql','1719674D3EE9E8B965BAC4042140D6BD','ARCHIVED','',0),('2016_11_06_00_auth.sql','C3B848943465F7D360EF3E01F46219E6','ARCHIVED','2016-11-06 17:11:18',0),('2017_01_07_00_auth_from_335_was_2017_01_06_00_auth.sql','D471D225E30B746E4A1736D173E83A84','ARCHIVED','2017-01-07 00:00:00',0),('2017_01_12_00_auth.sql','7EB5AAEC12EDD728EB66C89FF5E4C466','ARCHIVED','2017-01-12 00:00:00',0),('2017_02_11_00_auth.sql','16147413149F2EA1AD413FEA9C503093','ARCHIVED','2017-02-11 00:00:00',0),('2017_03_16_00_auth.sql','C1BC73E532180AE4CE5D28AF6A0730DC','RELEASED','2017-02-16 00:00:00',0),('2017_03_20_00_auth_from_335_was_2017_03_17_00_auth.sql','22FBDB54B8BC809C95E4D2AFAF1B249C','ARCHIVED','2017-03-20 16:48:01',0);
|
||||
INSERT INTO `updates` VALUES ('2014_11_10_00_auth.sql','0E3CB119442D09DD88E967015319BBC8DAFBBFE0','ARCHIVED','2015-03-21 21:44:12',0),('2014_11_10_01_auth.sql','327E77A1DA3546D5275AB249915DD57EDD6FDD3D','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_10_00_auth.sql','821703A96D80F9080074852B5A46E2909C9562EA','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_21_00_auth.sql','CE2E5D2CD82E79C25294539ADED27A1429105B43','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_00_auth.sql','E8C5B74BB45F0F35DEC182C72BACF435C7066FB0','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_01_auth.sql','862961815354DA2746F5F71FBC8155F57CBE75AB','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_02_auth.sql','33E4F94086590768EF5D4855DD43D7DE7C06ADA4','ARCHIVED','2015-03-21 21:44:51',0),('2016_01_13_00_auth.sql','24615CC69B3CD7BB4699874647C35BA86E8A93FD','ARCHIVED','2016-01-14 23:27:07',0),('2016_01_13_00_auth_434.sql','3E88183E1A85D11BFD74CF9A32A725C44AE02EEC','ARCHIVED','2016-01-13 01:19:16',0),('2016_03_12_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-03-12 01:19:16',0),('2016_05_15_00_auth_from_335_was_2016_05_11_00_auth.sql','C593DA4423F344FB10AAA86C20D1E87B','ARCHIVED','',0),('2016_08_28_00_auth.sql','30A76055F50A79629DB82B7BF17CE9B7','ARCHIVED','',0),('2016_09_03_02_auth_from_335_was_2016_06_06_00_auth.sql','8E1989D33A2A6CCC60B3AFAEFCBFD735','ARCHIVED','',0),('2016_09_28_00_auth.sql','1719674D3EE9E8B965BAC4042140D6BD','ARCHIVED','',0),('2016_11_06_00_auth.sql','C3B848943465F7D360EF3E01F46219E6','ARCHIVED','2016-11-06 17:11:18',0),('2017_01_07_00_auth_from_335_was_2017_01_06_00_auth.sql','D471D225E30B746E4A1736D173E83A84','ARCHIVED','2017-01-07 00:00:00',0),('2017_01_12_00_auth.sql','7EB5AAEC12EDD728EB66C89FF5E4C466','ARCHIVED','2017-01-12 00:00:00',0),('2017_02_11_00_auth.sql','16147413149F2EA1AD413FEA9C503093','ARCHIVED','2017-02-11 00:00:00',0),('2017_03_16_00_auth.sql','C1BC73E532180AE4CE5D28AF6A0730DC','RELEASED','2017-02-16 00:00:00',0),('2017_03_20_00_auth_from_335_was_2017_03_17_00_auth.sql','22FBDB54B8BC809C95E4D2AFAF1B249C','ARCHIVED','2017-03-20 16:48:01',0),('2017_04_02_00_auth.sql','2420814101287A57800A877BE699AE5F','ARCHIVED','2017-04-02 07:48:01',0);
|
||||
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
--
|
||||
UPDATE `rbac_permissions` SET `name`='Command: event info' WHERE `id`=367;
|
||||
DELETE FROM `rbac_permissions` WHERE `id` = 845;
|
||||
INSERT INTO `rbac_permissions` (`id`, `name`) VALUES (845, 'Command: go offset');
|
||||
DELETE FROM `rbac_linked_permissions` WHERE `id` = 198 AND `linkedId` = 845;
|
||||
INSERT INTO `rbac_linked_permissions` (`id`, `linkedId`) VALUES (198, 845);
|
||||
--
|
||||
@@ -0,0 +1,21 @@
|
||||
--
|
||||
UPDATE `command` SET `help`='Syntax: .gobject turn [guid|link] [oz [oy [ox]]]\r\n\r\nSet the orientation of the gameobject to player\'s orientation or the given orientation.' WHERE `name`='gobject turn';
|
||||
UPDATE `trinity_string` SET `content_default`='>> Add Game Object \'%u\' (%s) (GUID: %u) added at \'%f %f %f\'.' WHERE `entry`=525;
|
||||
UPDATE `command` SET `name`='event info', `help`='Syntax: .event info #event_id\r\nShow details about event with #event_id.' WHERE `name`='event';
|
||||
|
||||
DELETE FROM `trinity_string` WHERE `entry` IN (84, 85, 86);
|
||||
INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
|
||||
(84, 'Size: %f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(85, 'Faction: %u Flags: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(86, 'Model dimensions from center: Max X %f Y %f Z %f Min X %f Y %f Z %f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
DELETE FROM `command` WHERE `name` = "go";
|
||||
DELETE FROM `command` WHERE `name` = "go offset";
|
||||
INSERT INTO `command` (`name`, `permission`, `help`) VALUES ('go offset', 845, 'Syntax: .go offset [x[ y[ z[ o]]]]\nTeleports the player by given offset from his current coordinates.');
|
||||
|
||||
UPDATE `command` SET `help`='Syntax: .gobject info [$entry|$link | guid [$guid|$link]\r \r Query Gameobject information for given gameobject entry, guid or link.\rFor example .gobject info 36\ror .gobject info guid 100' WHERE `name`='gobject info';
|
||||
|
||||
ALTER TABLE `waypoint_data` CHANGE COLUMN `wpguid` `wpguid` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `action_chance`;
|
||||
|
||||
UPDATE `command` SET `help`='Syntax: .wp show $option\nOptions:\non $pathid (or selected creature with loaded path) - Show path\nfirst $pathid (or selected creature with loaded path) - Show first waypoint in path\nlast $pathid (or selected creature with loaded path) - Show last waypoint in path\noff - Hide all paths\ninfo $selected_waypoint - Show info for selected waypoint.' WHERE `name`='wp show';
|
||||
--
|
||||
@@ -749,6 +749,7 @@ enum RBACPermissions
|
||||
RBAC_PERM_COMMAND_RELOAD_CHARACTER_TEMPLATE = 842, // not on 3.3.5a or 4.3.4
|
||||
RBAC_PERM_COMMAND_RELOAD_QUEST_GREETING = 843, // not on 3.3.5a or 4.3.4
|
||||
RBAC_PERM_COMMAND_DEBUG_SEND_PLAYSCENE = 844, // not on 3.3.5a or 4.3.4
|
||||
RBAC_PERM_COMMAND_GO_OFFSET = 845,
|
||||
|
||||
// custom permissions 1000+
|
||||
RBAC_PERM_MAX
|
||||
|
||||
@@ -900,22 +900,31 @@ GameObject* ChatHandler::GetNearbyGameObject()
|
||||
return obj;
|
||||
}
|
||||
|
||||
GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(ObjectGuid::LowType lowguid, uint32 entry)
|
||||
GameObject* ChatHandler::GetObjectFromPlayerMapByDbGuid(ObjectGuid::LowType lowguid)
|
||||
{
|
||||
if (!m_session)
|
||||
return nullptr;
|
||||
auto bounds = m_session->GetPlayer()->GetMap()->GetGameObjectBySpawnIdStore().equal_range(lowguid);
|
||||
if (bounds.first != bounds.second)
|
||||
return bounds.first->second;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
GameObject* obj = pl->GetMap()->GetGameObject(ObjectGuid(HighGuid::GameObject, entry, lowguid));
|
||||
|
||||
if (!obj && sObjectMgr->GetGOData(lowguid)) // guid is DB guid of object
|
||||
Creature* ChatHandler::GetCreatureFromPlayerMapByDbGuid(ObjectGuid::LowType lowguid)
|
||||
{
|
||||
if (!m_session)
|
||||
return nullptr;
|
||||
// Select the first alive creature or a dead one if not found
|
||||
Creature* creature = nullptr;
|
||||
auto bounds = m_session->GetPlayer()->GetMap()->GetCreatureBySpawnIdStore().equal_range(lowguid);
|
||||
for (auto it = bounds.first; it != bounds.second; ++it)
|
||||
{
|
||||
auto bounds = pl->GetMap()->GetGameObjectBySpawnIdStore().equal_range(lowguid);
|
||||
if (bounds.first != bounds.second)
|
||||
obj = bounds.first->second;
|
||||
creature = it->second;
|
||||
if (it->second->IsAlive())
|
||||
break;
|
||||
}
|
||||
|
||||
return obj;
|
||||
return creature;
|
||||
}
|
||||
|
||||
enum SpellLinkType
|
||||
@@ -1005,9 +1014,9 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
|
||||
|
||||
enum GuidLinkType
|
||||
{
|
||||
SPELL_LINK_PLAYER = 0, // must be first for selection in not link case
|
||||
SPELL_LINK_CREATURE = 1,
|
||||
SPELL_LINK_GAMEOBJECT = 2
|
||||
GUID_LINK_PLAYER = 0, // must be first for selection in not link case
|
||||
GUID_LINK_CREATURE = 1,
|
||||
GUID_LINK_GAMEOBJECT = 2
|
||||
};
|
||||
|
||||
static char const* const guidKeys[] =
|
||||
@@ -1018,7 +1027,7 @@ static char const* const guidKeys[] =
|
||||
nullptr
|
||||
};
|
||||
|
||||
ObjectGuid ChatHandler::extractGuidFromLink(char* text)
|
||||
ObjectGuid::LowType ChatHandler::extractLowGuidFromLink(char* text, HighGuid& guidHigh)
|
||||
{
|
||||
int type = 0;
|
||||
|
||||
@@ -1027,46 +1036,41 @@ ObjectGuid ChatHandler::extractGuidFromLink(char* text)
|
||||
// |color|Hplayer:name|h[name]|h|r
|
||||
char* idS = extractKeyFromLink(text, guidKeys, &type);
|
||||
if (!idS)
|
||||
return ObjectGuid::Empty;
|
||||
return 0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case SPELL_LINK_PLAYER:
|
||||
case GUID_LINK_PLAYER:
|
||||
{
|
||||
guidHigh = HighGuid::Player;
|
||||
std::string name = idS;
|
||||
if (!normalizePlayerName(name))
|
||||
return ObjectGuid::Empty;
|
||||
return 0;
|
||||
|
||||
if (Player* player = ObjectAccessor::FindPlayerByName(name))
|
||||
return player->GetGUID();
|
||||
return player->GetGUID().GetCounter();
|
||||
|
||||
if (ObjectGuid guid = sWorld->GetCharacterGuidByName(name))
|
||||
return guid;
|
||||
return guid.GetCounter();
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
return 0;
|
||||
}
|
||||
case SPELL_LINK_CREATURE:
|
||||
case GUID_LINK_CREATURE:
|
||||
{
|
||||
guidHigh = HighGuid::Unit;
|
||||
ObjectGuid::LowType lowguid = atoul(idS);
|
||||
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(lowguid))
|
||||
return ObjectGuid(HighGuid::Unit, data->id, lowguid);
|
||||
else
|
||||
return ObjectGuid::Empty;
|
||||
return lowguid;
|
||||
}
|
||||
case SPELL_LINK_GAMEOBJECT:
|
||||
case GUID_LINK_GAMEOBJECT:
|
||||
{
|
||||
guidHigh = HighGuid::GameObject;
|
||||
ObjectGuid::LowType lowguid = atoul(idS);
|
||||
|
||||
if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
|
||||
return ObjectGuid(HighGuid::GameObject, data->id, lowguid);
|
||||
else
|
||||
return ObjectGuid::Empty;
|
||||
return lowguid;
|
||||
}
|
||||
}
|
||||
|
||||
// unknown type?
|
||||
return ObjectGuid::Empty;
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string ChatHandler::extractPlayerNameFromLink(char* text)
|
||||
|
||||
@@ -131,7 +131,7 @@ class TC_GAME_API ChatHandler
|
||||
char* extractQuotedArg(char* args);
|
||||
|
||||
uint32 extractSpellIdFromLink(char* text);
|
||||
ObjectGuid extractGuidFromLink(char* text);
|
||||
ObjectGuid::LowType extractLowGuidFromLink(char* text, HighGuid& guidHigh);
|
||||
GameTele const* extractGameTeleFromLink(char* text);
|
||||
bool GetPlayerGroupAndGUIDByName(char const* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline = false);
|
||||
std::string extractPlayerNameFromLink(char* text);
|
||||
@@ -142,7 +142,8 @@ class TC_GAME_API ChatHandler
|
||||
std::string GetNameLink(Player* chr) const;
|
||||
|
||||
GameObject* GetNearbyGameObject();
|
||||
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(ObjectGuid::LowType lowguid, uint32 entry);
|
||||
GameObject* GetObjectFromPlayerMapByDbGuid(ObjectGuid::LowType lowguid);
|
||||
Creature* GetCreatureFromPlayerMapByDbGuid(ObjectGuid::LowType lowguid);
|
||||
bool HasSentErrorMessage() const { return sentErrorMessage; }
|
||||
void SetSentErrorMessage(bool val){ sentErrorMessage = val; }
|
||||
|
||||
|
||||
@@ -114,7 +114,10 @@ enum TrinityStrings
|
||||
LANG_PVPSTATS_DISABLED = 81,
|
||||
LANG_COMMAND_NEARGRAVEYARD = 82,
|
||||
LANG_COMMAND_NEARGRAVEYARD_NOTFOUND = 83,
|
||||
// Free 84 - 95
|
||||
LANG_GOINFO_SIZE = 84,
|
||||
LANG_GOINFO_ADDON = 85,
|
||||
LANG_GOINFO_MODEL = 86,
|
||||
// Free 87 - 95
|
||||
|
||||
|
||||
LANG_GUILD_RENAME_ALREADY_EXISTS = 96,
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
if (!achievementId)
|
||||
{
|
||||
if (char* id = handler->extractKeyFromLink((char*)args, "Hachievement"))
|
||||
achievementId = atoi(id);
|
||||
achievementId = atoul(id);
|
||||
if (!achievementId)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
{ "activelist", rbac::RBAC_PERM_COMMAND_EVENT_ACTIVELIST, true, &HandleEventActiveListCommand, "" },
|
||||
{ "start", rbac::RBAC_PERM_COMMAND_EVENT_START, true, &HandleEventStartCommand, "" },
|
||||
{ "stop", rbac::RBAC_PERM_COMMAND_EVENT_STOP, true, &HandleEventStopCommand, "" },
|
||||
{ "", rbac::RBAC_PERM_COMMAND_EVENT, true, &HandleEventInfoCommand, "" },
|
||||
{ "info", rbac::RBAC_PERM_COMMAND_EVENT, true, &HandleEventInfoCommand, "" },
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
uint32 eventId = atoi(id);
|
||||
uint32 eventId = atoul(id);
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
|
||||
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
int32 eventId = atoi(id);
|
||||
int32 eventId = atoul(id);
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
|
||||
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
int32 eventId = atoi(id);
|
||||
int32 eventId = atoul(id);
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
{ "zonexy", rbac::RBAC_PERM_COMMAND_GO_ZONEXY, false, &HandleGoZoneXYCommand, "" },
|
||||
{ "xyz", rbac::RBAC_PERM_COMMAND_GO_XYZ, false, &HandleGoXYZCommand, "" },
|
||||
{ "ticket", rbac::RBAC_PERM_COMMAND_GO_TICKET, false, &HandleGoTicketCommand, "" },
|
||||
{ "", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoXYZCommand, "" },
|
||||
{ "offset", rbac::RBAC_PERM_COMMAND_GO_OFFSET, false, &HandleGoOffsetCommand,
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
int32 entry = atoi(id);
|
||||
uint32 entry = atoul(id);
|
||||
if (!entry)
|
||||
return false;
|
||||
|
||||
@@ -104,17 +104,17 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
int32 guid = atoi(param1);
|
||||
ObjectGuid::LowType guidLow = atoul(param1);
|
||||
|
||||
// Number is invalid - maybe the user specified the mob's name
|
||||
if (!guid)
|
||||
if (!guidLow)
|
||||
{
|
||||
std::string name = param1;
|
||||
WorldDatabase.EscapeString(name);
|
||||
whereClause << ", creature_template WHERE creature.id = creature_template.entry AND creature_template.name " _LIKE_" '" << name << '\'';
|
||||
}
|
||||
else
|
||||
whereClause << "WHERE guid = '" << guid << '\'';
|
||||
whereClause << "WHERE guid = '" << guidLow << '\'';
|
||||
}
|
||||
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT position_x, position_y, position_z, orientation, map FROM creature %s", whereClause.str().c_str());
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
if (!gyId)
|
||||
return false;
|
||||
|
||||
int32 graveyardId = atoi(gyId);
|
||||
uint32 graveyardId = atoul(gyId);
|
||||
|
||||
if (!graveyardId)
|
||||
return false;
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
if (!gridX || !gridY)
|
||||
return false;
|
||||
|
||||
uint32 mapId = id ? (uint32)atoi(id) : player->GetMapId();
|
||||
uint32 mapId = id ? atoul(id) : player->GetMapId();
|
||||
|
||||
// center of grid
|
||||
float x = ((float)atof(gridX) - CENTER_GRID_ID + 0.5f) * SIZE_OF_GRIDS;
|
||||
@@ -264,15 +264,15 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
int32 guid = atoi(id);
|
||||
if (!guid)
|
||||
ObjectGuid::LowType guidLow = atoul(id);
|
||||
if (!guidLow)
|
||||
return false;
|
||||
|
||||
float x, y, z, o;
|
||||
uint32 mapId;
|
||||
|
||||
// by DB guid
|
||||
if (GameObjectData const* goData = sObjectMgr->GetGOData(guid))
|
||||
if (GameObjectData const* goData = sObjectMgr->GetGOData(guidLow))
|
||||
{
|
||||
x = goData->posX;
|
||||
y = goData->posY;
|
||||
@@ -319,7 +319,7 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
int32 nodeId = atoi(id);
|
||||
uint32 nodeId = atoul(id);
|
||||
if (!nodeId)
|
||||
return false;
|
||||
|
||||
@@ -364,7 +364,7 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
int32 areaTriggerId = atoi(id);
|
||||
uint32 areaTriggerId = atoul(id);
|
||||
|
||||
if (!areaTriggerId)
|
||||
return false;
|
||||
@@ -422,7 +422,7 @@ public:
|
||||
if ((x == 0.0f && *zoneX != '0') || (y == 0.0f && *zoneY != '0'))
|
||||
return false;
|
||||
|
||||
uint32 areaId = id ? (uint32)atoi(id) : player->GetZoneId();
|
||||
uint32 areaId = id ? atoul(id) : player->GetZoneId();
|
||||
|
||||
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(areaId);
|
||||
|
||||
@@ -492,7 +492,7 @@ public:
|
||||
float y = (float)atof(goY);
|
||||
float z;
|
||||
float ort = port ? (float)atof(port) : player->GetOrientation();
|
||||
uint32 mapId = id ? (uint32)atoi(id) : player->GetMapId();
|
||||
uint32 mapId = id ? atoul(id) : player->GetMapId();
|
||||
|
||||
if (goZ)
|
||||
{
|
||||
@@ -539,7 +539,7 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
uint32 ticketId = atoi(id);
|
||||
uint32 ticketId = atoul(id);
|
||||
if (!ticketId)
|
||||
return false;
|
||||
|
||||
@@ -564,6 +564,51 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static bool HandleGoOffsetCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
char* goX = strtok((char*)args, " ");
|
||||
char* goY = strtok(NULL, " ");
|
||||
char* goZ = strtok(NULL, " ");
|
||||
char* port = strtok(NULL, " ");
|
||||
|
||||
float x, y, z, o;
|
||||
player->GetPosition(x, y, z, o);
|
||||
if (goX)
|
||||
x += atof(goX);
|
||||
if (goY)
|
||||
y += atof(goY);
|
||||
if (goZ)
|
||||
z += atof(goZ);
|
||||
if (port)
|
||||
o += atof(port);
|
||||
|
||||
if (!Trinity::IsValidMapCoord(x, y, z, o))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, player->GetMapId());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
|
||||
player->TeleportTo(player->GetMapId(), x, y, z, o);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_go_commandscript()
|
||||
{
|
||||
new go_commandscript();
|
||||
|
||||
@@ -77,16 +77,11 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
ObjectGuid::LowType guidLow = atoi(id);
|
||||
ObjectGuid::LowType guidLow = atoul(id);
|
||||
if (!guidLow)
|
||||
return false;
|
||||
|
||||
GameObject* object = NULL;
|
||||
|
||||
// by DB guid
|
||||
if (GameObjectData const* goData = sObjectMgr->GetGOData(guidLow))
|
||||
object = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(guidLow, goData->id);
|
||||
|
||||
GameObject* object = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, guidLow);
|
||||
@@ -154,7 +149,7 @@ public:
|
||||
|
||||
if (spawntimeSecs)
|
||||
{
|
||||
uint32 value = atoi((char*)spawntimeSecs);
|
||||
int32 value = atoi((char*)spawntimeSecs);
|
||||
object->SetRespawnTime(value);
|
||||
}
|
||||
|
||||
@@ -197,10 +192,10 @@ public:
|
||||
uint32 spawntm = 300;
|
||||
|
||||
if (spawntime)
|
||||
spawntm = atoi((char*)spawntime);
|
||||
spawntm = atoul(spawntime);
|
||||
|
||||
G3D::Quat rotation = G3D::Matrix3::fromEulerAnglesZYX(player->GetOrientation(), 0.f, 0.f);
|
||||
uint32 objectId = atoi(id);
|
||||
uint32 objectId = atoul(id);
|
||||
|
||||
if (!sObjectMgr->GetGameObjectTemplate(objectId))
|
||||
{
|
||||
@@ -314,7 +309,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
GameObject* target = handler->GetSession()->GetPlayer()->GetMap()->GetGameObject(ObjectGuid(HighGuid::GameObject, id, guidLow));
|
||||
GameObject* target = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_DETAIL, guidLow, objectInfo->name.c_str(), guidLow, id, x, y, z, mapId, o, phase);
|
||||
|
||||
@@ -340,16 +335,11 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
ObjectGuid::LowType guidLow = atoi(id);
|
||||
ObjectGuid::LowType guidLow = atoul(id);
|
||||
if (!guidLow)
|
||||
return false;
|
||||
|
||||
GameObject* object = NULL;
|
||||
|
||||
// by DB guid
|
||||
if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
|
||||
object = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(guidLow, gameObjectData->id);
|
||||
|
||||
GameObject* object = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, guidLow);
|
||||
@@ -363,7 +353,7 @@ public:
|
||||
Unit* owner = ObjectAccessor::GetUnit(*handler->GetSession()->GetPlayer(), ownerGuid);
|
||||
if (!owner || !ownerGuid.IsPlayer())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, ownerGuid.GetCounter(), object->GetGUID().GetCounter());
|
||||
handler->PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, ownerGuid.GetCounter(), guidLow);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -375,7 +365,7 @@ public:
|
||||
object->Delete();
|
||||
object->DeleteFromDB();
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_DELOBJMESSAGE, object->GetGUID().GetCounter());
|
||||
handler->PSendSysMessage(LANG_COMMAND_DELOBJMESSAGE, object->GetSpawnId());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -388,16 +378,11 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
ObjectGuid::LowType guidLow = atoi(id);
|
||||
ObjectGuid::LowType guidLow = atoul(id);
|
||||
if (!guidLow)
|
||||
return false;
|
||||
|
||||
GameObject* object = NULL;
|
||||
|
||||
// by DB guid
|
||||
if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
|
||||
object = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(guidLow, gameObjectData->id);
|
||||
|
||||
GameObject* object = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, guidLow);
|
||||
@@ -444,16 +429,11 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
ObjectGuid::LowType guidLow = atoi(id);
|
||||
ObjectGuid::LowType guidLow = atoul(id);
|
||||
if (!guidLow)
|
||||
return false;
|
||||
|
||||
GameObject* object = NULL;
|
||||
|
||||
// by DB guid
|
||||
if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
|
||||
object = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(guidLow, gameObjectData->id);
|
||||
|
||||
GameObject* object = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, guidLow);
|
||||
@@ -504,16 +484,11 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
ObjectGuid::LowType guidLow = atoi(id);
|
||||
ObjectGuid::LowType guidLow = atoul(id);
|
||||
if (!guidLow)
|
||||
return false;
|
||||
|
||||
GameObject* object = NULL;
|
||||
|
||||
// by DB guid
|
||||
if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
|
||||
object = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(guidLow, gameObjectData->id);
|
||||
|
||||
GameObject* object = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, guidLow);
|
||||
@@ -590,13 +565,28 @@ public:
|
||||
uint32 lootId = 0;
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char* param1 = handler->extractKeyFromLink((char*)args, "Hgameobject_entry");
|
||||
if (!param1)
|
||||
return false;
|
||||
|
||||
if (strcmp(param1, "guid") == 0)
|
||||
{
|
||||
if (WorldObject* object = handler->getSelectedObject())
|
||||
entry = object->GetEntry();
|
||||
else
|
||||
entry = atoi((char*)args);
|
||||
} else
|
||||
entry = atoi((char*)args);
|
||||
char* tail = strtok(nullptr, "");
|
||||
char* cValue = handler->extractKeyFromLink(tail, "Hgameobject");
|
||||
if (!cValue)
|
||||
return false;
|
||||
ObjectGuid::LowType guidLow = atoul(cValue);
|
||||
const GameObjectData* data = sObjectMgr->GetGOData(guidLow);
|
||||
if (!data)
|
||||
return false;
|
||||
entry = data->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = atoul(param1);
|
||||
}
|
||||
|
||||
GameObjectTemplate const* gameObjectInfo = sObjectMgr->GetGameObjectTemplate(entry);
|
||||
|
||||
@@ -616,7 +606,14 @@ public:
|
||||
handler->PSendSysMessage(LANG_GOINFO_LOOTID, lootId);
|
||||
handler->PSendSysMessage(LANG_GOINFO_DISPLAYID, displayId);
|
||||
handler->PSendSysMessage(LANG_GOINFO_NAME, name.c_str());
|
||||
handler->PSendSysMessage(LANG_GOINFO_SIZE, gameObjectInfo->size);
|
||||
|
||||
if (GameObjectTemplateAddon const* addon = sObjectMgr->GetGameObjectTemplateAddon(entry))
|
||||
handler->PSendSysMessage(LANG_GOINFO_ADDON, addon->faction, addon->flags);
|
||||
|
||||
if (GameObjectDisplayInfoEntry const* modelInfo = sGameObjectDisplayInfoStore.LookupEntry(displayId))
|
||||
handler->PSendSysMessage(LANG_GOINFO_MODEL, modelInfo->maxX, modelInfo->maxY, modelInfo->maxZ, modelInfo->minX, modelInfo->minY, modelInfo->minZ);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -627,15 +624,11 @@ public:
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
ObjectGuid::LowType guidLow = atoi(id);
|
||||
ObjectGuid::LowType guidLow = atoul(id);
|
||||
if (!guidLow)
|
||||
return false;
|
||||
|
||||
GameObject* object = NULL;
|
||||
|
||||
if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
|
||||
object = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(guidLow, gameObjectData->id);
|
||||
|
||||
GameObject* object = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, guidLow);
|
||||
|
||||
@@ -164,24 +164,54 @@ public:
|
||||
|
||||
static bool HandleGPSCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
WorldObject* object = NULL;
|
||||
WorldObject* object = nullptr;
|
||||
if (*args)
|
||||
{
|
||||
ObjectGuid guid = handler->extractGuidFromLink((char*)args);
|
||||
if (guid)
|
||||
object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
|
||||
|
||||
if (!object)
|
||||
{
|
||||
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
HighGuid guidHigh;
|
||||
ObjectGuid::LowType guidLow = handler->extractLowGuidFromLink((char*)args, guidHigh);
|
||||
if (!guidLow)
|
||||
return false;
|
||||
switch (guidHigh)
|
||||
{
|
||||
case HighGuid::Player:
|
||||
{
|
||||
object = sObjectMgr->GetPlayerByLowGUID(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HighGuid::Unit:
|
||||
{
|
||||
object = handler->GetCreatureFromPlayerMapByDbGuid(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_NOCREATUREFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HighGuid::GameObject:
|
||||
{
|
||||
object = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_NOGAMEOBJECTFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
if (!object)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
object = handler->getSelectedUnit();
|
||||
|
||||
if (!object)
|
||||
{
|
||||
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||
@@ -763,26 +793,55 @@ public:
|
||||
|
||||
static bool HandleGetDistanceCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
WorldObject* obj = NULL;
|
||||
|
||||
WorldObject* object = nullptr;
|
||||
if (*args)
|
||||
{
|
||||
ObjectGuid guid = handler->extractGuidFromLink((char*)args);
|
||||
if (guid)
|
||||
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
|
||||
|
||||
if (!obj)
|
||||
{
|
||||
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
HighGuid guidHigh;
|
||||
ObjectGuid::LowType guidLow = handler->extractLowGuidFromLink((char*)args, guidHigh);
|
||||
if (!guidLow)
|
||||
return false;
|
||||
switch (guidHigh)
|
||||
{
|
||||
case HighGuid::Player:
|
||||
{
|
||||
object = sObjectMgr->GetPlayerByLowGUID(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HighGuid::Unit:
|
||||
{
|
||||
object = handler->GetCreatureFromPlayerMapByDbGuid(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_NOCREATUREFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HighGuid::GameObject:
|
||||
{
|
||||
object = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!object)
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_NOGAMEOBJECTFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
if (!object)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = handler->getSelectedUnit();
|
||||
|
||||
if (!obj)
|
||||
object = handler->getSelectedUnit();
|
||||
if (!object)
|
||||
{
|
||||
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -790,7 +849,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_DISTANCE, handler->GetSession()->GetPlayer()->GetDistance(obj), handler->GetSession()->GetPlayer()->GetDistance2d(obj), handler->GetSession()->GetPlayer()->GetExactDist(obj), handler->GetSession()->GetPlayer()->GetExactDist2d(obj));
|
||||
handler->PSendSysMessage(LANG_DISTANCE, handler->GetSession()->GetPlayer()->GetDistance(object), handler->GetSession()->GetPlayer()->GetDistance2d(object), handler->GetSession()->GetPlayer()->GetExactDist(object), handler->GetSession()->GetPlayer()->GetExactDist2d(object));
|
||||
return true;
|
||||
}
|
||||
// Teleport player to last position
|
||||
@@ -2178,8 +2237,8 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 guid = atoi(guidStr);
|
||||
if (!guid)
|
||||
ObjectGuid::LowType guidLow = atoul(guidStr);
|
||||
if (!guidLow)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -2204,14 +2263,10 @@ public:
|
||||
|
||||
if (Player* player = handler->GetSession()->GetPlayer())
|
||||
{
|
||||
GameObject* go = NULL;
|
||||
|
||||
if (GameObjectData const* goData = sObjectMgr->GetGOData(guid))
|
||||
go = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(guid, goData->id);
|
||||
|
||||
GameObject* go = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!go)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, guid);
|
||||
handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, guidLow);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -2224,7 +2279,7 @@ public:
|
||||
}
|
||||
|
||||
go->ModifyHealth(-damage, player);
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_DAMAGED, go->GetName().c_str(), guid, -damage, go->GetGOValue()->Building.Health);
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_DAMAGED, go->GetName().c_str(), guidLow, -damage, go->GetGOValue()->Building.Health);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
if (!charID)
|
||||
return false;
|
||||
|
||||
uint32 id = atoi(charID);
|
||||
uint32 id = atoul(charID);
|
||||
if (!sObjectMgr->GetCreatureTemplate(id))
|
||||
return false;
|
||||
|
||||
@@ -373,7 +373,7 @@ public:
|
||||
char* guidStr = strtok((char*)args, " ");
|
||||
char* waitStr = strtok((char*)nullptr, " ");
|
||||
|
||||
ObjectGuid::LowType lowGuid = atoi((char*)guidStr);
|
||||
ObjectGuid::LowType lowGuid = atoul((char*)guidStr);
|
||||
|
||||
// attempt check creature existence by DB data
|
||||
CreatureData const* data = sObjectMgr->GetCreatureData(lowGuid);
|
||||
@@ -422,7 +422,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 newEntryNum = atoi(args);
|
||||
uint32 newEntryNum = atoul(args);
|
||||
if (!newEntryNum)
|
||||
return false;
|
||||
|
||||
@@ -447,7 +447,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint8 lvl = (uint8) atoi((char*)args);
|
||||
uint8 lvl = (uint8) atoi(args);
|
||||
if (lvl < 1 || lvl > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) + 3)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
@@ -482,12 +482,10 @@ public:
|
||||
if (!cId)
|
||||
return false;
|
||||
|
||||
ObjectGuid::LowType lowguid = atoi(cId);
|
||||
ObjectGuid::LowType lowguid = atoul(cId);
|
||||
if (!lowguid)
|
||||
return false;
|
||||
|
||||
if (CreatureData const* cr_data = sObjectMgr->GetCreatureData(lowguid))
|
||||
unit = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HighGuid::Unit, cr_data->id, lowguid));
|
||||
unit = handler->GetCreatureFromPlayerMapByDbGuid(lowguid);
|
||||
}
|
||||
else
|
||||
unit = handler->getSelectedCreature();
|
||||
@@ -553,7 +551,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 factionId = (uint32) atoi((char*)args);
|
||||
uint32 factionId = atoul(args);
|
||||
|
||||
if (!sFactionTemplateStore.LookupEntry(factionId))
|
||||
{
|
||||
@@ -596,7 +594,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 npcFlags = (uint32) atoi((char*)args);
|
||||
uint32 npcFlags = (uint32) atoi(args);
|
||||
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
|
||||
@@ -796,7 +794,7 @@ public:
|
||||
if (!cId)
|
||||
return false;
|
||||
|
||||
lowguid = atoi(cId);
|
||||
lowguid = atoul(cId);
|
||||
|
||||
// Attempting creature load from DB data
|
||||
CreatureData const* data = sObjectMgr->GetCreatureData(lowguid);
|
||||
@@ -882,7 +880,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 displayId = (uint32) atoi((char*)args);
|
||||
uint32 displayId = atoul(args);
|
||||
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
|
||||
@@ -976,12 +974,10 @@ public:
|
||||
}
|
||||
else // case .setmovetype #creature_guid $move_type (with selected creature)
|
||||
{
|
||||
lowguid = atoi((char*)guid_str);
|
||||
lowguid = atoul(guid_str);
|
||||
|
||||
/* impossible without entry
|
||||
if (lowguid)
|
||||
creature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(), MAKE_GUID(lowguid, HighGuid::Unit));
|
||||
*/
|
||||
creature = handler->GetCreatureFromPlayerMapByDbGuid(lowguid);
|
||||
|
||||
// attempt check creature existence by DB data
|
||||
if (!creature)
|
||||
@@ -1084,7 +1080,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 phase = (uint32) atoi((char*)args);
|
||||
uint32 phase = atoul(args);
|
||||
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
if (!creature || creature->IsPet())
|
||||
@@ -1160,7 +1156,7 @@ public:
|
||||
if (!stime)
|
||||
return false;
|
||||
|
||||
int spawnTime = atoi((char*)stime);
|
||||
int spawnTime = atoi(stime);
|
||||
|
||||
if (spawnTime < 0)
|
||||
{
|
||||
@@ -1359,7 +1355,7 @@ public:
|
||||
|
||||
Player* chr = handler->GetSession()->GetPlayer();
|
||||
|
||||
uint32 id = atoi(charID);
|
||||
uint32 id = atoul(charID);
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
@@ -1488,7 +1484,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
ObjectGuid::LowType leaderGUID = (uint32) atoi((char*)args);
|
||||
ObjectGuid::LowType leaderGUID = atoul(args);
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
|
||||
if (!creature || !creature->GetSpawnId())
|
||||
@@ -1540,7 +1536,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
ObjectGuid::LowType linkguid = (uint32) atoi((char*)args);
|
||||
ObjectGuid::LowType linkguid = atoul(args);
|
||||
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
|
||||
|
||||
@@ -751,7 +751,7 @@ public:
|
||||
if (target)
|
||||
handler->SendSysMessage(LANG_WAYPOINT_CREATSELECTED);
|
||||
|
||||
pathid = atoi((char*)guid_str);
|
||||
pathid = atoul(guid_str);
|
||||
}
|
||||
|
||||
std::string show = show_str;
|
||||
@@ -770,12 +770,12 @@ public:
|
||||
}
|
||||
|
||||
stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_ALL_BY_WPGUID);
|
||||
stmt->setUInt32(0, target->GetGUID().GetCounter());
|
||||
stmt->setUInt32(0, target->GetSpawnId());
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
handler->SendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM);
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, target->GetSpawnId());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -830,7 +830,7 @@ public:
|
||||
{
|
||||
Field* fields = result2->Fetch();
|
||||
uint32 wpguid = fields[0].GetUInt32();
|
||||
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HighGuid::Unit, VISUAL_WAYPOINT, wpguid));
|
||||
Creature* creature = handler->GetCreatureFromPlayerMapByDbGuid(wpguid);
|
||||
|
||||
if (!creature)
|
||||
{
|
||||
@@ -885,7 +885,7 @@ public:
|
||||
|
||||
// Set "wpguid" column to the visual waypoint
|
||||
stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_WPGUID);
|
||||
stmt->setInt32(0, int32(wpCreature->GetSpawnId()));
|
||||
stmt->setUInt32(0, wpCreature->GetSpawnId());
|
||||
stmt->setUInt32(1, pathid);
|
||||
stmt->setUInt32(2, point);
|
||||
WorldDatabase.Execute(stmt);
|
||||
@@ -1031,15 +1031,16 @@ public:
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid::LowType guid = fields[0].GetUInt32();
|
||||
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HighGuid::Unit, VISUAL_WAYPOINT, guid));
|
||||
ObjectGuid::LowType lowguid = fields[0].GetUInt32();
|
||||
|
||||
Creature* creature = handler->GetCreatureFromPlayerMapByDbGuid(lowguid);
|
||||
if (!creature)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, guid);
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, lowguid);
|
||||
hasError = true;
|
||||
|
||||
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
|
||||
stmt->setUInt32(0, guid);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
WorldDatabase.Execute(stmt);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user