Query Script Help - Scripting Bits and Pieces

General assistance and guidelines for editing the server side of Soma.

Query Script Help - Scripting Bits and Pieces

Postby Tiffany » Mon Apr 14, 2008 12:35 am

This was around pirate before and Ive had on my store forum for some time so just posting the data here. Not just queries but other misc stuff aswell.

Barr
Add barr to mobs except do not add to guard mobs as the barr values identify an XY parameter to stop them wandering about. The server will be unpredictable or crash if Guards barr is altered.
Updated from Finito's post.
Code: Select all
Update Monsterset set
smoneymin = smoneymin + 200,
smoneymax = smoneymax + 500
WHERE STABLENUM <> 1044 and STABLENUM <> 1045 and STABLENUM <> 216 and
STABLENUM <> 217 and STABLENUM <> 93 and STABLENUM <> 268 and STABLENUM <> 1013
and smoneymin > 0 and smoneymax <= 32266

NB: sTableNum is linked to the Monster Table sSid and therefore make sure it matches the Guards. Also the smoneymax limit needs to take into account how much you are adding / multiplying to the original values.

Adding Portals
Code: Select all
Make a mob that has the same picture as a portal, after this put its spawn place in the monsterset and everything, give it an event, go into the EVT file of that map and write:

EVENT <Event Number>
E LINK <COORDS> <MAP NUMBER>
E RETURN
END

Example

EVENT 9876
E LINK 423 323 15
E RETURN
END

This would take you to x423 y323 on map 15.



Making a CREATEACCOUNT Procedure
Code: Select all
Shove this into Query Analyzer and go.

CREATE PROCEDURE CREATEACCOUNT
@id varchar(20),
@pass varchar(20)
AS

SELECT * FROM NGSCUSER WHERE strUserId = @id

