Регистрация Главная Сообщество
Сообщения за день Справка Регистрация

Ответ
 
Опции темы
Старый 13.04.2010, 19:44   #1
 Старший сержант
Аватар для Винсент
 
Винсент лучик света в грозовом небеВинсент лучик света в грозовом небеВинсент лучик света в грозовом небеВинсент лучик света в грозовом небеВинсент лучик света в грозовом небеВинсент лучик света в грозовом небеВинсент лучик света в грозовом небе
Регистрация: 02.03.2010
Сообщений: 244
Популярность: 876
Сказал(а) спасибо: 44
Поблагодарили 131 раз(а) в 81 сообщениях
Отправить сообщение для Винсент с помощью ICQ Отправить сообщение для Винсент с помощью Skype™
 
По умолчанию [MaNGOS] PHP создатель портала

Небольшой php скрипт для создания собственных телепортов на сервере
скачивай и засовываем куда надо,после открываем его(в любом текстовом редакторе) и редактируем под себя


PHP код:
// We get the DB login infos 
define('DB_HOST''localhost');                       //имя хоста или ip адрес 
define('DB_USER''your_db_user');                 // юзер 
define('DB_PASSWORD''your_db_password');  //пароль 
define('DB_NAME''mangos');                        //основная база 
Полный сценарий:
PHP код:
<?php 
/* 
+ ---------------------------------------------------------------------------- + 

|                    Portal Creator for MaANGOS 

|     © p4lmi3r - 2010 

|    This program is free software: you can redistribute it and/or modify 
|    it under the terms of the GNU General Public License as published by 
|    the Free Software Foundation, either version 3 of the License, or 
|    (at your option) any later version. 

|    This program is distributed in the hope that it will be useful, 
|    but WITHOUT ANY WARRANTY; without even the implied warranty of 
|    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
|    GNU General Public License for more details. 

|    You should have received a copy of the GNU General Public License 
|    along with this program.  If not, see <http://www.gnu.org/licenses/>. 

+ ---------------------------------------------------------------------------- + 
*/ 


// We get the DB login infos 
define 'DB_HOST' 'localhost' );                     // Имя хоста или ip адрес 
define 'DB_USER' 'your_db_user' );                // Пользователь 
define 'DB_PASSWORD' 'your_db_password' ); // Пароль 
define 'DB_NAME' 'mangos' );                       // Основная база


// We define every variable 
if(isset( $_REQUEST 'Button' ])) $Button $_REQUEST 'Button' ]; 
else 
$Button '' 

if(isset( 
$_REQUEST 'search' ])) $search $_POST 'search' ]; 

if(isset( 
$_POST 'id' ])) $id $_POST 'id' ]; 
else 
$id "" 

if(isset( 
$_REQUEST 'newid' ])) $newid $_POST 'newid' ]; 

if(isset( 
$_POST 'target_map' ])) $target_map $_POST 'target_map' ]; 
else 
$target_map "" 

if(isset( 
$_POST 'target_position_x' ])) $target_position_x $_POST 'target_position_x' ]; 
else 
$target_position_x "" 

if(isset( 
$_POST 'target_position_y' ])) $target_position_y $_POST 'target_position_y' ]; 
else 
$target_position_y "" 

if(isset( 
$_POST 'target_position_z' ])) $target_position_z $_POST 'target_position_z' ]; 
else 
$target_position_z "" 

if(isset( 
$_POST 'target_orientation' ])) $target_orientation $_POST 'target_orientation' ]; 
else 
$target_orientation "" 

if(isset( 
$_POST 'entry' ])) $entry $_POST 'entry' ]; 
else 
$entry "" 

if(isset( 
$_POST 'displayId' ])) $displayId $_POST 'displayId' ]; 
else 
$displayId "" 

if(isset( 
$_POST 'name' ])) $name $_POST 'name' ]; 
else 
$name "" 

//this function is used to check the id entry which have to be unique 
function checkId $id ){ 
// we check if the id already exist 
$sql "SELECT id FROM spell_target_position WHERE id='$id'" 
$req mysql_query $sql ) or die( 'SQL error !' $sql '<br>' mysql_error ()); 

// we count the number of results 
$res mysql_num_rows $req ); 

return 
$res 




$db mysql_connect DB_HOST DB_USER DB_PASSWORD ); // connection to the base 
mysql_select_db DB_NAME $db ); // selection of the base 

