I have a merchant with a drink, and i want to give the drink for free to my main character. when the player clicks the option text "What type of drink is it" in the dialogue dWares, the merchant says "It is a very tasty beverage, have a sample!" and at that point i want to add the drink to the players inventory. This is what i have in my globalscript.asc:
function dialog_request;
{
if cMerchant.Say("It is a very tasty beverage, have a sample!");
cEgo.AddInventory(iDrink);
}
Quote
dialog_request (int parameter)
Called when a dialog script line "run-script" is processed. PARAMETER is the value of the number following the "run-script" on that line of the dialog script.
So you would probably put something like this in somewhere the dialog script ..
run-script 1
and in the global scri[pt something like this ...
function dialog_request(int data) {
if (data==1) {
cEgo.AddInventory(iDrink);
}
}
cool thanks it worked on first try ;D