if (@@rowcount = 0)
BEGIN
INSERT INTO NGSCUSER VALUES(@id, @pass, null, @id, 0, 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa',0, 0, null, 0, 'aaa',0, 0, 0,0)
END
GO


Deleting Services
Code: Select all
If your service manager is giving you the error "Specified service already exists, then you need to do this.

Exit Service Manager
Go to start menu
Click Run

Type these into the run box:

sc delete um_soma
sc delete fm_soma
sc delete sm_soma_0
sc delete "gs_soma_soma game"

This will remove the services from registry


No Authority Fix
Code: Select all
When setting up your server, before adding a server and configuring services you will need to install the starter services which is in the /services/ folder as "installstarter.bat"

If you do not, you will get the "You have no authority" message.

To remedy this, if you have already installed the starter service, run uninstallstarter.bat in the /services/ folder and then installstarter.bat

This should remedy your problem.


Adding a map
Code: Select all
In your database there is a table called "serverinfo". All of the map information is held there, add a number in the spare map places eg 80 and then make a copy of the map want to use (whch is held in C:\ServerFolder\oneperone\maps\).

If you wanted a new map which looked identical to Thousand Year Town, you would copy all of the "1" map files and rename them to 80 (or the number you chose in the serverinfo table)


Hex Editing ONEPERONE

Code: Select all
Unless you want to get hacked, you will need to hex edit your 1per1 executable file so that it works with your server.

Download a hex editor program (www.google.com)

Open 1p1 in that hex editor and use the find feature (CTRL+F) and search for instances of the word soma (depends if you are using the esoma db or a custom db such as Forsaken or Sausage) and change them to what the password for your server will be.

Save this hex edited file and it should be 100% operational unless you have edited something you should not have!


Manual Update (Stats)
Code: Select all
UPDATE GAMEUSER SET
sLEVEL = '0', iSTR = '0', iDEX = '0', iINT = '0', iCHA = '0', iWIS = '0', iCON = '0', sHP = '0', sMAXHP = '0', sMP = '0', sMAXMP = '0', sSTM = '0', sMAXSTM = '0', sMAXWGT = '0', iMORAL = '0', iMONEY = '0', iBANK = '0', sRANK = '0', iSwordEXP = '0', iSpearEXP = '0', iBowEXP = '0', iAxeEXP = '0', iKnuckleEXP = '0', iStaffEXP = '0', iWeaponMakeEXP = '0', iArmorMakeEXP = '0', iAccMakeEXP = '0', iPotionMakeEXP = '0', iCookingEXP = '0', iWMagicEXP = '0', iBMagicEXP = '0', IDMagicEXP = '0'
WHERE strUserId = 'CharNameHere'

Replace CharNameHere with your character's name.
Replace 0 with the stats you would like (Note: Every three 0's = one 0. ie. 2000000000 = 2000.


Editing starting stats
Code: Select all
Edit the stored procedure in the database called NEW_CHAR.

You can change everything that they start with such as str, dex, int, wis, money, moral, etc.


Making a GM Character
Code: Select all
UPDATE GAMEUSER SET
sLEVEL = '25', iSTR = '200000000', iDEX = '2000000000', iINT = '200000000', iCHA = '2000000000', iWIS = '2000000000', iCON = '200000000', sHP = '2500', sMAXHP = '2500', sMP = '2500', sMAXMP = '2500', sSTM = '2500', sMAXSTM = '2500', sMAXWGT = '2500', iMORAL = '7400000', iMONEY = '500000', iBANK = '50000000', sRANK = '1', iSwordEXP = '20000000', iSpearEXP = '20000000', iBowEXP = '20000000', iAxeEXP = '20000000', iKnuckleEXP = '20000000', iStaffEXP = '20000000', iWeaponMakeEXP = '20000000', iArmorMakeEXP = '20000000', iAccMakeEXP = '20000000', iPotionMakeEXP = '20000000', iCookingEXP = '20000000', iWMagicEXP = '10000000', iBMagicEXP = '10000000', iDMagicEXP = '0'
WHERE strUserId = 'CharNameHere'


Replace CharNameHere with your character's name

Increasing Stat/Skill/Exp etc

Code: Select all
You will need to enter these into Query Analyzer to get the required effects. With these, you will get 40x levelling/skills/stats and 100x crafting. You can change the numbers to what you wish.

UPDATE TB_EXP SET
maxexp = maxexp / 40,
wdexp = wdexp / 40,
rdexp = rdexp / 40

update tb_inc_exp set
bow = bow * 40,
sword = sword * 40,
axe = axe * 40,
spear = spear * 40,
knuckle = knuckle * 40,
staff = staff * 40,
darkmg = darkmg * 40,
whitemg = whitemg * 40,
bluemg = bluemg * 40,
wpmake = wpmake * 100,
ammake = ammake * 100,
acmake = acmake * 100,
pomake = pomake * 100,
ckmake = ckmake * 100

and

UPDATE TB_INC SET
STR = STR * 40,
INT = INT * 40,
DEX = DEX * 40,
WIS = WIS * 40

And for the last one to work (update tb_inc set) you need to go into Design Table in the database using Enterprise Manage on the TB_INC table and make sure you change the str, int, dex and wis to "varchar" for the type, save it and then use that query to make stats gain faster. You will get an error if you do not.

UPDATE TB_INC_CON SET
CON = CON * 60

UPDATE TB_INC_CHA SET
CHA = CHA * 200


Mercenary Town -> Continental Army Portal Warp
Code: Select all
Add this to 4.evt, just after EVENT 928

EVENT 987
E LINK 360 710 17
E RETURN
END

Click RELOAD EVENTS in Oneperone.


Adding warp restriction to Seorin
Code: Select all
This should go into 14.evt, I think.

;Warp to Continental Army (Castle Map)
EVENT 1450
E SELECT_MSG 1656 1658 1451 1659 -1 -1 -1 -1
END

EVENT 1451
E RUN_EVENT 1452
E RUN_EVENT 1455
E RUN_EVENT 1456
E RUN_EVENT 1457
END

EVENT 1452
A EXIST_ITEM 387 1
E SELECT_MSG 859 315 1453 316 1454 -1 -1 -1 -1
E RETURN
END

EVENT 1453
A EXIST_ITEM 387 1
E ROB_ITEM 387 1
E WARP_GATE 14 34 58
E RETURN
END

EVENT 1454
E RUN_EVENT 1455
E RUN_EVENT 1456
END

EVENT 1455
A GOLD 1000 -1
A CHECK_CLASS_TOWN
E ROB_GOLD 1000
E LINK 34 58 14
E RETURN
END

EVENT 1456
A GOLD -1 1000
E MESSAGE_NONE 744
END

EVENT 1457
E MESSAGE_NONE 2241
END


Note: Will require new rows in npcchat;

2241 - The Continental Army Area belongs to the Devil Race
2242 - The Continental Army Area belongs to the Human Race

Similar for Mundie (Devil World)

Fixing EXP Loss (on Revive)
Code: Select all
When using the query below to change levelling speed:

update tb_exp set
imaxexp = maxexp / 20

You will notice in the tb_exp table there is also colums rdexp and wdexp. RDEXP is how much exp is lost upon reviving and WDEXP is how much exp is lost upon warping (I think).

If you have divided your maxexp by 20, then you will need to also divide these by 20 to stop exp returning to 0 upon death. Here is the query to do this:

update tb_exp set
rdexp = rdexp / 20,
wdexp = wdexp / 20

Your exp loss is now fixed!


Level Rewind
Code: Select all
IF sLEVEL = 100 AND EXP = iMAXEXP
UPDATE GAMEUSER SET
sLEVEL = 90
WHERE STRUSERID = @ID


Skill Cap Workaround

Code: Select all
So, right... where to start. Well the skill cap we know at the moment is 370 skill.

A way to realise how the skill cap can be worked around is by having 370skill, and gaining .2 in another weapon. If you have 200 in axe and 170 bow, bow will fall to 169.8. If you proceed to hit for .2 in AXE you will reach 200.2

So, heres where the hints start, and this is quite tricky to get your head around...

UPDATE GAMEUSER SET
iWEAPEXP = X
WHERE STRUSERID=@ID

X will be what you would like the new cap to be.

Now, whatever weap you chose, manually remove anything in the db to do with that weapon type.


Crafting Skill Cap workaround (untested)
Code: Select all
UPDATE GAMEUSER SET
sITEMMAKEEXP = X
WHERE STRUSERID = @ID

X is how high you would like the cap to be and sITEMMAKEEXP is the skill.

Remove all recipes from the database for this type of skill.


Level Cap Workaround
Code: Select all
Before you ask, this isnt the whole script, your final script should be around 200 lines long.

You will need to add rows in tb_exp up until where you would like it to be. The script which is given here is very basic and needs customization to make it work correctly.

IF @sLevel = 100 AND @sLevel <= 120 and  @class = 0  AND @exp = @maxexp
UPDATE GameUser SET
sLevel = @sLevel+1,
iExp = 0,
iStr = @str+3569995,
iDex = @dex+21435599,
sMAXHP = @maxhp+8,
sMAXMP = @maxmp+5,
sMaxSTM = @maxstm+15,
sMaxWGT = @maxwgt+25,
iStrInc = 0,
iDexInc = 0,
iIntelInc =  0,
iConInc = 0,
iWisInc = 0,
iChaInc = 0
WHERE strUserId=@id

This excerpt will level them up and give them those stats as long as they are between level 100 and 120. After that.. write your own, or change that to let them gain those stats until 500 or whatever

So, you want a <<< Log out to level up >>> message? All you need to do is find the korean message which tells you that you can't level up anymore and edit it


WOTW Crash Fix (NOT TESTED FULLY)
Code: Select all
Delete all four Monsterset entries for sZone 26, then find another 396 entries in there and delete them. Make sure they monster spawns are ones which nobody uses - but, don't worry, the game is full of them so you shouldn't have much trouble finding a few!

Having approx 1867 entries will allow your WOTW to run without crashes, even when humans win.


18CON Start (Humans Only)
Code: Select all
IF @CLASS = 0
UPDATE GAMEUSER SET
ICON = <AMOUNT> WHERE STRUSERID = @ID
GO


35CHA Start (Devils Only)
Code: Select all
IF @CLASS >= 11
UPDATE GAMEUSER SET
ICHA = <AMOUNT> WHERE STRUSERID = @ID
GO


Shop IDs
Code: Select all
sId 1; sType 6 - TYT blacksmith weapon shop
sId 2; sType 7 - TYT Armour Vendor, Armour option
sId 4; sType 9 - TYT Reagent Vendor
sId 5; sType 10 - TYT Bar Owner
sId 6; sType 7 - TYT Armour Vendor, Clothes option
sId 7; sType 12 - Grave Keeper Shop
sId 8; sType 6 - Merc weapon shop
sId 9; sType 7 - Merc armour shop
sId 10; sType 12 - Merc Hongu
sId 11; sType 7 - Merc clothes shop
sId 12; sType 6 - *Devil* Darin's Food Shop
sId 13; sType 6 - *Devil* Lamatra's General Store
sId 14; sType 6 - Not sure yet..
sId 15; sType 6 - Abias Pold Weapon
sId 16; sType 7 - Abias Pold Armour
sId 17; sType 6 - Abias Pold Materials
sId 18; sType 12 - Jinmoo Materials
sId 19; sType 12 - Momo Items
sId 20; sType 12 - Momo Meats
sId 21; sType 12 - Aseol Materials
sId 22; sType 12 - Aseol Gems


Modifying Drops
Code: Select all
Run this through QA.

UPDATE monsterset SET

sItem01 = <itemnum - from basicitem>,
sItem02 = <itemnum - from basicitem>,
sItem03 = <itemnum - from basicitem>,
sItem04 = <itemnum - from basicitem>,
sItem05 = <itemnum - from basicitem>,
sItem06 = <itemnum - from basicitem>,
sItem07 = <itemnum - from basicitem>,
sItem08 = <itemnum - from basicitem>,
sItem09 = <itemnum - from basicitem>,
sItem01Rand = <drop rate>
sItem02Rand = <drop rate>
sItem03Rand = <drop rate>
sItem04Rand = <drop rate>
sItem05Rand = <drop rate>
sItem06Rand = <drop rate>
sItem07Rand = <drop rate>
sItem08Rand = <drop rate>
sItem09Rand = <drop rate>

WHERE sZone = <number of map the monster spawns in> And StableNum = <id of the monster in 'monster' table>


Making all armours unisex
Code: Select all
Dump this in QA and RUN

update basicitem set
gender = 0


Remove duplicate rows
Code: Select all
DELETE dbo.table name
WHERE (syntax such as ssid) = (duplicated row)


addaccount
Code: Select all
<?php

include("config.php");

if (isset($_POST['AddAccount'])) {
 if ($_POST['Username'] > "" && $_POST['Password'] > "") {
 $validchars = "abcdefghijklmnopqrstuvwxyz0123456789@ .";
 $valid = true;

 for ($i = 0; $i < strlen($_POST['Username']); $i++) {
 if (strpos($validchars,strtolower(substr($_POST['Username'],$i,1))) === false){
 $valid = false;
 }
 }

 for ($i = 0; $i < strlen($_POST['Password']); $i++) {
  if (strpos($validchars,strtolower(substr($_POST['Password'],$i,1))) === false){
 $valid = false;
 }
 }

 for ($i = 0; $i < strlen($_POST['RealName']); $i++) {
 if (strpos($validchars,strtolower(substr($_POST['RealName'],$i,1))) === false){
 $valid = false;
 }
 }

 for ($i = 0; $i < strlen($_POST['Email']); $i++) {
 if (strpos($validchars,strtolower(substr($_POST['Email'],$i,1))) === false){
 $valid = false;
 }
 }

 for ($i = 0; $i < strlen($_POST['Address1']); $i++) {
 if (strpos($validchars,strtolower(substr($_POST['Address1'],$i,1))) === false){
 $valid = false;
 }
 }

 for ($i = 0; $i < strlen($_POST['Phoneno']); $i++) {
 if (strpos($validchars,strtolower(substr($_POST['Phoneno'],$i,1))) === false){
 $valid = false;
 }
 }

 for ($i = 0; $i < strlen($_POST['SQ1']); $i++) {
 if (strpos($validchars,strtolower(substr($_POST['SQ1'],$i,1))) === false){
 $valid = false;
 }
 }

 for ($i = 0; $i < strlen($_POST['SQR1']); $i++) {
  if (strpos($validchars,strtolower(substr($_POST['SQR1'],$i,1))) === false){
 $valid = false;
 }
 }

 for ($i = 0; $i < strlen($_POST['SQ2']); $i++) {
 if (strpos($validchars,strtolower(substr($_POST['SQ2'],$i,1))) === false){
 $valid = false;
 }
 }

 for ($i = 0; $i < strlen($_POST['SQR2']); $i++) {
  if (strpos($validchars,strtolower(substr($_POST['SQR2'],$i,1))) === false){
 $valid = false;
 }
 }
 if ($valid == true) {
 $query = "SELECT strUSERId FROM NGSCUSER WHERE strUSERId = '".$_POST['Username']."'";
 $result = mssql_query($query,$conn);
 if (mssql_num_rows($result) > 0) {
 echo "Account name in use.";
 } else {
 $accquery = "INSERT INTO NGSCUSER strUSERId,strPasswd,strName,strEmail,strAddr1,strPhoneNo,strQuery1,strReply1
,strQuery2,strReply2)

VALUES('".$_POST['Username']."','".$_POST['Password']."','".$_POST['RealName']."','".$_POST['Email']."','".$_POST['Address1']

."','".$_POST['Phoneno']."','".$_POST['SQ1']."','".$_POST['SQR1']."','".$_POST['SQ2']."','".$_POST['SQR2']."')";
 $accresult = mssql_query($accquery,$conn);
 echo "Account Added";
 }
 } else {
 echo "You didn't fill out all the required fields.";
 }
} else {
 echo "dont try to hack me biatch!";
}
 echo "

";
}

?>
<table border="0">

 <tr>
 <td class="mytext">
  Add an Account

 <form action="addaccount.php" method="post">
 <table border="0">
 <tr>
 <td>Username</td>
 <td><input type="text" name="Username" height="5" maxlength="12"

style="width: 100px;"></td>
 </tr>
 <tr>
 <td>Password</td>
 <td><input type="text" name="Password" height="5" maxlength="10"

style="width: 100px;"></td>
 </tr>
 <tr>
 <td>Name</td>
 <td><input type="text" name="RealName" height="5" maxlength="20"

style="width: 100px;"></td>
 </tr>
 <tr>
 <td>Email Address</td>
 <td><input type="text" name="Email" height="5" maxlength="50"

style="width: 100px;"></td>
 </tr>
 <tr>
 <td>Address</td>
 <td><input type="text" name="Address1" height="5" maxlength="10"

style="width: 100px;"></td>
 </tr>
 <tr>
 <td>Phone Number</td>
 <td><input type="text" name="Phoneno" height="5" maxlength="20"

style="width: 100px;"></td>
  </tr>
  <tr>
 <td>Secrete Question</td>
 <td><input type="text" name="SQuestion1" height="5" maxlength="20"

style="width: 100px;"></td>
 </tr>
 <tr>
 <td>Secrete Answer</td>
 <td><input type="text" name="SQuestionR1" height="5" maxlength="10"

style="width: 100px;"></td>
 </tr>
 <tr>
 <td>Secrete Question2</td>
 <td><input type="text" name="SQuestion2" height="5" maxlength="20"

style="width: 100px;"></td>
  </tr>
 <tr>
 <td>Secrete Answer2</td>
 <td><input type="text" name="SQuestionR2" height="5" maxlength="10"

style="width: 100px;"></td>
 <tr>
 <td></td>
 <td><input type="submit" value="Add" name="AddAccount"></td>
  </tr>
 </table>
  </form>
 </td>
 </tr>
</table>


Dsoma Weapons and auras - 10.evt
Code: Select all
;DSOMA AURA NPC FILE - GIVES AURAS FOR FREE, AS WELL AS A WEAPON.

EVENT 01
E MESSAGE_NONE 1271
E SELECT_MSG -1 1266 14 1265 15 -1 -1 -1 -1
E RETURN
END

EVENT 02
A CHECK_JOB 11
E MESSAGE_NONE 2639
E RUN_EVENT 03
E RETURN
END

EVENT 03
E GIVE_ITEM 2005 1
E GIVE_SPECIAL_ATTACK 6
E GIVE_SPECIAL_ATTACK 1
E GIVE_SPECIAL_ATTACK 21
E GIVE_SPECIAL_ATTACK 11
E GIVE_SPECIAL_ATTACK 22
E SHOW_MAGIC 900
E MESSAGE_NONE 2645
E RETURN
END

EVENT 04
A CHECK_JOB 12
E MESSAGE_NONE 2641
E RUN_EVENT 05
E RETURN
END

EVENT 05
E GIVE_ITEM 2103 1
E GIVE_SPECIAL_ATTACK 9
E GIVE_SPECIAL_ATTACK 4
E GIVE_SPECIAL_ATTACK 27
E GIVE_SPECIAL_ATTACK 14
E GIVE_SPECIAL_ATTACK 28
E SHOW_MAGIC 900
E MESSAGE_NONE 2645
E RETURN
END


EVENT 06
A CHECK_JOB 13
E MESSAGE_NONE 2643
E RUN_EVENT 07
E RETURN
END

EVENT 07
E GIVE_ITEM 2128 1
E GIVE_SPECIAL_ATTACK 7
E GIVE_SPECIAL_ATTACK 2
E GIVE_SPECIAL_ATTACK 25
E GIVE_SPECIAL_ATTACK 12
E GIVE_SPECIAL_ATTACK 26
E SHOW_MAGIC 900
E MESSAGE_NONE 2645
E RETURN
END


EVENT 08
A CHECK_JOB 14
E MESSAGE_NONE 2640
E RUN_EVENT 09
E RETURN
END

EVENT 09
E GIVE_ITEM 2054 1
E GIVE_SPECIAL_ATTACK 8
E GIVE_SPECIAL_ATTACK 3
E GIVE_SPECIAL_ATTACK 23
E GIVE_SPECIAL_ATTACK 13
E GIVE_SPECIAL_ATTACK 24
E SHOW_MAGIC 900
E MESSAGE_NONE 2645
E RETURN
END


EVENT 10
A CHECK_JOB 15
E MESSAGE_NONE 2642
E RUN_EVENT 11
E RETURN
END

EVENT 11
E GIVE_ITEM 2177 1
E GIVE_SPECIAL_ATTACK 10
E GIVE_SPECIAL_ATTACK 5
E GIVE_SPECIAL_ATTACK 29
E GIVE_SPECIAL_ATTACK 15
E GIVE_SPECIAL_ATTACK 30
E SHOW_MAGIC 900
E MESSAGE_NONE 2645
E RETURN
END


EVENT 12
A CHECK_JOB 16
E MESSAGE_NONE 2644
E RUN_EVENT 13
E RETURN
END

EVENT 13
E GIVE_ITEM 2202 1
E GIVE_SPECIAL_ATTACK 18
E GIVE_SPECIAL_ATTACK 19
E GIVE_SPECIAL_ATTACK 20
E SHOW_MAGIC 900
E MESSAGE_NONE 2645
E RETURN
END

EVENT 14
E RUN_EVENT 02
E RUN_EVENT 04
E RUN_EVENT 06
E RUN_EVENT 08
E RUN_EVENT 10
E RUN_EVENT 12
END

EVENT 15
E LINK 371 867 9
E RETURN
END

need to add to NPCCHAT
Code: Select all
2639 You look like a swordsman... I'll teach you all the sword techniques I know, and give you a weapon to start you off.
2640 You look like a warrior... I'll teach you all the warrior techniques I know, and give you a weapon to start you off.
2641 You look like a knight... I'll teach you all the knight techniques I know, and give you a weapon to start you off.
2642 You look like a fighter... I'll teach you all the fighter techniques I know, and give you a weapon to start you off.
2643 You look like an archer... I'll teach you all the archer techniques I know, and give you a weapon to start you off.
2644 You look like a mage... I'll teach you all the mage techniques I know, and give you a weapon to start you off.
2645 Remeber, you can only use them when you have the required mastery... Use them wisely my devil friend!


Warehouse Fix to stop invisible items being in the WH NB: This will destroy items in the WH.
Code: Select all
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Storage_01]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Storage_01]
GO