if( $Button == 'Send' ){ 

// we check if the field are empty 
if(empty( $id ) OR empty( $target_map ) OR empty( $target_position_x ) OR empty( $target_position_y ) OR empty( $target_position_z ) OR empty( $target_orientation ) OR empty( $entry ) OR empty( $displayId )    ) 

echo 
'<font color="red">Warning you have to fill all the fields!</font>' 

// No field is empty, we can write them in the table 
//but 
//here is our id checker! 
elseif( checkId $id )) 

echo 
'<font color="red">Sorry this id already exist, try another spell</font>' 



else 
// the id does not exist, we insert the informations in the table 

$sql1 "INSERT INTO spell_target_position(id, target_map, target_position_x, target_position_y, target_position_z, target_orientation) VALUES('$id','$target_map','$target_position_x','$target_position_y','$target_position_z','$target_orientation')" 
mysql_query $sql1 ) or die( 'Erreur SQL !' $sql1 '<br>' mysql_error ()); 

$sql2 "INSERT INTO gameobject_template (entry, type, displayId, name, IconName, castBarCaption, unk1, faction, flags, size, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, data0, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20, data21, data22, data23, ScriptName) VALUES ('$entry','22','$displayId','$name','','','','0','0','1','0','0','0','0','0','0','$id','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','')" 
mysql_query $sql2 ) or die( 'Erreur SQL !' $sql2 '<br>' mysql_error ()); 

echo 
'<font color="orange">Your portal have been added</font><br />' 
echo 
'<font color="orange">Restart your server (.server restart 10)</font><br />' 
echo 
'<font color="orange">Type .gobject add ' $entry ' where you want to put your portal</font>' 




// the searching part, because some times the spell id you choosed will not work for somes reasons... 
if( $Button == 'Search' ){ 

$sqlsearch "SELECT `id` 
FROM `spell_target_position` 
WHERE `id` LIKE '%" 
mysql_escape_string $search ). "%'" 
$sqlResult mysql_query $sqlsearch ); 
// if an id was found, we show the edit form 
while(list( $id )= mysql_fetch_array $sqlResult )){ 
echo 
$id 
echo 
'<form method="post" action="">' 
echo 
'<table>' 
echo 
'<tr>' 
echo 
'<td><label for="newid">Teleport spell ID</label> :</td> <td><input type="text" name="newid" id="newid" /></td>' 
echo 
'</table>' 
echo 
'<input type="submit" value="Edit" name="Button" />' 
echo 
'<input type="hidden" value=' $id ' name="id" />' 
echo 
'</form>' 






if( 
$Button == 'Edit' ){ 

//here is our id checker again! 
if( checkId $id )) 

echo 
'<font color="red">Sorry this id already exist, try another spell</font>' 


else 
// the id does not exist, we insert the informations in the table 

$sqlupdate "UPDATE spell_target_position SET id='$newid' WHERE id='$id'" 
$sqlquery mysql_query $sqlupdate ); 

$sqlupdate2 "UPDATE gameobject_template SET data0='$newid' WHERE data0='$id'" 
$sqlquery2 mysql_query $sqlupdate2 ); 
error_log $sqlupdate2 ); 


?> 




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" /> 

<title>Mangos portal creator</title> 

