• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] fiddling around with phases and quests

Status
Not open for further replies.

Nalo

Enthusiast
Good afternoon Emudev'ens

as title teases im fiddling around with phases

So here's my Question :

* is it possible for a SQL query to make a quest change a players phase upon accepting and then back upon completion

* is it possible for a C++ script to work better than a SQL query ?


Please assist only if you can :)
:scared:
Kind
regards
Nalo
 

Tommy

Founder
Good afternoon Emudev'ens

as title teases im fiddling around with phases

So here's my Question :

* is it possible for a SQL query to make a quest change a players phase upon accepting and then back upon completion

* is it possible for a C++ script to work better than a SQL query ?


Please assist only if you can :)
:scared:
Kind
regards
Nalo

1. Yes
2. What do you mean by that?
 

Tommy

Founder
is there a way you can give me an example of SQL set query tommy?

SET query? Are you referring to an UPDATE query?

I'll give you an example of an UPDATE execution and a SELECT query.

UPDATE:

Code:
    std::string newName = "Testing";
    QueryResult result = WorldDatabase.PExecute("UPDATE creature_template SET `name`='%s' WHERE entry='%u'", newName.c_str(), creature->GetEntry());

SELECT:

Code:
    QueryResult result = WorldDatabase.PQuery("SELECT modelid1, modelid2 FROM creature_template WHERE entry='%u'", creature->GetEntry());
    if (!result)
    {
        TC_LOG_ERROR("misc", "Failed!");
        return;
    }

    do
    {
        Field* fields = result->Fetch();

        ChatHandler(player->GetSession()).PSendSysMessage("Modelid1: %u, Modelid2: %u", fields[0].GetUInt32(), fields[1].GetUInt32());
    }while(result->NextRow());
 
Status
Not open for further replies.
Top