CREATE TABLE [dbo].[Storage_01] (

[iIndex] [int] IDENTITY (1, 1) NOT NULL ,
[strUserId] *[varchar] (20) COLLATE Korean_Wansung_CI_AS NULL ,
[sType] *[char] (2) NULL ,
[Item00] *[char] (100) NULL ,
[Item01] *[char] (100) NULL ,
[Item02] *[char] (100) NULL ,
[Item03] *[char] (100) NULL ,
[Item04] *[char] (100) NULL ,
[Item05] *[char] (100) NULL ,
[Item06] *[char] (100) NULL ,
[Item07] *[char] (100) NULL ,
[Item08] *[char] (100) NULL ,
[Item09] *[char] (100) NULL ,
[Item10] *[char] (100) NULL ,
[Item11] *[char] (100) NULL ,
[Item12] *[char] (100) NULL ,
[Item13] *[char] (100) NULL ,
[Item14] *[char] (100) NULL ,
[Item15] *[char] (100) NULL ,
[Item16] *[char] (100) NULL ,
[Item17] *[char] (100) NULL ,
[Item18] *[char] (100) NULL ,
[Item19] *[char] (100) NULL ,
[Item20] *[char] (100) NULL ,
[Item21] *[char] (100) NULL ,
[Item22] *[char] (100) NULL ,
[Item23] *[char] (100) NULL ,
[Item24] *[char] (100) NULL ,
[Item25] *[char] (100) NULL ,
[Item26] *[char] (100) NULL ,
[Item27] *[char] (100) NULL ,
[Item28] *[char] (100) NULL ,
[Item29] *[char] (100) NULL ,
[Item30] *[char] (100) NULL ,
[Item31] *[char] (100) NULL ,
[Item32] *[char] (100) NULL ,
[Item33] *[char] (100) NULL ,
[Item34] *[char] (100) NULL ,
[Item35] *[char] (100) NULL ,
[Item36] *[char] (100) NULL ,
[Item37] *[char] (100) NULL ,
[Item38] *[char] (100) NULL ,
[Item39] *[char] (100) NULL ,
[Item40] *[char] (100) NULL ,
[Item41] *[char] (100) NULL ,
[Item42] *[char] (100) NULL ,
[Item43] *[char] (100) NULL ,
[Item44] *[char] (100) NULL ,
[Item45] *[char] (100) NULL ,
[Item46] *[char] (100) NULL ,
[Item47] *[char] (100) NULL ,
[Item48] *[char] (100) NULL ,
[Item49] *[char] (100) NULL ,
[Item50] *[char] (100) NULL ,
[Item51] *[char] (100) NULL ,
[Item52] *[char] (100) NULL ,
[Item53] *[char] (100) NULL ,
[Item54] *[char] (100) NULL ,
[Item55] *[char] (100) NULL ,
[Item56] *[char] (100) NULL ,
[Item57] *[char] (100) NULL ,
[Item58] *[char] (100) NULL ,
[Item59] *[char] (100) NULL ,
[Item60] *[char] (100) NULL ,
[Item61] *[char] (100) NULL ,
[Item62] *[char] (100) NULL ,
[Item63] *[char] (100) NULL ,
[Item64] *[char] (100) NULL ,
[Item65] *[char] (100) NULL ,
[Item66] *[char] (100) NULL ,
[Item67] *[char] (100) NULL ,
[Item68] *[char] (100) NULL ,
[Item69] *[char] (100) NULL ,
[Item70] *[char] (100) NULL ,
[Item71] *[char] (100) NULL ,
[Item72] *[char] (100) NULL ,
[Item73] *[char] (100) NULL ,
[Item74] *[char] (100) NULL ,
[Item75] *[char] (100) NULL ,
[Item76] *[char] (100) NULL ,
[Item77] *[char] (100) NULL ,
[Item78] *[char] (100) NULL ,
[Item79] *[char] (100) NULL ,
) ON [PRIMARY]
GO