<style type="text/css"> 
body {margin:auto; width: 800px; background-color:#333333; color:#ffffff;} 
.hint {color:#999999;} 
a {color:#666666;} 
h1 {color:green; text-align:center;} 
</style> 

</head> 

<body> 

<h1>MaNGOS portal creator</h1> 

<form method="post" action=""> 
<!-- spell_target_position form--> 
<table> 
<tr> 
<td><label for="id">Teleport spell ID</label> :</td> <td><input type="text" name="id" id="id" tabindex="1" /></td> <td><span class="hint">you can find somes IDs on <a href="http://www.wowhead.com/?search=teleport#uncategorized-spells" target="_blank">wowhead.com</a> search for effect #1 "Teleport units"</span></td> 
</tr> 
<tr> 
<td><label for="target_map">Map ID</label> :</td> <td><input type="text" name="target_map" id="target_map" tabindex="2" /></td> <td><span class="hint">This value can be found using .gps ingame</span></td> 
</tr> 
<tr> 
<td><label for="target_position_x">Position X</label> :</td> <td><input type="text" name="target_position_x" id="target_position_x" tabindex="3" /></td> <td><span class="hint">This value can be found using .gps ingame</span></td> 
</tr> 
<tr> 
<td><label for="target_position_y">Position Y</label> :</td> <td><input type="text" name="target_position_y" id="target_position_y" tabindex="4" /></td> <td><span class="hint">This value can be found using .gps ingame</span></td> 
</tr> 
<tr> 
<td><label for="target_position_z">Position Z</label> :</td> <td><input type="text" name="target_position_z" id="target_position_z" tabindex="5" /></td> <td><span class="hint">This value can be found using .gps ingame</span></td> 
</tr> 
<tr> 
<td><label for="target_orientation">Orientation</label> :</td> <td><input type="text" name="target_orientation" id="target_orientation" tabindex="6" /></td> <td><span class="hint">This value can be found using .gps ingame</span></td> 
</tr> 
</table> 

<!-- spell_target_position end form--> 

<!-- gameobject_template start form --> 
<table> 
<tr> 
<td><label for="entry">Entry</label> :</td> <td><input type="text" name="entry" id="entry" tabindex="7" /></td> <td><span class="hint">This have to be unique, take a high number like 900001</span></td> 
</tr> 
<tr> 
<td><label for="displayId">Display ID for the object</label> :</td> <td><input type="text" name="displayId" id="displayId" value="7146" tabindex="8" /></td> <td><span class="hint">Darnassus : 4393    Ironforge : 4394    Stormwind : 4396<br /> 
Orgrimmar : 4395    Thunder Bluff : 4397    Undercity : 4398<br /> 
Exodar : 6955    Silvermoon : 6956    Shattrath : 7146    Quel'Danas : 7826</span></td> 
</tr> 
<tr> 
<td><label for="name">Name (will be displayed on mouse over)</label> :</td> <td><input type="text" name="name" id="name" tabindex="9" /></td> <td><span class="hint">. . .</span></td> 
</tr> 
<tr> 
<td><input type="submit" value="Send" name="Button" tabindex="10" /></td> 
</tr> 
</table> 

</form> 
<!-- gameobject_template end form --> 

<!-- search form --> 
<form method="post" action=""> 
<table> 
<tr> 
<td><label for="search">Search</label> :</td> <td><input type="text" name="search" id="search" tabindex="11" /> Search a spell that didn't worked</td> 
</tr> 
<tr> 
<td><input type="submit" value="Search" name="Button" tabindex="12" /></td> 
</tr> 
</table> 

</form> 

</body> 
</html>
Как пользоваться?
Заходим на страницу
В поле
Teleport spell ID,как я понимаю 17609
Map ID :
Position X :
Position Y :
Position Z :
Orientation : это все позиции места,куда будет телепорт(в игре можно узнать по .gps)
Entry : номер ентри(ВНИМАНИЕ: должен быть уникальным!)
Name (will be displayed on mouse over) : имя,которое будет отображаться игроку при наведении на портал(ВНИМАНИЕ: только на английском языке!
Ну и всё...жмем send
Если все норм,то перезагружаем серв и входим в игру
Вводим .gobject add entry в нужном нам месте и вуаля!


[Ссылки могут видеть только зарегистрированные пользователи. ]

Последний раз редактировалось Винсент; 13.04.2010 в 19:51.
  Ответить с цитированием
2 пользователя(ей) сказали cпасибо:
Baly (17.04.2010), Inquisition (19.04.2010)
Ответ


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход

Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Нам интересно именно Ваше мнение по поводу нашего портала! Zhyk О портале Zhyk.Ru 504 27.10.2018 09:56
Перспективы нашего Портала. Vizir Треп 146 15.01.2011 18:09
[Помогите!] Mangos wostok Вопросы и ответы, обсуждение 2 26.03.2010 15:23
[Подсказка] Получаем много кристаллов портала, на руоффе пашет=) ZliLO Баги и читы Lineage 2 0 24.03.2009 19:16
Баги [mangos]2.4.2 MaiFun Читы, баги и статьи по WoW 1 11.09.2008 12:06

Заявление об ответственности / Список мошенников

Часовой пояс GMT +4, время: 06:17.

Пишите нам: [email protected]
Copyright © 2024 vBulletin Solutions, Inc.
Translate: zCarot. Webdesign by DevArt (Fox)
G-gaMe! Team production | Since 2008
Hosted by GShost.net