Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > 4Story
You last visited: Today at 20:00

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Function] Mount, Cash, Gold

Discussion on [Function] Mount, Cash, Gold within the 4Story forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2011
Posts: 286
Received Thanks: 241
[Function] Mount, Cash, Gold

//Edit: I changed the announcement part!!! Now the letter with money will only send when a player created his/her first character. If he makes a new one on the same account, he won´t will get the message!

BTW: To make the permament mount system work you have to change your code with this one in TGAME_GSP>dbo>functions>TChangedPetSystemToMountSy stem
PHP Code:
ALTER PROCEDURE [dbo].[TChangedPetSystemToMountSystem]
@
dwUserID    INT
AS

DECLARE @
wCount    SMALLINT

--ItemChanged
SET 
@wCount 0
SELECT 
@wCount COUNT(dlIDFROM TITEMTABLE WHERE dwOwnerID IN(SELECT dwCharID FROM TCHARTABLE WHERE dwUserID = @dwUserID) AND bOwnerType AND wItemID IN(7549,7550,7551,7552,7553,7554,7555,7556,7557)
SELECT @wCount = @wCount COUNT(dlIDFROM TGLOBAL_GSP.DBO.TCASHITEMCABINETTABLE WHERE dwUserID = @dwUserID AND wItemID IN(7549,7550,7551,7552,7553,7554,7555,7556,7557)

IF(@
wCount 0)
BEGIN
    EXEC TChangedMountItem 
@dwUserID754977097559
    EXEC TChangedMountItem 
@dwUserID755077097560
    EXEC TChangedMountItem 
@dwUserID755177097561
    EXEC TChangedMountItem 
@dwUserID755275307562
    EXEC TChangedMountItem 
@dwUserID755375397563
    EXEC TChangedMountItem 
@dwUserID755475487564
    EXEC TChangedMountItem 
@dwUserID755575187565
    EXEC TChangedMountItem 
@dwUserID755677097566
    EXEC TChangedMountItem 
@dwUserID755775587567
END

--PetChanged
SET 
@wCount 0
SELECT 
@wCount COUNT(wPetIDFROM TPETTABLE WHERE dwUserID = @dwUserID
IF(@wCount 0)
BEGIN    
    EXEC TChangedPetToMount 
@dwUserID175010
    EXEC TChangedPetToMount 
@dwUserID475010
    EXEC TChangedPetToMount 
@dwUserID775010
    EXEC TChangedPetToMount 
@dwUserID1075010
    EXEC TChangedPetToMount 
@dwUserID10275010
    EXEC TChangedPetToMount 
@dwUserID8175010
    EXEC TChangedPetToMount 
@dwUserID275020
    EXEC TChangedPetToMount 
@dwUserID575020
    EXEC TChangedPetToMount 
@dwUserID875020
    EXEC TChangedPetToMount 
@dwUserID1175020
    EXEC TChangedPetToMount 
@dwUserID10375020
    EXEC TChangedPetToMount 
@dwUserID375030
    EXEC TChangedPetToMount 
@dwUserID675030
    EXEC TChangedPetToMount 
@dwUserID975030
    EXEC TChangedPetToMount 
@dwUserID1275030
    EXEC TChangedPetToMount 
@dwUserID1377097559
    EXEC TChangedPetToMount 
@dwUserID1477097560
    EXEC TChangedPetToMount 
@dwUserID1577097561
    EXEC TChangedPetToMount 
@dwUserID1675187565
    EXEC TChangedPetToMount 
@dwUserID1777097566


END 

This function will create you a permament mount on your account and also some cash and gold! if you want to change something just edit!

PS: The function is 100% woking and contains no network errors etc.!

Just copy this code and change it with the old in TGAME_GSP>Dbo>Fuctions>TCreateChar
PHP Code:
/* CREATE CHARACTER PROCESS

========================================================
PARAMETER
========================================================
@szNAME        VARCHAR(50)
@dwCharID        INT        OUTPUT
@dwUserID        INT
@bSlot            TINYINT
@bClass        TINYINT
@bRace        TINYINT
@bCountry        TINYINT
@bSex            TINYINT
@bHair            TINYINT
@bFace        TINYINT
@bBody        TINYINT
@bPants        TINYINT
@bHand        TINYINT
@bFoot            TINYINT

========================================================
RETURN VALUE
========================================================
0    : SUCCESS
1    : NO GROUP
2    : DUPLICATE NAME
3    : INVALID SLOT
4    : Non Class ID 

========================================================
PROCESS
========================================================
1. Check duplicate name
2. Check slot
3. Insert character data

*/


ALTER PROCEDURE [dbo].[TCreateChar]
    @
bCreateCnt        TINYINT    OUTPUT,
    @
szNAME        VARCHAR(50),
    @
dwCharID        INT        OUTPUT,
    @
dwUserID        INT,
    @
bGroup        TINYINT,
    @
bSlot            TINYINT,
    @
bClass        TINYINT,
    @
bRace        TINYINT,
    @
bCountry        TINYINT,
    @
bSex            TINYINT,
    @
bHair            TINYINT,
    @
bFace        TINYINT,
    @
bBody        TINYINT,
    @
bPants        TINYINT,
    @
bHand        TINYINT,
    @
bFoot            TINYINT

AS
    DECLARE @
dwCharSeq INT
    
DECLARE @dwMP    INT
    
DECLARE @dwHP    INT
    
DECLARE @fPosX    FLOAT
    
DECLARE @fPosY    FLOAT
    
DECLARE @fPosZ    FLOAT
    
DECLARE @wDIR    SMALLINT
    
DECLARE @wSpawnID SMALLINT
    
DECLARE @nCheckGlobal INT
    
DECLARE @bRealSex    TINYINT

    SET 
@bCreateCnt 0
    SET 
@dwCharID 0
    SET 
@dwMP 2
    SET 
@dwHP 2

    SELECT TOP 1 
@dwHP = @dwHP wCON, @dwMP = @dwMP wMEN FROM TCLASSCHART WHERE bClassID = @bClass
    SELECT TOP 1 
@dwHP = @dwHP wCON, @dwMP = @dwMP wMEN FROM TRACECHART WHERE bRaceID = @bRace

    SET 
@dwHP * @dwHP 1
    SET 
@dwMP * @dwMP 1

    
IF EXISTSSELECT TOP 1 dwCharID FROM TCHARTABLE WHERE szNAME = @szNAME)
        RETURN 
2
    
/*
        * Duplicate npc name 
     */
    
IF EXISTS(SELECT TOP 1 FROM TNPCCHART WHERE szNAME = @szNAME)
        RETURN 
2
    
/*
     * Duplicate monster name
     */
    
IF EXISTS(SELECT TOP 1 FROM TMONSTERCHART WHERE szNAME = @szNAME)
        RETURN 
2
    
/*
     * Invalid slot
     */
    
IF EXISTS(SELECT TOP 1 dwCharID FROM TCHARTABLE WHERE dwUserID = @dwUserID AND bSlot = @bSlot AND bDelete 0)
        RETURN 
3
    
/*
      * Check the country
     */

    
DECLARE @bOriCountry TINYINT
    
DECLARE @bLevel    TINYINT
    
DECLARE @dwExp    INT
    
DECLARE @wSkillPoint    SMALLINT
    
DECLARE @dwGold INT

    
  

   
/*
     * Hier könnt ihr die Variablen ändern!
     */
    
SET @bOriCountry 3
    SET 
@bLevel 90
    SET 
@dwExp 0
    SET 
@wSpawnID 15003
    SET 
@wSkillPoint 200
  SET 
@dwGold 20


    SELECT TOP 1 
@bOriCountry bOriCountry FROM TCHARTABLE WHERE dwUserID=@dwUserID AND bDelete=AND bOriCountry 2
    
IF(@bOriCountry 2)
    
BEGIN
        SET 
@bCountry = @bOriCountry
        SET 
@bLevel 90
        SET 
@wSkillPoint 200
    SET 
@dwGold 20
        SELECT 
@dwExp dwExp FROM TLEVELCHART WHERE bLevel 8

        
IF(@bOriCountry 0)
            
SET @wSpawnID 15001
        
ELSE
            
SET @wSpawnID 15002
    END
    
ELSE IF(@bCountry <> 4)
        RETURN 
4

    SET 
@fPosX     587.04
    SET 
@fPosY     31.33
    SET 
@fPosZ     603.82
    SET 
@wDIR 1640

    EXEC 
@nCheckGlobal TGLOBAL_GSP.DBO.TCreateChar
        
@dwCharSeq  OUTPUT,
        @
bCreateCnt OUTPUT,
        @
bRealSex OUTPUT,
        @
dwUserID,
        @
bGroup,
        @
dwCharID,
        @
bSlot,
        @
szNAME,
        @
bClass,
        @
bRace,
        @
bCountry,
        @
bSex,
        @
bHair,        -- bHair
        
@bFace,    -- bFace
        
@bBody,    -- bBody
        
@bPants,    -- bPants
        
@bHand,    -- bHand
        
@bFoot,    -- bFoot        
        
@bLevel,
        @
dwExp    -- dwExp

    
IF(@nCheckGlobal <> 0)
        RETURN @
nCheckGlobal

    BEGIN TRAN TCREATECHAR



    INSERT INTO TCHARTABLE
    
(
        
dwUserID,
        
bSlot,
        
szNAME,
        
bRace,
        
bCountry,
        
bOriCountry,
        
bSex,
        
bRealSex,
        
bClass,
        
bLevel,
        
bHair,
        
bFace,
        
bBody,
        
bPants,
        
bHand,
        
bFoot,
        
dwEXP,
        
dwHP,
        
dwMP,
        
wSkillPoint,
        
dwGold,
        
dwSilver,
        
dwCooper,
        
wMapID,
        
wSpawnID,
        
wTemptedMon,
        
bAftermath,
        
fPosX,
        
fPosY,
        
fPosZ,
        
wDIR
    

    
VALUES
    
(
        @
dwUserID,    -- dwUserID
        
@bSlot,        -- bSlot
        
@szNAME,    -- szNAME
        
@bRace,    -- bRace
        
@bCountry,    -- bCountry
        
@bOriCountry,
        @
bSex,        -- bSex
        
@bRealSex,    -- bRealSex
        
@bClass,    -- bClass
        
@bLevel,    -- bLevel
        
@bHair,        -- bHair
        
@bFace,
        @
bBody,
        @
bPants,
        @
bHand,
        @
bFoot,
        @
dwExp,
        @
dwHP,
        @
dwMP,
        @
wSkillPoint,
        
0,
        
0,
        
0,
        
2010,
        @
wSpawnID,
        
0,
        
0,
        @
fPosX,
        @
fPosY,
        @
fPosZ,
        @
wDIR
    
)

    
SET @dwCharID = @@IDENTITY
    INSERT INTO TINVENTABLE
    
(
        
dwCharID,
        
bInvenID,
        
wItemID,
        
dEndTime
    

    
VALUES
    
(
        @
dwCharID,
        
255
        
3,
        
0
    
)

    
INSERT INTO TINVENTABLE
    
(
        
dwCharID,
        
bInvenID,
        
wItemID,
        
dEndTime
    

    
VALUES
    
(
        @
dwCharID,
        
254
        
2,
        
0
    
)

    
INSERT INTO TCABINETTABLE VALUES(@dwCharID01)
    
INSERT INTO TSKILLTABLE SELECT @dwCharIDwSkillID10 FROM TSTARTSKILL WHERE bClassID=@bClass
    COMMIT TRAN TCREATECHAR

    
DECLARE @bStartInven TINYINT
    
DECLARE @bStartSlot TINYINT
    
DECLARE @bStartChartType TINYINT
    
DECLARE @wStartItemID SMALLINT
    
DECLARE @bStartCount TINYINT
    
DECLARE CUR_STARTITEM CURSOR FOR
    
SELECT bInvenbSlotbChartTypewItemIDbCount FROM TSTARTITEMCHART WHERE bCountry=@bCountry AND bClass = @bClass
    OPEN CUR_STARTITEM
    FETCH NEXT FROM CUR_STARTITEM INTO 
@bStartInven, @bStartSlot, @bStartChartType, @wStartItemID, @bStartCount
    
WHILE @@FETCH_STATUS 0
    BEGIN
        EXEC TPutItemInInven 
@dwCharID, @bStartInven, @bStartSlot, @bStartChartType, @wStartItemID, @bStartCount
        FETCH NEXT FROM CUR_STARTITEM INTO  
@bStartInven, @bStartSlot, @bStartChartType, @wStartItemID, @bStartCount
    END
    CLOSE CUR_STARTITEM
    DEALLOCATE CUR_STARTITEM

--    &#54200;지보내기    ------------------------------------------------------------------------------------

IF(@bslot 0)
    
BEGIN

    
DECLARE @dwPostID INT
    
DECLARE @dwRecvID INT
    
DECLARE @szTitle VARCHAR(256)
    DECLARE @
szMessage VARCHAR(2048)
    DECLARE @
bLenTitle    BINARY(4)
    DECLARE @
bLenMessage BINARY(4)
    DECLARE @
szT VARCHAR(8)
    DECLARE @
szM VARCHAR(8)
    DECLARE @
dateCreated SMALLDATETIME
    SET 
@dateCreated GetDate()
    
  
SET @szTitle 'Welcome On Our Server! '
  
SET @szMessage 'Hey ' + @szName +'
Nice to meet you here. We are proud to announce that we offer more chances to new player now. Every new player will get a 175% permanent mount!
Visit us on www.4Story.com
Thank you for playing.'
    
SET @bLenTitle DATALENGTH(@szTitle)
    
SET @bLenMessage DATALENGTH(@szMessage)
    
SET @szT RIGHT(master.dbo.fn_sqlvarbasetostr(@bLenTitle), 8)
    
SET @szTitle  = @szT + @szTitle
    SET 
@szM RIGHT(master.dbo.fn_sqlvarbasetostr(@bLenMessage), 8)
    
SET @szMessage = @szM + @szMessage
    EXEC TSavePost 
@dwPostID OUTPUT, @dwRecvID OUTPUT0, @dwCharID, @szName'Server Announcement',@szTitle,@szMessage,0,0,10,0,0,@dateCreated

    END

-----------------------------------------------------------------------------------------------------------------------------

    
UPDATE TGLOBAL_GSP.DBO.TALLCHARTABLE SET dwCharID = @dwCharID WHERE dwSeq = @dwCharSeq  


    INSERT INTO THOTKEYTABLE 
        SELECT 
@dwCharIDbInvenIDbType1wID1bType2wID2bType3wID3bType4wID4bType5wID5,
              
bType6wID6bType7wID7bType8wID8bType9wID9bType10wID10bType11wID11bType12wID12 
        FROM TSTARTHOTKEY WHERE bClassID
=@bClass

    UPDATE THOTKEYTABLE SET wID12 
1+@bRace WHERE dwCharID = @dwCharID and bInvenID 1

    
IF EXISTSSELECT bClassID FROM TSTARTRECALL WHERE bClassID = @bClass AND bCountryID = @bCountry)
    
BEGIN
        
DECLARE @dwMonID INT
        
DECLARE @wMonTemp SMALLINT
        
DECLARE @dwATTR INT
        
DECLARE @dwMaxHP INT
        
DECLARE @dwMaxMP INT
        SET 
@wMonTemp 0
        SELECT 
@wMonTemp wMonID FROM TSTARTRECALL WHERE bClassID = @bClass AND bCountryID = @bCountry
        
IF(@wMonTemp 0)
        
BEGIN
            SELECT 
@dwATTR wSummonAttr FROM TMONSTERCHART WHERE wID= @wMonTemp
            SELECT 
@dwMaxHP=dwMaxHP, @dwMaxMP dwMaxMP FROM TMONATTRCHART WHERE wID=@dwATTR AND bLevel=1
            UPDATE TCHARTABLE SET wTemptedMon 
= @wMonTemp WHERE dwCharID = @dwCharID
            SET 
@dwATTR = @dwATTR POWER(2,16)
            
EXEC TCreateRecallMon 
                
@dwMonID OUTPUT
                @
dwCharID
                @
wMonTemp
                
0
                @
dwATTR
                
1
                @
dwMaxHP
                @
dwMaxMP
                
1,
                @
fPosX
                @
fPosY,

                @
fPosZ,
                
0
        END
    END
IF NOT EXISTS(SELECT dwUserID FROM TPETTABLE WHERE dwUserID = @dwUserID)

BEGIN
    
DECLARE @szMountName VARCHAR(50)
    
SET @szMountName = @szNAME+'''s Mount'
    
SET @szMountName REPLACE(@szMountName's''s''s''')
    
INSERT INTO TPETTABLE (dwUserIDwPetIDszNametimeuseVALUES(@dwUserID6, @szMountName0)
END

IF NOT EXISTS(SELECT dwUserID FROM TGLOBAL_GSP.dbo.TCASHTESTTABLE WHERE dwUserID = @dwUserID)

    
BEGIN
        INSERT INTO TGLOBAL_GSP
.dbo.TCASHTESTTABLE (dwUserIDdwCashdwBonusVALUES(@dwUserID100100)
    
END


    
RETURN @@ERROR 
xXxXHansXxXx is offline  
Thanks
5 Users
Old 04/06/2013, 14:57   #2
 
elite*gold: 5
Join Date: Jun 2011
Posts: 1,177
Received Thanks: 234
Werde es testen und einbauen ! Danke
Bukkit123 is offline  
Old 04/06/2013, 18:54   #3
 
elite*gold: 0
Join Date: Aug 2011
Posts: 286
Received Thanks: 241
Habe selbst nochmal alles Datenbanken neu gemahct und jede einzelne FUnktion selbst getestet. Es entstehen durch diese Function garantiert keine weiteren Fehler wie Netzwerk oder das man einmal aus dem Spiel fliegt etc.
xXxXHansXxXx is offline  
Old 04/06/2013, 19:56   #4
 
glossypvp's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 662
Received Thanks: 658
Hans you shouldn't share this ... just think about rival servers, it's definitely not good for your server, if you have one.
It will affect the players count on your server. I mean not by any function syntax error or anything, I mean players prefers to play on a server who have this fix.
Well you would like to say but you have that fix too, okay I agree, but what If an user find an other server first?
glossypvp is offline  
Old 04/06/2013, 20:31   #5
 
elite*gold: 0
Join Date: Aug 2011
Posts: 286
Received Thanks: 241
Quote:
Originally Posted by glossypvp View Post
Hans you shouldn't share this ... just think about rival servers, it's definitely not good for your server, if you have one.
It will affect the players count on your server. I mean not by any function syntax error or anything, I mean players prefers to play on a server who have this fix.
Well you would like to say but you have that fix too, okay I agree, but what If an user find an other server first?
I only use my server for friends, my own and fun so i dont care others I just want to help making fixxed server for all
Oh and i hope when improving things here i will get other improves from developers which I cant develop at my own.
xXxXHansXxXx is offline  
Thanks
1 User
Old 04/06/2013, 21:46   #6
 
pipitt05000's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 187
Received Thanks: 93
Good boy !
Thank's !

But i have a question on the first Function: when you have replace it, for have a mount, i must just execute the function and put my ID ? And for my futur login, i get a mount ??
pipitt05000 is offline  
Old 04/06/2013, 22:20   #7
 
elite*gold: 0
Join Date: Aug 2011
Posts: 286
Received Thanks: 241
Quote:
Originally Posted by pipitt05000 View Post
Good boy !
Thank's !

But i have a question on the first Function: when you have replace it, for have a mount, i must just execute the function and put my ID ? And for my futur login, i get a mount ??
No its more easyer You don´t have to execute anything. It´s autmatically when you create the first character of your account
xXxXHansXxXx is offline  
Old 04/06/2013, 22:37   #8
 
pipitt05000's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 187
Received Thanks: 93
I have already delete my table and put to zero, i have create a character but... Always mount :/
pipitt05000 is offline  
Old 04/06/2013, 22:43   #9
 
elite*gold: 0
Join Date: Aug 2011
Posts: 286
Received Thanks: 241
Quote:
Originally Posted by pipitt05000 View Post
I have already delete my table and put to zero, i have create a character but... Always mount :/
I dont know what you mean. You always get a permanent mount when creating a new character?
xXxXHansXxXx is offline  
Old 04/06/2013, 22:45   #10
 
pipitt05000's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 187
Received Thanks: 93
Sorry, i'm very bad in english...

So, when i create a new char, with your 2 function, i have no mount ! But in my table "TPETTABLE", i have the "BlaBla's mount"... That is the problem !
Can you help me ?
pipitt05000 is offline  
Old 04/06/2013, 22:55   #11
 
elite*gold: 0
Join Date: Aug 2011
Posts: 286
Received Thanks: 241
please send me your skype add and iw ill help you
xXxXHansXxXx is offline  
Old 04/06/2013, 22:57   #12
 
pipitt05000's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 187
Received Thanks: 93
It's not necessary, finally, it works... I'm just... without brain !

So, thank you !
pipitt05000 is offline  
Old 04/06/2013, 23:01   #13
 
elite*gold: 0
Join Date: Aug 2011
Posts: 286
Received Thanks: 241
Quote:
Originally Posted by pipitt05000 View Post
It's not necessary, finally, it works... I'm just... without brain !

So, thank you !
Hahahah, ok. I was sure that..... this functions contains no errors lol
xXxXHansXxXx is offline  
Old 04/07/2013, 00:24   #14
 
elite*gold: 0
Join Date: Sep 2010
Posts: 53
Received Thanks: 4


When I change the times in TBattleTimeChart opens this warning
xSoapSider is offline  
Old 04/07/2013, 00:35   #15
 
elite*gold: 0
Join Date: Aug 2011
Posts: 286
Received Thanks: 241
Quote:
Originally Posted by xSoapSider View Post


öffnet sich beim ändern der TBattleTimeChart
Und das hat was mit meiner Funktion zu tun ?

Schau mal unten, da steht doch was für ein Fehler aufkommt

Quote:
1800' is not a valid integer value for field 'dwBattleStart'
Du hast da ein ' zeichen drinne, warum auch immer. Integer bedeuted das du nur reelle Zahlen in dieses Feld eintragen darfst.
xXxXHansXxXx is offline  
Reply


Similar Threads Similar Threads
777 katar 1,5k cash + 32 mount 10€ psc
02/25/2011 - Last Chaos Trading - 0 Replies
oben stehts mit oder ohne pw egal meldet euch mount ist phönix pferd brauche psc schnell^^
Kill people with your mount (Passenger mount needed)
04/15/2009 - WoW Exploits, Hacks, Tools & Macros - 0 Replies
Couldn't find anything that was similar to this but I'm sorry if its a repost. First of all you need a passenger mount (Mammoths preferable) Next pick up some people that will ride with you and run to the Dalaran well and jump in it. Now the trick is that you will get teleported normally down into the sewers but the passengers have a 50% chance to get bugged and fall trough Dalaran and die. Will try to update it with pictures later and sorry if its a bad guide, its mainly just to piss...
Dalaran Sewer Mount arena (Aq 40 opening mount)
02/09/2009 - WoW Exploits, Hacks, Tools & Macros - 14 Replies
Well, you cant use any mounts in dalaran arena, except Black Qiraji Resonating Crystal. I know not much people have it, but still it is not intended to be able to mount in this arena, so i posted it there) Btw, you still can get the Scarab Lord title and mount, there are several servers, where gates are not open yet, all new servers where transfer is closed for first 3 months have their gates closed, so you can make the scepter on your server and then transfer to another server with closed...



All times are GMT +1. The time now is 20:00.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.