Sausage - Guild Village Fix wrote:insert into guild_town values ( getdate(), 1, 1, 0, 'GameMasters', 1, 10, -1, -1, -1 )


Finito wrote:Below is a modified GUILD_INSERT_REQ procedure for stopping devil joining human guild and vice versa.
Simply makes sure that the class of user matches that of the guild class and if not appropriate action is taken with an error.


Code: Select all
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[GUILD_INSERT_REQ]
@OutParam int OUTPUT,
@struserid varchar(20),
@strguildname varchar(20)
AS
DECLARE @guildnum smallint
DECLARE @guildclass smallint
DECLARE @userclass smallint
SELECT @guildnum = GuildNum, @guildclass = sGuildClass FROM GUILD WHERE strGuildName = @strguildname
IF @@ROWCOUNT <> 0
BEGIN
   SELECT @userclass = sClass FROM GAMEUSER WHERE strUserId = @struserid
   IF @@ROWCOUNT = 0
   BEGIN
      SELECT @OutParam = 4 -- GUILD_SYSTEM_ERROR
   END
   ELSE
   BEGIN
        -- Check player class with the class of guild (Human / Devil) to prevent devil joining human guild and
        -- vice versa.
      IF @userclass <10 AND @guildclass = 10
      BEGIN
         SELECT @OutParam = 4 -- GUILD_SYSTEM_ERROR
      END
      ELSE IF @userclass >= 10  AND @guildclass = 0
      BEGIN
         SELECT @OutParam = 4 -- GUILD_SYSTEM_ERROR
      END
      ELSE
      BEGIN
         SELECT * FROM GUILD_REQ WHERE strUserId = @struserid
         IF @@ROWCOUNT = 0
         BEGIN
            INSERT INTO GUILD_REQ VALUES ( @struserid, @guildnum, GETDATE() )
            
            IF @@ERROR = 0
            BEGIN
               SELECT @OutParam = 0
            END
            ELSE
            BEGIN
               SELECT @OutParam = 4 -- GUILD_SYSTEM_ERROR
            END
         END
         ELSE
         BEGIN
            SELECT @OutParam = 13 -- GUILD_ALREADY_JOIN_REQ
         END
      END
   END
