mysql_query and item_proto

02/04/2013 22:27 Chikyou#1
Hi !
I was making a quest with mysql_query, to conect to refine_vnum in item_proto.

Code:
quest melhorar begin
 state start begin
  when 20091.take with item.vnum() == 169 begin
   local a = select("Sírius", "Barăo", "Sair")
   if a == 1 then
    mysql_query("UPDATE player.item_proto SET refine_item='270' WHERE vnum='169'")
   elseif a == 2 then
    mysql_query("UPDATE player.item_proto SET refine_item='260' WHERE vnum='169'")
   end
  end
 end
end
Here is the quest.
But, to save the changes, i have to do /reload p ingame, and, i want that it save the changes without /reload p.
I don't know if it's possible to do it. But, maybe i receive an answer for it.

Sorry for my bad english.
Thank you.

Best Regrards.
02/06/2013 00:34 Chikyou#2
bump
02/06/2013 00:46 ©by Noa#3
refine_item doesn't exist
I think you mean refined_vnum
02/06/2013 01:09 Chikyou#4
Quote:
Originally Posted by ©by Noa View Post
refine_item doesn't exist
I think you mean refined_vnum
Yes i know, i just didn't remember the correct name xD

Btw, you know how i should do that? Or anyone else?
02/06/2013 01:39 ©by Noa#5
I dont know what you mean or what you like do.
Change refined_vnum some item with other one or refine it 100%?
02/06/2013 14:52 Chikyou#6
I want to make 2 refines in one weapon.

Exemple:

Battle Sword (169) -> Sirius sword (279) or Baron sword (269).

Exemple with quest:

Code:
quest test begin
state start begin
when 20091.take with item.vnum() == 169 begin
say("What weapon you want?")
local a = select ("Sirius", "Baron")
I don't know if you understand me, but it's something like that.
02/06/2013 14:59 ©by Noa#7
PHP Code:
when 20091.take with item.vnum() == 169 begin
say
("What weapon you want?")
local a select ("Sirius""Baron")
if 
a==1 then pc.give_item2(279
elseif 
a==2 then pc.give_item2(269
end
end 
02/16/2013 17:04 Chikyou#8
For example the weapon has placed bonus and the player wants to turn it into another weapon, with the way you said the new weapon would have no bonus, you know?
And I wanted that the new weapon had the bonus that had previous weapon.

Sorry for bad englisht ( Translator english <.< )
02/19/2013 15:01 Chikyou#9
bump
02/26/2013 00:01 Chikyou#10
bump
02/26/2013 00:41 Mashkin#11
Updating prototype information (item_proto, mob_proto etc.) in the game core requires the reload p command.
I'm not sure whether GM commands can be called from quests. There is the method cmdchat(), but I guess it only works for sending signals to the client.

There is no explicit reload() method in the quest scope, though.
02/26/2013 12:31 .Remix#12
It's not possible to save it without reload or shutdown.
But you shouldnt use reload, because it could crash some tables.