END
ELSE
BEGIN
   SELECT @OutParam = 10 -- GUILD_ABSENT_GUILD_NAME
END
Last edited by Tiffany on Mon Jan 26, 2009 10:17 pm, edited 7 times in total.
Reason: Split from Query Glossary and Stickied to make it more noticible for some users.
Tiffany
SD Pro 2 Star
SD Pro 2 Star
 
Posts: 428
Joined: Sat Jan 12, 2008 1:17 pm

Re: Query Glossary

Postby Deadice » Thu Apr 17, 2008 7:30 am

Thanks for posting this, it helps a lot
Deadice
SD One Star
SD One Star
 
Posts: 17
Joined: Fri Feb 29, 2008 6:15 pm

Re: Query Script Help - Scripting Bits and Pieces

Postby Jeager » Thu Jan 22, 2009 5:49 pm

Hmm how to remove 6day deleting chars ?
Hex editing the 1p1 I believe.
Jeager
 
Posts: 8
Joined: Thu Jan 15, 2009 8:45 pm

Re: Query Script Help - Scripting Bits and Pieces

Postby Jamesrezin » Tue Mar 17, 2009 11:16 am

how do i add 6th 7th in ninja guy 'unrealsoma db' :)
Jamesrezin
SD Two Star
SD Two Star
 
Posts: 46
Joined: Thu Feb 26, 2009 1:49 pm

Re: Query Script Help - Scripting Bits and Pieces

Postby unvmeh » Wed Mar 18, 2009 2:43 pm

Brad try searching in mod part of forums Tiffany kindly made a guide on how to imput to a server even you should be able to do....
........./´¯/)
......../¯..//
......./..../ /
./´¯/'...'/´¯¯`·¸
/'/.../..../......./¨¯\
('(...´(..´......,~/'...')
.\.................\/..../
..\.......... _.·´/
...\..............(
....\.............\
.....\.UNVMEH.\
User avatar
unvmeh
SD Pro 5 Star
SD Pro 5 Star
 
Posts: 1438
Joined: Tue Apr 29, 2008 7:33 pm

Re: Query Script Help - Scripting Bits and Pieces

Postby unvmeh » Wed Mar 18, 2009 2:49 pm

Brad try searching in mod part of forums Tiffany kindly made a guide on how to imput to a server even you should be able to do....

Well then again maybe not !!
........./´¯/)
......../¯..//
......./..../ /
./´¯/'...'/´¯¯`·¸
/'/.../..../......./¨¯\
('(...´(..´......,~/'...')
.\.................\/..../
..\.......... _.·´/
...\..............(
....\.............\
.....\.UNVMEH.\
User avatar
unvmeh
SD Pro 5 Star
SD Pro 5 Star
 
Posts: 1438
Joined: Tue Apr 29, 2008 7:33 pm

Re: Query Script Help - Scripting Bits and Pieces

Postby Archaon » Wed Mar 18, 2009 5:44 pm

unvmeh wrote:Brad try searching in mod part of forums Tiffany kindly made a guide on how to imput to a server even you should be able to do....

Well then again maybe not !!


even u could do it with a bit of help :P
SQL 2005 is like a women. You tell it to do something, it whines at you for 2 hours then does something completly different.
Archaon
SD Four Star
SD Four Star
 
Posts: 210
Joined: Fri Aug 29, 2008 2:36 pm

Re: Query Script Help - Scripting Bits and Pieces

Postby unvmeh » Thu Mar 19, 2009 9:45 am

some people are born gifted arch,
........./´¯/)
......../¯..//
......./..../ /
./´¯/'...'/´¯¯`·¸
/'/.../..../......./¨¯\
('(...´(..´......,~/'...')
.\.................\/..../
..\.......... _.·´/
...\..............(
....\.............\
.....\.UNVMEH.\
User avatar
unvmeh
SD Pro 5 Star
SD Pro 5 Star
 
Posts: 1438
Joined: Tue Apr 29, 2008 7:33 pm

Re: Query Script Help - Scripting Bits and Pieces

Postby akemi » Fri Mar 20, 2009 4:36 pm

Jeager wrote:Hmm how to remove 6day deleting chars ?
Hex editing the 1p1 I believe.


This is found in the procedures, look around your db. You might actually learn something.
User avatar
akemi
SD Two Star
SD Two Star
 
Posts: 37
Joined: Tue Feb 26, 2008 12:54 am

Re: Query Script Help - Scripting Bits and Pieces

Postby unvmeh » Fri Mar 20, 2009 5:33 pm

there are some nasty people on these forums lol ...
........./´¯/)
......../¯..//
......./..../ /
./´¯/'...'/´¯¯`·¸
/'/.../..../......./¨¯\
('(...´(..´......,~/'...')
.\.................\/..../
..\.......... _.·´/
...\..............(
....\.............\
.....\.UNVMEH.\
User avatar
unvmeh
SD Pro 5 Star
SD Pro 5 Star
 
Posts: 1438
Joined: Tue Apr 29, 2008 7:33 pm

Next

Return to Server Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron